密码房部分,幸运抽奖部分。
BIN
BaseModule/src/main/assets/room_wish_crystal_animation.svga
Normal file
@@ -5,4 +5,5 @@ import java.io.Serializable
|
||||
class BeforeJoinRoomCheckBean :Serializable {
|
||||
var room_id:String? = null
|
||||
var msg:String? = null
|
||||
var code:Int = -1
|
||||
}
|
||||
@@ -555,7 +555,7 @@ public interface ApiServer {
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.JOIN_ROOM)
|
||||
Call<BaseModel<RoomInfoResp>> roomGetIn(@Field("room_id") String roomId, @Field("password") String password);
|
||||
Call<BaseModel<RoomInfoResp>> roomGetIn(@Field("room_id") String roomId, @Field("room_password") String password);
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.BEFORE_JOIN_ROOM_CHECK)
|
||||
Call<BaseModel<BeforeJoinRoomCheckBean>> beforeJoinRoomCheck(@Field("room_id") String roomId);
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.bean.room.*;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
import com.xscm.moduleutil.listener.CPListener;
|
||||
import com.xscm.moduleutil.listener.JoinRoomErrorListener;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
import com.xscm.moduleutil.utils.SystemUtils;
|
||||
@@ -71,6 +72,7 @@ public class RetrofitClient {
|
||||
public ApiServer getApiServer() {
|
||||
return sApiServer;
|
||||
}
|
||||
|
||||
public OkHttpClient getHttpClient() {
|
||||
return client;
|
||||
}
|
||||
@@ -329,8 +331,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void giftWallUserList(String user_id,String gift_id,int page,BaseObserver<GiftWallUserBean> observer) {
|
||||
sApiServer.giftWallUserList(user_id,gift_id,page).enqueue(new Callback<BaseModel<GiftWallUserBean>>() {
|
||||
public void giftWallUserList(String user_id, String gift_id, int page, BaseObserver<GiftWallUserBean> observer) {
|
||||
sApiServer.giftWallUserList(user_id, gift_id, page).enqueue(new Callback<BaseModel<GiftWallUserBean>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<GiftWallUserBean>> call, Response<BaseModel<GiftWallUserBean>> response) {
|
||||
@@ -340,10 +342,10 @@ public class RetrofitClient {
|
||||
observer.onNext(body.getData());
|
||||
else if (body.getCode() == 0) {
|
||||
ToastUtils.showLong(body.getMsg());
|
||||
}else if (body.getCode() == 301) {
|
||||
} else if (body.getCode() == 301) {
|
||||
setCode301(body.getMsg());
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showLong("请求礼物用户错误", response.code());
|
||||
LogUtils.e("giftWallUserList", response.message());
|
||||
}
|
||||
@@ -772,7 +774,7 @@ public class RetrofitClient {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<GroupUserListBean>> call, Response<BaseModel<GroupUserListBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<GroupUserListBean> baseModel = response.body();
|
||||
if (baseModel.getCode() == 1)
|
||||
observer.onNext(baseModel.getData());
|
||||
@@ -1338,7 +1340,7 @@ public class RetrofitClient {
|
||||
} else if (baseModel.getCode() == 0) {
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showLong("约她获取礼物出现错误", response.code());
|
||||
LogUtils.e("getGiftInfoTa", response.message());
|
||||
}
|
||||
@@ -1350,6 +1352,7 @@ public class RetrofitClient {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void meetingTa(String roomId, String userId, String giftId, BaseObserver<String> observer) {
|
||||
sApiServer.meetingTa(roomId, userId, giftId).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@@ -1357,7 +1360,7 @@ public class RetrofitClient {
|
||||
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("meetingTa", response.message());
|
||||
}
|
||||
@@ -2423,8 +2426,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void setCustomGift(String gift_id, String new_gift_name,String roomId, BaseObserver<String> observer) {
|
||||
sApiServer.setCustomGift(gift_id, new_gift_name,roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||
public void setCustomGift(String gift_id, String new_gift_name, String roomId, BaseObserver<String> observer) {
|
||||
sApiServer.setCustomGift(gift_id, new_gift_name, roomId).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
@@ -2762,8 +2765,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void searchSong(String roomId,String search_user,BaseObserver<List<MusicSongBean>> observer) {
|
||||
sApiServer.searchSong(roomId,search_user).enqueue(new Callback<BaseModel<List<MusicSongBean>>>() {
|
||||
public void searchSong(String roomId, String search_user, BaseObserver<List<MusicSongBean>> observer) {
|
||||
sApiServer.searchSong(roomId, search_user).enqueue(new Callback<BaseModel<List<MusicSongBean>>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<List<MusicSongBean>>> call, Response<BaseModel<List<MusicSongBean>>> response) {
|
||||
@@ -2828,7 +2831,7 @@ public class RetrofitClient {
|
||||
} else if (listBaseModel.getCode() == 0) {
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showLong("客服信息不正确");
|
||||
LogUtils.e("appCustomerService", response.message());
|
||||
}
|
||||
@@ -2986,7 +2989,7 @@ public class RetrofitClient {
|
||||
|
||||
}
|
||||
|
||||
public void getBlackRoomList(String roomId,BaseObserver<List<BlackRoomBean>> observer){
|
||||
public void getBlackRoomList(String roomId, BaseObserver<List<BlackRoomBean>> observer) {
|
||||
sApiServer.getBlackRoomList(roomId).enqueue(new Callback<BaseModel<List<BlackRoomBean>>>() {
|
||||
|
||||
@Override
|
||||
@@ -2994,18 +2997,18 @@ public class RetrofitClient {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<List<BlackRoomBean>> listBaseModel = response.body();
|
||||
if (listBaseModel.getCode() == 1) {
|
||||
if (listBaseModel.getData()==null){
|
||||
if (listBaseModel.getData() == null) {
|
||||
observer.onNext(new ArrayList<>());
|
||||
}else {
|
||||
} else {
|
||||
observer.onNext(listBaseModel.getData());
|
||||
}
|
||||
} else if (listBaseModel.getCode() == 301) {
|
||||
setCode301(listBaseModel.getMsg());
|
||||
}else if (listBaseModel.getCode() == 0) {
|
||||
} else if (listBaseModel.getCode() == 0) {
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
observer.onNext(new ArrayList<>());
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showLong("请求交友小屋列表错误", response.code());
|
||||
LogUtils.e("getBlackRoomList", response.message());
|
||||
}
|
||||
@@ -3075,7 +3078,7 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void roomGetIn(String roomId, String password, BaseObserver<RoomInfoResp> observer) {
|
||||
public void roomGetIn(String roomId, String password, BaseObserver<RoomInfoResp> observer, JoinRoomErrorListener joinRoomErrorListener) {
|
||||
if (!isNetworkAvailable()) {
|
||||
handleNetworkUnavailable(observer);
|
||||
CommonAppContext.getInstance().isRoomJoininj = false;
|
||||
@@ -3090,17 +3093,22 @@ public class RetrofitClient {
|
||||
BaseModel<RoomInfoResp> roomInfoRespBaseModel = response.body();
|
||||
if (roomInfoRespBaseModel.getCode() == 1) {
|
||||
observer.onNext(roomInfoRespBaseModel.getData());
|
||||
} else if (roomInfoRespBaseModel.getCode() == 301) {
|
||||
setCode301(roomInfoRespBaseModel.getMsg());
|
||||
} else if (roomInfoRespBaseModel.getCode() == 0) {
|
||||
ToastUtils.showShort(roomInfoRespBaseModel.getMsg());
|
||||
if (joinRoomLoadListener != null) {
|
||||
joinRoomLoadListener.onJoinRoomLoad(roomInfoRespBaseModel.getMsg());
|
||||
}
|
||||
} else if (roomInfoRespBaseModel.getCode() == 202) {
|
||||
observer.onNext(roomInfoRespBaseModel.getData());
|
||||
} else {
|
||||
MessageListenerSingleton.getInstance().quitGroup(roomId);
|
||||
if (roomInfoRespBaseModel.getCode() == 301) {
|
||||
setCode301(roomInfoRespBaseModel.getMsg());
|
||||
} else if (roomInfoRespBaseModel.getCode() == 0) {
|
||||
ToastUtils.showShort(roomInfoRespBaseModel.getMsg());
|
||||
if (joinRoomLoadListener != null) {
|
||||
joinRoomLoadListener.onJoinRoomLoad(roomInfoRespBaseModel.getMsg());
|
||||
}
|
||||
} else if (roomInfoRespBaseModel.getCode() == 202) {
|
||||
observer.onNext(roomInfoRespBaseModel.getData());
|
||||
} else {
|
||||
MessageListenerSingleton.getInstance().quitGroup(roomId);
|
||||
}
|
||||
if (joinRoomErrorListener != null){
|
||||
joinRoomErrorListener.onJoinRoomError(roomInfoRespBaseModel.getCode(), roomInfoRespBaseModel.getMsg());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showLong("进入房间错误", response.code());
|
||||
@@ -3143,6 +3151,10 @@ public class RetrofitClient {
|
||||
} else if (beforeJoinRoomCheckBeanBaseModel.getCode() == 202) {
|
||||
observer.onNext(beforeJoinRoomCheckBeanBaseModel.getData());
|
||||
joinRoomLoadListener.onJoinRoomLoad(beforeJoinRoomCheckBeanBaseModel.getMsg());
|
||||
} else if (beforeJoinRoomCheckBeanBaseModel.getCode() == 101) {
|
||||
BeforeJoinRoomCheckBean beforeJoinRoomCheckBean = new BeforeJoinRoomCheckBean();
|
||||
beforeJoinRoomCheckBean.setCode(101);
|
||||
observer.onNext(beforeJoinRoomCheckBean);
|
||||
}
|
||||
} else {
|
||||
if (joinRoomLoadListener != null) {
|
||||
@@ -3204,8 +3216,8 @@ public class RetrofitClient {
|
||||
} else if (listBaseModel.getCode() == 0) {
|
||||
ToastUtils.showLong(listBaseModel.getMsg());
|
||||
}
|
||||
}else {
|
||||
ToastUtils.showLong("麦位时长数据错误",response.code());
|
||||
} else {
|
||||
ToastUtils.showLong("麦位时长数据错误", response.code());
|
||||
LogUtils.e("getPitTimeList", response.message());
|
||||
}
|
||||
}
|
||||
@@ -3916,8 +3928,8 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
public void roomAuctionJoin(String auctionId, String userId, String giftId, String
|
||||
num, String type,String gift_bag_id, BaseObserver<RoomAuction.AuctionListBean> observer) {
|
||||
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type,gift_bag_id)
|
||||
num, String type, String gift_bag_id, BaseObserver<RoomAuction.AuctionListBean> observer) {
|
||||
sApiServer.roomAuctionJoin(auctionId, userId, giftId, num, type, gift_bag_id)
|
||||
// .enqueue(new ApiResponseCallback<RoomAuction.AuctionListBean>(CommonAppContext.getInstance()) {
|
||||
// @Override
|
||||
// public void onSuccess(RoomAuction.AuctionListBean data) {
|
||||
@@ -4262,8 +4274,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String type, String pit_number, String heart_id,String gift_bag_id, BaseObserver<RoomGiftData> observer) {
|
||||
sApiServer.roomGift(room_id, gift_id, gift_num, to_uid, type, pit_number, heart_id,gift_bag_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
|
||||
public void roomGift(String room_id, String gift_id, String gift_num, String to_uid, String type, String pit_number, String heart_id, String gift_bag_id, BaseObserver<RoomGiftData> observer) {
|
||||
sApiServer.roomGift(room_id, gift_id, gift_num, to_uid, type, pit_number, heart_id, gift_bag_id).enqueue(new Callback<BaseModel<RoomGiftData>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomGiftData>> call, Response<BaseModel<RoomGiftData>> response) {
|
||||
if (response.code() == 200) {
|
||||
@@ -4410,7 +4422,7 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
public void applyPit(String roomId, String pitNumber, BaseObserver<String> observer) {
|
||||
sApiServer.applyPit(roomId, pitNumber,"").enqueue(new Callback<BaseModel<String>>() {
|
||||
sApiServer.applyPit(roomId, pitNumber, "").enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
onNextRetu(response, observer);
|
||||
@@ -4424,8 +4436,8 @@ public class RetrofitClient {
|
||||
}
|
||||
|
||||
// TODO: 2026/1/7 修改了上麦接口,这里重新写一个,是只针对酒吧房使用的
|
||||
public void applyPubPit(String roomId, String pitNumber,String gift_id, BaseObserver<String> observer) {
|
||||
sApiServer.applyPit(roomId, pitNumber,gift_id).enqueue(new Callback<BaseModel<String>>() {
|
||||
public void applyPubPit(String roomId, String pitNumber, String gift_id, BaseObserver<String> observer) {
|
||||
sApiServer.applyPit(roomId, pitNumber, gift_id).enqueue(new Callback<BaseModel<String>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
onNextRetu(response, observer);
|
||||
@@ -4438,15 +4450,15 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void liaoTa(String roomId,String toUserId,String type ,BaseObserver<String> observer) {
|
||||
sApiServer.liaoTa(roomId,toUserId,type).enqueue(new Callback<BaseModel<String>>() {
|
||||
public void liaoTa(String roomId, String toUserId, String type, BaseObserver<String> observer) {
|
||||
sApiServer.liaoTa(roomId, toUserId, type).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("撩Ta失败",response.code());
|
||||
} else {
|
||||
ToastUtils.showLong("撩Ta失败", response.code());
|
||||
LogUtils.e("liaoTa: " + response.message());
|
||||
}
|
||||
}
|
||||
@@ -4704,8 +4716,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void setRoomBusinessTime(String roomId,String start_time,String end_time, BaseObserver<String> observer) {
|
||||
sApiServer.setRoomBusinessTime(roomId,start_time,end_time).enqueue(new Callback<BaseModel<String>>() {
|
||||
public void setRoomBusinessTime(String roomId, String start_time, String end_time, BaseObserver<String> observer) {
|
||||
sApiServer.setRoomBusinessTime(roomId, start_time, end_time).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
@@ -4716,10 +4728,10 @@ public class RetrofitClient {
|
||||
observer.onNext("");
|
||||
} else if (baseModel.getCode() == 301) {
|
||||
setCode301(baseModel.getMsg());
|
||||
}else if (baseModel.getCode() == 0) {
|
||||
} else if (baseModel.getCode() == 0) {
|
||||
ToastUtils.showLong(baseModel.getMsg());
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
ToastUtils.showLong("设置营业时间失败,", response.code());
|
||||
LogUtils.e("setRoomBusinessTime", response.message());
|
||||
}
|
||||
@@ -5421,8 +5433,8 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void closePkMic(String pk_id ,String type ,String user_id,BaseObserver<String> observer) {
|
||||
sApiServer.closePkMic(pk_id,type,user_id).enqueue(new Callback<BaseModel<String>>() {
|
||||
public void closePkMic(String pk_id, String type, String user_id, BaseObserver<String> observer) {
|
||||
sApiServer.closePkMic(pk_id, type, user_id).enqueue(new Callback<BaseModel<String>>() {
|
||||
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<String>> call, Response<BaseModel<String>> response) {
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.xscm.moduleutil.listener
|
||||
|
||||
interface JoinRoomErrorListener {
|
||||
fun onJoinRoomError(errorCode: Int, errorMsg: String)
|
||||
}
|
||||
@@ -410,7 +410,39 @@ public class ImageUtils {
|
||||
}
|
||||
}
|
||||
Glide.with(mImageView).asBitmap().load(path)
|
||||
.apply(createUrlOnlyOptions(path))
|
||||
.apply(createUrlOnlyOptions(path)).listener(new RequestListener<Bitmap>() {
|
||||
@Override
|
||||
public boolean onResourceReady(Bitmap resource, Object model,
|
||||
Target<Bitmap> target, DataSource dataSource,
|
||||
boolean isFirstResource) {
|
||||
// dataSource 是关键参数!
|
||||
switch (dataSource) {
|
||||
case DATA_DISK_CACHE:
|
||||
case RESOURCE_DISK_CACHE:
|
||||
LogUtils.e("GlideCache", "来自磁盘缓存",path);
|
||||
break;
|
||||
case MEMORY_CACHE:
|
||||
LogUtils.e("GlideCache", "来自内存缓存",path);
|
||||
break;
|
||||
case LOCAL: // 本地文件
|
||||
LogUtils.e("GlideCache", "来自本地文件",path);
|
||||
break;
|
||||
case REMOTE: // 网络下载
|
||||
LogUtils.e("GlideCache", "来自网络下载",path);
|
||||
break;
|
||||
default:
|
||||
LogUtils.e("GlideCache", "来自: " + dataSource);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onLoadFailed(@Nullable GlideException e, Object model,
|
||||
Target<Bitmap> target, boolean isFirstResource) {
|
||||
Log.e("GlideCache", "加载失败"+"path:"+path, e);
|
||||
return false;
|
||||
}
|
||||
})
|
||||
.error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop()
|
||||
.thumbnail(0.3f).into(mImageView);
|
||||
}
|
||||
@@ -487,6 +519,25 @@ public class ImageUtils {
|
||||
|
||||
@Override
|
||||
public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {
|
||||
|
||||
// dataSource 是关键参数!
|
||||
switch (dataSource) {
|
||||
case DATA_DISK_CACHE:
|
||||
case RESOURCE_DISK_CACHE:
|
||||
LogUtils.e("GlideCache", "来自磁盘缓存",path);
|
||||
break;
|
||||
case MEMORY_CACHE:
|
||||
LogUtils.e("GlideCache", "来自内存缓存",path);
|
||||
break;
|
||||
case LOCAL: // 本地文件
|
||||
LogUtils.e("GlideCache", "来自本地文件",path);
|
||||
break;
|
||||
case REMOTE: // 网络下载
|
||||
LogUtils.e("GlideCache", "来自网络下载",path);
|
||||
break;
|
||||
default:
|
||||
LogUtils.e("GlideCache", "来自: " + dataSource);
|
||||
}
|
||||
// 加载成功!resource 就是最终的 Bitmap 对象
|
||||
int imageWidth = resource.getWidth(); // 图片原始宽度
|
||||
int imageHeight = resource.getHeight(); // 图片原始高度
|
||||
|
||||
@@ -32,14 +32,13 @@ android {
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
dataBinding {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = '11'
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
dataBinding true
|
||||
viewBinding true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,6 +182,7 @@
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.user.activity.CreatedRoomActivity"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||
android:exported="false" />
|
||||
<activity
|
||||
android:name=".activity.user.activity.MyRoomActivity"
|
||||
|
||||
@@ -249,6 +249,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
var isBackPrivate = false //是否主动返回小黑屋
|
||||
|
||||
/**
|
||||
* 1:踩头条
|
||||
* 2:小时榜
|
||||
* 3:MQTT
|
||||
*/
|
||||
private var skipRoomType = -1
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_DOWN) {
|
||||
// 拦截返回键,显示退出对话框而不是直接退出
|
||||
@@ -1660,6 +1667,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
// }
|
||||
|
||||
AgoraManager.getInstance().lastRoomId = roomId
|
||||
skipRoomType = -1
|
||||
//进入小黑屋无所谓
|
||||
MvpPre?.getRoomIn(messageEvent.text.room_id, "")
|
||||
MessageExListenerSingleton.getInstance().joinGroup(messageEvent.text.room_id)
|
||||
if (publicScreenFragment != null) {
|
||||
@@ -2446,6 +2455,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
MessageListenerSingleton.quitGroup(pendingRoomId)
|
||||
MessageListenerSingleton.getInstance().joinGroup(pendingRoomId)
|
||||
AgoraManager.getInstance().lastRoomId = roomId
|
||||
skipRoomType = -1
|
||||
//交友房卡关系完成进入小黑屋
|
||||
MvpPre!!.getRoomIn(pendingRoomId, "")
|
||||
lastSwitchedRoomId = pendingRoomId!!
|
||||
|
||||
@@ -3053,8 +3064,8 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
dialog.show()
|
||||
}
|
||||
|
||||
fun setRoomTime(roomInfoResp: RoomInfoResp){
|
||||
this.mRoomInfoResp=roomInfoResp
|
||||
fun setRoomTime(roomInfoResp: RoomInfoResp) {
|
||||
this.mRoomInfoResp = roomInfoResp
|
||||
}
|
||||
|
||||
|
||||
@@ -3080,7 +3091,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
AgoraManager.getInstance().muteLocalAudioStream(false)
|
||||
AgoraManager.getInstance().ClientRole(true)
|
||||
CommonAppContext.getInstance().isMai = true
|
||||
var userId : String =""
|
||||
var userId: String = ""
|
||||
mRoomInfoResp?.room_info?.pit_list?.size?.let {
|
||||
if (it < 9) {
|
||||
return
|
||||
@@ -3353,6 +3364,22 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
setView(resp)
|
||||
}
|
||||
|
||||
override fun beforeJoinRoomCheck(isJoinRoom: Boolean, errorCode: Int, skipRoomId: String) {
|
||||
if (errorCode == 0) {
|
||||
MessageListenerSingleton.getInstance().joinGroup(roomId)
|
||||
initPublicScreenFragment()
|
||||
} else {
|
||||
if (isJoinRoom) {
|
||||
when (skipRoomType) {
|
||||
1,2,3 -> {
|
||||
roomId2 = skipRoomId
|
||||
getHour()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//隐藏视图
|
||||
private fun instView() {
|
||||
val countText = mRoomInfoResp?.room_info?.queue_number.toString()
|
||||
@@ -3414,8 +3441,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
// )
|
||||
// MessageListenerSingleton.getInstance()
|
||||
// .joinGroup(mRoomInfoResp?.room_info?.head_line?.room_id)
|
||||
roomId2 = mRoomInfoResp?.room_info?.head_line?.room_id
|
||||
getHour()
|
||||
// roomId2 = mRoomInfoResp?.room_info?.head_line?.room_id
|
||||
// getHour()
|
||||
skipRoomType = 1
|
||||
//踩头条加入房间
|
||||
MvpPre?.getRoomIn(mRoomInfoResp?.room_info?.head_line?.room_id, "")
|
||||
} else {
|
||||
com.blankj.utilcode.util.ToastUtils.showLong("您就在当前房间")
|
||||
@@ -3684,9 +3713,11 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
return
|
||||
}
|
||||
|
||||
roomId2 = event.room_id
|
||||
MessageListenerSingleton.getInstance().joinGroup(event.room_id)
|
||||
getHour()
|
||||
// roomId2 = event.room_id
|
||||
// MessageListenerSingleton.getInstance().joinGroup(event.room_id)
|
||||
// getHour()
|
||||
skipRoomType = 2
|
||||
//小时榜跳转房间
|
||||
MvpPre?.getRoomIn(event.room_id, "")
|
||||
}
|
||||
|
||||
@@ -3737,7 +3768,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
ClickUtils.clearAllClickRecords()
|
||||
AgoraManager.getInstance().cleanup()
|
||||
roomId = roomId2
|
||||
// 重新连接房间相关服务
|
||||
resumeRoomState()
|
||||
publicScreenFragment?.onDestroy()
|
||||
@@ -3825,8 +3855,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
fun refreshRoomInfo(roomId: String) {
|
||||
roomId2 = roomId
|
||||
getHour()
|
||||
// roomId2 = roomId
|
||||
// getHour()
|
||||
skipRoomType = 3
|
||||
//MQTT 进入房间
|
||||
MvpPre?.getRoomIn(roomId, "")
|
||||
}
|
||||
|
||||
@@ -3834,13 +3866,13 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
// 添加检查房间连接状态的方法
|
||||
private fun resumeRoomState() {
|
||||
// 恢复房间相关状态
|
||||
if (MvpPre != null && roomId != null) {
|
||||
if (MvpPre != null && roomId2 != null) {
|
||||
// MvpPre!!.postRoomInfo(roomId)
|
||||
}
|
||||
|
||||
// 重新连接房间相关服务
|
||||
if (MessageListenerSingleton.getInstance() != null) {
|
||||
MessageListenerSingleton.getInstance().joinGroup(roomId)
|
||||
MessageListenerSingleton.getInstance().joinGroup(roomId2)
|
||||
}
|
||||
|
||||
// 恢复音频状态
|
||||
@@ -3928,6 +3960,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
// 只有在没有房间信息时才重新获取
|
||||
if (mRoomInfoResp == null) {
|
||||
cleanupResources()
|
||||
skipRoomType = -1
|
||||
MvpPre!!.getRoomIn(roomId, password)
|
||||
}
|
||||
return
|
||||
@@ -4103,14 +4136,6 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
publicScreenFragment?.clearExMessageListener()
|
||||
publicScreenFragment?.setIsPriRoom(false, arrayListOf())
|
||||
}
|
||||
|
||||
// if (publicScreenFragment != null) {
|
||||
// publicScreenFragment!!.onFragmentShowDestroy()
|
||||
// publicScreenFragment = null
|
||||
// }
|
||||
|
||||
// MvpPre?.getRoomIn(AgoraManager.getInstance().lastRoomId, "")
|
||||
// AgoraManager.getInstance().lastRoomId = ""
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ public class RoomContacts {
|
||||
public interface View extends IView<Activity> {
|
||||
void roomInfo(RoomInfoResp resp);
|
||||
|
||||
void beforeJoinRoomCheck(Boolean isJoinRoom,int errorCode,String roomId);
|
||||
|
||||
void showPasswordDialog();
|
||||
|
||||
void enterFail();
|
||||
|
||||
@@ -661,6 +661,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
setRoomSeatViewType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeJoinRoomCheck(Boolean isJoinRoom, int errorCode, String roomId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPasswordDialog() {
|
||||
|
||||
|
||||
@@ -1005,6 +1005,11 @@ public class RoomKtvFragment extends BaseMvpFragment<RoomPresenter, FragmentRoom
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeJoinRoomCheck(Boolean isJoinRoom, int errorCode, String roomId) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void showPasswordDialog() {
|
||||
|
||||
@@ -129,7 +129,7 @@ public class HotListPresenter extends BasePresenter<HotListContacts.View> implem
|
||||
MvpRef.get().enterFail();
|
||||
}
|
||||
}
|
||||
});
|
||||
},null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,9 +4,15 @@ import static com.liulishuo.okdownload.OkDownloadProvider.context;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.xscm.modulemain.activity.main.activity.MainActivity;
|
||||
import com.xscm.modulemain.activity.room.contacts.RoomContacts;
|
||||
import com.xscm.modulemain.activity.user.activity.DailyTasksActivity;
|
||||
import com.xscm.modulemain.activity.user.activity.MyRoomActivity;
|
||||
import com.xscm.modulemain.dialog.DialogEditRoomPwd;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.BeforeJoinRoomCheckBean;
|
||||
import com.xscm.moduleutil.bean.RedPacketConfig;
|
||||
@@ -20,6 +26,7 @@ import com.xscm.moduleutil.dialog.ConfirmDialog;
|
||||
import com.xscm.moduleutil.http.APIException;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
import com.xscm.moduleutil.listener.JoinRoomErrorListener;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import com.xscm.moduleutil.rtc.AgoraManager;
|
||||
@@ -34,11 +41,14 @@ import io.reactivex.disposables.Disposable;
|
||||
|
||||
public class RoomPresenter extends BasePresenter<RoomContacts.View> implements RoomContacts.IRoomPre {
|
||||
RoomContacts.View mView;
|
||||
private Context mContext;
|
||||
public RoomPresenter(RoomContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
mView = view;
|
||||
this.mContext = context;
|
||||
}
|
||||
|
||||
|
||||
// TODO: 2025/6/10 加入房间
|
||||
@Override
|
||||
public void getRoomIn(String roomId, String password) {
|
||||
@@ -50,16 +60,44 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
|
||||
@Override
|
||||
public void onNext(BeforeJoinRoomCheckBean beforeJoinRoomCheckBean) {
|
||||
if (beforeJoinRoomCheckBean.getRoom_id() == null || beforeJoinRoomCheckBean.getRoom_id().equals("")) {
|
||||
joinRoom(roomId, password);
|
||||
}else {
|
||||
queren(beforeJoinRoomCheckBean.getRoom_id(), beforeJoinRoomCheckBean.getMsg());
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
|
||||
if(beforeJoinRoomCheckBean.getCode() == 101){
|
||||
new DialogEditRoomPwd(mContext).show(new DialogEditRoomPwd.OnDialogDismissListener() {
|
||||
@Override
|
||||
public void onDialogDismiss() {
|
||||
MvpRef.get().beforeJoinRoomCheck(false,-1,"");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPwdListener(@NonNull String pwd) {
|
||||
if (beforeJoinRoomCheckBean.getRoom_id() == null || beforeJoinRoomCheckBean.getRoom_id().equals("")) {
|
||||
joinRoom(roomId, pwd);
|
||||
}else {
|
||||
queren(beforeJoinRoomCheckBean.getRoom_id(), beforeJoinRoomCheckBean.getMsg());
|
||||
}
|
||||
}
|
||||
});
|
||||
}else {
|
||||
if (beforeJoinRoomCheckBean.getRoom_id() == null || beforeJoinRoomCheckBean.getRoom_id().equals("")) {
|
||||
joinRoom(roomId, password);
|
||||
}else {
|
||||
queren(beforeJoinRoomCheckBean.getRoom_id(), beforeJoinRoomCheckBean.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void joinRoom(String roomId, String password){
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().beforeJoinRoomCheck(true,-1,roomId);
|
||||
|
||||
api.roomGetIn(roomId, password, new BaseObserver<RoomInfoResp>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
@@ -68,11 +106,9 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
|
||||
@Override
|
||||
public void onNext(RoomInfoResp resp) {
|
||||
|
||||
if(!resp.getRoom_id().isEmpty()){
|
||||
queren(resp.getRoom_id(),resp.getMsg());
|
||||
}else {
|
||||
|
||||
if (!resp.getRoom_id().isEmpty()) {
|
||||
queren(resp.getRoom_id(), resp.getMsg());
|
||||
} else {
|
||||
String appId = CommonAppContext.getInstance().getCurrentEnvironment().getSwSdkAppId();
|
||||
String token = resp.getUser_info().getAgora_token(); // 如果启用了鉴权才需要
|
||||
String roomId = resp.getRoom_info().getRoom_id(); // 房间 ID
|
||||
@@ -88,17 +124,16 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
LogUtils.e("roomId:", roomId);
|
||||
AgoraManager.getInstance()
|
||||
.joinRoom(token, roomId, uid, enableMic, enableJs);
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
|
||||
MvpRef.get().roomInfo(resp);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
if (e instanceof APIException) {
|
||||
APIException apiException = (APIException) e;
|
||||
@@ -111,6 +146,11 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
MvpRef.get().enterFail();
|
||||
}
|
||||
}
|
||||
}, (errorCode, errorMsg) -> {
|
||||
if (MvpRef == null) {
|
||||
MvpRef = new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().beforeJoinRoomCheck(false,errorCode,"");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -126,6 +166,10 @@ public class RoomPresenter extends BasePresenter<RoomContacts.View> implements R
|
||||
getRoomIn(roomId,"");
|
||||
},
|
||||
v -> {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().beforeJoinRoomCheck(false,-1,"");
|
||||
// 点击“取消”按钮时什么都不做
|
||||
}, false, 0).show();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@ import android.text.TextWatcher;
|
||||
import android.view.Gravity;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.activity.OnBackPressedCallback;
|
||||
@@ -140,16 +142,16 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
|
||||
|
||||
// roomInfoResp = (RoomInfoResp) getIntent().getSerializableExtra("roomInfo");
|
||||
|
||||
if (roomInfoResp!=null){
|
||||
if (roomInfoResp != null) {
|
||||
ImageUtils.loadHeadCC(roomInfoResp.getRoom_info().getRoom_cover(), mBinding.ivTrendContent);
|
||||
mBinding.edNickName.setText(roomInfoResp.getRoom_info().getRoom_name());
|
||||
mBinding.etG.setText(roomInfoResp.getRoom_info().getRoom_intro());
|
||||
roomUrl=roomInfoResp.getRoom_info().getRoom_cover();
|
||||
roomUrl = roomInfoResp.getRoom_info().getRoom_cover();
|
||||
mBinding.llSj.setVisibility(View.VISIBLE);
|
||||
mBinding.tvSj.setText(roomInfoResp.getRoom_info().getStart_time() + "-" + roomInfoResp.getRoom_info().getEnd_time());
|
||||
}else {
|
||||
if (handler!=null ){
|
||||
if (showPopupRunnable!=null){
|
||||
} else {
|
||||
if (handler != null) {
|
||||
if (showPopupRunnable != null) {
|
||||
handler.post(showPopupRunnable);
|
||||
}
|
||||
}
|
||||
@@ -209,13 +211,25 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
|
||||
|
||||
ThemeableDrawableUtils.setThemeableRoundedBackground(mBinding.tvSave, ColorManager.getInstance().getPrimaryColorInt(), 53);
|
||||
mBinding.tvSave.setTextColor(ColorManager.getInstance().getButtonColorInt());
|
||||
|
||||
mBinding.switchShowPwd.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
if (isChecked) {
|
||||
mBinding.etRoomPwd.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mBinding.etRoomPwd.setVisibility(View.GONE);
|
||||
mBinding.etRoomPwd.setText("");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (handler!=null ) {
|
||||
if (showPopupRunnable!=null) {
|
||||
if (handler != null) {
|
||||
if (showPopupRunnable != null) {
|
||||
handler.removeCallbacks(showPopupRunnable);
|
||||
if (popupWindow != null) {
|
||||
popupWindow.dissmiss();
|
||||
@@ -247,9 +261,16 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
|
||||
ToastUtils.show("请输入房间名");
|
||||
return;
|
||||
}
|
||||
if (roomInfoResp!=null){
|
||||
MvpPre.editRoom(roomInfoResp.getRoom_info().getRoom_id(), roomName, roomUrl,mBinding.etG.getText().toString(), "");
|
||||
}else {
|
||||
String roomPwd = mBinding.etRoomPwd.getText().toString().trim();
|
||||
if (mBinding.etRoomPwd.getVisibility() == View.VISIBLE) {
|
||||
if (TextUtils.isEmpty(roomPwd))
|
||||
ToastUtils.show("请输入密码");
|
||||
return;
|
||||
}
|
||||
|
||||
if (roomInfoResp != null) {
|
||||
MvpPre.editRoom(roomInfoResp.getRoom_info().getRoom_id(), roomName, roomUrl, mBinding.etG.getText().toString(), "");
|
||||
} else {
|
||||
MvpPre.checkTxt(roomName, roomUrl, mBinding.etG.getText().toString());
|
||||
}
|
||||
}
|
||||
@@ -350,7 +371,7 @@ public class CreatedRoomActivity extends BaseMvpActivity<CreatedRoomPresenter, A
|
||||
if (imgMedia.isCompressed()) {
|
||||
url = imgMedia.getCompressPath();
|
||||
} else {
|
||||
url = imgMedia.getRealPath();
|
||||
url = imgMedia.getCutPath();
|
||||
}
|
||||
MvpPre.uploadFile(new File(url), 0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.xscm.modulemain.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.ViewGroup
|
||||
import com.blankj.utilcode.util.ScreenUtils
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.DialogEditRoomPwdLayoutBinding
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
|
||||
class DialogEditRoomPwd(context: Context) : BaseDialog<DialogEditRoomPwdLayoutBinding>(context) {
|
||||
|
||||
init {
|
||||
// 设置对话框的宽度为屏幕宽度
|
||||
window?.setLayout(
|
||||
(ScreenUtils.getScreenWidth() * 315f / 375).toInt(),
|
||||
ViewGroup.LayoutParams.WRAP_CONTENT
|
||||
)
|
||||
setCancelable(false)
|
||||
setCanceledOnTouchOutside(false)
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_edit_room_pwd_layout
|
||||
}
|
||||
|
||||
private var onDialogDismissListener:OnDialogDismissListener? = null
|
||||
|
||||
override fun initView() {
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
onDialogDismissListener?.onDialogDismiss()
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvCancel.setOnClickListener {
|
||||
onDialogDismissListener?.onDialogDismiss()
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.tvConfirm.setOnClickListener {
|
||||
if (mBinding.etRoomPwd.text.toString().trim()
|
||||
.isNotEmpty() && mBinding.etRoomPwd.text.toString().trim().length == 4
|
||||
) {
|
||||
onDialogDismissListener?.onPwdListener(mBinding.etRoomPwd.text.toString().trim())
|
||||
dismiss()
|
||||
} else {
|
||||
ToastUtils.showShort("请输入正确密码!")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
}
|
||||
|
||||
fun show(onDialogDismissListener: OnDialogDismissListener) {
|
||||
super.show()
|
||||
this.onDialogDismissListener = onDialogDismissListener
|
||||
}
|
||||
|
||||
interface OnDialogDismissListener {
|
||||
fun onPwdListener(pwd: String)
|
||||
|
||||
fun onDialogDismiss()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.xscm.modulemain.dialog
|
||||
|
||||
import android.content.Context
|
||||
import android.view.Gravity
|
||||
import android.view.View
|
||||
import com.blankj.utilcode.util.ToastUtils
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.opensource.svgaplayer.SVGACallback
|
||||
import com.opensource.svgaplayer.SVGAParser
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity
|
||||
import com.xscm.modulemain.R
|
||||
import com.xscm.modulemain.databinding.DialogLuckyDrawLayoutBinding
|
||||
import com.xscm.moduleutil.widget.dialog.BaseDialog
|
||||
|
||||
class DialogLuckyDraw(context: Context) : BaseDialog<DialogLuckyDrawLayoutBinding>(context) {
|
||||
|
||||
init {
|
||||
window?.apply {
|
||||
setGravity(Gravity.BOTTOM)
|
||||
}
|
||||
|
||||
setCancelable(false)
|
||||
setCanceledOnTouchOutside(false)
|
||||
}
|
||||
|
||||
private var isLottery = false
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
return R.layout.dialog_lucky_draw_layout
|
||||
}
|
||||
|
||||
override fun initView() {
|
||||
mBinding.ivClose.setOnClickListener {
|
||||
dismiss()
|
||||
}
|
||||
|
||||
mBinding.iv1.setOnClickListener {
|
||||
lottery(1)
|
||||
}
|
||||
|
||||
mBinding.iv10.setOnClickListener {
|
||||
lottery(10)
|
||||
}
|
||||
|
||||
mBinding.iv100.setOnClickListener {
|
||||
lottery(100)
|
||||
}
|
||||
mBinding.ivOnOrOff.tag = 1
|
||||
mBinding.ivOnOrOff.setOnClickListener {
|
||||
if (mBinding.ivOnOrOff.tag == 1) {
|
||||
mBinding.ivOnOrOff.tag = 0
|
||||
mBinding.ivOnOrOff.setImageResource(R.mipmap.icon_lucky_donghua_pre)
|
||||
} else {
|
||||
mBinding.ivOnOrOff.tag = 1
|
||||
mBinding.ivOnOrOff.setImageResource(R.mipmap.icon_lucky_donghua_nor)
|
||||
}
|
||||
}
|
||||
}
|
||||
//913073443 13837096053
|
||||
private fun lottery(count: Int) {
|
||||
if (isLottery) {
|
||||
ToastUtils.showShort("正在抽取中...")
|
||||
return
|
||||
}
|
||||
isLottery = true
|
||||
|
||||
if (mBinding.ivOnOrOff.tag == 1) {
|
||||
startAnim()
|
||||
}
|
||||
|
||||
fetchLotteryResult(count)
|
||||
}
|
||||
|
||||
override fun initData() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun fetchLotteryResult(count: Int) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
private fun showLotteryResult() {
|
||||
|
||||
}
|
||||
|
||||
private fun startAnim() {
|
||||
mBinding.svgaAnim.visibility = View.VISIBLE
|
||||
// 停止并清除当前动画
|
||||
mBinding.svgaAnim.stopAnimation()
|
||||
mBinding.svgaAnim.clear()
|
||||
// 使用SVGAParser重新解析
|
||||
val parser = SVGAParser(context)
|
||||
parser.decodeFromAssets("room_wish_crystal_animation.svga",
|
||||
object : SVGAParser.ParseCompletion {
|
||||
override fun onComplete(videoItem: SVGAVideoEntity) {
|
||||
mBinding.svgaAnim.setVideoItem(videoItem)
|
||||
mBinding.svgaAnim.clearsAfterStop = true
|
||||
|
||||
// 设置回调
|
||||
mBinding.svgaAnim.callback = object : SVGACallback {
|
||||
override fun onFinished() {
|
||||
isLottery = false
|
||||
mBinding.svgaAnim.visibility = View.GONE
|
||||
mBinding.ivSvgaBg.visibility = View.VISIBLE
|
||||
}
|
||||
|
||||
override fun onPause() {}
|
||||
override fun onRepeat() {}
|
||||
override fun onStep(frame: Int, percentage: Double) {
|
||||
if (frame == 1) {
|
||||
mBinding.ivSvgaBg.visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 开始动画
|
||||
mBinding.svgaAnim.startAnimation()
|
||||
}
|
||||
|
||||
override fun onError() {
|
||||
// 处理错误
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
class itemAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_lottery_gift_layout) {
|
||||
override fun convert(helper: BaseViewHolder, item: String) {
|
||||
helper.setText(R.id.tv_name, item)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -211,6 +211,11 @@ public class RoomOnlineDialogFragment extends BaseMvpDialogFragment<RoomPresente
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeJoinRoomCheck(Boolean isJoinRoom, int errorCode, String roomId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showPasswordDialog() {
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ActivityUtils;
|
||||
import com.blankj.utilcode.util.FragmentUtils;
|
||||
@@ -18,6 +20,7 @@ import com.xscm.modulemain.activity.main.activity.MainActivity;
|
||||
import com.xscm.modulemain.activity.room.activity.RoomActivity;
|
||||
import com.xscm.modulemain.activity.user.activity.DailyTasksActivity;
|
||||
import com.xscm.modulemain.activity.user.activity.MyRoomActivity;
|
||||
import com.xscm.modulemain.dialog.DialogEditRoomPwd;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.BeforeJoinRoomCheckBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
@@ -86,10 +89,34 @@ public class RoomManager {
|
||||
|
||||
@Override
|
||||
public void onNext(BeforeJoinRoomCheckBean beforeJoinRoomCheckBean) {
|
||||
if (beforeJoinRoomCheckBean.getRoom_id() == null || beforeJoinRoomCheckBean.getRoom_id().equals("")) {
|
||||
joinRoom(context, roomId, password, taskId);
|
||||
if(beforeJoinRoomCheckBean.getCode() == 101){
|
||||
new DialogEditRoomPwd(context).show(new DialogEditRoomPwd.OnDialogDismissListener() {
|
||||
@Override
|
||||
public void onDialogDismiss() {
|
||||
if (ActivityUtils.getTopActivity() instanceof MainActivity){
|
||||
((MainActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}else if (ActivityUtils.getTopActivity() instanceof MyRoomActivity){
|
||||
((MyRoomActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}else if (ActivityUtils.getTopActivity() instanceof DailyTasksActivity){
|
||||
((DailyTasksActivity) ActivityUtils.getTopActivity()).isShowLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPwdListener(@NonNull String pwd) {
|
||||
if (beforeJoinRoomCheckBean.getRoom_id() == null || beforeJoinRoomCheckBean.getRoom_id().equals("")) {
|
||||
joinRoom(context, roomId, pwd, taskId);
|
||||
}else {
|
||||
queren(beforeJoinRoomCheckBean.getRoom_id(), beforeJoinRoomCheckBean.getMsg());
|
||||
}
|
||||
}
|
||||
});
|
||||
}else {
|
||||
queren(beforeJoinRoomCheckBean.getRoom_id(), beforeJoinRoomCheckBean.getMsg());
|
||||
if (beforeJoinRoomCheckBean.getRoom_id() == null || beforeJoinRoomCheckBean.getRoom_id().equals("")) {
|
||||
joinRoom(context, roomId, password, taskId);
|
||||
}else {
|
||||
queren(beforeJoinRoomCheckBean.getRoom_id(), beforeJoinRoomCheckBean.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -221,7 +248,7 @@ public class RoomManager {
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
}
|
||||
});
|
||||
},null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
|
||||
</data>
|
||||
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
@@ -96,12 +102,11 @@
|
||||
android:gravity="center|left"
|
||||
android:hint="请输入房间名称"
|
||||
android:maxLength="10"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:paddingHorizontal="@dimen/dp_10"
|
||||
android:singleLine="true"
|
||||
android:text=""
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_suj_room_name"
|
||||
@@ -154,17 +159,17 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_150"
|
||||
android:layout_height="@dimen/dp_130"
|
||||
android:backgroundTint="#F0EEF7"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:background="@drawable/bg_r100_hui">
|
||||
android:background="@drawable/shape_15">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_g"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_140"
|
||||
android:layout_marginStart="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginHorizontal="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:background="@android:color/transparent"
|
||||
android:gravity="left|top"
|
||||
@@ -172,7 +177,7 @@
|
||||
android:maxLength="500"
|
||||
android:textColor="#333333"
|
||||
android:textColorHint="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sz"
|
||||
@@ -188,44 +193,118 @@
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_sj"
|
||||
android:layout_width="match_parent"
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
android:orientation="horizontal"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center|start"
|
||||
android:paddingStart="@dimen/dp_16">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="营业时间"
|
||||
android:textColor="@color/colorBlack45"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sj"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
tools:text="0/500"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="其他设置"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:textColor="@color/colorBlack45"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:paddingVertical="@dimen/dp_5"
|
||||
android:backgroundTint="#F0EEF7"
|
||||
android:layout_marginHorizontal="@dimen/dp_16"
|
||||
android:background="@drawable/shape_15"
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="@dimen/dp_8">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="设置密码"
|
||||
android:layout_gravity="center"
|
||||
android:textColor="@color/colorBlack45"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
|
||||
<Switch
|
||||
android:id="@+id/switch_show_pwd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right|center"
|
||||
android:gravity="right"
|
||||
tools:ignore="UseSwitchCompatOrMaterialXml" />
|
||||
</LinearLayout>
|
||||
|
||||
<com.xscm.moduleutil.widget.SplitEditText
|
||||
android:visibility="gone"
|
||||
android:id="@+id/et_room_pwd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_66"
|
||||
android:layout_marginStart="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_63"
|
||||
android:inputType="numberPassword"
|
||||
android:textColor="@color/color_FF333333"
|
||||
app:borderColor="#fff"
|
||||
app:contentNumber="4"
|
||||
app:contentShowMode="text"
|
||||
app:corner_size="5dp"
|
||||
app:inputBoxSquare="true"
|
||||
app:inputBoxStyle="singleBox"
|
||||
app:spaceSize="7dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:background="@color/colorBlack25"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_0_5"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_sj"
|
||||
android:paddingHorizontal="@dimen/dp_16"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="@dimen/dp_1"
|
||||
android:gravity="center|start"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_marginBottom="@dimen/dp_10"
|
||||
android:text="营业时间"
|
||||
android:textColor="@color/colorBlack45"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_sj"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:textColor="@color/color_FF666666"
|
||||
android:textSize="@dimen/sp_14"
|
||||
tools:text="0/500" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_save"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginLeft="@dimen/dp_34"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
@@ -235,8 +314,7 @@
|
||||
android:text="提交审核"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_17" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
</layout>
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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"
|
||||
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/bg_r16_fff"
|
||||
android:orientation="vertical">
|
||||
<!-- 标题栏 -->
|
||||
<RelativeLayout
|
||||
android:layout_width="match_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_centerInParent="true"
|
||||
android:text="输入房间密码"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16"/>
|
||||
|
||||
<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" />
|
||||
</RelativeLayout>
|
||||
|
||||
<!-- 内容区域 -->
|
||||
<com.xscm.moduleutil.widget.SplitEditText
|
||||
android:layout_marginVertical="@dimen/dp_20"
|
||||
android:id="@+id/et_room_pwd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_marginBottom="@dimen/dp_8"
|
||||
android:layout_marginEnd="@dimen/dp_66"
|
||||
android:layout_marginStart="@dimen/dp_66"
|
||||
android:layout_height="@dimen/dp_63"
|
||||
android:inputType="numberPassword"
|
||||
android:textColor="@color/color_FF333333"
|
||||
app:borderColor="#EFF2F8"
|
||||
app:contentNumber="4"
|
||||
app:contentShowMode="text"
|
||||
app:corner_size="5dp"
|
||||
app:inputBoxSquare="true"
|
||||
app:inputBoxStyle="singleBox"
|
||||
app:spaceSize="7dp" />
|
||||
<!-- 按钮区域 -->
|
||||
<LinearLayout
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/dp_20"
|
||||
android:paddingEnd="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r53_f3f3f3"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r53_0dffb9"
|
||||
android:backgroundTint="#3ABC6D"
|
||||
android:gravity="center"
|
||||
android:text="确定"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
175
MainModule/src/main/res/layout/dialog_lucky_draw_layout.xml
Normal file
@@ -0,0 +1,175 @@
|
||||
<?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="wrap_content"
|
||||
android:background="@drawable/bg_r8_top_aeedff"
|
||||
android:backgroundTint="@color/color_A2B0FF"
|
||||
android:orientation="vertical">
|
||||
<!-- 标题栏 -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_50"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="逗你玩"
|
||||
android:textColor="@color/color_FF333333"
|
||||
android:textSize="@dimen/sp_16" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_close"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:padding="@dimen/dp_10"
|
||||
android:src="@mipmap/icon_lucky_close" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_line_1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.1" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/guide_line_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.85" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_svga_bg"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_lucky_shuijingqiu"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/svga_anim"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
app:autoPlay="false"
|
||||
app:layout_constraintEnd_toEndOf="@id/iv_svga_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/iv_svga_bg"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_svga_bg"
|
||||
app:layout_constraintBottom_toBottomOf="@id/iv_svga_bg"
|
||||
app:loopCount="1"
|
||||
app:source="room_wish_crystal_animation.svga" />
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_on_or_off"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:layout_margin="@dimen/dp_20"
|
||||
app:layout_constraintBottom_toBottomOf="@id/guide_line_2"
|
||||
android:src="@mipmap/icon_lucky_donghua_pre"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_btn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@id/guide_line_2">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@mipmap/icon_lucky_1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_10"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@mipmap/icon_lucky_10" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_100"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:src="@mipmap/icon_lucky_100" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<!-- 按钮区域 -->
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:paddingStart="@dimen/dp_20"
|
||||
android:paddingEnd="@dimen/dp_20"
|
||||
android:paddingBottom="@dimen/dp_20"
|
||||
android:paddingTop="@dimen/dp_10"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/ll_btn">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r53_f3f3f3"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textColor="@color/color_FF999999"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_confirm"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/dp_40"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_r53_0dffb9"
|
||||
android:backgroundTint="#3ABC6D"
|
||||
android:gravity="center"
|
||||
android:text="确定"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_14" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/recycle_view"
|
||||
android:visibility="gone"
|
||||
android:background="@drawable/bg_r8_top_aeedff"
|
||||
android:backgroundTint="@color/colorBlack45"
|
||||
app:layout_constraintTop_toTopOf="@id/guide_line_1"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_btn"
|
||||
app:spanCount="3"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
tools:listitem="@layout/item_lottery_gift_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</layout>
|
||||
@@ -38,8 +38,8 @@
|
||||
android:id="@+id/iv_type"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
android:layout_height="@dimen/dp_23"
|
||||
android:src="@mipmap/jiaoyou"
|
||||
android:scaleType="fitCenter"
|
||||
android:src="@mipmap/jiaoyou"
|
||||
app:layout_constraintEnd_toEndOf="@+id/ll"
|
||||
app:layout_constraintTop_toTopOf="@+id/ll" />
|
||||
|
||||
@@ -49,20 +49,20 @@
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_12"
|
||||
android:layout_marginEnd="@dimen/dp_12"
|
||||
tools:text="烟花易冷"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="12sp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="12sp"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/view_num_bg"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/view_num_bg"
|
||||
tools:text="烟花易冷"
|
||||
|
||||
/>
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_play"
|
||||
@@ -117,4 +117,16 @@
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lock"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_mima"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
37
MainModule/src/main/res/layout/item_lottery_gift_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_25"
|
||||
android:paddingVertical="@dimen/dp_18">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_gift"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_pri_gift_bg_1"
|
||||
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>
|
||||
@@ -109,7 +109,16 @@
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lock"
|
||||
android:visibility="gone"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:src="@mipmap/icon_mima"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
|
||||
BIN
MainModule/src/main/res/mipmap-hdpi/icon_mima.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_1.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_10.png
Normal file
|
After Width: | Height: | Size: 5.2 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_100.png
Normal file
|
After Width: | Height: | Size: 8.8 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_biaoti.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_close.png
Normal file
|
After Width: | Height: | Size: 707 B |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_donghua_nor.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_donghua_pre.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_rules.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_lucky_shuijingqiu.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
MainModule/src/main/res/mipmap-xhdpi/icon_mima.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
MainModule/src/main/res/mipmap-xxhdpi/icon_mima.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
@@ -38,6 +38,7 @@ import com.tencent.qcloud.tuicore.interfaces.TUIExtensionInfo;
|
||||
import com.tencent.qcloud.tuicore.interfaces.TUIValueCallback;
|
||||
import com.tencent.qcloud.tuicore.util.SPUtils;
|
||||
import com.tencent.qcloud.tuicore.util.ToastUtil;
|
||||
import com.tencent.qcloud.tuikit.timcommon.BuildConfig;
|
||||
import com.tencent.qcloud.tuikit.timcommon.bean.ChatFace;
|
||||
import com.tencent.qcloud.tuikit.timcommon.bean.TUIMessageBean;
|
||||
import com.tencent.qcloud.tuikit.timcommon.component.face.FaceManager;
|
||||
@@ -287,7 +288,7 @@ public class InputView extends LinearLayout implements View.OnClickListener, Tex
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (userInfo != null && mChatInfo.getType()==1 && !mChatInfo.getId().equals("u"+userId) ) {
|
||||
if (userInfo != null && mChatInfo.getType()==1 && !mChatInfo.getId().equals("u"+userId) && !BuildConfig.DEBUG) {
|
||||
if (userInfo.getIs_can_chat() == 0 && userInfo.getCan_chat_money() > 0) {
|
||||
Toast.makeText(getContext(), "充值不足"+userInfo.getCan_chat_money()+"元,您无法发送消息", Toast.LENGTH_LONG).show();
|
||||
ARouter.getInstance().build("/modulevocal/RechargeActivity").navigation();
|
||||
|
||||