fix: 修正 VIP 購買選項 model
This commit is contained in:
@@ -62,7 +62,7 @@ public class HomeIndicatorAdapter extends CommonNavigatorAdapter {
|
||||
indicator.setLineHeight(context.getResources().getDimensionPixelOffset(R.dimen.dp_4));
|
||||
indicator.setRoundRadius(context.getResources().getDimensionPixelOffset(R.dimen.dp_2));
|
||||
indicator.setLineWidth(context.getResources().getDimensionPixelOffset(R.dimen.dp_13));
|
||||
indicator.setColors(context.getResources().getColor(R.color.color_FF4B81));
|
||||
indicator.setColors(context.getResources().getColor(R.color.color_e29030));
|
||||
FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
|
||||
// lp.bottomMargin = mBottomMargin;
|
||||
indicator.setLayoutParams(lp);
|
||||
|
@@ -119,7 +119,7 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
}
|
||||
|
||||
private fun initView() {
|
||||
banner = findViewById(R.id.banner_view)
|
||||
this.banner = findViewById(R.id.banner_view)
|
||||
// if (UiUtils.isRtl(AppUtils.getApp())) {
|
||||
//// banner.setBannerGalleryEffect(5, 5, 5)
|
||||
// } else {
|
||||
@@ -320,7 +320,9 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
private fun checkBuyVip(block: () -> Unit) {
|
||||
val myVipInfo = vipViewModel.myVipInfoLiveData.value
|
||||
val currentVipInfo = vipViewModel.vipInfosLiveData.value?.get(currentIndex)
|
||||
if (currentVipInfo != null && myVipInfo != null && currentVipInfo.vipLevel > myVipInfo.vipLevel) {
|
||||
if (currentVipInfo != null &&
|
||||
myVipInfo != null &&
|
||||
currentVipInfo.vipLevel > myVipInfo.vipLevel) {
|
||||
val message = context.getString(R.string.vip_buy_tips).format(
|
||||
myVipInfo.vipName,currentVipInfo.vipName
|
||||
)
|
||||
@@ -335,19 +337,20 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
}
|
||||
|
||||
private fun buyVip() {
|
||||
val googleUnavailable = ((currentChargeInfo?.productDetails?.getOneTimePurchaseOfferDetails()
|
||||
?.getPriceAmountMicros()
|
||||
?: "0") == "0")
|
||||
var text =
|
||||
currentChargeInfo?.productDetails?.getOneTimePurchaseOfferDetails()?.getFormattedPrice()
|
||||
if (text.isNullOrEmpty()) {
|
||||
text = vipViewModel.myVipInfoLiveData.value?.buyAmount.toString()
|
||||
}
|
||||
vipViewModel.myVipInfoLiveData.value?.buyAmount?.let {
|
||||
val currentVipInfo = vipViewModel.vipInfosLiveData.value?.get(currentIndex)
|
||||
currentVipInfo?.let {
|
||||
val googleUnavailable = ((currentChargeInfo?.productDetails?.getOneTimePurchaseOfferDetails()
|
||||
?.getPriceAmountMicros()
|
||||
?: "0") == "0")
|
||||
var text =
|
||||
currentChargeInfo?.productDetails?.getOneTimePurchaseOfferDetails()?.getFormattedPrice()
|
||||
if (text.isNullOrEmpty()) {
|
||||
text = it.buyAmount.toString()
|
||||
}
|
||||
SelectPayTypeDialog.newInstance(
|
||||
text,
|
||||
!googleUnavailable,
|
||||
it
|
||||
it.buyAmount
|
||||
)
|
||||
.apply {
|
||||
setOnDiamondChargeClick {
|
||||
@@ -410,6 +413,20 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
currentPageVipInfo.vipLevel
|
||||
).also { binding.tvNoticeText.text = it }
|
||||
} else {
|
||||
var myVipIsHighLevel = false
|
||||
val myVipInfo = vipViewModel.myVipInfoLiveData.value
|
||||
myVipInfo?.let {
|
||||
myVipIsHighLevel = myVipInfo.vipLevel >= currentPageVipInfo.vipLevel
|
||||
}
|
||||
|
||||
if (myVipIsHighLevel) {
|
||||
binding.layoutBottomPanel.alpha = 0.5F
|
||||
binding.layoutBottomPanel.isEnabled = false
|
||||
} else {
|
||||
binding.layoutBottomPanel.alpha = 1F
|
||||
binding.layoutBottomPanel.isEnabled = true
|
||||
}
|
||||
|
||||
binding.tvNoticeText.visibility = View.GONE
|
||||
binding.tvAdditionalText.visibility = View.VISIBLE
|
||||
binding.tvOpenVip.visibility = View.VISIBLE
|
||||
@@ -428,7 +445,6 @@ class VipCenterActivity : BaseViewBindingActivity<ActivityVipCenterBinding>(),
|
||||
val result = "$formattedDate ${getString(R.string.vip_center_6)}"
|
||||
binding.tvAdditionalText.text = result
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/home_tab_bar_bg"
|
||||
android:paddingBottom="@dimen/dp_10"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
@@ -35,13 +35,13 @@
|
||||
android:layout_height="@dimen/dp_160"
|
||||
android:layout_marginTop="@dimen/dp_30"
|
||||
app:layout_constraintTop_toBottomOf="@id/title_bar"
|
||||
android:visibility="visible"
|
||||
app:bvp_auto_play="false"
|
||||
app:bvp_can_loop="false"
|
||||
app:bvp_indicator_visibility="gone"
|
||||
app:bvp_page_style="multi_page_scale"
|
||||
app:layout_goneMarginTop="@dimen/dp_16"
|
||||
tools:visibility="visible"
|
||||
android:visibility="visible"
|
||||
android:layoutDirection="ltr" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
|
@@ -21,6 +21,7 @@
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/dp_15"
|
||||
android:paddingEnd="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:layout_marginTop="@dimen/dp_44"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@@ -763,5 +763,6 @@
|
||||
<color name="color_FCF4DF">#FCF4DF</color>
|
||||
|
||||
<color name="color_313131">#313131</color>
|
||||
<color name="color_e29030">#e29030</color>
|
||||
|
||||
</resources>
|
||||
|
@@ -33,6 +33,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_35"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:layout_marginEnd="@dimen/dp_40"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
Reference in New Issue
Block a user