feat: 쿠폰 등록, 인기 단편 전체보기
- 쿠폰 등록 후 캔 내역 페이지가 아닌 바로 이전 페이지로 이동하도록 수정 - 인기 단편 전체보기에 포인트 사용 여부 표시
This commit is contained in:
@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.audio_content.all
|
||||
|
||||
import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
@@ -29,6 +30,12 @@ class AudioContentRankingAllAdapter(
|
||||
transformations(RoundedCornersTransformation(5.3f.dpToPx()))
|
||||
}
|
||||
|
||||
binding.tvPoint.visibility = if (item.isPointAvailable) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
binding.tvTitle.text = item.title
|
||||
binding.tvRank.text = index.plus(1).toString()
|
||||
binding.tvTheme.text = item.themeStr
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package kr.co.vividnext.sodalive.mypage.can.coupon
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.text.InputFilter
|
||||
import android.widget.Toast
|
||||
import kr.co.vividnext.sodalive.base.BaseActivity
|
||||
import kr.co.vividnext.sodalive.common.LoadingDialog
|
||||
import kr.co.vividnext.sodalive.databinding.ActivityCanCouponBinding
|
||||
import kr.co.vividnext.sodalive.mypage.can.status.CanStatusActivity
|
||||
import org.koin.android.ext.android.inject
|
||||
|
||||
|
||||
@@ -33,10 +31,7 @@ class CanCouponActivity : BaseActivity<ActivityCanCouponBinding>(
|
||||
|
||||
binding.tvRegistration.setOnClickListener {
|
||||
val couponNumber = binding.etCouponNumber.text.toString()
|
||||
viewModel.useCoupon(couponNumber) {
|
||||
finish()
|
||||
startActivity(Intent(applicationContext, CanStatusActivity::class.java))
|
||||
}
|
||||
viewModel.useCoupon(couponNumber) { finish() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,25 +31,23 @@ class CanCouponViewModel(private val repository: CanRepository) : BaseViewModel(
|
||||
{
|
||||
_isLoading.value = false
|
||||
if (it.success && it.data != null) {
|
||||
_toastLiveData.postValue("해당 쿠폰의 캔이 충전되었습니다.")
|
||||
_toastLiveData.value = it.message
|
||||
onSuccess()
|
||||
} else {
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
_toastLiveData.value = it.message
|
||||
} else {
|
||||
_toastLiveData.postValue(
|
||||
"알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
)
|
||||
_toastLiveData.value = "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
_isLoading.value = false
|
||||
if (it.message != null) {
|
||||
_toastLiveData.postValue(it.message)
|
||||
_toastLiveData.value = it.message
|
||||
Logger.e(it.message!!)
|
||||
} else {
|
||||
_toastLiveData.postValue("알 수 없는 오류가 발생했습니다. 다시 시도해 주세요.")
|
||||
_toastLiveData.value = "알 수 없는 오류가 발생했습니다. 다시 시도해 주세요."
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,21 @@
|
||||
android:textSize="8sp"
|
||||
tools:ignore="SmallSp"
|
||||
tools:text="00:30:20" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_point"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
android:background="@drawable/bg_round_corner_2_6_7849bc"
|
||||
android:fontFamily="@font/gmarket_sans_medium"
|
||||
android:gravity="center"
|
||||
android:padding="2.6dp"
|
||||
android:text="포인트"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="8sp"
|
||||
android:visibility="gone"
|
||||
tools:ignore="SmallSp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
|
||||
Reference in New Issue
Block a user