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

Qa/#172 wish #177

Merged
merged 2 commits into from
Dec 20, 2023
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
4 changes: 2 additions & 2 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ class MissionResultActivity :
if (date == null || isMissionComplete == "LOSE") {
view.text = view.context.getString(R.string.mission_result_failure)
view.background = view.context.getDrawable(R.drawable.wish_ment_pink_rectangle)
view.setTextColor(view.context.resources.getColor(R.color.Pink_600))
} else {
val dateString = date.split("T")[1].substring(0, 5)
view.text =
"$dateString ${view.context.getString(R.string.mission_result_complete)}"
view.background = view.context.getDrawable(R.drawable.wish_ment_green_rectangle)
view.setTextColor(view.context.resources.getColor(R.color.Green_600))
}
}
}
Expand Down
23 changes: 11 additions & 12 deletions app/src/main/java/sopt/uni/presentation/wish/WishActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +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 (wishViewModel.isMineState.value!!) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋‚˜์ค‘์— ๋„ ์ฒ˜๋ฆฌ ๊ผญ ํ•ด์ฃผ์„ธ์š”~

wishList.add(WishMultiData(0, wishViewModel.newWishCoupon.value))
}

if (it.isEmpty() && !wishViewModel.isMineState.value!!) {
binding.rvWish.visibility = View.INVISIBLE
binding.tvWishEmptyMy.visibility = View.VISIBLE
binding.tvWishEmptyYour.visibility = View.INVISIBLE
binding.tvWishEmpty.visibility = View.VISIBLE
return@observe
} else if (it.isEmpty() && !wishViewModel.isMineState.value!!) {
} else if (wishViewModel.isMineState.value!! && wishViewModel.availableWishCoupon.value == 0) {
binding.rvWish.visibility = View.INVISIBLE
binding.tvWishEmptyYour.visibility = View.VISIBLE
binding.tvWishEmptyMy.visibility = View.INVISIBLE
return@observe
binding.tvWishEmpty.visibility = View.VISIBLE
} 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))
binding.tvWishEmpty.visibility = View.INVISIBLE
}

for (i in 0 until it.size) {
Expand Down Expand Up @@ -108,6 +105,7 @@ class WishActivity : BindingActivity<ActivityWishBinding>(R.layout.activity_wish
lifecycleScope.launch {
wishViewModel.getMyWishList(userId).join()
}
binding.tvWishEmpty.setText(R.string.wish_empty_my)
setupRecyclerView(rvWish, multiviewAdapter)
multiviewAdapter.submitData(_wishList)
}
Expand All @@ -117,6 +115,7 @@ class WishActivity : BindingActivity<ActivityWishBinding>(R.layout.activity_wish
lifecycleScope.launch {
wishViewModel.getPartnerWishList(partnerId!!).join()
}
binding.tvWishEmpty.setText(R.string.wish_empty_your)
setupRecyclerView(rvWish, yourMultiviewAdapter)
yourMultiviewAdapter.submitData(_wishList)
}
Expand Down
14 changes: 1 addition & 13 deletions app/src/main/res/layout/activity_wish.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
tools:listitem="@layout/item_wish_large" />

<TextView
android:id="@+id/tv_wish_empty_my"
android:id="@+id/tv_wish_empty"
style="@style/Body1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
Expand All @@ -165,18 +165,6 @@
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>
Expand Down
Loading