1:添加酒吧房的弹框获取数据
This commit is contained in:
@@ -13,7 +13,7 @@ public class RoonGiftModel {
|
||||
private String gift_name;//礼物名称
|
||||
private String base_image;//礼物图片
|
||||
private String gift_price;//礼物价格
|
||||
private String gift_id;//礼物id
|
||||
private String gift_id="";//礼物id
|
||||
private String gift_bag_name;
|
||||
private String rule;
|
||||
private String rule_url;
|
||||
@@ -38,6 +38,12 @@ public class RoonGiftModel {
|
||||
|
||||
private int is_cp;//1:是 0:不是 是不是cp心动礼物
|
||||
private int is_teacher;//1:是 0:不是 是不是师徒礼物
|
||||
|
||||
|
||||
//下面是在酒吧房使用的参数
|
||||
private int id;
|
||||
private String new_gift_name="";//用户设置的礼物内容
|
||||
|
||||
public boolean isCan_send_self() {
|
||||
if ( isManghe()) {
|
||||
return true;
|
||||
|
||||
@@ -40,6 +40,10 @@ public interface ApiServer {
|
||||
@POST(Constants.MODIFY_MOBILE)
|
||||
Call<BaseModel<String>> mobileView(@Field("mobile") String mobile, @Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code,@Field("new_sms_code") String new_sms_code);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.SET_PIT_TIME)
|
||||
Call<BaseModel<String>> setPitTime(@Field("room_id") String roomId, @Field("time") String time);
|
||||
|
||||
@GET(Constants.GET_FESTIVAL_THEME)
|
||||
Call<BaseModel<FestivalThemeBean>> getFestivalThemeBean();
|
||||
|
||||
@@ -353,6 +357,15 @@ public interface ApiServer {
|
||||
@GET(Constants.GIFT_LIST)
|
||||
Call<BaseModel<List<RoonGiftModel>>> getGiftList(@Query("label") int label, @Query("room_id") String room_id);
|
||||
|
||||
@GET(Constants.GET_CUSTOM_GIFT_LIST)
|
||||
Call<BaseModel<List<RoonGiftModel>>> getCustomGiftList();
|
||||
|
||||
@GET(Constants.GET_NEW_GIFT_LIST)
|
||||
Call<BaseModel<List<RoonGiftModel>>> getNewGiftList(@Query("label") int label, @Query("type") String type );
|
||||
|
||||
@GET(Constants.SET_CUSTOM_GIFT)
|
||||
Call<BaseModel<String>> setCustomGift(@Query("gift_id") String gift_id, @Query("new_gift_name") String new_gift_name );
|
||||
|
||||
@GET(Constants.TOPIC_LIST)
|
||||
//获取话题
|
||||
Call<BaseModel<List<HeatedBean>>> topicList(@Query("page") String page, @Query("page_limit") String page_limit);
|
||||
|
||||
@@ -304,7 +304,26 @@ public class RetrofitClient {
|
||||
LogUtils.e("getFestivalTheme", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setPitTime(String room_id,String time,BaseObserver<String> observer) {
|
||||
sApiServer.setPitTime(room_id,time).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200) {
|
||||
onNextRetu(response, observer);
|
||||
}else {
|
||||
ToastUtils.showLong("麦位时长设置错误", response.code());
|
||||
LogUtils.e("setPitTime", response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
LogUtils.e("setPitTime", t.toString());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void mobileView(String mobile, String new_mobile, String sms_code, String new_sms_code, BaseObserver<String> observer) {
|
||||
@@ -2247,6 +2266,78 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getCustomGiftList(BaseObserver<List<RoonGiftModel>> observer) {
|
||||
sApiServer.getCustomGiftList().enqueue(new Callback<BaseModel<List<RoonGiftModel>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<RoonGiftModel>>> call, Response<BaseModel<List<RoonGiftModel>>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<RoonGiftModel>> listBaseModel = response.body();
|
||||
if (listBaseModel.getCode() == 1) {
|
||||
observer.onNext(listBaseModel.getData()==null ? new ArrayList<>() : listBaseModel.getData());
|
||||
} else if (listBaseModel.getCode() == 0) {
|
||||
ToastUtils.showLong(listBaseModel.getMsg());
|
||||
} else if (listBaseModel.getCode() == 301) {
|
||||
setCode301(listBaseModel.getMsg());
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showLong("自定义礼物数据错误",response.code());
|
||||
LogUtils.e("getGiftList", response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<RoonGiftModel>>> call, Throwable t) {
|
||||
LogUtils.e("getGiftList", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
public void getNewGiftList(int label,String type,BaseObserver<List<RoonGiftModel>> observer) {
|
||||
sApiServer.getNewGiftList(label,type).enqueue(new Callback<BaseModel<List<RoonGiftModel>>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<RoonGiftModel>>> call, Response<BaseModel<List<RoonGiftModel>>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<RoonGiftModel>> listBaseModel = response.body();
|
||||
if (listBaseModel.getCode() == 1) {
|
||||
observer.onNext(listBaseModel.getData()==null ? new ArrayList<>() : listBaseModel.getData());
|
||||
} else if (listBaseModel.getCode() == 0) {
|
||||
ToastUtils.showLong(listBaseModel.getMsg());
|
||||
} else if (listBaseModel.getCode() == 301) {
|
||||
setCode301(listBaseModel.getMsg());
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showLong("酒吧房礼物数据错误",response.code());
|
||||
LogUtils.e("getGiftList", response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<RoonGiftModel>>> call, Throwable t) {
|
||||
LogUtils.e("getGiftList", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setCustomGift(String gift_id, String new_gift_name, BaseObserver<String> observer) {
|
||||
sApiServer.setCustomGift(gift_id, new_gift_name).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200) {
|
||||
onNextRetu(response,observer);
|
||||
}else {
|
||||
ToastUtils.showLong("自定义礼物设置错误",response.code());
|
||||
LogUtils.e("setCustomGift", response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<String>> call, Throwable t) {
|
||||
LogUtils.e("setCustomGift", t.fillInStackTrace());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void singerUpdateSong(String songId, String song_name, String gift_id, String gift_num, BaseObserver<String> observer) {
|
||||
sApiServer.singerUpdateSong(songId, song_name, gift_id, gift_num).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
|
||||
@@ -225,6 +225,9 @@ public class Constants {
|
||||
public static final String GET_REWARD_LIST = "/api/UserZone/reward_list";//动态打赏列表
|
||||
public static final String GET_GIFT_LABEL = "/api/Gift/get_gift_label";//礼物标签
|
||||
public static final String GIFT_LIST = "/api/Gift/get_gift_list";//礼物列表
|
||||
public static final String GET_CUSTOM_GIFT_LIST = "/api/GiftNew/get_custom_gift_list";//自定义礼物列表
|
||||
public static final String GET_NEW_GIFT_LIST = "/api/GiftNew/get_gift_list";//新礼物列表
|
||||
public static final String SET_CUSTOM_GIFT = "/api/GiftNew/set_custom_gift";//自定义礼物设置
|
||||
public static final String TOPIC_LIST = "/api/UserZone/topic_list";//获取话题列表
|
||||
public static final String PUBLISH_ZONE = "/api/UserZone/publish_zone";//发布动态
|
||||
public static final String GET_CATEGORIES = "/api/UserZone/get_zone_topic";//动态引用的四条话题
|
||||
@@ -452,9 +455,9 @@ public class Constants {
|
||||
public static final String POST_DAILY_TASKS_SIGN_STATUS = "/api/Tasks/dailyTasksSignStatus";//每日签到状态
|
||||
|
||||
|
||||
|
||||
// public static final String MODIFY_MOBILE = "/api/UserData/modify_mobile";//手机换绑
|
||||
// public static final String MODIFY_MOBILE = "/api/UserData/modify_mobile";//手机换绑
|
||||
public static final String MODIFY_MOBILE = "/api/UserData/modify_mobiles";//手机换绑
|
||||
public static final String SET_PIT_TIME = "/api/BarRoom/set_pit_time";//房间麦位时长设置
|
||||
public static final String BIND_MOBILE = "/api/UserData/bind_mobile";//手机绑定
|
||||
public static final String GET_FESTIVAL_THEME = "/api/Theme/get_festival_theme";//节日主题接口
|
||||
public static final String GET_PERSONALTY_LIST_BEAN = "/api/Decorate/get_decorate_list";//装饰列表
|
||||
@@ -467,5 +470,4 @@ public class Constants {
|
||||
public static final String POST_SIGN_COIN = "/api/Sign/sign_coin";//签约出价
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
BIN
BaseModule/src/main/res/mipmap-hdpi/icon_bar.png
Normal file
BIN
BaseModule/src/main/res/mipmap-hdpi/icon_bar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
BaseModule/src/main/res/mipmap-xhdpi/icon_bar.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xhdpi/icon_bar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
BIN
BaseModule/src/main/res/mipmap-xxhdpi/icon_bar.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xxhdpi/icon_bar.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
BaseModule/src/main/res/mipmap-xxhdpi/icon_make_friends.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xxhdpi/icon_make_friends.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 269 KiB |
BIN
BaseModule/src/main/res/mipmap-xxhdpi/room_make.png
Normal file
BIN
BaseModule/src/main/res/mipmap-xxhdpi/room_make.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
@@ -95,6 +95,7 @@ import com.xscm.modulemain.dialog.RoomPkDialogFragment
|
||||
import com.xscm.modulemain.dialog.RoomSettingFragment
|
||||
import com.xscm.modulemain.dialog.SoundEffectsDialogFragment
|
||||
import com.xscm.modulemain.dialog.TourClubDialogFragment
|
||||
import com.xscm.modulemain.dialog.barRoom.MakeFriendsDialog
|
||||
import com.xscm.modulemain.manager.RoomManager
|
||||
import com.xscm.modulemain.service.ForegroundService
|
||||
import com.xscm.modulemain.service.RoomPlayService
|
||||
@@ -498,6 +499,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
view
|
||||
)
|
||||
}
|
||||
mBinding!!.roomTop.rl2.setOnClickListener { view: View ->
|
||||
this.onClick(
|
||||
view
|
||||
)
|
||||
}
|
||||
mBinding!!.ivSoundEffects.setOnClickListener { view: View ->
|
||||
this.onClick(
|
||||
view
|
||||
@@ -2603,7 +2609,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
)
|
||||
} else if (id == R.id.rl) {
|
||||
MvpPre!!.clearUserCharm(roomId, "")
|
||||
} else if (id == R.id.ll_input) {
|
||||
}else if (id == R.id.rl2) {
|
||||
MakeFriendsDialog(this, roomId).show()
|
||||
}
|
||||
else if (id == R.id.ll_input) {
|
||||
mBinding?.llInput?.visibility = View.GONE
|
||||
mBinding?.inputMenu1?.dismiss()
|
||||
} else if (id == R.id.iv_emoji) {
|
||||
@@ -4024,6 +4033,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
mBinding!!.roomTop.btnCloseLive.setOnClickListener(null)
|
||||
mBinding!!.roomTop.tvNum.setOnClickListener(null)
|
||||
mBinding!!.roomTop.rl.setOnClickListener(null)
|
||||
mBinding!!.roomTop.rl2.setOnClickListener(null)
|
||||
mBinding!!.ivSoundEffects.setOnClickListener(null)
|
||||
mBinding!!.ivWheatFeeding.setOnClickListener(null)
|
||||
mBinding!!.clFirstCharge.setOnClickListener(null)
|
||||
@@ -4279,6 +4289,16 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
} else {
|
||||
mBinding?.roomTop?.rl?.visibility = View.GONE
|
||||
}
|
||||
userMakeVisibility()
|
||||
}
|
||||
|
||||
// TODO: 判断房间类型是否是酒吧房,只有酒吧房才会有交友小屋,其他房间类型没有
|
||||
private fun userMakeVisibility(){
|
||||
if(mRoomInfoResp?.room_info?.type_id=="11"){
|
||||
mBinding?.roomTop?.rl2?.visibility = View.VISIBLE
|
||||
}else{
|
||||
mBinding?.roomTop?.rl2?.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
|
||||
@@ -93,13 +93,16 @@ public class RoomJukeboxFragment extends BaseMvpFragment<JukeboxPresenter, Fragm
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
if (roomInfoResp == null) {
|
||||
return;
|
||||
}
|
||||
setRoomInfo(roomInfoResp);
|
||||
parentFragment = (RoomFragment) getParentFragment();
|
||||
}
|
||||
|
||||
private void setRoomInfo(RoomInfoResp roomInfoResp) {
|
||||
this.roomInfoResp = roomInfoResp;
|
||||
roomId = roomInfoResp.getRoom_info().getRoom_id();
|
||||
roomId = roomInfoResp == null ? "" : roomInfoResp.getRoom_info().getRoom_id();
|
||||
|
||||
setView();
|
||||
}
|
||||
@@ -404,7 +407,7 @@ public class RoomJukeboxFragment extends BaseMvpFragment<JukeboxPresenter, Fragm
|
||||
Animation rotateAnimation = AnimationUtils.loadAnimation(getContext(), com.xscm.moduleutil.R.anim.image_rotate);
|
||||
LinearInterpolator lin = new LinearInterpolator();
|
||||
rotateAnimation.setInterpolator(lin);
|
||||
mBinding.ciUserAva.setAnimation(rotateAnimation);
|
||||
mBinding.ciUserAva.setAnimation(rotateAnimation);
|
||||
}
|
||||
|
||||
//关闭旋转
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.modulemain.activity.room.fragment
|
||||
|
||||
import android.os.Bundle
|
||||
import com.blankj.utilcode.util.ActivityUtils
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
@@ -7,15 +8,22 @@ import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.room.activity.RoomActivity
|
||||
import com.xscm.modulemain.activity.room.presenter.PubPresenter
|
||||
import com.xscm.modulemain.databinding.FragmentPubRoomBinding
|
||||
import com.xscm.modulemain.dialog.RoomAuctionWebViewDialog
|
||||
import com.xscm.modulemain.dialog.RoomUserInfoFragment
|
||||
import com.xscm.modulemain.dialog.barRoom.FlirtatiousDialog
|
||||
import com.xscm.modulemain.dialog.barRoom.GiftGivingDialog
|
||||
import com.xscm.modulemain.dialog.barRoom.RoomAboutDialog
|
||||
import com.xscm.modulemain.dialog.barRoom.RoomDurationDialog
|
||||
import com.xscm.modulemain.dialog.barRoom.SetupCustomGiftDialog
|
||||
import com.xscm.modulemain.widget.RoomPubWheatView
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment
|
||||
import com.xscm.moduleutil.base.CommonAppContext
|
||||
import com.xscm.moduleutil.bean.RoomMessageEvent
|
||||
import com.xscm.moduleutil.bean.UserInfo
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||
import com.xscm.moduleutil.utils.ClickUtils
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
|
||||
|
||||
class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
@@ -62,7 +70,6 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
viewList.add(mBinding.rpwv5)
|
||||
viewList.add(mBinding.rpwv6)
|
||||
|
||||
|
||||
for ((idx, view) in viewList.withIndex()) {
|
||||
if (mRoomInfoResp?.room_info?.pit_list!!.size > indexList[idx].toInt() - 1) {
|
||||
view.setRoomWheatNumber(indexList[idx])
|
||||
@@ -71,14 +78,21 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
|
||||
view.iv_custom_gift?.setOnClickListener {
|
||||
ToastUtils.showShort("礼物")
|
||||
GiftGivingDialog(ActivityUtils.getTopActivity(), mRoomId,view.pitBean.user_id,view.pitBean.nickname,view.pitBean.avatar).show()
|
||||
}
|
||||
|
||||
view.ivYueT?.setOnClickListener {
|
||||
ToastUtils.showShort("约她")
|
||||
RoomAboutDialog(ActivityUtils.getTopActivity(),mRoomId,view.pitBean.user_id,view.pitBean.nickname,view.pitBean.avatar).show()
|
||||
}
|
||||
|
||||
view.ivLiaoT?.setOnClickListener {
|
||||
ToastUtils.showShort("撩她")
|
||||
if (!SpUtil.getBooleanValue("pub", false)) {
|
||||
FlirtatiousDialog(ActivityUtils.getTopActivity()).show()
|
||||
}else{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
view.setOnClickListener { v ->
|
||||
@@ -132,6 +146,21 @@ class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
mBinding.ivSetTime.setOnClickListener {
|
||||
RoomDurationDialog(ActivityUtils.getTopActivity(),mRoomId).show()
|
||||
}
|
||||
mBinding.ivCustomGift.setOnClickListener {
|
||||
SetupCustomGiftDialog(ActivityUtils.getTopActivity(), mRoomId).show()
|
||||
}
|
||||
|
||||
mBinding.ivPubHeart.setOnClickListener {
|
||||
//酒吧房规则
|
||||
val bundle = Bundle()
|
||||
bundle.putString(
|
||||
"url",
|
||||
CommonAppContext.getInstance()
|
||||
.getCurrentEnvironment().serverUrl + "api/Page/page_show?id=36"
|
||||
)
|
||||
val dialog = RoomAuctionWebViewDialog(ActivityUtils.getTopActivity(), bundle)
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
|
||||
fun roomInfoUpdate(roomInfoResp: RoomInfoResp) {
|
||||
|
||||
@@ -86,6 +86,7 @@ public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, A
|
||||
MvpPre.getAlbumDetail(albumId, pwd, page + "", "10");
|
||||
}
|
||||
});
|
||||
mBinding.tvBj.setVisibility(userId.equals(SpUtil.getUserId() + "") ? VISIBLE : View.GONE);
|
||||
mBinding.imCrAlbum.setOnClickListener(this::onClick);
|
||||
mBinding.tvBj.setOnClickListener(this::onClick);
|
||||
mBinding.zan.setOnClickListener(this::onClick);
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.xscm.modulemain.R
|
||||
|
||||
/**
|
||||
* 固定项目适配器
|
||||
* 所有项目使用相同的布局和图片,只需要传入数量
|
||||
*/
|
||||
class FixedItemAdapter(
|
||||
private val itemCount: Int
|
||||
|
||||
) : RecyclerView.Adapter<FixedItemAdapter.ViewHolder>() {
|
||||
|
||||
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
// 在这里定义你的视图组件,例如:
|
||||
// val imageView: ImageView = itemView.findViewById(R.id.imageView)
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
// 使用你的实际布局资源替换 R.layout.item_fixed
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_make_friends, parent, false)
|
||||
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
// 设置点击监听器
|
||||
// holder.itemView.setOnClickListener {
|
||||
// itemClickListener?.invoke(position)
|
||||
// }
|
||||
|
||||
// 如果所有图片都一样,可以在这里设置相同的图片资源
|
||||
// holder.imageView.setImageResource(R.drawable.your_image)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return itemCount
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新项目数量
|
||||
*/
|
||||
fun updateCount(newCount: Int) {
|
||||
// 如果使用DiffUtil,可以实现更高效的更新
|
||||
notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,8 @@ public class HorizontalListAdapter extends RecyclerView.Adapter<HorizontalListAd
|
||||
return com.xscm.moduleutil.R.mipmap.icon_liang;
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT:
|
||||
return com.xscm.moduleutil.R.mipmap.icon_sign_contract;
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM:
|
||||
return com.xscm.moduleutil.R.mipmap.icon_bar;
|
||||
// 常用工具
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomSubsidy:
|
||||
return com.xscm.moduleutil.R.mipmap.ic_subsidy;
|
||||
|
||||
@@ -58,6 +58,7 @@ class RoomGiftGivingAdapter(private val dataList: List<RoonGiftModel>,
|
||||
53
|
||||
)
|
||||
tv_wheat_qd.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
tv_gift_desc.text = item.new_gift_name
|
||||
|
||||
tv_wheat_qd.setOnClickListener {
|
||||
// 回调选中的值和位置
|
||||
|
||||
@@ -111,7 +111,7 @@ public class RoomSettingAdapter extends BaseQuickAdapter<RoomSettingBean, BaseVi
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomTypeSIGNCONTRACT:
|
||||
return com.xscm.moduleutil.R.mipmap.icon_sign_contract;
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomTypePUBROOM:
|
||||
return com.xscm.moduleutil.R.mipmap.icon_liang;
|
||||
return com.xscm.moduleutil.R.mipmap.icon_bar;
|
||||
// 常用工具
|
||||
case RoomSettingBean.QXRoomSettingTypeRoomSubsidy:
|
||||
return com.xscm.moduleutil.R.mipmap.ic_subsidy;
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.xscm.modulemain.R
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2025/11/28 10:39
|
||||
* 用途:房间人才列表适配器,支持单选功能
|
||||
* 用途:房间人才列表适配器,支持单选功能 和 酒吧房设置时长公用同一个适配器
|
||||
*/
|
||||
class RoomTalentAdapter(
|
||||
private val dataList: List<String>,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
@@ -47,6 +48,13 @@ class SetupCustomGiftAdapter(private val dataList: List<RoonGiftModel>,
|
||||
fun bind(item: RoonGiftModel, position: Int) {
|
||||
tv_gift_name.text = item.gift_name
|
||||
tv_gift_price.text = item.gift_price
|
||||
if (item.new_gift_name.isNotEmpty()) {
|
||||
tv_gift_desc.text = item.new_gift_name
|
||||
tv_gift_desc.setTextColor(Color.parseColor("#F5F24F")) // 金色
|
||||
} else {
|
||||
tv_gift_desc.text = "待设置"
|
||||
tv_gift_desc.setTextColor(Color.parseColor("#999999")) // 灰色
|
||||
}
|
||||
|
||||
//加载礼物图片
|
||||
ImageUtils.loadImageView(item.getBase_image(), iv_gift_pic)
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ActivityUtils.startActivity
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.activity.RechargeActivity
|
||||
import com.xscm.modulemain.databinding.DialogAboutRoomBinding
|
||||
import com.xscm.modulemain.databinding.DialogFlirtatiousBinding
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
@@ -56,7 +55,15 @@ class FlirtatiousDialog(context: Context) :
|
||||
onConfirmCallback?.invoke("")
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvCancel.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
mBinding.vCheckbox.setOnClickListener {
|
||||
it.isSelected = !it.isSelected
|
||||
if (it.isSelected) {
|
||||
SpUtil.setBooleanValue("pub", true)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
@@ -12,6 +13,7 @@ import com.xscm.modulemain.databinding.DialogGiftGivingBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
@@ -20,9 +22,21 @@ import io.reactivex.disposables.Disposable
|
||||
* 时间:2026/1/5 10:41
|
||||
* 用途:酒吧房赠送自定义礼物
|
||||
*/
|
||||
class GiftGivingDialog (context: Context, val roomId: String) :
|
||||
class GiftGivingDialog(
|
||||
context: Context,
|
||||
roomId: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
avatar: String
|
||||
) :
|
||||
BaseDialog<DialogGiftGivingBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
// 将参数存储为私有变量,避免在基类构造函数调用时被访问
|
||||
private var mRoomId: String = roomId
|
||||
private var mUserId: String = userId
|
||||
private var mUsername: String = username
|
||||
private var mAvatar: String = avatar
|
||||
|
||||
var adapter: RoomGiftGivingAdapter? = null
|
||||
var time: MutableList<String> = mutableListOf()
|
||||
|
||||
@@ -33,42 +47,62 @@ class GiftGivingDialog (context: Context, val roomId: String) :
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
|
||||
val layoutManager = GridLayoutManager(context, 4)
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
// TODO: 这里调用的事设置插队礼物接口
|
||||
RetrofitClient.getInstance().getGiftList(1,roomId,object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
// 不在这里初始化数据,改为在 show() 方法中初始化
|
||||
}
|
||||
|
||||
override fun onNext(t: MutableList<RoonGiftModel>) {
|
||||
if (t.isNotEmpty()) {
|
||||
adapter = RoomGiftGivingAdapter(t) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
// 重写 show() 方法,在显示 Dialog 之前初始化数据
|
||||
override fun show() {
|
||||
// 确保参数不为空
|
||||
if (!TextUtils.isEmpty(mUsername)) {
|
||||
mBinding.tvName.text = mUsername
|
||||
}
|
||||
if (!TextUtils.isEmpty(mAvatar)) {
|
||||
ImageUtils.loadHead(mAvatar, mBinding.ivAvatar)
|
||||
}
|
||||
|
||||
// 设置GridLayoutManager,每行显示4个item
|
||||
val layoutManager =
|
||||
GridLayoutManager(context, 4)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
// 调用父类的 show() 方法
|
||||
super.show()
|
||||
|
||||
// TODO: 调用赠送自定义礼物。点击麦位上左边的最小图标
|
||||
RetrofitClient.getInstance()
|
||||
.getCustomGiftList(object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
override fun onNext(t: MutableList<RoonGiftModel>) {
|
||||
if (t.isNotEmpty()) {
|
||||
adapter = RoomGiftGivingAdapter(t) { selectedValue, position ->
|
||||
// 处理选中事件,使用roomId和userId
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position, roomId: $mRoomId, userId: $mUserId")
|
||||
}
|
||||
|
||||
// 设置GridLayoutManager,每行显示4个item
|
||||
val layoutManager =
|
||||
GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
window.setGravity(Gravity.CENTER)
|
||||
window.setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(ScreenUtils.getAppScreenHeight() * 348f / 812).toInt()
|
||||
(ScreenUtils.getAppScreenWidth() * 287f / 375).toInt(),
|
||||
(ScreenUtils.getAppScreenHeight() * 290f / 812).toInt()
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.FixedItemAdapter
|
||||
import com.xscm.modulemain.adapter.RoomGiftGivingAdapter
|
||||
import com.xscm.modulemain.databinding.DialogGiftGivingBinding
|
||||
import com.xscm.modulemain.databinding.DialogMakeFriendsBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/5 19:27
|
||||
* 用途:交友小屋弹窗
|
||||
*/
|
||||
class MakeFriendsDialog(context: Context, val roomId: String?) :
|
||||
BaseDialog<DialogMakeFriendsBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
var adapter: FixedItemAdapter? = null
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_make_friends
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
setupWindow()
|
||||
|
||||
val layoutManager = GridLayoutManager(context, 2)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
// TODO: 这里调用的事设置插队礼物接口
|
||||
// RetrofitClient.getInstance().getGiftList(1,roomId,object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
// override fun onSubscribe(d: Disposable) {
|
||||
// }
|
||||
//
|
||||
// override fun onNext(t: MutableList<RoonGiftModel>) {
|
||||
// if (t.isNotEmpty()) {
|
||||
// adapter = RoomGiftGivingAdapter(t) { selectedValue, position ->
|
||||
// // 处理选中事件
|
||||
// LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
// }
|
||||
//
|
||||
// // 设置GridLayoutManager,每行显示4个item
|
||||
// val layoutManager =
|
||||
// GridLayoutManager(context, 4)
|
||||
// mBinding.recycleView.layoutManager = layoutManager
|
||||
// mBinding.recycleView.adapter = adapter
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
val layoutManager =
|
||||
GridLayoutManager(context, 2)
|
||||
adapter= FixedItemAdapter(15)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
val window = window ?: return
|
||||
window.setGravity(Gravity.BOTTOM)
|
||||
window.setLayout(
|
||||
ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
(ScreenUtils.getAppScreenHeight() * 400f / 812).toInt()
|
||||
)
|
||||
window.setBackgroundDrawableResource(android.R.color.transparent)
|
||||
|
||||
val params = window.attributes
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.DialogPerformInputBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
@@ -18,15 +19,18 @@ import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
class PerformInputDialog(context: Context) :
|
||||
BaseDialog<DialogPerformInputBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
private var giftModel: RoonGiftModel? = null
|
||||
|
||||
// 定义回调接口
|
||||
private var onConfirmCallback: ((String) -> Unit)? = null
|
||||
|
||||
// 设置回调接口的方法
|
||||
fun setOnConfirmListener(callback: (String) -> Unit): PerformInputDialog {
|
||||
onConfirmCallback = callback
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_perform_input
|
||||
}
|
||||
@@ -51,12 +55,16 @@ class PerformInputDialog(context: Context) :
|
||||
mBinding.tvConfirm.setOnClickListener {
|
||||
val inputText = mBinding.etInput.text.toString().trim()
|
||||
onConfirmCallback?.invoke(inputText)
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
// 初始化数据,如果需要的话
|
||||
giftModel?.let { model ->
|
||||
if (model.new_gift_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.new_gift_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
@@ -72,4 +80,24 @@ class PerformInputDialog(context: Context) :
|
||||
params.windowAnimations = com.xscm.moduleutil.R.style.BaseDialogStyleH
|
||||
window.attributes = params
|
||||
}
|
||||
|
||||
fun show(item: RoonGiftModel?) {
|
||||
giftModel = item
|
||||
super.show()
|
||||
// 确保在显示后立即刷新数据
|
||||
refreshData()
|
||||
}
|
||||
|
||||
private fun refreshData() {
|
||||
giftModel?.let { model ->
|
||||
if (model.new_gift_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.new_gift_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun dismiss() {
|
||||
super.dismiss()
|
||||
mBinding.etInput.text?.clear()
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,24 @@ package com.xscm.modulemain.dialog.barRoom
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.text.TextUtils
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.ActivityUtils.startActivity
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.user.activity.RechargeActivity
|
||||
import com.xscm.modulemain.adapter.RoomGiftGivingAdapter
|
||||
import com.xscm.modulemain.databinding.DialogAboutRoomBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.bean.WalletBean
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.utils.ImageUtils
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
@@ -22,9 +28,18 @@ import io.reactivex.disposables.Disposable
|
||||
* 时间:2026/1/5 14:18
|
||||
* 用途:酒吧房约她弹框
|
||||
*/
|
||||
class RoomAboutDialog (context: Context) :
|
||||
class RoomAboutDialog(
|
||||
context: Context,
|
||||
roomId: String,
|
||||
userId: String,
|
||||
username: String,
|
||||
avatar: String
|
||||
) :
|
||||
BaseDialog<DialogAboutRoomBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
private var mRoomId: String = roomId
|
||||
private var mUserId: String = userId
|
||||
private var mUsername: String = username
|
||||
private var mAvatar: String = avatar
|
||||
// 定义回调接口
|
||||
private var onConfirmCallback: ((String) -> Unit)? = null
|
||||
|
||||
@@ -65,7 +80,7 @@ class RoomAboutDialog (context: Context) :
|
||||
|
||||
override fun initData() {
|
||||
// 初始化数据,如果需要的话
|
||||
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean>(){
|
||||
RetrofitClient.getInstance().wallet(object : BaseObserver<WalletBean>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
@@ -73,6 +88,23 @@ class RoomAboutDialog (context: Context) :
|
||||
mBinding.tvBalance.text = t.coin ?: "0"
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun show() {
|
||||
// 确保参数不为空
|
||||
if (!TextUtils.isEmpty(mUsername)) {
|
||||
mBinding.tvName.text = mUsername
|
||||
}
|
||||
if (!TextUtils.isEmpty(mAvatar)) {
|
||||
ImageUtils.loadHead(mAvatar, mBinding.ivAvatar)
|
||||
}
|
||||
|
||||
// 调用父类的 show() 方法
|
||||
super.show()
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
|
||||
@@ -4,13 +4,19 @@ import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.ActivityUtils
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.hjq.toast.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.RoomTalentAdapter
|
||||
import com.xscm.modulemain.databinding.DialogRoomDurationBinding
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import com.xscm.moduleutil.utils.ColorManager
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
import io.reactivex.disposables.Disposable
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
@@ -36,23 +42,30 @@ class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
if (adapter?.getSelectedValue()?.isEmpty() == true || adapter?.getSelectedValue()==null) {
|
||||
ToastUtils.show("请选择时间")
|
||||
} else {//确定
|
||||
// var messageEvent =
|
||||
// RoomInputEvent(SpUtil.getUserInfo().nickname + "选择了" + adapter?.getSelectedValue() + "时间")
|
||||
// (ActivityUtils.getTopActivity() as? RoomActivity)?.let { roomActivity ->
|
||||
// roomActivity.dialogMessage(messageEvent)
|
||||
// }
|
||||
dismiss()
|
||||
RetrofitClient.getInstance().setPitTime(roomId, adapter?.getSelectedValue()!!.replace("分钟", ""),object :
|
||||
BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(
|
||||
mBinding.tvQd,
|
||||
ColorManager.getInstance().primaryColorInt,
|
||||
53
|
||||
)
|
||||
mBinding.tvQd.setTextColor(ColorManager.getInstance().buttonColorInt)
|
||||
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
|
||||
override fun initData() {
|
||||
|
||||
time= mutableListOf()
|
||||
time.clear()
|
||||
time.add("5分钟")
|
||||
@@ -65,6 +78,9 @@ class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
|
||||
@@ -6,12 +6,9 @@ import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.hjq.toast.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.adapter.RoomWishGiftAdapter
|
||||
import com.xscm.modulemain.adapter.SetupCustomGiftAdapter
|
||||
import com.xscm.modulemain.databinding.DialogSetupCustomGiftBinding
|
||||
import com.xscm.modulemain.databinding.DialogWishGiftBinding
|
||||
import com.xscm.moduleutil.bean.RoonGiftModel
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
@@ -48,9 +45,9 @@ class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
||||
|
||||
|
||||
override fun initData() {
|
||||
// TODO: 这里调用的事设置插队礼物接口
|
||||
// TODO: 获取自定义礼物
|
||||
RetrofitClient.getInstance()
|
||||
.getGiftList(1, roomId, object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
.getNewGiftList(14, "6", object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
@@ -58,14 +55,21 @@ class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
||||
if (t.isNotEmpty()) {
|
||||
adapter = SetupCustomGiftAdapter(t) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
if (performInputDialog == null) {
|
||||
performInputDialog = PerformInputDialog(context)
|
||||
}
|
||||
performInputDialog?.show()
|
||||
LogUtils.e("选中了: $selectedValue, 位置: ${t[position]}")
|
||||
performInputDialog = PerformInputDialog(context)
|
||||
performInputDialog?.show(t[position])
|
||||
performInputDialog?.setOnConfirmListener { content ->
|
||||
// TODO: 这里表演内容的回调
|
||||
ToastUtils.show(content)
|
||||
t[position].new_gift_name=content
|
||||
RetrofitClient.getInstance().setCustomGift(t[position].gift_id,content,object : BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
performInputDialog?.dismiss()
|
||||
adapter?.notifyItemChanged(position)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -79,6 +83,7 @@ class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
|
||||
@@ -38,7 +38,7 @@ class WishGiftDialog(context: Context, val roomId: String) :
|
||||
}
|
||||
mBinding.tvQd.setOnClickListener {
|
||||
if ( adapter?.getSelectedValue()==null) {
|
||||
ToastUtils.show("请心愿礼物")
|
||||
ToastUtils.show("请选择心愿礼物")
|
||||
} else {//确定
|
||||
// var messageEvent =
|
||||
// RoomInputEvent(SpUtil.getUserInfo().nickname + "选择了" + adapter?.getSelectedValue() + "时间")
|
||||
@@ -57,8 +57,8 @@ class WishGiftDialog(context: Context, val roomId: String) :
|
||||
|
||||
|
||||
override fun initData() {
|
||||
// TODO: 这里调用的事设置插队礼物接口
|
||||
RetrofitClient.getInstance().getGiftList(1,roomId,object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
// TODO: label 15:酒吧房普通礼物 14:自定义礼物
|
||||
RetrofitClient.getInstance().getNewGiftList(15,"6",object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:singleLine="true"
|
||||
android:text="甜蜜奶酪"
|
||||
tools:text="甜蜜奶酪"
|
||||
android:textColor="@color/colorWhite85"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
android:layout_gravity="center"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:drawablePadding="@dimen/dp_3"
|
||||
android:text="1"
|
||||
tools:text="1"
|
||||
android:textColor="@color/colorWhite85"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -4,23 +4,60 @@
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_r14_1e4853_093a1f"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:paddingHorizontal="@dimen/dp_16">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:paddingVertical="@dimen/dp_5"
|
||||
tools:text="送用户名称送礼"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_title"
|
||||
android:layout_width="match_parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:layout_height="@dimen/dp_50">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:text="送给"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<com.xscm.moduleutil.widget.CircularImage
|
||||
android:id="@+id/iv_avatar"
|
||||
android:layout_width="@dimen/dp_32"
|
||||
android:layout_height="@dimen/dp_32"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_toRightOf="@+id/tv_title"
|
||||
tools:src="@mipmap/ic_launcher" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_toRightOf="@+id/iv_avatar"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textStyle="bold"
|
||||
tools:text="送给用户昵称" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="@dimen/dp_15"
|
||||
android:src="@mipmap/gb"
|
||||
android:tint="@color/color_FFFFFF99" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
@@ -28,13 +65,12 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingBottom="60dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="4"
|
||||
app:layout_constraintBottom_toTopOf="@+id/ll_but"
|
||||
app:spanCount="3"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
app:layout_constraintTop_toBottomOf="@+id/rl_title"
|
||||
tools:itemCount="8"
|
||||
tools:listitem="@layout/item_gift_giving"
|
||||
/>
|
||||
|
||||
46
MainModule/src/main/res/layout/dialog_make_friends.xml
Normal file
46
MainModule/src/main/res/layout/dialog_make_friends.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_r14_1e4853_093a1f"
|
||||
android:paddingHorizontal="@dimen/dp_16">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_13"
|
||||
android:paddingVertical="@dimen/dp_5"
|
||||
android:text="交友小屋"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_16"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="70dp"
|
||||
android:layout_marginHorizontal="@dimen/dp_20"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_title"
|
||||
tools:itemCount="8"
|
||||
tools:listitem="@layout/item_make_friends"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -52,7 +52,10 @@
|
||||
android:paddingEnd="@dimen/dp_12"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textColorHint="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:maxLength="4"
|
||||
android:inputType="text"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_clickable"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:clipToPadding="false"
|
||||
android:paddingBottom="8dp"
|
||||
android:paddingBottom="100dp"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="4"
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_pub_heart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_119"
|
||||
tools:ignore="MissingConstraints"
|
||||
android:background="@mipmap/gift_bj">
|
||||
android:background="@drawable/bg_r5_e9e9"
|
||||
>
|
||||
|
||||
|
||||
<ImageView
|
||||
@@ -93,7 +94,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="唱歌"
|
||||
android:textColor="#F5F24F"
|
||||
android:textColor="#D0C60E"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="marquee"
|
||||
@@ -114,7 +115,7 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@drawable/bg_r53_0dffb9"
|
||||
android:layout_marginTop="@dimen/dp_4"
|
||||
android:text="确定"
|
||||
android:text="赠送"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/color_FF333333"
|
||||
|
||||
19
MainModule/src/main/res/layout/item_make_friends.xml
Normal file
19
MainModule/src/main/res/layout/item_make_friends.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginVertical="@dimen/dp_10">
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
android:layout_width="@dimen/dp_128"
|
||||
android:layout_height="@dimen/dp_128"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/icon_make_friends"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -92,7 +92,7 @@
|
||||
android:id="@+id/tv_gift_desc"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="待设置"
|
||||
android:text="待设置"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:maxLines="1"
|
||||
|
||||
@@ -223,6 +223,40 @@
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl2"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_22"
|
||||
android:layout_alignTop="@id/rl"
|
||||
android:layout_marginStart="@dimen/dp_8"
|
||||
android:background="@drawable/bg_r73_33fffff"
|
||||
android:layout_toEndOf="@id/rl"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_make"
|
||||
android:layout_width="@dimen/dp_12"
|
||||
android:layout_height="@dimen/dp_12"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginStart="@dimen/dp_7"
|
||||
android:src="@mipmap/room_make" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:layout_marginEnd="@dimen/dp_7"
|
||||
android:layout_toEndOf="@+id/im_qc"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:text="交友小屋" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/stub_buttons2"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user