修复转赠礼物bug
This commit is contained in:
@@ -873,7 +873,7 @@
|
||||
<activity
|
||||
android:name=".pay.activity.GiveGoldToUserActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateHidden|adjustResize" />
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".pay.activity.GiveGoldSearchActivity"
|
||||
android:screenOrientation="portrait"
|
||||
|
@@ -101,12 +101,12 @@ class GiveGoldActivity : BaseViewBindingActivity<ActivityGiveGoldBinding>() {
|
||||
if (it) dialogManager.showProgressDialog(this)
|
||||
else dialogManager.dismissDialog()
|
||||
}
|
||||
GiftModel.get().knapList
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
loadData(true)
|
||||
GiftModel.get().requestKnapGiftInfos().subscribe()
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
|
@@ -38,6 +38,8 @@ import com.yizhuan.xchat_android_core.initial.InitialModel
|
||||
import com.yizhuan.xchat_android_core.pay.PayModel
|
||||
import com.yizhuan.xchat_android_core.user.UserModel
|
||||
import com.yizhuan.xchat_android_core.user.bean.SearchUserInfo
|
||||
import com.yizhuan.xchat_android_core.user.bean.UserInfo
|
||||
import com.yizhuan.xchat_android_core.utils.net.RxHelper
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
import kotlinx.android.synthetic.main.activity_give_gold_to_user.*
|
||||
|
||||
@@ -90,16 +92,20 @@ class GiveGoldToUserActivity : BaseViewBindingActivity<ActivityGiveGoldToUserBin
|
||||
if (diamondList?.contains(userInfo?.erbanNo) == true || levelSep >= (initInfo?.giveDiamondExperLevel
|
||||
?: 0)
|
||||
) {
|
||||
binding.tvGiftTab.visibility = View.VISIBLE
|
||||
binding.tvDiamondTab.visibility = View.VISIBLE
|
||||
binding.groupDiamond.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.tvGiftTab.visibility = View.GONE
|
||||
binding.tvDiamondTab.visibility = View.GONE
|
||||
binding.groupDiamond.visibility = View.GONE
|
||||
}
|
||||
if (giftList?.contains(userInfo?.erbanNo) == true || levelSep >= (initInfo?.giveGiftExperLevel
|
||||
?: 0)
|
||||
) {
|
||||
binding.tvGiftTab.visibility = View.VISIBLE
|
||||
binding.groupGift.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.tvGiftTab.visibility = View.GONE
|
||||
binding.groupGift.visibility = View.GONE
|
||||
}
|
||||
binding.viewPagerEntrance.addOnPageChangeListener(object : OnPageSelectedListener() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
@@ -115,10 +121,8 @@ class GiveGoldToUserActivity : BaseViewBindingActivity<ActivityGiveGoldToUserBin
|
||||
else dialogManager.dismissDialog()
|
||||
}
|
||||
giveGoldModel.giveGiftLiveData.observe(this) {
|
||||
it?.let {
|
||||
toast(getString(R.string.gift_give_success))
|
||||
finish()
|
||||
}
|
||||
toast(getString(R.string.gift_give_success))
|
||||
finish()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,7 +212,9 @@ class GiveGoldToUserActivity : BaseViewBindingActivity<ActivityGiveGoldToUserBin
|
||||
}
|
||||
|
||||
private fun initDiamond() {
|
||||
if (binding.tvGiftTab.visibility == View.VISIBLE) {
|
||||
if(binding.tvDiamondTab.visibility == View.GONE){
|
||||
return
|
||||
}else if (binding.tvGiftTab.visibility == View.VISIBLE) {
|
||||
binding.tvGiftTab.isSelected = false
|
||||
binding.groupGift.visibility = View.GONE
|
||||
}
|
||||
@@ -231,19 +237,31 @@ class GiveGoldToUserActivity : BaseViewBindingActivity<ActivityGiveGoldToUserBin
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
private fun initGift() {
|
||||
if(binding.tvGiftTab.visibility == View.GONE){
|
||||
return
|
||||
}
|
||||
val giftList = GiftModel.get().knapList
|
||||
if (binding.tvDiamondTab.visibility == View.GONE) {
|
||||
binding.tvGiftTab.isSelected = true
|
||||
binding.tvSure.isEnabled = true
|
||||
}
|
||||
binding.tvGiftTab.setOnClickListener {
|
||||
if (binding.tvDiamondTab.visibility == View.VISIBLE) {
|
||||
binding.tvDiamondTab.isSelected = false
|
||||
binding.groupDiamond.visibility = View.GONE
|
||||
binding.tvGiftTab.isSelected = true
|
||||
binding.groupGift.visibility = View.VISIBLE
|
||||
binding.tvSure.isEnabled = true
|
||||
}
|
||||
}
|
||||
if(giftList.size == 0){
|
||||
binding.tvEmptyTip.visibility = View.VISIBLE
|
||||
return
|
||||
}else{
|
||||
binding.tvEmptyTip.visibility = View.GONE
|
||||
}
|
||||
// giftList.map { it.isSelected = false }
|
||||
val list = transformList(giftList, 8)
|
||||
binding.magicIndicatorEntrance.initIndicator(list.size)
|
||||
binding.magicIndicatorEntrance.setSelectedPage(centerIndex)
|
||||
@@ -316,18 +334,9 @@ class GiveGoldToUserActivity : BaseViewBindingActivity<ActivityGiveGoldToUserBin
|
||||
}
|
||||
binding.viewPagerEntrance.setCurrentItem(centerIndex, false)
|
||||
binding.editGift.addTextChangedListener(this)
|
||||
binding.tvGiftTab.setOnClickListener {
|
||||
if (binding.tvDiamondTab.visibility == View.VISIBLE) {
|
||||
binding.tvDiamondTab.isSelected = false
|
||||
binding.groupDiamond.visibility = View.GONE
|
||||
binding.tvGiftTab.isSelected = true
|
||||
binding.groupGift.visibility = View.VISIBLE
|
||||
binding.tvSure.isEnabled = true
|
||||
}
|
||||
}
|
||||
binding.tvAll.setOnClickListener {
|
||||
if (giftAllCount != -1)
|
||||
binding.editGift.setText(giftAllCount)
|
||||
binding.editGift.setText(giftAllCount.toString())
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user