[Modify]修复兑换权限bug
This commit is contained in:
@@ -51,11 +51,17 @@ class EarnRecordActivity : BaseViewBindingActivity<ActivityEarnRecordBinding>(),
|
||||
if (it.isClanElder) {
|
||||
binding.tvGoldDetail.visibility = View.VISIBLE
|
||||
binding.tvConvertDiamond.visibility = View.GONE
|
||||
binding.csGoldBg.background = ContextCompat.getDrawable(this, R.drawable.bg_gold_detail)
|
||||
binding.csGoldBg.background =
|
||||
ContextCompat.getDrawable(this, R.drawable.bg_gold_detail)
|
||||
} else {
|
||||
binding.tvGoldDetail.visibility = View.GONE
|
||||
binding.tvConvertDiamond.visibility = View.VISIBLE
|
||||
binding.csGoldBg.background = ContextCompat.getDrawable(this, R.drawable.bg_earn_gold)
|
||||
if (it.hasGoldExchangeAuth) {
|
||||
binding.tvConvertDiamond.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.tvConvertDiamond.visibility = View.GONE
|
||||
}
|
||||
binding.csGoldBg.background =
|
||||
ContextCompat.getDrawable(this, R.drawable.bg_earn_gold)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -32,53 +32,49 @@
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_close_tip"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_tip"
|
||||
android:gravity="center"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:src="@drawable/ic_close_exchange_tip"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_sure_close"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_sure_close"
|
||||
app:layout_constraintHorizontal_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_sure_close" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_sure_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="@dimen/dp_18"
|
||||
android:text="@string/sure_to_close"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_name"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_close_tip"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_message" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_9168FA"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tv_sure_close"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_sure_tip"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_sure_close"
|
||||
tools:text="PEKO小新" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_sure_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_20"
|
||||
android:text="@string/gold_exchange_power"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tv_name"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/tv_name" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_message">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/iv_close_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@drawable/ic_close_exchange_tip"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_sure_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_6"
|
||||
android:text="@string/sure_to_close"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/color_9168FA"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="PEKO小新" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_sure_tip"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gold_exchange_power"
|
||||
android:textColor="@color/text_title_color"
|
||||
android:textSize="@dimen/sp_14"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_bottom"
|
||||
@@ -88,7 +84,7 @@
|
||||
android:layout_marginBottom="24dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_sure_tip">
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_tip">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_cancel"
|
||||
@@ -116,6 +112,6 @@
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_bottom"/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/ll_bottom" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
@@ -5070,5 +5070,7 @@
|
||||
<string name="edit_your_tags_tip">編輯你的標簽,可以大大提高你的人氣~</string>
|
||||
<string name="my_tag">我的標簽</string>
|
||||
<string name="setting_personal_tags_will_be_more_popular">設置個人標簽將更受歡迎~</string>
|
||||
<string name="gold_exchange_permission_of_the_user_has_been_disabled">已關閉該用戶的金幣兌換權限~</string>
|
||||
<string name="gold_exchange_permission_of_the_user_has_been_enabled">已開啟該用戶的金幣兌換權限~</string>
|
||||
|
||||
</resources>
|
@@ -58,7 +58,8 @@ class ExchangePermissionActivity : BaseViewBindingActivity<ActivityExchangePermi
|
||||
mNoExchangeAdapter.setOnItemChildClickListener { _, _, position ->
|
||||
associationViewModel.operateMemberExchange(
|
||||
1,
|
||||
mNoExchangeAdapter.data[position].uid
|
||||
mNoExchangeAdapter.data[position].uid,
|
||||
"1"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -69,7 +70,8 @@ class ExchangePermissionActivity : BaseViewBindingActivity<ActivityExchangePermi
|
||||
override fun onOk() {
|
||||
associationViewModel.operateMemberExchange(
|
||||
0,
|
||||
mEnableExchangeAdapter.data[position].uid
|
||||
mEnableExchangeAdapter.data[position].uid,
|
||||
"0"
|
||||
)
|
||||
}
|
||||
})
|
||||
@@ -82,6 +84,11 @@ class ExchangePermissionActivity : BaseViewBindingActivity<ActivityExchangePermi
|
||||
}
|
||||
|
||||
associationViewModel.operateMemberExchangeLiveData.observe(this) {
|
||||
if (it == "0") {
|
||||
toast(getString(R.string.gold_exchange_permission_of_the_user_has_been_disabled))
|
||||
} else if (it == "1") {
|
||||
toast(getString(R.string.gold_exchange_permission_of_the_user_has_been_enabled))
|
||||
}
|
||||
associationViewModel.getMemberExchangeList()
|
||||
}
|
||||
|
||||
|
@@ -50,12 +50,12 @@ class AssociationViewModel : BaseViewModel() {
|
||||
)
|
||||
}
|
||||
|
||||
fun operateMemberExchange(status: Int, targetUid: Long) {
|
||||
fun operateMemberExchange(status: Int, targetUid: Long, type: String) {
|
||||
safeLaunch(
|
||||
true,
|
||||
block = {
|
||||
_operateMemberExchangeLiveData.value =
|
||||
AssociationModel.operateMemberExchange(status, targetUid)
|
||||
AssociationModel.operateMemberExchange(status, targetUid) ?: type
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@@ -85,9 +85,12 @@
|
||||
android:layout_marginStart="@dimen/dp_3"
|
||||
android:textColor="@color/color_6D6B89"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"
|
||||
android:maxEms="5"
|
||||
app:layout_constraintBaseline_toBaselineOf="@+id/tv_id"
|
||||
app:layout_constraintStart_toEndOf="@+id/view_id"
|
||||
tools:text="灌南的房间" />
|
||||
tools:text="灌南的房间点击" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_room_name"
|
||||
|
@@ -9,6 +9,7 @@ data class EarnRecordInfo(
|
||||
val diamonds: BigDecimal,
|
||||
val crystals: Double,
|
||||
val golds: BigDecimal,
|
||||
val isClan: Boolean,
|
||||
val isClanElder: Boolean
|
||||
val isClan: Boolean = false,
|
||||
val isClanElder: Boolean = false,
|
||||
val hasGoldExchangeAuth: Boolean = false
|
||||
)
|
Reference in New Issue
Block a user