-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor: 금주의 식단 디자인 수정 #291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 25 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
dedf859
refactor: 식단 날짜 선택 ui 수정 및 현재 날짜 표시
huiwoo-jo dd0a85e
feat: 식단 카테고리 선택 버튼 추가 - 초기값 수정 필요
huiwoo-jo b954a52
fix: pause상태 후 월요일로 이동되는 문제 해결
huiwoo-jo b5e6e49
build: 식단 한식 ui 수정
huiwoo-jo d85c68e
build: 일품 메뉴 item 디자인 반영 - 데이터 형식 수정 필요
huiwoo-jo ea7f61f
build: 일품 메뉴 데이터 수정
huiwoo-jo 1238e58
feat: 일품 메뉴 리스트 국명, 영문명, 가격 적용
huiwoo-jo 0a38e20
feat: 식단 이미지 적용
huiwoo-jo 8757317
fix: 날짜 선택에 따른 일품 메뉴 출력 오류 및 아이디 수정
huiwoo-jo f6a5276
build: 한식, 일품 선택 버튼 폰트 및 radius 적용
huiwoo-jo 1c5c1d0
build: 한식 타이틀 및 리사이클러 아이템 폰트 적용
huiwoo-jo 691d2a3
build: 한식, 일품 선택 버튼 그림자 제거
huiwoo-jo 1552017
build: Timber 제거 및 코드 포맷팅
huiwoo-jo e4072b9
build: 한식, 일품 선택 변수를 상수화
huiwoo-jo fa9ca4a
build: 한식, 일품 컨테이너 id 변경
huiwoo-jo 95bf561
build: 한식, 일품 id 변경
huiwoo-jo 4416392
build: 한식, 일식 string 호출 방식 변경
huiwoo-jo 56a59cc
build: cafeteria 색상 변경 중복 코드 간결화
huiwoo-jo 58f2186
build: selectedDate 사용 방법 변경
huiwoo-jo 890de9a
build: 한식 viewModel 변수명 변경 및 출력 방식 수정
huiwoo-jo e3af14e
build: no_menu 제거 및 주말 식당 이용 안내 추가 - 초기 출력 설정 필요
huiwoo-jo 71c547c
build: findNearestMonday 함수 순서 변경
huiwoo-jo 0c32d9f
fix: fragment 진입시 메뉴가 모두 뜨는 문제 임시 해결
huiwoo-jo 8b5d2f3
reactor: 한식, 일품 출력 방식 문제 및 주말 판단 방식 변경
huiwoo-jo 3326a2b
build: 코드 자동 포맷팅
huiwoo-jo 31515f3
refactor: ViewHolder 분리
huiwoo-jo d6329da
refactor: 주말 출력 방식 오류 및 viewModel 인자 수정
huiwoo-jo 72f78bf
refactor: adapter 호출 방식 수정
huiwoo-jo 555ca02
refactor: korean, anotehr 변수 제거 및 호출 방식 수정
huiwoo-jo 1cc59d2
refactor: 뷰 세팅 함수들 분리
huiwoo-jo 162f7ae
build: 미사용 함수 제거
huiwoo-jo ec4161a
refactor: 한식 메뉴 리스트 사용 방법을 postValue에서 setValue로 수정
huiwoo-jo b7f937d
refactor: 일품 메뉴를 data class AnotherMenuItem로 분리
huiwoo-jo f114eae
refactor: DecimalFormat 상수화
huiwoo-jo 9c2dccd
build: 일품 data class명 변경
huiwoo-jo df01383
build: 날짜 선택 셀 크기 및 개수를 상수로 추출
huiwoo-jo 8fcd43d
Merge branch 'develop' into refactor/cafeteria-v2
huiwoo-jo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
app/src/main/java/com/dongyang/android/youdongknowme/ui/adapter/CafeteriaAnotherAdapter.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| package com.dongyang.android.youdongknowme.ui.adapter | ||
|
|
||
| import android.annotation.SuppressLint | ||
| import android.view.LayoutInflater | ||
| import android.view.ViewGroup | ||
| import androidx.core.view.setPadding | ||
| import androidx.recyclerview.widget.RecyclerView | ||
| import com.dongyang.android.youdongknowme.R | ||
| import com.dongyang.android.youdongknowme.databinding.ItemCafeteriaAnotherBinding | ||
|
|
||
| class CafeteriaAnotherAdapter : RecyclerView.Adapter<CafeteriaAnotherAdapter.ViewHolder>() { | ||
|
|
||
| init { | ||
| setHasStableIds(true) | ||
| } | ||
|
|
||
| private var menu = arrayListOf<Array<String>>() | ||
|
|
||
| inner class ViewHolder(private val binding: ItemCafeteriaAnotherBinding) : | ||
| RecyclerView.ViewHolder(binding.root) { | ||
| fun bind(item: Array<String>) { | ||
| binding.menuKr = item[0] | ||
| binding.menuEn = item[1].split('_') | ||
| .joinToString(" ") { word -> | ||
| word.lowercase().replaceFirstChar { firstChar -> firstChar.uppercase() } | ||
| } | ||
| binding.menuPrice = item[2] | ||
|
|
||
| val context = binding.root.context | ||
| val resourceName = "img_cafeteria_" + item[1].lowercase() | ||
| val drawableResId = | ||
| context.resources.getIdentifier(resourceName, "drawable", context.packageName) | ||
|
|
||
| if (drawableResId != 0) { | ||
| binding.imgAnother.setImageResource(drawableResId) | ||
| binding.imgAnother.setPadding(0) | ||
| } else { | ||
| binding.imgAnother.setImageResource(R.drawable.img_cafeteria_korean) | ||
| binding.imgAnother.setPadding(15) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
| return ViewHolder( | ||
| ItemCafeteriaAnotherBinding.inflate( | ||
| LayoutInflater.from(parent.context), parent, false | ||
| ) | ||
| ) | ||
| } | ||
|
|
||
| override fun getItemId(position: Int): Long { | ||
| return position.toLong() | ||
| } | ||
|
|
||
| override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
| holder.bind(menu[position]) | ||
| } | ||
|
|
||
| @SuppressLint("NotifyDataSetChanged") | ||
| fun submitList(item: List<Array<String>>) { | ||
| menu.clear() | ||
| menu.addAll(item) | ||
| notifyDataSetChanged() | ||
| } | ||
|
|
||
| override fun getItemCount(): Int = menu.size | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.