Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
dedf859
refactor: 식단 날짜 선택 ui 수정 및 현재 날짜 표시
huiwoo-jo Mar 12, 2025
dd0a85e
feat: 식단 카테고리 선택 버튼 추가 - 초기값 수정 필요
huiwoo-jo Mar 14, 2025
b954a52
fix: pause상태 후 월요일로 이동되는 문제 해결
huiwoo-jo Mar 14, 2025
b5e6e49
build: 식단 한식 ui 수정
huiwoo-jo Mar 14, 2025
d85c68e
build: 일품 메뉴 item 디자인 반영 - 데이터 형식 수정 필요
huiwoo-jo Mar 14, 2025
ea7f61f
build: 일품 메뉴 데이터 수정
huiwoo-jo Mar 14, 2025
1238e58
feat: 일품 메뉴 리스트 국명, 영문명, 가격 적용
huiwoo-jo Mar 14, 2025
0a38e20
feat: 식단 이미지 적용
huiwoo-jo Mar 14, 2025
8757317
fix: 날짜 선택에 따른 일품 메뉴 출력 오류 및 아이디 수정
huiwoo-jo Mar 14, 2025
f6a5276
build: 한식, 일품 선택 버튼 폰트 및 radius 적용
huiwoo-jo Mar 14, 2025
1c5c1d0
build: 한식 타이틀 및 리사이클러 아이템 폰트 적용
huiwoo-jo Mar 14, 2025
691d2a3
build: 한식, 일품 선택 버튼 그림자 제거
huiwoo-jo Mar 14, 2025
1552017
build: Timber 제거 및 코드 포맷팅
huiwoo-jo Mar 14, 2025
e4072b9
build: 한식, 일품 선택 변수를 상수화
huiwoo-jo Mar 14, 2025
fa9ca4a
build: 한식, 일품 컨테이너 id 변경
huiwoo-jo Mar 14, 2025
95bf561
build: 한식, 일품 id 변경
huiwoo-jo Mar 14, 2025
4416392
build: 한식, 일식 string 호출 방식 변경
huiwoo-jo Mar 27, 2025
56a59cc
build: cafeteria 색상 변경 중복 코드 간결화
huiwoo-jo Mar 27, 2025
58f2186
build: selectedDate 사용 방법 변경
huiwoo-jo Mar 27, 2025
890de9a
build: 한식 viewModel 변수명 변경 및 출력 방식 수정
huiwoo-jo Mar 27, 2025
e3af14e
build: no_menu 제거 및 주말 식당 이용 안내 추가 - 초기 출력 설정 필요
huiwoo-jo Mar 27, 2025
71c547c
build: findNearestMonday 함수 순서 변경
huiwoo-jo Mar 27, 2025
0c32d9f
fix: fragment 진입시 메뉴가 모두 뜨는 문제 임시 해결
huiwoo-jo Mar 27, 2025
8b5d2f3
reactor: 한식, 일품 출력 방식 문제 및 주말 판단 방식 변경
huiwoo-jo Apr 3, 2025
3326a2b
build: 코드 자동 포맷팅
huiwoo-jo Apr 3, 2025
31515f3
refactor: ViewHolder 분리
huiwoo-jo Apr 12, 2025
d6329da
refactor: 주말 출력 방식 오류 및 viewModel 인자 수정
huiwoo-jo Apr 12, 2025
72f78bf
refactor: adapter 호출 방식 수정
huiwoo-jo Apr 17, 2025
555ca02
refactor: korean, anotehr 변수 제거 및 호출 방식 수정
huiwoo-jo Apr 17, 2025
1cc59d2
refactor: 뷰 세팅 함수들 분리
huiwoo-jo Apr 17, 2025
162f7ae
build: 미사용 함수 제거
huiwoo-jo Apr 17, 2025
ec4161a
refactor: 한식 메뉴 리스트 사용 방법을 postValue에서 setValue로 수정
huiwoo-jo Apr 17, 2025
b7f937d
refactor: 일품 메뉴를 data class AnotherMenuItem로 분리
huiwoo-jo Apr 17, 2025
f114eae
refactor: DecimalFormat 상수화
huiwoo-jo Apr 17, 2025
9c2dccd
build: 일품 data class명 변경
huiwoo-jo Apr 21, 2025
df01383
build: 날짜 선택 셀 크기 및 개수를 상수로 추출
huiwoo-jo Apr 21, 2025
8fcd43d
Merge branch 'develop' into refactor/cafeteria-v2
huiwoo-jo Apr 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.dongyang.android.youdongknowme.data.model

data class AnotherMenu(
val menuNameKr: String,
val name: String,
val price: String
)
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,26 @@ class CafeteriaRepository(
val price: Int,
val operatingDays: List<Weekdays>,
) {
PORKCUTLET("돈까스", 5_000, Weekdays.values().toList()),
CHEESE_PORKCUTLET("치즈돈까스", 5_500, Weekdays.values().toList()),
SWEET_POTATO_CHEESE_PORKCUTLET("고구마치즈돈까스", 6_000, Weekdays.values().toList()),
SPAM_KIMCHI_FRIED_RICE("스팸 김치 볶음밥", 4_900, listOf(Weekdays.MONDAY, Weekdays.TUESDAY)),
CHICKEN_MAYO_RICE("치킨 마요 덮밥", 4_900, listOf(Weekdays.WEDNESDAY)),
SPICY_MAYO_RICE("불닭 마요 덮밥", 4_900, listOf(Weekdays.WEDNESDAY)),
PORK_BELLY_RICE("삼겹살 덮밥", 5_500, listOf(Weekdays.THURSDAY)),
JANGJORIM_BUTTER_RICE("장조림 버터 비빔밥", 4_500, listOf(Weekdays.FRIDAY)),

RAMEN("라면", 3_500, Weekdays.values().toList()),
CHEESE_RAMEN("치즈라면", 4_000, Weekdays.values().toList()),
SEAFOOD_RAMEN("해물라면", 4_500, Weekdays.values().toList()),
SPAM_KIMCHI_FRIED_RICE("스팸김치볶음밥", 4_900, listOf(Weekdays.MONDAY, Weekdays.TUESDAY)),
HOT_CHICKEN_MAYO_RICE("불닭마요덮밥", 4_500, listOf(Weekdays.WEDNESDAY, Weekdays.THURSDAY)),
CHICKEN_MAYO_RICE("치킨마요덮밥", 4_500, listOf(Weekdays.WEDNESDAY, Weekdays.THURSDAY)),
OMELET_RICE("오므라이스", 5_500, listOf(Weekdays.FRIDAY));
CHEESE_RAMEN("치즈 라면", 4_000, Weekdays.values().toList()),
SEAFOOD_RAMEN("해물짬뽕 라면", 4_500, Weekdays.values().toList()),

CHAPAGETTI("짜파게티", 3_500, Weekdays.values().toList()),
CHAPAGETTI_EGG_CHEESE("짜계치", 4_000, Weekdays.values().toList()),
SPICY_RAMEN("불닭볶음면", 3_500, Weekdays.values().toList()),
CARBONARA_SPICY_RAMEN("까르보 불닭볶음면", 3_800, Weekdays.values().toList()),
CHEESE_SPICY_RAMEN("치즈 불닭볶음면", 4_000, Weekdays.values().toList()),

PORK_CUTLET("돈까스", 5_000, Weekdays.values().toList()),
CHEESE_PORK_CUTLET("치즈 돈까스", 5_500, Weekdays.values().toList()),
BRISKET_CHICKEN_CUTLET("통가슴살 치킨까스", 5_200, Weekdays.values().toList()),
SWEET_POTATO_CHEESE_PORK_CUTLET("고구마 치즈 돈까스", 6_000, Weekdays.values().toList()),
HOMEMADE_KING_PORK_CUTLET("수제 왕 돈까스", 6_000, Weekdays.values().toList()),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ val viewModelModule = module {
AlarmViewModel(get())
}
viewModel {
CafeteriaViewModel(get(), get())
CafeteriaViewModel(get())
}
viewModel {
LicenseViewModel()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.dongyang.android.youdongknowme.ui.adapter

import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.dongyang.android.youdongknowme.data.model.AnotherMenu
import com.dongyang.android.youdongknowme.databinding.ItemCafeteriaAnotherBinding
import com.dongyang.android.youdongknowme.ui.viewholder.CafeteriaAnotherViewHolder

class CafeteriaAnotherAdapter : RecyclerView.Adapter<CafeteriaAnotherViewHolder>() {

init {
setHasStableIds(true)
}

private var menu = arrayListOf<AnotherMenu>()

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CafeteriaAnotherViewHolder {
return CafeteriaAnotherViewHolder(
ItemCafeteriaAnotherBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
)
}

override fun getItemId(position: Int): Long {
return position.toLong()
}

override fun onBindViewHolder(holder: CafeteriaAnotherViewHolder, position: Int) {
holder.bind(menu[position])
}

@SuppressLint("NotifyDataSetChanged")
fun submitList(item: List<AnotherMenu>) {
menu.clear()
menu.addAll(item)
notifyDataSetChanged()
}

override fun getItemCount(): Int = menu.size
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.dongyang.android.youdongknowme.databinding.ItemCafeteriaMenuBinding
import com.dongyang.android.youdongknowme.databinding.ItemCafeteriaKoreanBinding

class CafeteriaAdapter : RecyclerView.Adapter<CafeteriaAdapter.ViewHolder>() {
class CafeteriaKoreanAdapter : RecyclerView.Adapter<CafeteriaKoreanAdapter.ViewHolder>() {

init {
setHasStableIds(true)
}

private var menu = arrayListOf<String>()

inner class ViewHolder(private val binding: ItemCafeteriaMenuBinding) :
inner class ViewHolder(private val binding: ItemCafeteriaKoreanBinding) :
RecyclerView.ViewHolder(binding.root) {
fun bind(item: String) {
binding.menu = item
binding.koreanMenu = item
}
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
return ViewHolder(
ItemCafeteriaMenuBinding.inflate(
ItemCafeteriaKoreanBinding.inflate(
LayoutInflater.from(parent.context), parent, false
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.dongyang.android.youdongknowme.databinding.ItemCalendarDayBinding
import com.kizitonwose.calendarview.CalendarView
import com.kizitonwose.calendarview.model.CalendarDay
import com.kizitonwose.calendarview.ui.ViewContainer
import java.time.LocalDate
import java.time.format.DateTimeFormatter

class CafeteriaContainer(
Expand All @@ -24,34 +25,44 @@ class CafeteriaContainer(

init {
view.setOnClickListener {
if (viewModel.selectedDate.value != day.date) {
notifyDateChanged(viewModel, calendarView, viewModel.selectedDate.value, day.date)
viewModel.selectedDate.value?.let { selectedDate ->
if (selectedDate != day.date) {
notifyDateChanged(viewModel, calendarView, selectedDate, day.date)
}
}
}
}

fun bind(day: CalendarDay) {
this.day = day
bind.itemCalendarDate.text = dateFormatter.format(day.date)
bind.itemCalendarDay.text = dayFormatter.format(day.date)
bind.itemCalendarMonth.text = monthFormatter.format(day.date)

if (day.date == viewModel.selectedDate.value) {
bind.mvItemCalendarDate.setCardBackgroundColor(
ContextCompat.getColor(
view.context,
R.color.blue300
)
)
bind.itemCalendarDate.setTextColor(ContextCompat.getColor(view.context, R.color.white))
} else {
bind.mvItemCalendarDate.setCardBackgroundColor(
ContextCompat.getColor(
view.context,
R.color.white
)
bind.apply {
tvItemCalendarDate.text = dateFormatter.format(day.date)
tvItemCalendarDay.text = dayFormatter.format(day.date)
tvItemCalendarMonth.text = monthFormatter.format(day.date)
}

val (bgColor, textColor) = when (day.date) {
viewModel.selectedDate.value -> R.color.blue300 to R.color.white
LocalDate.now() -> R.color.gray200 to R.color.gray500
else -> R.color.white to R.color.gray500
}

bind.mvItemCalendarContainer.setCardBackgroundColor(
ContextCompat.getColor(
view.context,
bgColor
)
bind.itemCalendarDate.setTextColor(ContextCompat.getColor(view.context, R.color.black))
)
setTextColor(textColor)
}

private fun setTextColor(colorRes: Int) {
val color = ContextCompat.getColor(view.context, colorRes)

bind.apply {
tvItemCalendarDate.setTextColor(color)
tvItemCalendarDay.setTextColor(color)
tvItemCalendarMonth.setTextColor(color)
}
}
}
}
Loading
Loading