Skip to content

Commit

Permalink
[fix/mypage_design]: JMT-252 Empty 레이아웃 표시
Browse files Browse the repository at this point in the history
  • Loading branch information
dogdduddy committed Sep 27, 2023
1 parent 0b856ab commit d32a38e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ class RegisteredRestaurantFragment : Fragment() {

myRestaurantAdapter.addLoadStateListener { combinedLoadStates ->
if (combinedLoadStates.append.endOfPaginationReached) {
binding.notYetLayout.root.isVisible = myRestaurantAdapter.itemCount == 0
binding.emptyLayout.isVisible = myRestaurantAdapter.itemCount == 0
} else {
binding.notYetLayout.root.isVisible = false
binding.emptyLayout.isVisible = false
}

if(combinedLoadStates.refresh is LoadState.Error) {
binding.notYetLayout.root.isVisible = true
binding.emptyLayout.isVisible = true
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,35 @@
android:nestedScrollingEnabled="true"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>

<include
android:id="@+id/not_yet_layout"
layout="@layout/not_yet_layout"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/empty_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:orientation="vertical">

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:src="@drawable/jmt_character"
android:layout_marginBottom="32dp"
app:layout_constraintBottom_toTopOf="@+id/not_yet_text"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:contentDescription="@string/jmt_character_image"/>

<TextView
android:id="@+id/not_yet_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/result_empty"
android:textAppearance="@style/text_large_bold"
android:textColor="@color/grey300"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>

</org.gdsc.presentation.view.custom.NestedScrollCoordinatorLayout>
1 change: 1 addition & 0 deletions presentation/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@


<string name="service_not_yet">앗, 서비스 준비 중이에요!\n &#160;&#160;조금만 기다려주세요.</string>
<string name="result_empty">등록한 맛집이 없어요</string>
<string name="jmt_character_image">존마탱 캐릭터 이미지</string>
<string name="search_for_recommendable_restaurant">추천 해주고 싶은\n 맛집을 검색해주세요!</string>
<string name="no_searched_result">검색 결과가 없어요.\n올바른 식당명인지 확인해주세요.</string>
Expand Down

0 comments on commit d32a38e

Please sign in to comment.