1:给酒吧房小黑屋添加充值和显示金币的控件
This commit is contained in:
@@ -11,7 +11,7 @@ public class WalletBean {
|
|||||||
|
|
||||||
private String id;
|
private String id;
|
||||||
private String user_id;
|
private String user_id;
|
||||||
private String coin;//金币
|
private String coin="0";//金币
|
||||||
private String earnings;//钻石
|
private String earnings;//钻石
|
||||||
private String url;//灵活就业合作伙伴协议
|
private String url;//灵活就业合作伙伴协议
|
||||||
private String title;//状态
|
private String title;//状态
|
||||||
|
|||||||
@@ -192,7 +192,6 @@ import java.lang.ref.WeakReference
|
|||||||
import java.nio.charset.StandardCharsets
|
import java.nio.charset.StandardCharsets
|
||||||
import java.util.Arrays
|
import java.util.Arrays
|
||||||
import java.util.Date
|
import java.util.Date
|
||||||
import java.util.concurrent.Executors
|
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import java.util.stream.Collectors
|
import java.util.stream.Collectors
|
||||||
|
|
||||||
@@ -602,6 +601,12 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mBinding?.clGold?.setOnClickListener { view : View ->
|
||||||
|
this.onClick(
|
||||||
|
view
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
mBinding!!.inputMenu1.performClick()
|
mBinding!!.inputMenu1.performClick()
|
||||||
|
|
||||||
V2TIMManager.getConversationManager()
|
V2TIMManager.getConversationManager()
|
||||||
@@ -1098,6 +1103,16 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
SpUtil.getInstance().setIntValue("is_pk",mRoomInfoResp?.room_info?.is_pk?:1)
|
SpUtil.getInstance().setIntValue("is_pk",mRoomInfoResp?.room_info?.is_pk?:1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: 小黑屋充值
|
||||||
|
fun refillGold(){
|
||||||
|
RechargeDialogFragment.show(roomId, null, supportFragmentManager, "", "")
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: 充值赋值
|
||||||
|
fun goldAssignment(gold_coin: String){
|
||||||
|
mBinding?.tvGold?.text = "余额:"+ gold_coin
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private fun checkAndRestoreMinimizeState() {
|
private fun checkAndRestoreMinimizeState() {
|
||||||
val prefs = getSharedPreferences("room_minimize_state", Context.MODE_PRIVATE)
|
val prefs = getSharedPreferences("room_minimize_state", Context.MODE_PRIVATE)
|
||||||
@@ -2879,6 +2894,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
mBinding!!.svgaGift.visibility = View.VISIBLE
|
mBinding!!.svgaGift.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (id == R.id.cl_gold){
|
||||||
|
refillGold()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3072,6 +3089,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if (voive) View.VISIBLE else View.VISIBLE
|
if (voive) View.VISIBLE else View.VISIBLE
|
||||||
mBinding?.rlPrivateMsg?.visibility = View.VISIBLE
|
mBinding?.rlPrivateMsg?.visibility = View.VISIBLE
|
||||||
mBinding?.rlEffects?.visibility = View.VISIBLE
|
mBinding?.rlEffects?.visibility = View.VISIBLE
|
||||||
|
mBinding?.clGold?.visibility= View.VISIBLE
|
||||||
|
|
||||||
if (SpUtil.getOpenEffect()==1){
|
if (SpUtil.getOpenEffect()==1){
|
||||||
mBinding?.ivIcon?.setImageResource(com.xscm.moduleutil.R.mipmap.icon_close_effects)
|
mBinding?.ivIcon?.setImageResource(com.xscm.moduleutil.R.mipmap.icon_close_effects)
|
||||||
@@ -3104,6 +3122,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
|||||||
if (voive) View.VISIBLE else View.GONE
|
if (voive) View.VISIBLE else View.GONE
|
||||||
mBinding?.rlPrivateMsg?.visibility = View.GONE
|
mBinding?.rlPrivateMsg?.visibility = View.GONE
|
||||||
mBinding?.rlEffects?.visibility = View.GONE
|
mBinding?.rlEffects?.visibility = View.GONE
|
||||||
|
mBinding?.clGold?.visibility= View.GONE
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 这里是当进入电影放房的时候,如果是排麦模式,并且不是电影放的时候,就隐藏排麦视图 */
|
/** 这里是当进入电影放房的时候,如果是排麦模式,并且不是电影放的时候,就隐藏排麦视图 */
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class PrivateContacts {
|
|||||||
|
|
||||||
interface View : IView<Activity>{
|
interface View : IView<Activity>{
|
||||||
|
|
||||||
fun wallet(list:List<String>,walletBean: WalletBean?)
|
fun wallet(walletBean: WalletBean?)
|
||||||
|
|
||||||
fun sendGiftResult(success:Boolean,idx: Int)
|
fun sendGiftResult(success:Boolean,idx: Int)
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ class PrivateContacts {
|
|||||||
|
|
||||||
fun exitRoom(roomId: String?, userId: String?)
|
fun exitRoom(roomId: String?, userId: String?)
|
||||||
|
|
||||||
fun wallet(list:List<String>)
|
fun wallet()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,7 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
|
|
||||||
override fun initData() {
|
override fun initData() {
|
||||||
MvpPre?.getGiftList(mRoomId)
|
MvpPre?.getGiftList(mRoomId)
|
||||||
|
MvpPre?.wallet()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun roomInfoUpdate(roomInfoResp: RoomInfoResp) {
|
fun roomInfoUpdate(roomInfoResp: RoomInfoResp) {
|
||||||
@@ -229,7 +230,10 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun wallet(list: List<String>, walletBean: WalletBean?) {
|
override fun wallet(walletBean: WalletBean?) {
|
||||||
|
if (ActivityUtils.getTopActivity() is RoomActivity) {
|
||||||
|
(ActivityUtils.getTopActivity() as RoomActivity).goldAssignment(walletBean?.coin.toString())
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +247,7 @@ class RoomPrivateFragment(var mRoomInfoResp: RoomInfoResp?) :
|
|||||||
itemTextView.visibility = View.VISIBLE
|
itemTextView.visibility = View.VISIBLE
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
MvpPre?.wallet()
|
||||||
val itemImage = giftViewList[idx]
|
val itemImage = giftViewList[idx]
|
||||||
val itemTextView = giftTViewList[idx]
|
val itemTextView = giftTViewList[idx]
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class PrivatePresenter(context: Context, val view: PrivateContacts.View?) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun wallet(list:List<String>) {
|
override fun wallet() {
|
||||||
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean?>() {
|
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean?>() {
|
||||||
override fun onSubscribe(d: Disposable) {
|
override fun onSubscribe(d: Disposable) {
|
||||||
addDisposable(d)
|
addDisposable(d)
|
||||||
@@ -118,9 +118,11 @@ class PrivatePresenter(context: Context, val view: PrivateContacts.View?) :
|
|||||||
if (MvpRef == null) {
|
if (MvpRef == null) {
|
||||||
MvpRef = WeakReference(view)
|
MvpRef = WeakReference(view)
|
||||||
}
|
}
|
||||||
MvpRef.get()?.wallet(list,walletBean)
|
MvpRef.get()?.wallet(walletBean)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
|
|
||||||
|
|
||||||
</com.xscm.moduleutil.widget.DropRedView>
|
</com.xscm.moduleutil.widget.DropRedView>
|
||||||
<!-- 每日任务-->
|
<!-- 每日任务-->
|
||||||
<com.xscm.moduleutil.widget.DropDayTaskView
|
<com.xscm.moduleutil.widget.DropDayTaskView
|
||||||
android:id="@+id/cl_day_task"
|
android:id="@+id/cl_day_task"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -98,7 +98,6 @@
|
|||||||
<!-- android:background="@mipmap/room_xsb"-->
|
<!-- android:background="@mipmap/room_xsb"-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -115,8 +114,8 @@
|
|||||||
android:id="@+id/tv_task_message"
|
android:id="@+id/tv_task_message"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@+id/im_day_task"
|
|
||||||
android:layout_marginStart="-30dp"
|
android:layout_marginStart="-30dp"
|
||||||
|
android:layout_toEndOf="@+id/im_day_task"
|
||||||
android:background="@drawable/ease_bg_msg_count"
|
android:background="@drawable/ease_bg_msg_count"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:paddingLeft="@dimen/dp_5"
|
android:paddingLeft="@dimen/dp_5"
|
||||||
@@ -211,11 +210,11 @@
|
|||||||
android:layout_marginTop="@dimen/dp_200"
|
android:layout_marginTop="@dimen/dp_200"
|
||||||
android:layout_marginEnd="@dimen/dp_30"
|
android:layout_marginEnd="@dimen/dp_30"
|
||||||
android:nestedScrollingEnabled="true"
|
android:nestedScrollingEnabled="true"
|
||||||
app:spanCount="1"
|
|
||||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
app:layout_constraintVertical_bias="0.0" />
|
app:layout_constraintVertical_bias="0.0"
|
||||||
|
app:spanCount="1" />
|
||||||
|
|
||||||
|
|
||||||
<com.xscm.moduleutil.widget.AvatarFrameView
|
<com.xscm.moduleutil.widget.AvatarFrameView
|
||||||
@@ -302,8 +301,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/dp_5"
|
android:layout_marginEnd="@dimen/dp_5"
|
||||||
android:layout_weight="0.3"
|
android:layout_weight="0.3"
|
||||||
android:visibility="gone"
|
android:gravity="center_vertical"
|
||||||
android:gravity="center_vertical">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_mic"
|
android:id="@+id/iv_mic"
|
||||||
@@ -353,8 +352,8 @@
|
|||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/dp_5"
|
android:layout_marginEnd="@dimen/dp_5"
|
||||||
android:visibility="gone"
|
android:layout_weight="0.3"
|
||||||
android:layout_weight="0.3">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_more"
|
android:id="@+id/iv_more"
|
||||||
@@ -367,10 +366,10 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rl_misc"
|
android:id="@+id/rl_misc"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="@dimen/dp_5"
|
android:layout_marginEnd="@dimen/dp_5"
|
||||||
android:layout_weight="0.3">
|
android:layout_weight="0.3"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_misc"
|
android:id="@+id/iv_misc"
|
||||||
@@ -412,9 +411,9 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rl_effects"
|
android:id="@+id/rl_effects"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.3">
|
android:layout_weight="0.3"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -428,9 +427,9 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rl_private_msg"
|
android:id="@+id/rl_private_msg"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.6">
|
android:layout_weight="0.6"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_private_set"
|
android:id="@+id/iv_private_set"
|
||||||
@@ -448,9 +447,9 @@
|
|||||||
android:id="@+id/ll_input"
|
android:id="@+id/ll_input"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
|
android:elevation="@dimen/dp_10"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:elevation="@dimen/dp_10"
|
|
||||||
app:layout_constraintBottom_toTopOf="@id/ll_bottom"
|
app:layout_constraintBottom_toTopOf="@id/ll_bottom"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
@@ -474,8 +473,8 @@
|
|||||||
android:layout_height="@dimen/dp_60"
|
android:layout_height="@dimen/dp_60"
|
||||||
android:layout_marginTop="200dp"
|
android:layout_marginTop="200dp"
|
||||||
android:layout_marginEnd="15dp"
|
android:layout_marginEnd="15dp"
|
||||||
android:visibility="gone"
|
|
||||||
android:elevation="@dimen/dp_10"
|
android:elevation="@dimen/dp_10"
|
||||||
|
android:visibility="gone"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintBottom_toTopOf="@+id/cl_first_charge"
|
app:layout_constraintBottom_toTopOf="@+id/cl_first_charge"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
@@ -555,6 +554,55 @@
|
|||||||
tools:text="0人排队" />
|
tools:text="0人排队" />
|
||||||
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/cl_gold"
|
||||||
|
android:layout_width="@dimen/dp_98"
|
||||||
|
android:layout_height="@dimen/dp_43"
|
||||||
|
android:layout_marginBottom="@dimen/dp_44"
|
||||||
|
android:background="@drawable/rounded_left_corners"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/ll_bottom"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
tools:visibility="visible">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_gold"
|
||||||
|
android:layout_width="30dp"
|
||||||
|
android:layout_height="30dp"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/jinb"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_gold"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/tv_first_gold"
|
||||||
|
android:textSize="11sp"
|
||||||
|
app:layout_constraintStart_toStartOf="@+id/tv_first_gold"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:text="余额" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_first_gold"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_15"
|
||||||
|
android:textColor="@color/blue1"
|
||||||
|
android:textSize="14sp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@+id/tv_gold"
|
||||||
|
android:text="去充值" />
|
||||||
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user