房间相册 选择解锁礼物UI 交互
This commit is contained in:
@@ -63,6 +63,7 @@ class ChooseGiftRoomAlbumDialogFragment : BottomSheetDialogFragment() {
|
||||
|
||||
setOnItemClickListener { _, _, position ->
|
||||
onPickedListener?.onPicked(data[position])
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -10,6 +10,7 @@ import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
@@ -18,6 +19,7 @@ import com.yizhuan.erban.R
|
||||
import com.yizhuan.erban.databinding.DialogRoomAlbumUploadBinding
|
||||
import com.yizhuan.erban.ui.utils.ImageLoadUtilsV2
|
||||
import com.yizhuan.erban.ui.widget.recyclerview.decoration.GridSpacingItemNewDecoration
|
||||
import com.yizhuan.xchat_android_core.gift.bean.GiftInfo
|
||||
import com.yizhuan.xchat_android_library.common.photo.PhotoProvider
|
||||
import com.yizhuan.xchat_android_library.common.photo.PhotoProvider.photoProvider
|
||||
import com.yizhuan.xchat_android_library.easypermisssion.EasyPermissions
|
||||
@@ -29,6 +31,8 @@ class UploadRoomAlbumDialogFragment : BottomSheetDialogFragment() {
|
||||
|
||||
private lateinit var photoAdapter: BaseMultiItemQuickAdapter<PhotoItem, BaseViewHolder>
|
||||
|
||||
private var unlockedGift: GiftInfo? = null
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NO_TITLE, R.style.ErbanBottomSheetDialog)
|
||||
@@ -106,13 +110,25 @@ class UploadRoomAlbumDialogFragment : BottomSheetDialogFragment() {
|
||||
|
||||
binding.rvPhoto.adapter = photoAdapter
|
||||
|
||||
binding.vGift.isEnabled = false
|
||||
binding.rgType.setOnCheckedChangeListener { group, checkedId ->
|
||||
if (checkedId == binding.rbCommon.id) {
|
||||
binding.tvNoGift.visibility = View.VISIBLE
|
||||
binding.tvNoGift.text =
|
||||
getString(R.string.room_album_type_no_need_unlocked_gift_tips)
|
||||
binding.groupGift.visibility = View.INVISIBLE
|
||||
unlockedGift = null
|
||||
|
||||
binding.vGift.isEnabled = false
|
||||
binding.tvGiftLabel.setTextColor(ContextCompat.getColor(requireContext(), R.color.color_B3B3C3))
|
||||
} else {
|
||||
binding.tvNoGift.visibility = View.INVISIBLE
|
||||
binding.groupGift.visibility = View.VISIBLE
|
||||
binding.tvNoGift.visibility = View.VISIBLE
|
||||
binding.tvNoGift.text =
|
||||
getString(R.string.room_album_type_choose_unlocked_gift_tips)
|
||||
|
||||
binding.groupGift.visibility = View.INVISIBLE
|
||||
binding.vGift.isEnabled = true
|
||||
binding.tvGiftLabel.setTextColor(ContextCompat.getColor(requireContext(), R.color.color_1F1B4F))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +136,8 @@ class UploadRoomAlbumDialogFragment : BottomSheetDialogFragment() {
|
||||
val chooseGiftRoomAlbumDialogFragment = ChooseGiftRoomAlbumDialogFragment()
|
||||
chooseGiftRoomAlbumDialogFragment.onPickedListener =
|
||||
ChooseGiftRoomAlbumDialogFragment.OnPickedListener {
|
||||
unlockedGift = it
|
||||
|
||||
binding.tvNoGift.visibility = View.INVISIBLE
|
||||
binding.groupGift.visibility = View.VISIBLE
|
||||
|
||||
|
@@ -97,7 +97,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_20"
|
||||
android:text="@string/unlock_gift"
|
||||
android:textColor="@color/color_1F1B4F"
|
||||
android:textColor="@color/color_B3B3C3"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintStart_toStartOf="@id/v_gift"
|
||||
@@ -108,7 +108,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_6"
|
||||
android:text="當前無需選擇解鎖禮物"
|
||||
android:text="@string/room_album_type_no_need_unlocked_gift_tips"
|
||||
android:textColor="@color/color_B3B3C3"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="@id/v_gift"
|
||||
app:layout_constraintEnd_toStartOf="@id/iv_gift_more"
|
||||
|
@@ -5140,5 +5140,7 @@
|
||||
<string name="normal_photo">普通照片</string>
|
||||
<string name="locked_photo">解鎖照片</string>
|
||||
<string name="unlock_gift">解鎖禮物</string>
|
||||
<string name="room_album_type_no_need_unlocked_gift_tips">當前無需選擇解鎖禮物</string>
|
||||
<string name="room_album_type_choose_unlocked_gift_tips">選擇解鎖禮物</string>
|
||||
|
||||
</resources>
|
Reference in New Issue
Block a user