feat:完善钱包余额更新
feat:调整我的入口UI(钱包、VIP、公会)
@@ -4,6 +4,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import com.chwl.app.base.BaseViewModel
|
||||
import com.chwl.core.earn.bean.*
|
||||
import com.chwl.core.earn.model.EarnModel
|
||||
import com.chwl.core.pay.PayModel
|
||||
import com.chwl.library.utils.TimeUtils
|
||||
import java.util.*
|
||||
|
||||
@@ -145,6 +146,7 @@ class EarnRecordViewModel : BaseViewModel() {
|
||||
block = {
|
||||
_exchangeConfirmLiveData.value =
|
||||
EarnModel.exchangeConfirm(goldNum, diamondNum, currency)
|
||||
PayModel.get().refreshWalletInfo(true)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@@ -290,12 +290,12 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
|
||||
private fun updateHallInfo(clanAndHallInfo: ClanAndHallInfo?) {
|
||||
if ((clanAndHallInfo?.clan?.elderUid ?: 0L) > 0) {
|
||||
mBinding.ivGuild.setImageResource(R.drawable.me_bg_my_guild)
|
||||
mBinding.tvGuild.setText(R.string.me_my_guild)
|
||||
mBinding.ivGuild.singleClick {
|
||||
ModuleClanActivity.start(context, clanAndHallInfo?.clan?.elderUid ?: 0L)
|
||||
}
|
||||
} else if ((clanAndHallInfo?.hall?.ownerUid ?: 0L) > 0) {
|
||||
mBinding.ivGuild.setImageResource(R.drawable.me_bg_my_guild)
|
||||
mBinding.tvGuild.setText(R.string.me_my_guild)
|
||||
mBinding.ivGuild.singleClick {
|
||||
ModuleHallActivity.start(
|
||||
context,
|
||||
@@ -304,7 +304,7 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
)
|
||||
}
|
||||
} else {
|
||||
mBinding.ivGuild.setImageResource(R.drawable.me_bg_guild)
|
||||
mBinding.tvGuild.setText(R.string.me_join_guild)
|
||||
mBinding.ivGuild.singleClick {
|
||||
//公會周榜
|
||||
context?.let { it1 -> AssociationActivity.start(it1) }
|
||||
@@ -314,12 +314,12 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
||||
|
||||
private fun updateHallInfo(familyInfo: H5FamilyInfo) {
|
||||
if (familyInfo.familyId != null && familyInfo.familyId != 0L) {
|
||||
mBinding.ivGuild.setImageResource(R.drawable.me_bg_my_guild)
|
||||
mBinding.tvGuild.setText(R.string.me_my_guild)
|
||||
mBinding.ivGuild.singleClick {
|
||||
CommonWebViewActivity.start(context, familyInfo.getFullMyFamilyUrl())
|
||||
}
|
||||
} else {
|
||||
mBinding.ivGuild.setImageResource(R.drawable.me_bg_guild)
|
||||
mBinding.tvGuild.setText(R.string.me_join_guild)
|
||||
mBinding.ivGuild.singleClick {
|
||||
CommonWebViewActivity.start(context, familyInfo.getFullFamilyListUrl())
|
||||
}
|
||||
|
@@ -120,8 +120,8 @@ public class ChargeActivity extends BaseMvpActivity<IChargeView, ChargePresenter
|
||||
SpannableString ss = new SpannableString(privacyAgreementDescTip);
|
||||
int privacyAgreementTipIndex = privacyAgreementDescTip.indexOf(privacyAgreementTip);
|
||||
|
||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_8E9094)), privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.color_1E1E1F)) {
|
||||
ss.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_8E8E8E)), privacyAgreementTipIndex, privacyAgreementTipIndex + privacyAgreementTip.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
ss.setSpan(new OriginalDrawStatusClickSpan(ContextCompat.getColor(context, R.color.color_AD89FF)) {
|
||||
@Override
|
||||
public void onClick(@NonNull View widget) {
|
||||
if (widget instanceof TextView)
|
||||
|
@@ -21,6 +21,7 @@ class WalletDiamondFragment : BaseBindingFragment<WalletDiamondFragmentBinding>(
|
||||
mBinding.layoutDetails.singleClick {
|
||||
CommonWebViewActivity.start(context, UriProvider.getGoldDetail())
|
||||
}
|
||||
|
||||
mBinding.tvNext.singleClick {
|
||||
jumpConvert()
|
||||
}
|
||||
|
@@ -7,9 +7,14 @@ import com.chwl.core.earn.bean.GoldToDiamondInfo
|
||||
import com.chwl.core.earn.model.EarnModel
|
||||
import com.chwl.core.pay.PayModel
|
||||
import com.chwl.core.pay.bean.WalletInfo
|
||||
import com.chwl.core.pay.event.GetWalletInfoEvent
|
||||
import com.chwl.core.pay.event.UpdateWalletInfoEvent
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.functions.Consumer
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
import org.greenrobot.eventbus.ThreadMode
|
||||
|
||||
class WalletViewModel : BaseViewModel() {
|
||||
|
||||
@@ -17,6 +22,9 @@ class WalletViewModel : BaseViewModel() {
|
||||
|
||||
val convertInfoLiveData = MutableLiveData<BeanResult<GoldToDiamondInfo>>()
|
||||
|
||||
init {
|
||||
EventBus.getDefault().register(this)
|
||||
}
|
||||
fun getWalletInfo() {
|
||||
addDisposable(
|
||||
PayModel.get().walletInfo
|
||||
@@ -42,4 +50,26 @@ class WalletViewModel : BaseViewModel() {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onWalletInfoUpdate(event: UpdateWalletInfoEvent?) {
|
||||
loadLocalWalletInfo()
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onGetWalletInfoEvent(event: GetWalletInfoEvent?) {
|
||||
loadLocalWalletInfo()
|
||||
}
|
||||
|
||||
private fun loadLocalWalletInfo() {
|
||||
val info = PayModel.get().currentWalletInfo
|
||||
if (info != null) {
|
||||
walletInfoLiveData.value = BeanResult.success(info)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCleared() {
|
||||
super.onCleared()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
}
|
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 34 KiB |
Before Width: | Height: | Size: 33 KiB |
Before Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 46 KiB |
@@ -21,13 +21,13 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:layout_height="50dp" />
|
||||
|
||||
<View
|
||||
<com.chwl.app.view.AutoMirroredImageView
|
||||
android:id="@+id/iv_balance_bg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginHorizontal="@dimen/dp_18"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:background="@drawable/charge_bg_balance"
|
||||
android:src="@drawable/charge_bg_balance"
|
||||
app:layout_constraintDimensionRatio="339:115"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
@@ -262,6 +262,20 @@
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_user_attentions"
|
||||
app:layout_constraintWidth_percent="0.2933" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wallet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/wallet"
|
||||
android:textColor="#78330A"
|
||||
android:textSize="@dimen/dp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_wallet"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_wallet"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_wallet"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_wallet"
|
||||
app:layout_constraintVertical_bias="0.82" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_vip"
|
||||
android:layout_width="0dp"
|
||||
@@ -274,6 +288,20 @@
|
||||
app:layout_constraintTop_toTopOf="@id/iv_wallet"
|
||||
app:layout_constraintWidth_percent="0.2986" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_vip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/me_join_vip"
|
||||
android:textColor="#52189E"
|
||||
android:textSize="@dimen/dp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_vip"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_vip"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_vip"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_vip"
|
||||
app:layout_constraintVertical_bias="0.82" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_guild"
|
||||
android:layout_width="0dp"
|
||||
@@ -286,6 +314,20 @@
|
||||
app:layout_constraintTop_toTopOf="@id/iv_wallet"
|
||||
app:layout_constraintWidth_percent="0.2933" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_guild"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/me_join_guild"
|
||||
android:textColor="#7A2A52"
|
||||
android:textSize="@dimen/dp_13"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_guild"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_guild"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_guild"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_guild"
|
||||
app:layout_constraintVertical_bias="0.82" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@@ -86,7 +86,7 @@
|
||||
android:textColor="#B38C3F"
|
||||
android:textSize="@dimen/dp_12" />
|
||||
|
||||
<ImageView
|
||||
<com.chwl.app.view.AutoMirroredImageView
|
||||
android:id="@+id/iv_details_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@@ -86,7 +86,7 @@
|
||||
android:textColor="#B38C3F"
|
||||
android:textSize="@dimen/dp_12" />
|
||||
|
||||
<ImageView
|
||||
<com.chwl.app.view.AutoMirroredImageView
|
||||
android:id="@+id/iv_details_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@@ -948,6 +948,8 @@
|
||||
<string name="me_open_various_privileges">افتح واستمتع بمختلف الامتيازات</string>
|
||||
<string name="me_my_association">النقابة · الغرفة</string>
|
||||
<string name="me_join_guild">الانضمام إلى النقابة</string>
|
||||
<string name="me_my_guild">我的公會</string>
|
||||
<string name="me_join_vip">加入VIP</string>
|
||||
<string name="me_personal_center">المركز الشخصي</string>
|
||||
<string name="me_my_room">غرفتي</string>
|
||||
<string name="me_gain_recording">سجل الإيرادات</string>
|
||||
|
@@ -964,6 +964,8 @@
|
||||
<string name="me_open_various_privileges">開通立享各項特權</string>
|
||||
<string name="me_my_association">公会·房间</string>
|
||||
<string name="me_join_guild">加入公會</string>
|
||||
<string name="me_my_guild">我的公會</string>
|
||||
<string name="me_join_vip">加入VIP</string>
|
||||
<string name="me_personal_center">個人中心</string>
|
||||
<string name="me_my_room">我的房間</string>
|
||||
<string name="me_gain_recording">收益記錄</string>
|
||||
|
@@ -732,4 +732,6 @@
|
||||
<color name="color_AA7400">#AA7400</color>
|
||||
<color name="color_4E390A">#4E390A</color>
|
||||
<color name="color_7E8373">#7E8373</color>
|
||||
<color name="color_8E8E8E">#8E8E8E</color>
|
||||
<color name="color_AD89FF">#AD89FF</color>
|
||||
</resources>
|
||||
|
@@ -959,6 +959,8 @@
|
||||
<string name="me_open_various_privileges">Open and Enjoy Various Privileges</string>
|
||||
<string name="me_my_association">Guild · Room</string>
|
||||
<string name="me_join_guild">Join Guild</string>
|
||||
<string name="me_my_guild">我的公會</string>
|
||||
<string name="me_join_vip">加入VIP</string>
|
||||
<string name="me_personal_center">Personal Center</string>
|
||||
<string name="me_my_room">My Room</string>
|
||||
<string name="me_gain_recording">Revenue records</string>
|
||||
|