Skip to content

Commit

Permalink
#160/소원권 Ui 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
sub101 committed Dec 10, 2023
1 parent 59525f1 commit 9b629c9
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/src/main/java/sopt/uni/presentation/wish/WishActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,20 @@ class WishActivity : BindingActivity<ActivityWishBinding>(R.layout.activity_wish
wishViewModel.wishCouponList.observe(this) {
var wishList = mutableListOf<WishMultiData>()

if (it.isEmpty() && !wishViewModel.isMineState.value!!) {
if (it.isEmpty() && wishViewModel.isMineState.value!!) {
binding.rvWish.visibility = View.INVISIBLE
binding.tvWishEmptyMy.visibility = View.VISIBLE
binding.tvWishEmptyYour.visibility = View.INVISIBLE
return@observe
} else if (it.isEmpty() && !wishViewModel.isMineState.value!!) {
binding.rvWish.visibility = View.INVISIBLE
binding.tvWishEmptyYour.visibility = View.VISIBLE
binding.tvWishEmptyMy.visibility = View.INVISIBLE
return@observe
} else {
binding.rvWish.visibility = View.VISIBLE
binding.tvWishEmptyMy.visibility = View.INVISIBLE
binding.tvWishEmptyYour.visibility = View.INVISIBLE
}
if (wishViewModel.isMineState.value!!) {
wishList.add(WishMultiData(0, wishViewModel.newWishCoupon.value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ class WishUseMyFragment : Fragment() {
with(binding) {
if (wishCouponIsUsed == true) {
btnWishUseMyFinish.isEnabled = false
btnWishUseMyFinish.setText(R.string.wish_used)
btnWishUseMyFinish.backgroundTintList =
resources.getColorStateList(R.color.Gray_300)
} else {
btnWishUseMyFinish.isEnabled = true
btnWishUseMyFinish.setText(R.string.wish_use_wish)
btnWishUseMyFinish.backgroundTintList =
resources.getColorStateList(R.color.Lightblue_500)
}
Expand Down
13 changes: 13 additions & 0 deletions app/src/main/res/layout/activity_wish.xml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_wish_my_wish" />

<TextView
android:id="@+id/tv_wish_empty_your"
style="@style/Body1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/wish_empty_your"
android:textColor="@color/Gray_400"
android:visibility="invisible"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_wish_my_wish" />

</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</layout>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
<string name="use_wish_dialog_description">사용한 소원권은 취소할 수 없어요</string>
<string name="wish_your">상대가 아직 사용하지 않은 소원권이에요</string>
<string name="wish_your_used">이미 사용한 소원권이에요</string>
<string name="wish_used">이미 사용한 소원권입니다</string>
<string name="your_wish_is">%s의 소원은</string>

<!-- History -->
Expand Down

0 comments on commit 9b629c9

Please sign in to comment.