Skip to content

Commit

Permalink
#86 fix : 추천 음식점 없을때 없는 문구 추가
Browse files Browse the repository at this point in the history
Co-authored-by: plashdof <[email protected]>
Co-authored-by: yy0ung <[email protected]>
  • Loading branch information
3 people committed Dec 11, 2023
1 parent b4cec83 commit bbb9ddc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.View
import com.avengers.nibobnebob.databinding.DialogRecommendRestaurantBinding
import com.avengers.nibobnebob.presentation.ui.main.home.adapter.HomeRecommendAdapter
import com.avengers.nibobnebob.presentation.ui.main.home.model.UiRecommendRestaurantData
Expand All @@ -13,7 +14,6 @@ class RecommendRestaurantDialog(
context: Context,
private val uiRecommendRestaurantDataList: List<UiRecommendRestaurantData>,
private val restaurantClickListener: (Int) -> Unit

) : Dialog(context) {

private lateinit var binding: DialogRecommendRestaurantBinding
Expand All @@ -35,6 +35,11 @@ class RecommendRestaurantDialog(
rvRecommendRestaurant.adapter = adapter
adapter.submitList(uiRecommendRestaurantDataList)

if(uiRecommendRestaurantDataList.isEmpty()){
binding.tvIsEmpty.visibility = View.VISIBLE
}


binding.tvCancel.setOnClickListener {
dismiss()
}
Expand Down
15 changes: 13 additions & 2 deletions Aos/app/src/main/res/layout/dialog_recommend_restaurant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_is_empty"
style="@style/TextMediumRegular"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="@string/no_recommend_restaurant"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_recommend_label" />


<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_recommend_restaurant"
Expand All @@ -33,7 +45,7 @@
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_recommend_label"
app:layout_constraintTop_toBottomOf="@+id/tv_is_empty"
tools:listitem="@layout/item_recommend_restaurant" />

<TextView
Expand All @@ -42,7 +54,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:layout_marginBottom="20dp"
android:text="@string/dialog_cancel"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
1 change: 1 addition & 0 deletions Aos/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<string name="detail_review_all"><![CDATA[전체보기 >]]></string>
<string name="user_detail_empty">아직 추가한 맛집이 없습니다.</string>
<string name="phone_number_empty">전화번호 없음</string>
<string name="no_recommend_restaurant">\n\n추천드릴 음식점이 존재하지 않습니다.\n\n</string>

<string-array name="location_list">
<item>강남구</item>
Expand Down

0 comments on commit bbb9ddc

Please sign in to comment.