Skip to content
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

[Fix] 식단 상세 Fix #286

Merged
merged 7 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -33,7 +33,7 @@ class DiningItemsFragment : Fragment(R.layout.fragment_dining_items) {
viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) {
viewModel.dining.collect {
val diningList = it.filter { dining -> dining.type == type }.arrange()
diningAdapter.submitList( diningList.filter { dining -> dining.menu.isNotEmpty() } )
diningAdapter.submitList( diningList.filter { dining -> dining.menu.isNotEmpty() && dining.menu.first() != "미운영" } )
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ class DiningAdapter : ListAdapter<Dining, RecyclerView.ViewHolder>(diffCallback)
textViewNoPhoto.visibility = View.VISIBLE
imageViewNoPhoto.visibility = View.VISIBLE
imageViewDining.visibility = View.INVISIBLE
cardViewDining.setOnClickListener(null)
EventLogger.logClickEvent(
AnalyticsConstant.Domain.CAMPUS,
AnalyticsConstant.Label.MENU_IMAGE,
DiningUtil.getKoreanName(dining.type) + "_" + dining.place
)
cardViewDining.setOnClickListener {
EventLogger.logClickEvent(
AnalyticsConstant.Domain.CAMPUS,
AnalyticsConstant.Label.MENU_IMAGE,
DiningUtil.getKoreanName(dining.type) + "_" + dining.place
)
}
}

if(dining.changedAt.isNotEmpty()) {
Expand Down Expand Up @@ -134,7 +135,6 @@ class DiningAdapter : ListAdapter<Dining, RecyclerView.ViewHolder>(diffCallback)
}

companion object {
private const val DIALOG_MIN_SCALE = 0.75f
private val diffCallback = object : DiffUtil.ItemCallback<Dining>() {
override fun areItemsTheSame(
oldItem: Dining,
Expand Down
3 changes: 2 additions & 1 deletion koin/src/main/res/layout/activity_dining.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintTop_toBottomOf="@id/tabs_dining_time"
app:layout_constraintBottom_toBottomOf="parent"/>
app:layout_constraintBottom_toBottomOf="parent"
android:background="@color/background_dark"/>

</androidx.constraintlayout.widget.ConstraintLayout>
<include layout="@layout/base_navigation_drawer_right" />
Expand Down
51 changes: 28 additions & 23 deletions koin/src/main/res/layout/fragment_dining_items.xml
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto"
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_dark">
android:layout_height="wrap_content">

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_dining_type"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
android:background="@color/white"
tools:itemCount="2"
tools:listitem="@layout/item_dining"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"/>
android:paddingBottom="8dp"
android:background="@color/background_dark">

<TextView
android:id="@+id/text_view_caution_dining_changable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="24dp"
android:textSize="13sp"
android:textColor="@color/gray15"
android:text="@string/caution_dining_changable"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/recycler_view_dining_type" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view_dining_type"
android:layout_width="match_parent"
android:layout_height="0dp"
android:background="@color/white"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintTop_toTopOf="parent"
tools:itemCount="2"
tools:listitem="@layout/item_dining" />

</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/text_view_caution_dining_changeable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:text="@string/caution_dining_changeable"
android:textColor="@color/gray15"
android:textSize="13sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/recycler_view_dining_type" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.core.widget.NestedScrollView>
</layout>
2 changes: 1 addition & 1 deletion koin/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
<string name="bus">버스</string>
<string name="see_all">전체보기</string>
<string name="complete_sign_up">회원가입 완료</string>
<string name="caution_dining_changable">식단 정보는 운영 상황에 따라 변동될 수 있습니다.</string>
<string name="caution_dining_changeable">식단 정보는 운영 상황에 따라 변동될 수 있습니다.</string>
<string name="set_menu">세트 메뉴</string>
<string name="side_menu">사이드 메뉴</string>
<string name="best_menu">대표 메뉴</string>
Expand Down