1:修改酒吧房弹框接口调用
This commit is contained in:
@@ -137,7 +137,7 @@ public class CommonAppContext extends MultiDexApplication implements Application
|
||||
@Getter
|
||||
public UnreadCountEvent unreadCountEvent;
|
||||
|
||||
public static int selectRelease = 1;
|
||||
public static int selectRelease = -1;
|
||||
|
||||
public int is_open = 0;//主题的开关
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.xscm.moduleutil.bean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/6 14:25
|
||||
* 用途:
|
||||
*/
|
||||
class PitTimeRespBean {
|
||||
var time: Int = 0
|
||||
var time_str: String = ""
|
||||
/* "time": 5,
|
||||
"time_str": "5分钟"*/
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class RoonGiftModel {
|
||||
|
||||
//下面是在酒吧房使用的参数
|
||||
private int id;
|
||||
private String new_gift_name="";//用户设置的礼物内容
|
||||
private String gift_remark_name="";//用户设置的礼物内容
|
||||
|
||||
public boolean isCan_send_self() {
|
||||
if ( isManghe()) {
|
||||
|
||||
@@ -31,7 +31,7 @@ public enum QXRoomSeatViewType {
|
||||
/**
|
||||
* 酒吧
|
||||
*/
|
||||
PUB(11,"酒吧"),
|
||||
PUB(7,"酒吧"),
|
||||
/**
|
||||
* 酒吧
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@ enum class RoomType(
|
||||
DATING("交友", 1,3, 4, 8), // 1、3、4、8 均对应交友
|
||||
BLACK_ROOM("小黑屋", 6),
|
||||
JUKEBOX("点唱", 9),
|
||||
PUB_ROOM("酒吧", 11),
|
||||
PUB_ROOM("酒吧", 7),
|
||||
PRIVATE_ROOM("酒吧交友小屋", 12),
|
||||
MUTUAL_ENTERTAINMENT("互娱", 7),
|
||||
SIGN_CONTRACT("签约", 10);
|
||||
|
||||
@@ -358,13 +358,13 @@ public interface ApiServer {
|
||||
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();
|
||||
Call<BaseModel<List<RoonGiftModel>>> getCustomGiftList(@Query("user_id") String user_id);
|
||||
|
||||
@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 );
|
||||
Call<BaseModel<String>> setCustomGift(@Query("gift_id") String gift_id, @Query("gift_remark_name") String new_gift_name );
|
||||
|
||||
@GET(Constants.TOPIC_LIST)
|
||||
//获取话题
|
||||
@@ -545,6 +545,9 @@ public interface ApiServer {
|
||||
@POST(Constants.TASK_JUMP_ROOM)
|
||||
Call<BaseModel<String>> taskJumpRoomId(@Field("task_id") String taskId);
|
||||
|
||||
@GET(Constants.GET_PIT_TIME)
|
||||
Call<BaseModel<List<PitTimeRespBean>>> getPitTimeList();
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.DELETE_ALBUM_IMAGE)
|
||||
Call<BaseModel<String>> deleteAlbumImage(@Field("id") String id);
|
||||
|
||||
@@ -306,14 +306,14 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void setPitTime(String room_id,String time,BaseObserver<String> observer) {
|
||||
sApiServer.setPitTime(room_id,time).enqueue(new Callback<BaseModel<String>>() {
|
||||
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 {
|
||||
} else {
|
||||
ToastUtils.showLong("麦位时长设置错误", response.code());
|
||||
LogUtils.e("setPitTime", response.message());
|
||||
}
|
||||
@@ -2266,21 +2266,21 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getCustomGiftList(BaseObserver<List<RoonGiftModel>> observer) {
|
||||
sApiServer.getCustomGiftList().enqueue(new Callback<BaseModel<List<RoonGiftModel>>>() {
|
||||
public void getCustomGiftList(String user_id, BaseObserver<List<RoonGiftModel>> observer) {
|
||||
sApiServer.getCustomGiftList(user_id).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());
|
||||
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());
|
||||
ToastUtils.showLong("自定义礼物数据错误", response.code());
|
||||
LogUtils.e("getGiftList", response.message());
|
||||
}
|
||||
}
|
||||
@@ -2291,21 +2291,22 @@ public class RetrofitClient {
|
||||
}
|
||||
});
|
||||
}
|
||||
public void getNewGiftList(int label,String type,BaseObserver<List<RoonGiftModel>> observer) {
|
||||
sApiServer.getNewGiftList(label,type).enqueue(new Callback<BaseModel<List<RoonGiftModel>>>() {
|
||||
|
||||
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());
|
||||
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());
|
||||
ToastUtils.showLong("酒吧房礼物数据错误", response.code());
|
||||
LogUtils.e("getGiftList", response.message());
|
||||
}
|
||||
}
|
||||
@@ -2323,9 +2324,9 @@ public class RetrofitClient {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
if (response.code() == 200) {
|
||||
onNextRetu(response,observer);
|
||||
}else {
|
||||
ToastUtils.showLong("自定义礼物设置错误",response.code());
|
||||
onNextRetu(response, observer);
|
||||
} else {
|
||||
ToastUtils.showLong("自定义礼物设置错误", response.code());
|
||||
LogUtils.e("setCustomGift", response.message());
|
||||
}
|
||||
}
|
||||
@@ -2998,6 +2999,34 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getPitTimeList(BaseObserver<List<PitTimeRespBean>> observer) {
|
||||
sApiServer.getPitTimeList().enqueue(new Callback<BaseModel<List<PitTimeRespBean>>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<PitTimeRespBean>>> call, Response<BaseModel<List<PitTimeRespBean>>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<PitTimeRespBean>> listBaseModel = response.body();
|
||||
if (listBaseModel.getCode() == 1)
|
||||
observer.onNext(listBaseModel.getData());
|
||||
else if (listBaseModel.getCode() == 301) {
|
||||
setCode301(listBaseModel.getMsg());
|
||||
} else if (listBaseModel.getCode() == 0) {
|
||||
ToastUtils.showLong(listBaseModel.getMsg());
|
||||
}
|
||||
}else {
|
||||
ToastUtils.showLong("麦位时长数据错误",response.code());
|
||||
LogUtils.e("getPitTimeList", response.message());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<List<PitTimeRespBean>>> call, Throwable t) {
|
||||
LogUtils.e("getPitTimeList", t.toString());
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void updatePassword(String roomId, String password, BaseObserver<String> observer) {
|
||||
sApiServer.updatePassword(roomId, password).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
|
||||
@@ -37,21 +37,21 @@ public class ImageLoader {
|
||||
|
||||
public static void loadHead(Context context, ImageView view, String url) {
|
||||
RequestOptions options = RequestOptions.circleCropTransform();
|
||||
Glide.with(context).load(url).apply(options).error(com.xscm.moduleutil.R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.ALL).into(view);
|
||||
Glide.with(context).load(url).apply(options).error(com.xscm.moduleutil.R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
}
|
||||
|
||||
public static void loadHead(ImageView view, String url) {
|
||||
RequestOptions options = RequestOptions.circleCropTransform();
|
||||
Glide.with(view).load(url).apply(options).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.ALL).into(view);
|
||||
Glide.with(view).load(url).apply(options).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
}
|
||||
|
||||
public static void loadImage(ImageView view, String url) {
|
||||
Glide.with(view).load(url).error(R.mipmap.default_image).placeholder(R.mipmap.default_image).diskCacheStrategy(DiskCacheStrategy.ALL).into(view);
|
||||
Glide.with(view).load(url).error(R.mipmap.default_image).placeholder(R.mipmap.default_image).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
}
|
||||
|
||||
public static void loadImage(Context context, ImageView view, String url) {
|
||||
Glide.with(context).load(url).error(R.mipmap.default_image).placeholder(R.mipmap.default_image)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL).into(view);
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
}
|
||||
/**
|
||||
* 加载图片并灰度
|
||||
@@ -62,7 +62,7 @@ public class ImageLoader {
|
||||
*/
|
||||
public static void loadImage(Context context,ImageView view, String url, Float placeholder) {
|
||||
Glide.with(context).load(url).apply(RequestOptions.bitmapTransform(new GrayscaleTransformation(placeholder)))
|
||||
.error(R.mipmap.default_image).placeholder(R.mipmap.default_image).diskCacheStrategy(DiskCacheStrategy.ALL).into(view);
|
||||
.error(R.mipmap.default_image).placeholder(R.mipmap.default_image).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(view);
|
||||
}
|
||||
// 可调节灰度程度的方法
|
||||
public static void loadGrayscaleImage(Context context, String url, ImageView imageView, float saturation) {
|
||||
@@ -78,7 +78,7 @@ public class ImageLoader {
|
||||
} else {
|
||||
view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
Glide.with(context).load(url).diskCacheStrategy(DiskCacheStrategy.ALL).into(view);
|
||||
Glide.with(context).load(url).diskCacheStrategy(DiskCacheStrategy.RESOURCE).into(view);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public class ImageUtils {
|
||||
* 默认加载
|
||||
*/
|
||||
public static void loadImageView(String path, ImageView mImageView) {
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +87,7 @@ public class ImageUtils {
|
||||
*/
|
||||
public static void loadIcon(String path, ImageView mImageView) {
|
||||
mImageView.setVisibility(TextUtils.isEmpty(path) ? GONE : View.VISIBLE);
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -106,8 +106,8 @@ public class ImageUtils {
|
||||
* @param height
|
||||
*/
|
||||
public static void loadSample(String path, ImageView mImageView, int width, int height) {
|
||||
RequestOptions options = new RequestOptions().override(width, height).diskCacheStrategy(DiskCacheStrategy.ALL);
|
||||
Glide.with(mImageView).load(path).apply(options).into(mImageView);
|
||||
RequestOptions options = new RequestOptions().override(width, height).diskCacheStrategy(DiskCacheStrategy.RESOURCE);
|
||||
Glide.with(mImageView).load(path).apply(options).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,7 +196,7 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).error(errorRes).placeholder(errorRes).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).error(errorRes).placeholder(errorRes).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).thumbnail(0.1f).into(mImageView);
|
||||
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).placeholder(R.mipmap.default_avatar).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHeadCC(String path, ImageView mImageView) {
|
||||
@@ -226,7 +226,7 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).asBitmap().load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).asBitmap().load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHead(String path, ImageView mImageView) {
|
||||
@@ -240,7 +240,7 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).thumbnail(0.1f).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadHeadCC(String path, ImageView mImageView, LinearLayout.LayoutParams params) {
|
||||
@@ -255,7 +255,7 @@ public class ImageUtils {
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).asBitmap().load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL)
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
|
||||
// 添加加载监听
|
||||
.listener(new RequestListener<Bitmap>() {
|
||||
@Override
|
||||
@@ -288,11 +288,11 @@ public class ImageUtils {
|
||||
}
|
||||
|
||||
public static void loadCenterCrop(String path, ImageView mImageView) {
|
||||
Glide.with(mImageView).load(path).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).centerCrop().diskCacheStrategy(DiskCacheStrategy.RESOURCE).into(mImageView);
|
||||
}
|
||||
|
||||
public static void loadRes(int path, ImageView mImageView) {
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.RESOURCE).into(mImageView);
|
||||
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ public class ImageUtils {
|
||||
// Glide 加载配置
|
||||
Glide.with(context)
|
||||
.load(stableUrl)
|
||||
.diskCacheStrategy(DiskCacheStrategy.ALL) // 缓存所有版本
|
||||
.diskCacheStrategy(DiskCacheStrategy.RESOURCE) // 缓存所有版本
|
||||
.signature(new ObjectKey(signature)) // 使用签名确保缓存一致
|
||||
.placeholder(R.mipmap.room_bj) // 加载中占位图
|
||||
.error(R.mipmap.room_bj) // 加载失败占位图
|
||||
|
||||
@@ -268,6 +268,7 @@ public class Constants {
|
||||
public static final String JOIN_ROOM = "/api/Room/join_room";//加入房间
|
||||
public static final String BEFORE_JOIN_ROOM_CHECK = "/api/Room/before_join_room_check";//加入房间前检查
|
||||
public static final String TASK_JUMP_ROOM = "/api/Room/task_jump_room";//师徒任务 加入房间
|
||||
public static final String GET_PIT_TIME = "/api/BarRoom/get_pit_time_list";//酒吧房麦位时长列表
|
||||
|
||||
public static final String UPDATEPASSWORD = "/api/room/setRoomPassword";//更新房间秘密啊
|
||||
public static final String GET_ROOM_ONLINE = "/api/Room/room_online_list";//房间在线列表
|
||||
|
||||
@@ -9,7 +9,6 @@ class PubContacts {
|
||||
|
||||
interface View : IView<Activity>{
|
||||
|
||||
fun signCoinList(list:List<String>)
|
||||
|
||||
fun wallet(list:List<String>,walletBean: WalletBean?)
|
||||
}
|
||||
@@ -17,21 +16,7 @@ class PubContacts {
|
||||
interface Ipre : IPresenter{
|
||||
fun applyPit(roomId:String,pitNumber:String)
|
||||
|
||||
fun signStart(roomId:String,userId:String)
|
||||
|
||||
fun signEnd(signId:String)
|
||||
|
||||
fun signDelay(signId:String,roomId:String)
|
||||
|
||||
fun signRefuse(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>)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,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
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.activity.room.activity.RoomActivity
|
||||
import com.xscm.modulemain.activity.room.presenter.PubPresenter
|
||||
@@ -25,7 +24,11 @@ import com.xscm.moduleutil.bean.room.RoomUserBean
|
||||
import com.xscm.moduleutil.utils.ClickUtils
|
||||
import com.xscm.moduleutil.utils.SpUtil
|
||||
|
||||
|
||||
/**
|
||||
* @Author
|
||||
* @Time 2026/1/6 14:47
|
||||
* @Description 酒吧房fragment
|
||||
*/
|
||||
class RoomPubFragment(var mRoomInfoResp: RoomInfoResp?) :
|
||||
BaseMvpFragment<PubPresenter, FragmentPubRoomBinding>() {
|
||||
|
||||
|
||||
@@ -43,105 +43,5 @@ class PubPresenter(context: Context, val view: PubContacts.View?) :
|
||||
}
|
||||
|
||||
|
||||
override fun signStart(roomId: String, userId: String) {
|
||||
RetrofitClient.getInstance().signStart(roomId, userId, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signEnd(signId: String) {
|
||||
RetrofitClient.getInstance().signEnd(signId, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signDelay(signId: String, roomId: String) {
|
||||
RetrofitClient.getInstance().signDelay(signId, roomId, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(s: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun signRefuse(roomId: String) {
|
||||
RetrofitClient.getInstance().signRefuse(roomId, object : BaseObserver<String?>(){
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
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()
|
||||
.setMutePit(roomId, pitNumber, isMute, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(string: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
override fun setLockPit(roomId: String, pitNumber: String, isLock: String) {
|
||||
RetrofitClient.getInstance()
|
||||
.setLockPit(roomId, pitNumber, isLock, object : BaseObserver<String?>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
addDisposable(d)
|
||||
}
|
||||
|
||||
override fun onNext(string: String) {
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -86,7 +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);
|
||||
@@ -393,6 +393,7 @@ public class AlbumDetailActivity extends BaseMvpActivity<AlbumDetailPresenter, A
|
||||
ImageUtils.loadHeadCC(albumBean.getImage(), mBinding.ivAlbumDetailBg);
|
||||
mBinding.tvAlbumName.setText(albumBean.getName());
|
||||
mBinding.tvAlbumNum.setText(albumBean.getCount() + "张照片");
|
||||
mBinding.tvBj.setVisibility(userId.equals(SpUtil.getUserId() + "") ? VISIBLE : View.GONE);
|
||||
mBinding.imCrAlbum.setVisibility(userId.equals(SpUtil.getUserId() + "") ? VISIBLE : View.GONE);
|
||||
mBinding.topBar.setRightTxtVisible(userId.equals(SpUtil.getUserId() + ""));
|
||||
if (albumBean.getPwd() != null && !albumBean.getPwd().isEmpty()) {
|
||||
|
||||
@@ -58,7 +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_gift_desc.text = item.gift_remark_name
|
||||
|
||||
tv_wheat_qd.setOnClickListener {
|
||||
// 回调选中的值和位置
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.xscm.modulemain.adapter
|
||||
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.moduleutil.bean.PitTimeRespBean
|
||||
|
||||
/**
|
||||
* 项目名称:羽声语音
|
||||
* 时间:2026/1/6 14:31
|
||||
* 用途:
|
||||
*/
|
||||
class RoomPitTimeAdapter(val dataList: List<PitTimeRespBean>,
|
||||
private val onItemSelectedListener: (PitTimeRespBean, Int) -> Unit
|
||||
) : RecyclerView.Adapter<RoomPitTimeAdapter.ViewHolder>() {
|
||||
|
||||
private var selectedPosition = -1 // 默认没有选中项
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val view = LayoutInflater.from(parent.context)
|
||||
.inflate(R.layout.item_room_talent, parent, false)
|
||||
return ViewHolder(view)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
|
||||
val item = dataList[position]
|
||||
holder.bind(item, position)
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int = dataList.size
|
||||
|
||||
inner class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
private val textView: TextView = itemView.findViewById(R.id.tv_talent)
|
||||
|
||||
fun bind(item: PitTimeRespBean, position: Int) {
|
||||
textView.text = item.time_str
|
||||
|
||||
// 设置选中状态
|
||||
if (position == selectedPosition) {
|
||||
textView.setBackgroundResource(R.drawable.bg_item_selected) // 选中背景
|
||||
textView.setTextColor(android.graphics.Color.parseColor("#3ABC6D"))
|
||||
} else {
|
||||
textView.setBackgroundResource(R.drawable.bg_item_normal) // 默认背景
|
||||
textView.setTextColor(android.graphics.Color.parseColor("#333333"))
|
||||
|
||||
}
|
||||
|
||||
// 设置点击事件
|
||||
itemView.setOnClickListener {
|
||||
// 如果点击的是已选中的项,不做处理
|
||||
if (position == selectedPosition) return@setOnClickListener
|
||||
|
||||
// 更新选中位置
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
// 通知之前选中的项更新背景
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
// 通知当前选中的项更新背景
|
||||
notifyItemChanged(position)
|
||||
|
||||
// 回调选中的值和位置
|
||||
onItemSelectedListener(item, position)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置选中的位置
|
||||
*/
|
||||
fun setSelectedPosition(position: Int) {
|
||||
if (position in 0 until itemCount && position != selectedPosition) {
|
||||
val previousPosition = selectedPosition
|
||||
selectedPosition = position
|
||||
|
||||
if (previousPosition != -1) {
|
||||
notifyItemChanged(previousPosition)
|
||||
}
|
||||
|
||||
notifyItemChanged(position)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前选中的位置
|
||||
*/
|
||||
fun getSelectedPosition(): Int = selectedPosition
|
||||
|
||||
/**
|
||||
* 获取当前选中的值
|
||||
*/
|
||||
fun getSelectedValue(): String? {
|
||||
return if (selectedPosition in 0 until itemCount) {
|
||||
dataList[selectedPosition].time.toString()
|
||||
} else {
|
||||
null
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,8 +48,8 @@ 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
|
||||
if (item.gift_remark_name.isNotEmpty()) {
|
||||
tv_gift_desc.text = item.gift_remark_name
|
||||
tv_gift_desc.setTextColor(Color.parseColor("#F5F24F")) // 金色
|
||||
} else {
|
||||
tv_gift_desc.text = "待设置"
|
||||
|
||||
@@ -75,8 +75,7 @@ class GiftGivingDialog(
|
||||
super.show()
|
||||
|
||||
// TODO: 调用赠送自定义礼物。点击麦位上左边的最小图标
|
||||
RetrofitClient.getInstance()
|
||||
.getCustomGiftList(object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
RetrofitClient.getInstance().getCustomGiftList(mUserId,object : BaseObserver<MutableList<RoonGiftModel>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ class PerformInputDialog(context: Context) :
|
||||
override fun initData() {
|
||||
// 初始化数据,如果需要的话
|
||||
giftModel?.let { model ->
|
||||
if (model.new_gift_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.new_gift_name)
|
||||
if (model.gift_remark_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.gift_remark_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,8 +90,8 @@ class PerformInputDialog(context: Context) :
|
||||
|
||||
private fun refreshData() {
|
||||
giftModel?.let { model ->
|
||||
if (model.new_gift_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.new_gift_name)
|
||||
if (model.gift_remark_name?.isNotEmpty() == true) {
|
||||
mBinding.etInput.setText(model.gift_remark_name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ class RoomAboutDialog(
|
||||
|
||||
|
||||
override fun show() {
|
||||
LogUtils.e("show", "roomId:$mRoomId userId:$mUserId username:$mUsername avatar:$mAvatar")
|
||||
// 确保参数不为空
|
||||
if (!TextUtils.isEmpty(mUsername)) {
|
||||
mBinding.tvName.text = mUsername
|
||||
|
||||
@@ -9,8 +9,9 @@ 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.adapter.RoomPitTimeAdapter
|
||||
import com.xscm.modulemain.databinding.DialogRoomDurationBinding
|
||||
import com.xscm.moduleutil.bean.PitTimeRespBean
|
||||
import com.xscm.moduleutil.color.ThemeableDrawableUtils
|
||||
import com.xscm.moduleutil.http.BaseObserver
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
@@ -23,11 +24,11 @@ import io.reactivex.disposables.Disposable
|
||||
* 时间:2026/1/4 18:57
|
||||
* 用途:酒吧房设置时长
|
||||
*/
|
||||
class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
class RoomDurationDialog(context: Context, val roomId: String) :
|
||||
BaseDialog<DialogRoomDurationBinding>(context, com.xscm.moduleutil.R.style.BaseDialogStyleH) {
|
||||
|
||||
var adapter: RoomTalentAdapter? = null
|
||||
var time: MutableList<String> = mutableListOf()
|
||||
var adapter: RoomPitTimeAdapter? = null
|
||||
var time: MutableList<PitTimeRespBean> = mutableListOf()
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_room_duration
|
||||
@@ -39,18 +40,21 @@ class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
dismiss()
|
||||
}
|
||||
mBinding.tvQd.setOnClickListener {
|
||||
if (adapter?.getSelectedValue()?.isEmpty() == true || adapter?.getSelectedValue()==null) {
|
||||
if (adapter?.getSelectedValue()
|
||||
?.isEmpty() == true || adapter?.getSelectedValue() == null || adapter?.getSelectedValue() == "0"
|
||||
) {
|
||||
ToastUtils.show("请选择时间")
|
||||
} else {//确定
|
||||
RetrofitClient.getInstance().setPitTime(roomId, adapter?.getSelectedValue()!!.replace("分钟", ""),object :
|
||||
BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
RetrofitClient.getInstance()
|
||||
.setPitTime(roomId, adapter?.getSelectedValue()!!.replace("分钟", ""), object :
|
||||
BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: String) {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
override fun onNext(t: String) {
|
||||
dismiss()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -65,22 +69,28 @@ class RoomDurationDialog (context: Context, val roomId: String) :
|
||||
|
||||
|
||||
override fun initData() {
|
||||
time = mutableListOf()
|
||||
RetrofitClient.getInstance().getPitTimeList(object : BaseObserver<List<PitTimeRespBean>>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
override fun onNext(t: List<PitTimeRespBean>) {
|
||||
if (t.isNotEmpty()) {
|
||||
time.clear()
|
||||
time.addAll(t)
|
||||
}
|
||||
adapter = RoomPitTimeAdapter(time) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
time= mutableListOf()
|
||||
time.clear()
|
||||
time.add("5分钟")
|
||||
time.add("10分钟")
|
||||
time.add("15分钟")
|
||||
time.add("20分钟")
|
||||
time.add("25分钟")
|
||||
time.add("30分钟")
|
||||
adapter = RoomTalentAdapter(time) { selectedValue, position ->
|
||||
// 处理选中事件
|
||||
LogUtils.e("选中了: $selectedValue, 位置: $position")
|
||||
}
|
||||
val layoutManager = GridLayoutManager(context, 3)
|
||||
mBinding.recycleView.layoutManager = layoutManager
|
||||
mBinding.recycleView.adapter = adapter
|
||||
}
|
||||
|
||||
private fun setupWindow() {
|
||||
|
||||
@@ -60,7 +60,7 @@ class SetupCustomGiftDialog(context: Context, val roomId: String) :
|
||||
performInputDialog?.show(t[position])
|
||||
performInputDialog?.setOnConfirmListener { content ->
|
||||
// TODO: 这里表演内容的回调
|
||||
t[position].new_gift_name=content
|
||||
t[position].gift_remark_name=content
|
||||
RetrofitClient.getInstance().setCustomGift(t[position].gift_id,content,object : BaseObserver<String>() {
|
||||
override fun onSubscribe(d: Disposable) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user