签约 A
This commit is contained in:
@@ -67,7 +67,7 @@ public class RoomMessageEvent extends BaseEvent {
|
||||
private String victory_cover;//胜利的头像
|
||||
private String defeated_name;//输掉的名称
|
||||
private String defeated_cover;//输掉的头像
|
||||
private String end_time;//惩罚时间 /// 在交友房中,是倒计时时间
|
||||
private String end_time;//惩罚时间 /// 在交友房中,是倒计时时间 //签约房倒计时
|
||||
private int is_mute;//1:静音对方 0:不静音对方
|
||||
private int is_mute_pit;
|
||||
private int count;//排麦模式下的人数
|
||||
@@ -106,6 +106,10 @@ public class RoomMessageEvent extends BaseEvent {
|
||||
|
||||
private String rights_icon;//Cp特效
|
||||
|
||||
private String sign_id = "-1";//签约ID
|
||||
private String sign_value;//签约最高价
|
||||
private String sign_day;//被签约天数
|
||||
private String current_body_value;//被签约身价
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,9 @@ public class UserInfo extends BaseEvent implements Serializable {
|
||||
private CpInfo cp_info;
|
||||
private int market_value;//身价
|
||||
|
||||
private String sign_value;
|
||||
private String sign_id;
|
||||
|
||||
/*"cp_info": {
|
||||
"name": "string",
|
||||
"user_id1": "string",
|
||||
|
||||
@@ -93,7 +93,6 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
public static final int QXRoomMessageTypeCPSx = 131;//心动礼物,双向发送
|
||||
|
||||
|
||||
|
||||
/// 交友房阶段发生变化
|
||||
public static final int QXRoomMessageTypeRoomFriendPartDidChanged = 1049;
|
||||
/// 交友房时间发生延时
|
||||
@@ -133,7 +132,21 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
/// 房间内换麦
|
||||
public static final int QXRoomMessageTypehm = 1039;
|
||||
public static final int QXRoomMessageTypeCPText = 1080;//CP特效,进入房间的特效,
|
||||
/// 签约开始
|
||||
public static final int QXRoomMessageTypeSignStartText = 1090;
|
||||
|
||||
/// 签约出价 FromUserInfo :出价最高用户信息,sign_value:出的价,sign_id:场次
|
||||
public static final int QXRoomMessageTypeSignMaxUserText = 1091;
|
||||
|
||||
/**
|
||||
* 签约结束
|
||||
* FromUserInfo:出价用户信息
|
||||
* ToUserInfo:被签用户信息
|
||||
* sign_value:出的最高价
|
||||
*/
|
||||
public static final int QXRoomMessageTypeSignEndText = 1092;
|
||||
/// 延时到这个时间点
|
||||
public static final int QXRoomMessageTypeSignDelayText = 1093;
|
||||
|
||||
|
||||
private RoomMessageEvent emMessage;
|
||||
|
||||
@@ -35,6 +35,7 @@ public interface ApiServer {
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.ROOM_HOUR_BEAN)
|
||||
Call<BaseModel<RoomHourBean>> getRoomHourRanking(@Field("page") String page, @Field("page_limit") String page_limit);
|
||||
|
||||
@FormUrlEncoded //手机换绑
|
||||
@POST(Constants.MODIFY_MOBILE)
|
||||
Call<BaseModel<String>> mobileView(@Field("mobile") String mobile, @Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code);
|
||||
@@ -128,6 +129,7 @@ public interface ApiServer {
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_INVITE)
|
||||
Call<BaseModel<String>> postInvite(@Field("apply_id") String apply_id, @Field("type") String type);
|
||||
|
||||
@GET(Constants.GET_TEMP_KEY)
|
||||
Call<BaseModel<TempKeyBean>> getTempKey();
|
||||
|
||||
@@ -335,7 +337,8 @@ public interface ApiServer {
|
||||
@GET(Constants.GIFT_LIST)
|
||||
Call<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label, @Query("room_id") String room_id);
|
||||
|
||||
@GET(Constants.TOPIC_LIST)//获取话题
|
||||
@GET(Constants.TOPIC_LIST)
|
||||
//获取话题
|
||||
Call<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit);
|
||||
|
||||
@FormUrlEncoded
|
||||
@@ -530,6 +533,7 @@ public interface ApiServer {
|
||||
|
||||
@GET(Constants.GET_FIRST_CHARGE_GIFT)
|
||||
Call<BaseModel<FirstChargeGiftBean>> firstChargeGift();
|
||||
|
||||
@GET(Constants.GET_NEW_CHARGE_GIFT)
|
||||
Call<BaseModel<FirstChargeGiftBean>> getNewChargeGift();
|
||||
|
||||
@@ -834,6 +838,7 @@ public interface ApiServer {
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_XLH_ALL_RECORD)
|
||||
Call<BaseModel<List<GiftBean>>> xlhAllRecord(@Field("room_id") String room_id, @Field("page") String page, @Field("page_size") String page_size);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.Get_XH_RANking)
|
||||
Call<BaseModel<List<GiftBean>>> xlXH_RANking(@Field("room_id") String room_id, @Field("page") String page, @Field("page_size") String page_size);
|
||||
@@ -882,6 +887,13 @@ public interface ApiServer {
|
||||
@POST(Constants.POST_SIGN_DELAY)
|
||||
Call<BaseModel<String>> signDelay(@Field("sign_id") String sign_id, @Field("room_id") String room_id);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_COIN_LIST)
|
||||
Call<BaseModel<List<String>>> signCoinList(@Field("sign_id") String sign_id);
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.POST_SIGN_COIN)
|
||||
Call<BaseModel<String>> signCoin(@Field("sign_id") String sign_id,@Field("sign_value") String sign_value);
|
||||
|
||||
@GET(Constants.GET_SKILL_LIST)
|
||||
Call<BaseModel<List<String>>> skillList();
|
||||
|
||||
|
||||
@@ -63,8 +63,7 @@ public class BaseModelTypeAdapter<T> extends TypeAdapter<BaseModel<T>> {
|
||||
model.setData(null);
|
||||
} else {
|
||||
// 如果 data 是字符串类型但不是 "null",可根据业务决定是否抛异常或处理
|
||||
reader.skipValue();
|
||||
model.setData(null);
|
||||
model.setData((T)value);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
|
||||
@@ -4558,6 +4558,50 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void signCoinList(String sign_id, BaseObserver<List<String>> observer) {
|
||||
sApiServer.signCoinList(sign_id).enqueue(new Callback<BaseModel<List<String>>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<String>>> call, Response<BaseModel<List<String>>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<String>> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1)
|
||||
observer.onNext(baseModel.getData() != null ? baseModel.getData() : new ArrayList<String>());
|
||||
else if (baseModel.getCode() == 301) {
|
||||
try {
|
||||
ToastUtils.showShort(baseModel.getMsg());
|
||||
CommonAppContext.getInstance().clearLoginInfo();
|
||||
} catch (ClassNotFoundException e) {
|
||||
}
|
||||
|
||||
} else {
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<String>>> call, Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void signCoin(String sign_id,String sign_value, BaseObserver<String> observer) {
|
||||
sApiServer.signCoin(sign_id,sign_value).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
onNextRetu(response, observer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public void getCpRoom(String userId, BaseObserver<HeartCpBean> observer) {
|
||||
sApiServer.getCpRoom(userId).enqueue(new Callback<BaseModel<HeartCpBean>>() {
|
||||
@@ -4693,6 +4737,7 @@ public class RetrofitClient {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void signStart(String room_id, String user_id, BaseObserver<String> observer) {
|
||||
sApiServer.signStart(room_id, user_id).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
|
||||
@@ -443,6 +443,8 @@ public class Constants {
|
||||
public static final String POST_SIGN_START = "/api/Sign/start_sign";//签约开始
|
||||
public static final String POST_SIGN_END = "/api/Sign/end_sign";//签约结束
|
||||
public static final String POST_SIGN_DELAY = "/api/Sign/sign_delay";//签约延时
|
||||
public static final String POST_SIGN_COIN_LIST = "/api/Sign/sign_coin_list";//签约出价价格列表
|
||||
public static final String POST_SIGN_COIN = "/api/Sign/sign_coin";//签约出价
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1507,6 +1507,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
messageEvent.text.rights_icon
|
||||
)
|
||||
}
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignStartText) {
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignMaxUserText) {
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignEndText) {
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
} else if (msgType == EMMessageInfo.QXRoomMessageTypeSignDelayText) {
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1797,6 +1805,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
RoomType.SIGN_CONTRACT -> {
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] =
|
||||
getPitBean(messageEvent, 1)
|
||||
@@ -1805,6 +1814,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.rlMisc.visibility = View.GONE
|
||||
roomFragment?.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
else -> {
|
||||
roomFragment!!.updateSeatViewExchangedWithPitArray(mRoomInfoResp)
|
||||
}
|
||||
@@ -1887,6 +1897,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
roomFragment!!.upRoomInfoData(mRoomInfoResp)
|
||||
roomFragment!!.handleRoomMessage(messageEvent)
|
||||
}
|
||||
|
||||
RoomType.SIGN_CONTRACT -> {
|
||||
mRoomInfoResp?.room_info?.pit_list!![pitNumber.toInt() - 1] = RoomPitBean(pitNumber)
|
||||
|
||||
@@ -3660,7 +3671,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 添加检查房间连接状态的方法
|
||||
private fun resumeRoomState() {
|
||||
// 恢复房间相关状态
|
||||
|
||||
@@ -3,11 +3,15 @@ package com.xscm.modulemain.activity.room.contacts
|
||||
import android.app.Activity
|
||||
import com.xscm.moduleutil.activity.IPresenter
|
||||
import com.xscm.moduleutil.activity.IView
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
|
||||
class MentorShipContacts {
|
||||
|
||||
interface View : IView<Activity>{
|
||||
|
||||
fun signCoinList(list:List<String>)
|
||||
|
||||
fun wallet(list:List<String>,walletBean: WalletBean?)
|
||||
}
|
||||
|
||||
interface Ipre : IPresenter{
|
||||
@@ -19,8 +23,14 @@ class MentorShipContacts {
|
||||
|
||||
fun signDelay(signId:String,roomId:String)
|
||||
|
||||
fun signCoinList(signId:String)
|
||||
|
||||
fun signCoin(signId:String,sign_value:String)
|
||||
|
||||
fun setMutePit(roomId:String,pitNumber:String,isMute:String)
|
||||
|
||||
fun setLockPit(roomId:String,pitNumber:String,isLock:String)
|
||||
|
||||
fun wallet(list:List<String>)
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,7 @@ import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import com.xscm.moduleutil.bean.RoomCharmRankBean;
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent;
|
||||
import com.xscm.moduleutil.bean.UserOnlineStatusBean;
|
||||
import com.xscm.moduleutil.bean.room.EMMessageInfo;
|
||||
import com.xscm.moduleutil.bean.room.FriendInfo;
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||
@@ -937,6 +938,18 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
case 1059:
|
||||
mentorShipFragment.event1039(messageEvent);
|
||||
break;
|
||||
case EMMessageInfo.QXRoomMessageTypeSignStartText:
|
||||
mentorShipFragment.event1090(messageEvent);
|
||||
break;
|
||||
case EMMessageInfo.QXRoomMessageTypeSignMaxUserText:
|
||||
mentorShipFragment.event1091(messageEvent);
|
||||
break;
|
||||
case EMMessageInfo.QXRoomMessageTypeSignEndText:
|
||||
mentorShipFragment.event1092(messageEvent);
|
||||
break;
|
||||
case EMMessageInfo.QXRoomMessageTypeSignDelayText:
|
||||
mentorShipFragment.event1093(messageEvent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,14 +12,25 @@ import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
|
||||
import com.xscm.modulemain.activity.room.presenter.MentorShipPresenter
|
||||
import com.xscm.modulemain.databinding.FragmentMentorShipBinding
|
||||
import com.xscm.modulemain.dialog.DialogMentorShip
|
||||
import com.xscm.modulemain.dialog.RoomOnlineDialogFragment
|
||||
import com.xscm.modulemain.dialog.RoomTalentDialog
|
||||
import com.xscm.modulemain.dialog.RoomUserInfoFragment
|
||||
import com.xscm.modulemain.utils.CountdownTimer
|
||||
import com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||
import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||
import com.xscm.moduleutil.utils.ClickUtils
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.SupervisorJob
|
||||
import kotlinx.coroutines.cancel
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
/**
|
||||
* 签约房
|
||||
@@ -46,8 +57,26 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
private var popupWindow: PopupWindow? = null
|
||||
|
||||
private var mPitBean: RoomPitBean? = null
|
||||
private var roomId: String = mRoomInfo?.room_info?.room_id!!
|
||||
private var signPitBean: RoomPitBean? = null
|
||||
private var mRoomId: String = mRoomInfo?.room_info?.room_id!!
|
||||
private var mSignPitBean: RoomPitBean? = null
|
||||
|
||||
private var mSignId: String? = null
|
||||
|
||||
private val timer = CountdownTimer()
|
||||
private val scope = CoroutineScope(Dispatchers.Main + SupervisorJob())
|
||||
|
||||
private val startOrDelay = arrayOf("开始", "延迟")
|
||||
|
||||
private var mUserInfo: RoomUserBean? = mRoomInfo?.user_info
|
||||
|
||||
private var dialogMentorShip: DialogMentorShip? = null
|
||||
|
||||
private val ivForMai = arrayOf(
|
||||
com.xscm.moduleutil.R.mipmap.icon_apply_for_mai,
|
||||
com.xscm.moduleutil.R.mipmap.icon_show_alent,
|
||||
com.xscm.moduleutil.R.mipmap.icon_contract
|
||||
)
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.fragment_mentor_ship
|
||||
@@ -70,6 +99,8 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
viewList.add(mBinding.rmswRightMidd)
|
||||
viewList.add(mBinding.rmswRightRight)
|
||||
|
||||
mBinding.tvTimeLeft.visibility = View.GONE
|
||||
|
||||
for ((idx, view) in viewList.withIndex()) {
|
||||
if (mRoomInfo?.room_info?.pit_list!!.size > indexList[idx].toInt() - 1) {
|
||||
view.setRoomWheatNumber(indexList[idx])
|
||||
@@ -77,7 +108,10 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
if (idx == 0) {
|
||||
view.setHostTv(mBinding.tvHostName)
|
||||
} else if (idx == 1) {
|
||||
signPitBean = bean
|
||||
mSignPitBean = bean
|
||||
if (bean.user_id != "0" && mUserInfo?.user_id != null && viewList[0].pitBean?.user_id.equals(mUserInfo?.user_id.toString())) {
|
||||
mBinding.tvTimeLeft.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
view.isMentorShip(true)
|
||||
view.setData(bean)
|
||||
@@ -116,7 +150,7 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
|
||||
// 处理抱麦逻辑
|
||||
RoomOnlineDialogFragment.show(
|
||||
roomId,
|
||||
mRoomId,
|
||||
mPitBean?.pit_number,
|
||||
mRoomInfo?.user_info,
|
||||
mRoomInfo,
|
||||
@@ -133,56 +167,94 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
mBinding.ivApplyForMai.setOnClickListener(this)
|
||||
mBinding.tvTimeLeft.setOnClickListener(this)
|
||||
mBinding.tvTimeRight.setOnClickListener(this)
|
||||
|
||||
if (mRoomInfo?.sign_info?.sign_id != "-1") {
|
||||
if (mRoomInfo?.sign_info?.sign_status == 0) {
|
||||
mBinding.tvTimeLeft.text = startOrDelay[0]
|
||||
} else {
|
||||
mBinding.tvTimeLeft.text = startOrDelay[1]
|
||||
startTimer(mRoomInfo?.sign_info?.end_time!!)
|
||||
}
|
||||
mBinding.tvSignDay.visibility = View.VISIBLE
|
||||
|
||||
mSignId = mRoomInfo?.sign_info?.sign_id
|
||||
mBinding.tvLeftPrice.text = mRoomInfo?.sign_info?.current_body_value.toString()
|
||||
|
||||
|
||||
mBinding.tvSignDay.text = "签约${mRoomInfo?.sign_info?.sign_day}天"
|
||||
|
||||
if (mUserInfo?.user_id?.toString().equals(mSignPitBean?.user_id)) {
|
||||
setIvForMai(1)
|
||||
} else if (!mSignPitBean?.user_id.equals("0")) {
|
||||
setIvForMai(2)
|
||||
} else {
|
||||
setIvForMai(0)
|
||||
}
|
||||
} else {
|
||||
mBinding.tvTimeLeft.text = startOrDelay[0]
|
||||
mBinding.tvTime.text = "倒计时 00:00"
|
||||
setIvForMai(0)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View?) {
|
||||
when (v?.id) {
|
||||
R.id.iv_apply_for_mai -> {
|
||||
when (mBinding.ivApplyForMai.tag) {
|
||||
ivForMai[0] -> {
|
||||
MvpPre!!.applyPit(mRoomInfo?.room_info?.room_id!!, "")
|
||||
}
|
||||
|
||||
ivForMai[1] -> {
|
||||
RoomTalentDialog(ActivityUtils.getTopActivity(), mRoomId).show()
|
||||
}
|
||||
|
||||
ivForMai[2] -> {
|
||||
MvpPre?.signCoinList(mSignId!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
R.id.tv_time_left -> {
|
||||
if (mBinding.tvTimeLeft.text.toString() == "开始") {
|
||||
MvpPre.signStart(roomId,signPitBean?.user_id!!)
|
||||
if (mBinding.tvTimeLeft.text.toString() == startOrDelay[0]) {
|
||||
MvpPre.signStart(mRoomId, mSignPitBean?.user_id!!)
|
||||
} else {
|
||||
MvpPre.signDelay(mRoomInfo?.sign_info?.sign_id!!,roomId)
|
||||
MvpPre.signDelay(mSignId!!, mRoomId)
|
||||
}
|
||||
}
|
||||
|
||||
R.id.tv_time_right -> {
|
||||
MvpPre.signEnd(mRoomInfo?.sign_info?.sign_id!!)
|
||||
MvpPre.signEnd(mSignId!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun showHostOrAboveBottomView(isSignUser:Boolean) {
|
||||
private fun showHostOrAboveBottomView(isShow: Boolean) {
|
||||
if (getHostUser() < 4) {
|
||||
mBinding.tvTimeLeft.visibility = View.VISIBLE
|
||||
mBinding.tvTimeLeft.text = "开始"
|
||||
mBinding.tvTime.text = "倒计时 00:00"
|
||||
mBinding.tvTimeRight.visibility = if (isShow) View.VISIBLE else View.INVISIBLE
|
||||
mBinding.tvTime.visibility = if (isShow) View.VISIBLE else View.INVISIBLE
|
||||
} else {
|
||||
mBinding.tvHostName.visibility = View.GONE
|
||||
mBinding.tvTime.visibility = if (isShow) View.VISIBLE else View.INVISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun roomInfoUpdate(mRoomInfoResp: RoomInfoResp) {
|
||||
mRoomInfo = mRoomInfoResp
|
||||
mUserInfo = mRoomInfo?.user_info
|
||||
}
|
||||
|
||||
fun event1003(messageEvent: RoomMessageEvent) {
|
||||
val fromUserInfo = messageEvent.text.fromUserInfo ?: return
|
||||
|
||||
val pitNumber = messageEvent.text.pit_number
|
||||
val userId = fromUserInfo.user_id
|
||||
|
||||
if (indexList.contains(pitNumber)) {
|
||||
val viewPos = indexList.indexOf(pitNumber)
|
||||
val pitBean = mRoomInfo?.room_info?.pit_list!![pitNumber.toInt() - 1]
|
||||
viewList[viewPos].setData(pitBean)
|
||||
if (pitNumber == "1") {
|
||||
showHostOrAboveBottomView(true)
|
||||
signPitBean = pitBean
|
||||
mSignPitBean = pitBean
|
||||
}
|
||||
if (pitNumber == "9" && pitBean.user_id.equals(mUserInfo?.user_id.toString())) {
|
||||
mBinding.tvTimeLeft.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,12 +272,154 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
viewList[viewPos].setData(pitBean)
|
||||
|
||||
if (pitNumber == "1") {
|
||||
mSignPitBean = pitBean
|
||||
}
|
||||
|
||||
if (pitNumber == "9" && pitBean.user_id.equals(mUserInfo?.user_id.toString())) {
|
||||
mBinding.tvTimeLeft.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始
|
||||
* sign_id :场次id(这个出价的时候要传回来)
|
||||
*/
|
||||
fun event1090(messageEvent: RoomMessageEvent?) {
|
||||
mSignId = messageEvent?.text?.sign_id
|
||||
val endTime = messageEvent?.text?.end_time
|
||||
val signDay = messageEvent?.text?.sign_day
|
||||
val currBodyValue = messageEvent?.text?.current_body_value
|
||||
if (!mSignId.equals("-1")) {
|
||||
startTimer(endTime?.toLong()!!)
|
||||
mBinding.tvTimeLeft.text = startOrDelay[1]
|
||||
mBinding.tvLeftPrice.text = currBodyValue
|
||||
mBinding.tvSignDay.visibility = View.VISIBLE
|
||||
mBinding.tvSignDay.text = "签约${signDay}天"
|
||||
|
||||
if (viewList[indexList.indexOf("1")].pitBean.user_id.equals(mUserInfo?.user_id.toString())) {
|
||||
setIvForMai(1)
|
||||
} else {
|
||||
setIvForMai(2)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* IM 推送 1091
|
||||
* FromUserInfo :出价最高用户信息,sign_value:出的价,sign_id:场次
|
||||
*/
|
||||
fun event1091(messageEvent: RoomMessageEvent?) {
|
||||
val fromUserInfo = messageEvent?.text?.fromUserInfo
|
||||
val signId = messageEvent?.text?.sign_id
|
||||
if (fromUserInfo != null && mSignId == signId) {
|
||||
val pitBean = RoomPitBean()
|
||||
pitBean.pit_number = indexList[2]
|
||||
pitBean.user_id = fromUserInfo.user_id.toString()
|
||||
pitBean.avatar = fromUserInfo.avatar
|
||||
pitBean.nickname = fromUserInfo.nickname
|
||||
pitBean.sex = fromUserInfo.sex.toString()
|
||||
pitBean.charm = fromUserInfo.charm
|
||||
viewList[indexList.indexOf("2")].setData(pitBean)
|
||||
|
||||
if (dialogMentorShip != null && dialogMentorShip?.isShowing!!) {
|
||||
MvpPre!!.signCoinList(mSignId!!)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* IM推送 1092 结束
|
||||
* FromUserInfo:出价用户信息
|
||||
* ToUserInfo:被签用户信息
|
||||
* sign_value:出的最高价
|
||||
*/
|
||||
fun event1092(messageEvent: RoomMessageEvent?) {
|
||||
stopTimer()
|
||||
|
||||
val fromUserInfo = messageEvent?.text?.fromUserInfo
|
||||
val toUserInfo = messageEvent?.text?.toUserInfo
|
||||
val signValue = messageEvent?.text?.sign_value
|
||||
if (fromUserInfo != null && toUserInfo != null && signValue != null) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* IM 1093的推送
|
||||
* end_time:延时到这个时间点
|
||||
*/
|
||||
fun event1093(messageEvent: RoomMessageEvent?) {
|
||||
val endTime = messageEvent?.text?.end_time
|
||||
restartWithDelay(endTime?.toLong()!!)
|
||||
}
|
||||
|
||||
|
||||
override fun signCoinList(list: List<String>) {
|
||||
MvpPre!!.wallet(list)
|
||||
}
|
||||
|
||||
override fun wallet(list: List<String>,walletBean: WalletBean?) {
|
||||
if (dialogMentorShip == null) {
|
||||
dialogMentorShip = DialogMentorShip(ActivityUtils.getTopActivity())
|
||||
}
|
||||
dialogMentorShip?.show(list,mSignPitBean,
|
||||
object : DialogMentorShip.OnItemClickListener {
|
||||
override fun onItemClick(coin: String) {
|
||||
MvpPre!!.signCoin(mSignId!!, coin)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
private fun setIvForMai(idx: Int) {
|
||||
mBinding.ivApplyForMai.setImageResource(ivForMai[idx])
|
||||
mBinding.ivApplyForMai.tag = ivForMai[idx]
|
||||
}
|
||||
|
||||
|
||||
// 在需要开始计时的地方调用
|
||||
private fun startTimer(milliseconds: Long) {
|
||||
showHostOrAboveBottomView(true)
|
||||
// 启动计时器
|
||||
timer.startCountdown(milliseconds, scope)
|
||||
// 观察时间变化
|
||||
scope.launch {
|
||||
timer.timeLeft.collect { time ->
|
||||
val formattedTime = timer.formatTime(time)
|
||||
// 更新UI显示
|
||||
updateTimerDisplay(formattedTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun stopTimer() {
|
||||
timer.stop()
|
||||
setIvForMai(0)
|
||||
showHostOrAboveBottomView(false)
|
||||
signPitBean = pitBean
|
||||
}
|
||||
|
||||
mBinding.tvLeftPrice.text = "0"
|
||||
mBinding.tvSignDay.visibility = View.GONE
|
||||
mBinding.tvTimeLeft.text = startOrDelay[0]
|
||||
mBinding.tvTime.text = "倒计时 00:00"
|
||||
}
|
||||
|
||||
// 更新UI显示
|
||||
private fun updateTimerDisplay(time: String) {
|
||||
// 在这里更新你的UI,比如:
|
||||
mBinding.tvTime.text = "倒计时 ${time}"
|
||||
}
|
||||
|
||||
// 延迟后重新开始计时
|
||||
private fun restartWithDelay(newMilliseconds: Long, delayMillis: Long = 1000) {
|
||||
scope.launch {
|
||||
delay(delayMillis)
|
||||
startTimer(newMilliseconds)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun event1035(messageEvent: RoomMessageEvent) {
|
||||
|
||||
}
|
||||
@@ -271,7 +485,7 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
}
|
||||
switchCloseMic.setOnCheckedChangeListener { compoundButton, b ->
|
||||
MvpPre.setMutePit(
|
||||
roomId,
|
||||
mRoomId,
|
||||
mPitBean?.pit_number!!,
|
||||
if (b) "2" else "4"
|
||||
)
|
||||
@@ -280,7 +494,7 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
|
||||
switchLockMic.setOnCheckedChangeListener { compoundButton, b ->
|
||||
MvpPre.setLockPit(
|
||||
roomId,
|
||||
mRoomId,
|
||||
mPitBean?.pit_number!!,
|
||||
if (b) "1" else "0"
|
||||
)
|
||||
@@ -290,7 +504,7 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
tvHugMic.setOnClickListener { v: View? ->
|
||||
// 处理抱麦逻辑
|
||||
RoomOnlineDialogFragment.show(
|
||||
roomId, mPitBean?.pit_number, mRoomInfo?.user_info, mRoomInfo,
|
||||
mRoomId, mPitBean?.pit_number, mRoomInfo?.user_info, mRoomInfo,
|
||||
childFragmentManager
|
||||
)
|
||||
popupWindow!!.dismiss()
|
||||
@@ -322,4 +536,12 @@ class RoomMentorShipFragment(var mRoomInfo: RoomInfoResp?) :
|
||||
viewList.clear()
|
||||
}
|
||||
|
||||
|
||||
// 在Fragment销毁时记得清理资源
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
scope.cancel()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.xscm.modulemain.activity.room.presenter
|
||||
|
||||
import android.content.Context
|
||||
import com.xscm.modulemain.activity.room.contacts.JukeboxContacts
|
||||
import com.xscm.modulemain.activity.room.contacts.MentorShipContacts
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.presenter.BasePresenter
|
||||
import com.xscm.moduleutil.presenter.RewardGiftContacts
|
||||
import io.reactivex.disposables.Disposable
|
||||
import java.lang.ref.WeakReference
|
||||
|
||||
@@ -24,6 +25,23 @@ class MentorShipPresenter(context: Context, val view: MentorShipContacts.View) :
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
override fun wallet(list:List<String>) {
|
||||
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(walletBean: WalletBean) {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = WeakReference(view)
|
||||
}
|
||||
MvpRef.get()?.wallet(list,walletBean)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
override fun signStart(roomId: String, userId: String) {
|
||||
RetrofitClient.getInstance().signStart(roomId, userId, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
@@ -60,6 +78,33 @@ class MentorShipPresenter(context: Context, val view: MentorShipContacts.View) :
|
||||
})
|
||||
}
|
||||
|
||||
override fun signCoinList(signId: String) {
|
||||
RetrofitClient.getInstance().signCoinList(signId, object : BaseObserver<List<String>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(list: List<String>) {
|
||||
if (MvpRef == null){
|
||||
MvpRef = WeakReference(view)
|
||||
}
|
||||
MvpRef.get()?.signCoinList(list)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signCoin(signId: String, sign_value: String) {
|
||||
RetrofitClient.getInstance().signCoin(signId, sign_value, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
override fun setMutePit(roomId: String, pitNumber: String, isMute: String) {
|
||||
RetrofitClient.getInstance()
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.xscm.modulemain.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.DialogMentorShipLayoutBinding
|
||||
import com.xscm.moduleutil.bean.room.RoomPitBean
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
|
||||
class DialogMentorShip(context: Context) : BaseDialog<DialogMentorShipLayoutBinding>(context) {
|
||||
|
||||
init {
|
||||
// 设置对话框从底部弹出
|
||||
window?.setGravity(Gravity.BOTTOM)
|
||||
// 设置对话框的宽度为屏幕宽度
|
||||
window?.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
|
||||
// 添加动画效果
|
||||
window?.setWindowAnimations(com.xscm.moduleutil.R.style.DialogAnimationt)
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_mentor_ship_layout
|
||||
}
|
||||
|
||||
private var adapter: Adapter? = null
|
||||
private var onItemClickListener: OnItemClickListener? = null
|
||||
override fun initView() {
|
||||
adapter = Adapter(R.layout.item_mentor_ship_layout, arrayListOf())
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
adapter?.setOnItemClickListener { adapter, view, position ->
|
||||
onItemClickListener?.onItemClick(adapter.data[position]!!.toString())
|
||||
}
|
||||
mBinding.tvRecharge.setOnClickListener {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun show(list: List<String>, mSignPitBean: RoomPitBean?, onItemClickListener: OnItemClickListener?) {
|
||||
super.show()
|
||||
mBinding.tvName.text = mSignPitBean?.nickname
|
||||
ImageUtils.loadHeadCC(mSignPitBean?.avatar, mBinding.ivHead)
|
||||
this.onItemClickListener = onItemClickListener
|
||||
adapter?.setNewData(list)
|
||||
}
|
||||
|
||||
|
||||
class Adapter(idx: Int, data: MutableList<String>) :
|
||||
BaseQuickAdapter<String, BaseViewHolder>(idx, data) {
|
||||
override fun convert(helper: BaseViewHolder, item: String?) {
|
||||
helper.setText(R.id.tv_glod, item)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface OnItemClickListener {
|
||||
fun onItemClick(coin: String)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.xscm.modulemain.utils
|
||||
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Job
|
||||
import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class CountdownTimer {
|
||||
private var job: Job? = null
|
||||
private val _timeLeft = MutableStateFlow(0L)
|
||||
val timeLeft: StateFlow<Long> = _timeLeft
|
||||
|
||||
fun startCountdown(endTimestamp: Long, scope: CoroutineScope) {
|
||||
job?.cancel()
|
||||
job = scope.launch {
|
||||
while (true) {
|
||||
val currentTime = System.currentTimeMillis() / 1000
|
||||
val remainingTime = (endTimestamp - currentTime) * 1000 // 转换为毫秒
|
||||
|
||||
if (remainingTime <= 0) {
|
||||
_timeLeft.value = 0
|
||||
break
|
||||
}
|
||||
|
||||
_timeLeft.value = remainingTime
|
||||
delay(1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
job?.cancel()
|
||||
}
|
||||
|
||||
fun formatTime(milliseconds: Long): String {
|
||||
val seconds = (milliseconds / 1000).toInt()
|
||||
val minutes = seconds / 60
|
||||
val remainingSeconds = seconds % 60
|
||||
return String.format("%02d:%02d", minutes, remainingSeconds)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class RoomMentorShipWheatView : BaseWheatView {
|
||||
hostTv?.text = bean.nickname
|
||||
} else {
|
||||
mTvName.visibility = VISIBLE
|
||||
mCharmView.visibility = INVISIBLE
|
||||
mCharmView.visibility = GONE
|
||||
hostTv?.visibility = GONE
|
||||
}
|
||||
}
|
||||
|
||||
21
MainModule/src/main/res/drawable/select_item_click.xml
Normal file
21
MainModule/src/main/res/drawable/select_item_click.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<!-- 按下状态:白色背景 -->
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<solid android:color="@android:color/white" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#FF56E449" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
<!-- 默认状态:#33E9E9E9背景 -->
|
||||
<item android:state_pressed="false">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="@dimen/dp_12" />
|
||||
<solid android:color="#33E9E9E9" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
111
MainModule/src/main/res/layout/dialog_mentor_ship_layout.xml
Normal file
111
MainModule/src/main/res/layout/dialog_mentor_ship_layout.xml
Normal file
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data></data>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/dialog_user_info_bg"
|
||||
android:clipToPadding="false"
|
||||
android:maxHeight="@dimen/dp_400"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
android:paddingBottom="@dimen/dp_40">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="竞拍"
|
||||
android:textColor="#73FFFFFF"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_marginHorizontal="@dimen/dp_2"
|
||||
android:background="@drawable/shape_circle"
|
||||
android:padding="@dimen/dp_2"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="烟花易冷烟花易冷"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end|center_vertical"
|
||||
android:text="如果没有成功拍下ta,金币将退回给您"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:paddingHorizontal="@dimen/dp_8"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_top"
|
||||
app:spanCount="4"
|
||||
tools:listitem="@layout/item_mentor_ship_layout" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_wallet"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_25"
|
||||
android:drawableStart="@mipmap/jinb"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/recycle_view" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_recharge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:background="@drawable/shape_15"
|
||||
android:backgroundTint="#FF3ABC6D"
|
||||
android:paddingHorizontal="@dimen/dp_10"
|
||||
android:paddingVertical="@dimen/dp_3"
|
||||
android:text="充值"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/recycle_view" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -15,7 +15,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_begin="@dimen/dp_10" />
|
||||
app:layout_constraintGuide_begin="@dimen/dp_8" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -44,6 +44,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tv_title"
|
||||
@@ -59,12 +60,13 @@
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="@dimen/dp_8"
|
||||
android:paddingVertical="@dimen/dp_1"
|
||||
android:text="开始"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_time"
|
||||
app:layout_constraintEnd_toStartOf="@id/tv_time"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_time"
|
||||
android:text="开始" />
|
||||
app:layout_constraintTop_toTopOf="@id/tv_time" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time_right"
|
||||
@@ -79,6 +81,7 @@
|
||||
android:text="结束"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/tv_time"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_time"
|
||||
app:layout_constraintTop_toTopOf="@id/tv_time" />
|
||||
@@ -98,6 +101,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_40"
|
||||
android:layout_marginTop="@dimen/dp_3"
|
||||
android:src="@mipmap/icon_host_top_tips_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
@@ -107,9 +111,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_48"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:textColor="#FFEFEAFF"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
@@ -172,7 +176,7 @@
|
||||
android:id="@+id/tv_left_price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="9998"
|
||||
android:text="0"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textStyle="normal"
|
||||
@@ -191,6 +195,19 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/gl_left_price" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sign_day"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_18"
|
||||
android:drawableLeft="@mipmap/icon_time"
|
||||
android:text="签约7天"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/gl_left_price" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_apply_for_mai"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -231,16 +248,18 @@
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/fly_bottom_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.62" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_right_bg"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -252,25 +271,26 @@
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_right_1"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_begin="48dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_right_2"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/gl_right_3"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.8"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="0.8" />
|
||||
|
||||
<com.xscm.modulemain.widget.RoomMentorShipWheatView
|
||||
android:id="@+id/rmsw_right_left"
|
||||
|
||||
37
MainModule/src/main/res/layout/item_mentor_ship_layout.xml
Normal file
37
MainModule/src/main/res/layout/item_mentor_ship_layout.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp_4"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:background="@drawable/select_item_click"
|
||||
android:backgroundTint="#33E9E9E9"
|
||||
android:paddingHorizontal="@dimen/dp_18"
|
||||
android:paddingVertical="@dimen/dp_30">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_glod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_gold_bg"
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_glod"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_glod"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:text="0"
|
||||
android:textColor="@color/select_item_text"
|
||||
android:textSize="@dimen/sp_14"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/iv_glod" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user