1:新版定包版本
This commit is contained in:
@@ -62,19 +62,19 @@ android {
|
||||
|
||||
// // 测试版配置
|
||||
beta {
|
||||
// dimension "environment"
|
||||
// // 测试版包名:基础包名 + .beta(com.example.myapp.beta)
|
||||
// applicationIdSuffix ".beta"
|
||||
// // 测试版版本名:1.0-beta
|
||||
// versionNameSuffix "-beta"
|
||||
//
|
||||
// // 【测试版应用名称】动态生成带标识的名称
|
||||
// resValue "string", "app_name", "秘地-测试版"
|
||||
//
|
||||
// // 【测试版图标】替换为测试专用图标
|
||||
// manifestPlaceholders = [
|
||||
// appIcon: "@mipmap/ic_launcher_app_bat" // 需在main/res/mipmap放置该图标
|
||||
// ]
|
||||
dimension "environment"
|
||||
// 测试版包名:基础包名 + .beta(com.example.myapp.beta)
|
||||
applicationIdSuffix ".beta"
|
||||
// 测试版版本名:1.0-beta
|
||||
versionNameSuffix "-beta"
|
||||
|
||||
// 【测试版应用名称】动态生成带标识的名称
|
||||
resValue "string", "app_name", "秘地-测试版"
|
||||
|
||||
// 【测试版图标】替换为测试专用图标
|
||||
manifestPlaceholders = [
|
||||
appIcon: "@mipmap/ic_launcher_app_bat" // 需在main/res/mipmap放置该图标
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ android {
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled true
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.release
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ isBuildModule=false
|
||||
#org.gradle.deamon=false
|
||||
android.injected.testOnly=false
|
||||
|
||||
APP_VERSION_NAME=1.2.8
|
||||
APP_VERSION_CODE=183
|
||||
APP_VERSION_NAME=1.2.9.1
|
||||
APP_VERSION_CODE=187
|
||||
|
||||
org.gradle.jvm.toolchain.useLegacyAdapters=false
|
||||
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15
|
||||
@@ -47,7 +47,7 @@ beta=false
|
||||
|
||||
org.gradle.caching=false
|
||||
# ??APT????
|
||||
kapt.incremental.apt=false
|
||||
kapt.incremental.apt=true
|
||||
|
||||
# 或者禁用特定模块的增量编译
|
||||
#org.gradle.configureondemand=false
|
||||
|
||||
@@ -704,6 +704,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
public void onEvent(XLHBean event) {
|
||||
LogUtils.e("收到XLH", event);
|
||||
if (event == null) return;
|
||||
if (event.getText()==null || event.getText().isEmpty()) return;
|
||||
if (SpUtil.getFloatingScreen() == 1) {
|
||||
synchronized (xlhQueueLock) {
|
||||
xlhMessageQueue.add(event);
|
||||
@@ -830,6 +831,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("播放红包音效失败", e);
|
||||
isRedPacketMediaPrepared=false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1017,6 +1019,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
Animation.ABSOLUTE, 0
|
||||
);
|
||||
enterAnim.setDuration(1500);
|
||||
enterAnim.setInterpolator(new DecelerateInterpolator(2.0f));
|
||||
enterAnim.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
@@ -1032,7 +1035,8 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
Animation.ABSOLUTE, 0,
|
||||
Animation.ABSOLUTE, 0
|
||||
);
|
||||
exitAnim.setDuration(2000);
|
||||
exitAnim.setDuration(3000);
|
||||
exitAnim.setInterpolator(new DecelerateInterpolator(2f));
|
||||
exitAnim.setAnimationListener(new Animation.AnimationListener() {
|
||||
@Override
|
||||
public void onAnimationStart(Animation animation) {
|
||||
@@ -1041,19 +1045,6 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
@Override
|
||||
public void onAnimationEnd(Animation animation) {
|
||||
// 移除视图并处理下一个
|
||||
// ViewGroup rootView = (ViewGroup) getParent();
|
||||
// if (rootView != null) {
|
||||
// rootView.removeView(QXGiftDriftView.this);
|
||||
// }
|
||||
//
|
||||
// if (!dataArray.isEmpty()) {
|
||||
// dataArray.remove(0);
|
||||
// }
|
||||
// isPlaying = false;
|
||||
//
|
||||
// if (!dataArray.isEmpty()) {
|
||||
// giftAction();
|
||||
// }
|
||||
onAnimationEnd.run();
|
||||
}
|
||||
|
||||
@@ -1062,7 +1053,7 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
}
|
||||
});
|
||||
view.startAnimation(exitAnim);
|
||||
}, 3000); // 停留1秒
|
||||
}, 5000); // 停留1秒
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1071,34 +1062,6 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
});
|
||||
view.startAnimation(enterAnim);
|
||||
|
||||
|
||||
// ObjectAnimator animator1 = ObjectAnimator.ofFloat(view, "translationX", view.getWidth(), 0f);
|
||||
// animator1.setDuration(1500);
|
||||
// animator1.setInterpolator(new DecelerateInterpolator(1f));
|
||||
// animator1.start();
|
||||
|
||||
// view.postDelayed(() -> {
|
||||
// try {
|
||||
// ObjectAnimator animator2 = ObjectAnimator.ofFloat(view, "translationX", 0f, -view.getWidth());
|
||||
// animator2.setDuration(3000);
|
||||
// animator2.setInterpolator(new DecelerateInterpolator(2.0f));
|
||||
// animator2.addListener(new AnimatorListenerAdapter() {
|
||||
// @Override
|
||||
// public void onAnimationEnd(Animator animation) {
|
||||
// onAnimationEnd.run();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onAnimationCancel(Animator animation) {
|
||||
// onAnimationEnd.run();
|
||||
// }
|
||||
// });
|
||||
// animator2.start();
|
||||
// } catch (Exception e) {
|
||||
// LogUtils.e("MQTT动画执行失败", e);
|
||||
// onAnimationEnd.run();
|
||||
// }
|
||||
// }, 3000);
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("MQTT动画启动失败", e);
|
||||
onAnimationEnd.run();
|
||||
|
||||
@@ -345,7 +345,7 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
case TRIM_MEMORY_RUNNING_CRITICAL:
|
||||
// 应用仍在运行,但系统已开始杀死后台进程
|
||||
LogUtils.d("Memory trim: critical");
|
||||
releaseAllNonEssentialResources();
|
||||
// releaseAllNonEssentialResources();
|
||||
break;
|
||||
case TRIM_MEMORY_UI_HIDDEN:
|
||||
// 应用UI已隐藏,可以释放UI相关资源
|
||||
@@ -377,9 +377,9 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
// Glide.get(this).clearMemory();
|
||||
|
||||
// 释放MQTT资源
|
||||
if (mqttConnect != null) {
|
||||
mqttConnect.close();
|
||||
}
|
||||
// if (mqttConnect != null) {
|
||||
// mqttConnect.close();
|
||||
// }
|
||||
|
||||
// 通知各个组件释放资源
|
||||
// EventBus.getDefault().post(new MemoryTrimEvent());
|
||||
@@ -450,8 +450,8 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
// startService(mqttServiceIntent);
|
||||
// }
|
||||
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.181.248","android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://62.234.12.147","android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.181.248","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://62.234.12.147","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect.mqttClient();
|
||||
|
||||
// 每次启动应用时重置状态
|
||||
@@ -526,6 +526,14 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
return null;
|
||||
}
|
||||
|
||||
public void upMqtt(){
|
||||
if (mqttConnect==null){
|
||||
mqttConnect=MqttConnect.getInstance(this,"tcp://1.13.181.248","android-"+ MqttClient.generateClientId());
|
||||
// mqttConnect=MqttConnect.getInstance(this,"tcp://62.234.12.147","android-"+ MqttClient.generateClientId());
|
||||
mqttConnect.mqttClient();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
MultiDex.install(this);
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.xscm.moduleutil.bean;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class MqttXlhEnd {
|
||||
public class MqttXlhEnd implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
private String message;
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ public class RoomMessageEvent {
|
||||
private String gift_num;
|
||||
|
||||
private RedPacketInfo redpacketInfo;
|
||||
private String redpacket_id;
|
||||
}
|
||||
|
||||
@Data
|
||||
|
||||
@@ -65,6 +65,7 @@ public class UserInfo implements Serializable {
|
||||
private int heartId; // "heartId": 4,
|
||||
private int heartNum; //
|
||||
private String red_num;
|
||||
private String ta;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xscm.moduleutil.bean;
|
||||
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -15,5 +16,11 @@ public class XLHBean implements Serializable {
|
||||
private String text;
|
||||
private String room_id;
|
||||
|
||||
private int from_type ;
|
||||
private int from_type ;//100:巡乐会进度更新 101:巡乐会即将开始 102:巡乐会已经开始 103:巡乐会有人锁定了礼物 104:巡乐会结束落包
|
||||
private BlindBoxBean.XlhData xlh_data;
|
||||
private UserInfo FromUserInfo;
|
||||
private String end_time;
|
||||
private BlindBoxBean.xlhUser room_user;
|
||||
private String gift_num;
|
||||
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ public class EMMessageInfo implements MultiItemEntity {
|
||||
public static final int QXRoomMessageTypeQingGRMl = 1059;
|
||||
//有红包列表
|
||||
public static final int QXRoomMessageTypeQXRoomMessageRed = 1060;
|
||||
public static final int QXRoomMessageTypeQXRoomMessageRedRemove = 1061;
|
||||
|
||||
///房间内换麦
|
||||
public static final int QXRoomMessageTypehm = 1039;
|
||||
|
||||
@@ -22,6 +22,7 @@ public class RoomHourBean {
|
||||
private int total_price;
|
||||
private String label_icon;
|
||||
private int xlh_status;
|
||||
private int redpacket_status;// >0 有红包,=0 没有红包
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public class GiftItemAdapter extends BaseQuickAdapter<XlhDrawBean, BaseViewHolde
|
||||
|
||||
helper.setText(R.id.tv_gift_name, item.getGift_name()+"x"+item.getCount());
|
||||
ImageUtils.loadHeadCC(item.getBase_image(),helper.getView(R.id.gift_img));
|
||||
helper.setText(R.id.tv_gift_num, item.getGift_price());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,10 +583,13 @@ public class GiftLotteryDialog extends BaseMvpDialogFragment<GiftLotteryPresente
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageReceived(MqttXlhEnd event) {
|
||||
XLHBean xlhBean = GsonUtils.fromJson(event.getMessage(), XLHBean.class);
|
||||
// if (xlhBean.getFrom_type()==3) {
|
||||
// dismiss();
|
||||
// }
|
||||
// BlindBoxBean.XlhData xlhData =new BlindBoxBean.XlhData();
|
||||
if (xlhBean.getFrom_type()==100 || xlhBean.getFrom_type()==101 || xlhBean.getFrom_type()==102){
|
||||
UpView(xlhBean.getXlh_data());
|
||||
}else if (xlhBean.getFrom_type()==104){
|
||||
xlhData.setCurrent_num(0);
|
||||
xlhData.setStatus(0);
|
||||
UpView(xlhData);
|
||||
}
|
||||
if (xlhBean.getFrom_type() == 3) {
|
||||
xlhData.setCurrent_num(0);
|
||||
xlhData.setStatus(0);
|
||||
|
||||
@@ -183,7 +183,7 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
}
|
||||
});
|
||||
mBinding.tvNumber.setText("x0");
|
||||
mBinding.tvNumber.setTypeface(android.graphics.Typeface.create("sans-serif-condensed", Typeface.BOLD));
|
||||
mBinding.tvNumber.setTypeface(android.graphics.Typeface.create("semibold", Typeface.NORMAL));
|
||||
}
|
||||
|
||||
// 添加自动滚动相关的方法
|
||||
@@ -433,9 +433,26 @@ public class TourClubDialogFragment extends BaseMvpDialogFragment<GiftLotteryPre
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageReceived(MqttXlhEnd event) {
|
||||
XLHBean xlhBean = GsonUtils.fromJson(event.getMessage(), XLHBean.class);
|
||||
if (xlhBean.getFrom_type()==103){
|
||||
endTime = Long.parseLong(xlhBean.getEnd_time() != null ? xlhBean.getEnd_time() : "0");
|
||||
BlindBoxBean.xlhUser xlhUser = new BlindBoxBean.xlhUser();
|
||||
xlhUser.setAvatar(xlhBean.getFromUserInfo().getAvatar());
|
||||
xlhUser.setNickname(xlhBean.getFromUserInfo().getNickname());
|
||||
mBinding.gvXyz.setModel(xlhUser);
|
||||
mBinding.qxDjs.setEndTime(endTime);
|
||||
mBinding.tvNumber.setText("x"+(xlhBean.getGift_num() != null ? xlhBean.getGift_num() : "0"));
|
||||
isDrawing=false;
|
||||
if (xlhBean.getRoom_user()!=null){
|
||||
mBinding.gvFz.setModel(xlhBean.getRoom_user());
|
||||
}
|
||||
mBinding.gvFz.setIsLuckUser(false);
|
||||
}else if (xlhBean.getFrom_type()==104){
|
||||
dismiss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动倒计时
|
||||
*/
|
||||
|
||||
@@ -8,6 +8,7 @@ import android.util.Log;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.blankj.utilcode.util.LogUtils;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.xscm.moduleutil.bean.MqttXlhEnd;
|
||||
@@ -30,11 +31,13 @@ public class MqttInitCallback implements MqttCallback {
|
||||
private String clientId = "";
|
||||
private MqttConnect mqttConnect = null;
|
||||
private Context context = null;
|
||||
|
||||
MqttInitCallback(Context context, String host, String clientId) {
|
||||
this.context = context;
|
||||
this.HOST = host;
|
||||
this.clientId = clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接丢失
|
||||
*/
|
||||
@@ -139,6 +142,7 @@ public class MqttInitCallback implements MqttCallback {
|
||||
Log.e("MQTT", "解析MQTT消息异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
// 处理集合数据
|
||||
private void processDataList(List<HourlyBean> dataList) {
|
||||
// 遍历集合并发送每个元素
|
||||
@@ -149,6 +153,7 @@ public class MqttInitCallback implements MqttCallback {
|
||||
// 或者发送整个集合
|
||||
EventBus.getDefault().post(dataList);
|
||||
}
|
||||
|
||||
// 判断是否为 JSON 数组
|
||||
private boolean isJsonArray(String jsonString) {
|
||||
try {
|
||||
@@ -157,6 +162,7 @@ public class MqttInitCallback implements MqttCallback {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private void receiveMessage(String topic, String data) {
|
||||
try {
|
||||
JSONObject jsonObject = JSON.parseObject(data);
|
||||
@@ -179,16 +185,19 @@ public class MqttInitCallback implements MqttCallback {
|
||||
new RoomGiftRunable(message).run();
|
||||
break;
|
||||
case 8000:
|
||||
XLHBean xlhBean= GsonUtils.fromJson(message, XLHBean.class);
|
||||
if (xlhBean!=null && xlhBean.getRoom_id()!=null && SpUtil.getMyRoomId()!=null) {
|
||||
if (xlhBean.getRoom_id().equals(SpUtil.getMyRoomId())) {
|
||||
if (xlhBean.getFrom_type()==3) {
|
||||
// XLHBean xlhBean= GsonUtils.fromJson(message, XLHBean.class);
|
||||
// if (xlhBean!=null && xlhBean.getRoom_id()!=null && SpUtil.getMyRoomId()!=null) {
|
||||
// if (xlhBean.getRoom_id().equals(SpUtil.getMyRoomId())) {
|
||||
// if (xlhBean.getFrom_type()==3) {
|
||||
LogUtils.e("MQTT", "收到消息" + message);
|
||||
|
||||
MqttXlhEnd mqttXlhEnd = new MqttXlhEnd();
|
||||
mqttXlhEnd.setMessage(message);
|
||||
EventBus.getDefault().post(mqttXlhEnd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -211,6 +220,7 @@ public class MqttInitCallback implements MqttCallback {
|
||||
// ToastUtils.show("收到轮盘飘屏,解析异常");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* publish发布成功后会执行到这里
|
||||
*/
|
||||
|
||||
@@ -7,10 +7,7 @@ import com.xscm.moduleutil.bean.RedPacketInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
@@ -42,6 +39,11 @@ public class QXRedPacketManager {
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
public List<RedPacketInfo> getSortedUserListLambda(Map<String, RedPacketInfo> userMap) {
|
||||
List<RedPacketInfo> redPacketInfoList = new ArrayList<>(userMap.values());
|
||||
redPacketInfoList.sort((user1, user2) -> Long.compare(user1.getStart_time(), user2.getStart_time()));
|
||||
return redPacketInfoList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加红包列表
|
||||
@@ -102,7 +104,7 @@ public class QXRedPacketManager {
|
||||
* @return 红包列表
|
||||
*/
|
||||
public List<RedPacketInfo> getAllRedPackets() {
|
||||
return new ArrayList<>(this.redPackets.values());
|
||||
return getSortedUserListLambda(redPackets);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,7 +146,7 @@ public class QXRedPacketManager {
|
||||
if (this.redPackets == null || this.redPackets.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<RedPacketInfo> packets = new ArrayList<>(this.redPackets.values());
|
||||
List<RedPacketInfo> packets = getAllRedPackets();
|
||||
|
||||
for (RedPacketInfo packet : packets) {
|
||||
long packetTime = packet.remainingTime();
|
||||
@@ -180,9 +182,13 @@ public class QXRedPacketManager {
|
||||
}
|
||||
}
|
||||
|
||||
// 继续执行定时任务
|
||||
// 修复:增加空值检查避免 NullPointerException
|
||||
if (checkTimerHandler != null && checkTimerRunnable != null) {
|
||||
// 继续执行定时任务
|
||||
checkTimerHandler.postDelayed(checkTimerRunnable, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 移除所有红包
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
package com.xscm.moduleutil.utils
|
||||
|
||||
import android.app.ActivityManager
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Shader
|
||||
import android.text.TextUtils
|
||||
import android.util.Base64
|
||||
import android.widget.TextView
|
||||
import com.blankj.utilcode.util.LogUtils
|
||||
import com.tencent.qcloud.tuikit.timcommon.BuildConfig
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.FileInputStream
|
||||
import java.io.FileNotFoundException
|
||||
import java.io.IOException
|
||||
import java.lang.reflect.ParameterizedType
|
||||
|
||||
|
||||
fun setGradient(textView: TextView) {
|
||||
val endX = textView.paint.textSize * textView.text.length
|
||||
val colors = intArrayOf(
|
||||
Color.parseColor("#4E67F1"),
|
||||
Color.parseColor("#AA88F8")
|
||||
) //颜色的数组
|
||||
val position = floatArrayOf(0f, 1.0f) //颜色渐变位置的数组
|
||||
val linearGradient =
|
||||
LinearGradient(0f, 0f, endX, 0f, colors, position, Shader.TileMode.CLAMP)
|
||||
textView.paint.shader = linearGradient
|
||||
textView.invalidate()
|
||||
}
|
||||
|
||||
/**
|
||||
* service是否正在运行
|
||||
* @param context
|
||||
* @param className
|
||||
* @return
|
||||
*/
|
||||
fun isServiceExisted(context: Context, className: String): Boolean {
|
||||
val activityManager = context
|
||||
.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager
|
||||
val serviceList = activityManager
|
||||
.getRunningServices(Int.MAX_VALUE)
|
||||
if (serviceList.size <= 0) {
|
||||
return false
|
||||
}
|
||||
for (i in serviceList.indices) {
|
||||
val serviceInfo = serviceList[i]
|
||||
val serviceName = serviceInfo.service
|
||||
val name = serviceName.className
|
||||
if (name == className) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
fun String.showToast() {
|
||||
if (!TextUtils.isEmpty(this)) {
|
||||
// ToastUtils.showShort(this)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun String.log() {
|
||||
if (!TextUtils.isEmpty(this)) {
|
||||
if (BuildConfig.DEBUG)
|
||||
LogUtils.dTag("midinLog", this)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun String.log2() {
|
||||
if (!TextUtils.isEmpty(this)) {
|
||||
if (BuildConfig.DEBUG)
|
||||
LogUtils.dTag("midi2", this)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机分辨率从DP转成PX
|
||||
*
|
||||
* @param context
|
||||
* @param dpValue
|
||||
* @return
|
||||
*/
|
||||
fun dip2px(context: Context, dpValue: Float): Int {
|
||||
val scale = context.resources.displayMetrics.density
|
||||
return (dpValue * scale + 0.5f).toInt()
|
||||
}
|
||||
|
||||
fun <T> getClass(t: Any): Class<T> {
|
||||
// 通过反射 获取父类泛型 (T) 对应 Class类
|
||||
return (t.javaClass.genericSuperclass as ParameterizedType)
|
||||
.actualTypeArguments[0]
|
||||
as Class<T>
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 文件转Base64.
|
||||
*
|
||||
* @param filePath
|
||||
* @return
|
||||
*/
|
||||
fun file2Base64(filePath: String): String {
|
||||
var objFileIS: FileInputStream? = null
|
||||
try {
|
||||
objFileIS = FileInputStream(filePath)
|
||||
} catch (e: FileNotFoundException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
val objByteArrayOS = ByteArrayOutputStream()
|
||||
val byteBufferString = ByteArray(1024)
|
||||
try {
|
||||
var readNum: Int
|
||||
while (objFileIS!!.read(byteBufferString).also { readNum = it } != -1) {
|
||||
objByteArrayOS.write(byteBufferString, 0, readNum)
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
return Base64.encodeToString(objByteArrayOS.toByteArray(), Base64.DEFAULT)
|
||||
}
|
||||
|
||||
|
||||
@@ -51,11 +51,11 @@ public class EnvironmentPrefs {
|
||||
// }
|
||||
|
||||
// 默认使用生产环境
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.TEST.name());
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.PRODUCTION.name());
|
||||
try {
|
||||
return EnvironmentEnum.valueOf(envName);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return EnvironmentEnum.TEST; // 出错时默认返回生产环境
|
||||
return EnvironmentEnum.PRODUCTION; // 出错时默认返回生产环境
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class QXMeetGiftView extends RelativeLayout {
|
||||
giftImageView = new ImageView(context);
|
||||
giftImageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
|
||||
LayoutParams giftImageParams = new LayoutParams(
|
||||
dpToPx(62), // 固定宽度
|
||||
dpToPx(48), // 固定宽度
|
||||
dpToPx(62) // 固定高度
|
||||
);
|
||||
giftImageParams.addRule(CENTER_IN_PARENT);
|
||||
@@ -146,8 +146,8 @@ public class QXMeetGiftView extends RelativeLayout {
|
||||
if (isLockGift) {
|
||||
// 重新设置礼物图片的约束
|
||||
LayoutParams params = (LayoutParams) giftImageView.getLayoutParams();
|
||||
params.width = dpToPx(62);
|
||||
params.height = dpToPx(62);
|
||||
params.width = dpToPx(36);
|
||||
params.height = dpToPx(36);
|
||||
params.addRule(CENTER_IN_PARENT);
|
||||
params.setMargins(0, 0, 0, 0);
|
||||
giftImageView.setLayoutParams(params);
|
||||
|
||||
@@ -100,6 +100,7 @@ public class QXTimeDownView extends FrameLayout {
|
||||
bigTimeLabel.setTextColor(0xFFFFECA7);
|
||||
bigTimeLabel.setGravity(Gravity.CENTER);
|
||||
bigTimeLabel.setVisibility(View.GONE);
|
||||
bigTimeLabel.setTypeface(Typeface.create("semibold", Typeface.NORMAL));
|
||||
LayoutParams bigTimeParams = new LayoutParams(
|
||||
LayoutParams.WRAP_CONTENT,
|
||||
LayoutParams.WRAP_CONTENT
|
||||
|
||||
@@ -1,122 +0,0 @@
|
||||
package com.xscm.moduleutil.widget
|
||||
|
||||
|
||||
import android.graphics.SurfaceTexture
|
||||
import android.opengl.GLES20
|
||||
import android.opengl.Matrix
|
||||
|
||||
class ChannelSplitRenderer {
|
||||
|
||||
private val vertexShaderCode = """
|
||||
attribute vec4 aPosition;
|
||||
attribute vec2 aTexCoord;
|
||||
varying vec2 vTexCoord;
|
||||
void main() {
|
||||
gl_Position = aPosition;
|
||||
vTexCoord = aTexCoord;
|
||||
}
|
||||
"""
|
||||
|
||||
private val fragmentShaderCode = """
|
||||
precision mediump float;
|
||||
uniform sampler2D uTexture;
|
||||
varying vec2 vTexCoord;
|
||||
void main() {
|
||||
// 只使用左半部分作为最终颜色
|
||||
vec2 leftCoord = vec2(vTexCoord.x * 0.5, vTexCoord.y);
|
||||
vec4 color = texture2D(uTexture, leftCoord);
|
||||
|
||||
// 设置 alpha 为 1.0 表示完全不透明,或根据需求设为 0.0 表示全透明
|
||||
gl_FragColor = vec4(color.rgb, 0.0); // 左通道颜色 + 不透明
|
||||
}"""
|
||||
|
||||
private var program = 0
|
||||
private var positionHandle = 0
|
||||
private var texCoordHandle = 0
|
||||
private var textureHandle = 0
|
||||
private val projectionMatrix = FloatArray(16)
|
||||
private val modelMatrix = FloatArray(16)
|
||||
|
||||
fun onSurfaceCreated(surface: SurfaceTexture, width: Int, height: Int) {
|
||||
// 初始化着色器
|
||||
val vertexShader = ShaderUtils.loadShader(GLES20.GL_VERTEX_SHADER, vertexShaderCode)
|
||||
val fragmentShader = ShaderUtils.loadShader(GLES20.GL_FRAGMENT_SHADER, fragmentShaderCode)
|
||||
|
||||
program = GLES20.glCreateProgram().also {
|
||||
GLES20.glAttachShader(it, vertexShader)
|
||||
GLES20.glAttachShader(it, fragmentShader)
|
||||
GLES20.glLinkProgram(it)
|
||||
}
|
||||
|
||||
positionHandle = GLES20.glGetAttribLocation(program, "aPosition")
|
||||
texCoordHandle = GLES20.glGetAttribLocation(program, "aTexCoord")
|
||||
textureHandle = GLES20.glGetUniformLocation(program, "uTexture")
|
||||
|
||||
// 初始化矩阵
|
||||
Matrix.setIdentityM(projectionMatrix, 0)
|
||||
Matrix.setIdentityM(modelMatrix, 0)
|
||||
|
||||
GLES20.glClearColor(0.0f, 0.0f, 0.0f, 0.0f)
|
||||
GLES20.glEnable(GLES20.GL_BLEND)
|
||||
GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA)
|
||||
}
|
||||
|
||||
fun onSurfaceChanged(width: Int, height: Int) {
|
||||
GLES20.glViewport(0, 0, width, height)
|
||||
}
|
||||
|
||||
fun onDrawFrame(textureId: Int) {
|
||||
GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT)
|
||||
GLES20.glUseProgram(program)
|
||||
|
||||
// 定义顶点坐标(全屏)
|
||||
val vertices = floatArrayOf(
|
||||
-1.0f, -1.0f, 0.0f,
|
||||
1.0f, -1.0f, 0.0f,
|
||||
-1.0f, 1.0f, 0.0f,
|
||||
1.0f, 1.0f, 0.0f
|
||||
)
|
||||
|
||||
// 修改纹理坐标,只映射左半部分视频内容到左侧屏幕
|
||||
val texCoords = floatArrayOf(
|
||||
0.0f, 1.0f, // 左下角
|
||||
0.5f, 1.0f, // 右下角(对应视频中间)
|
||||
0.0f, 0.0f, // 左上角
|
||||
0.5f, 0.0f // 右上角
|
||||
)
|
||||
|
||||
val vertexBuffer = ShaderUtils.createFloatBuffer(vertices)
|
||||
val texBuffer = ShaderUtils.createFloatBuffer(texCoords)
|
||||
|
||||
GLES20.glEnableVertexAttribArray(positionHandle)
|
||||
GLES20.glVertexAttribPointer(
|
||||
positionHandle, 3,
|
||||
GLES20.GL_FLOAT, false,
|
||||
0, vertexBuffer
|
||||
)
|
||||
|
||||
GLES20.glEnableVertexAttribArray(texCoordHandle)
|
||||
GLES20.glVertexAttribPointer(
|
||||
texCoordHandle, 2,
|
||||
GLES20.GL_FLOAT, false,
|
||||
0, texBuffer
|
||||
)
|
||||
|
||||
// 绑定纹理
|
||||
GLES20.glActiveTexture(GLES20.GL_TEXTURE0)
|
||||
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId)
|
||||
GLES20.glUniform1i(textureHandle, 0)
|
||||
|
||||
// 绘制
|
||||
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4)
|
||||
|
||||
// 清理
|
||||
GLES20.glDisableVertexAttribArray(positionHandle)
|
||||
GLES20.glDisableVertexAttribArray(texCoordHandle)
|
||||
}
|
||||
|
||||
|
||||
fun release() {
|
||||
GLES20.glDeleteProgram(program)
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.xscm.moduleutil.widget.room
|
||||
|
||||
import androidx.lifecycle.LifecycleObserver
|
||||
import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.Observer
|
||||
import androidx.lifecycle.ViewModel
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp
|
||||
import com.xscm.moduleutil.http.RetrofitClient
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
|
||||
open class BaseViewModel : ViewModel(),LifecycleObserver {
|
||||
|
||||
val roomInfoData=MutableLiveData<RoomInfoResp>()
|
||||
private val passRoom by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val error by lazy { MutableLiveData<Exception>() }
|
||||
|
||||
private val finally by lazy { MutableLiveData<Int>() }
|
||||
//加入房间
|
||||
fun jiaoRoom(roomId:String, password:String){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求失败,出现异常
|
||||
*/
|
||||
fun getError(): LiveData<Exception> {
|
||||
return error
|
||||
}
|
||||
|
||||
/**
|
||||
* 请求完成,在此处做一些关闭操作
|
||||
*/
|
||||
fun getFinally(): LiveData<Int> {
|
||||
return finally
|
||||
}
|
||||
}
|
||||
6
moduleUtil/src/main/res/drawable/bg_xlh_huod_bj.xml
Normal file
6
moduleUtil/src/main/res/drawable/bg_xlh_huod_bj.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape android:shape="rectangle"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#D7961F" android:centerColor="#ffd7961f" android:endColor="#D7961F" android:angle="270" />
|
||||
<corners android:topLeftRadius="0dp" android:topRightRadius="0dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
|
||||
</shape>
|
||||
@@ -10,7 +10,7 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/color_transparent">
|
||||
android:background="#40000000">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/xlh_close"
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_t"
|
||||
android:layout_width="@dimen/dp_276"
|
||||
android:layout_width="@dimen/dp_331"
|
||||
android:layout_height="@dimen/dp_365"
|
||||
android:background="@mipmap/xlh_ob"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -138,11 +138,11 @@
|
||||
|
||||
android:id="@+id/gv_fzlw"
|
||||
android:layout_width="@dimen/dp_48"
|
||||
android:layout_height="@dimen/dp_76"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_zyx"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
app:layout_constraintTop_toTopOf="@+id/gv_fz"
|
||||
android:translationY="@dimen/dp_78"
|
||||
android:translationY="@dimen/dp_86"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -156,7 +156,8 @@
|
||||
app:layout_constraintTop_toTopOf="@+id/gv_sdlw"
|
||||
android:translationY="@dimen/dp_68"
|
||||
android:textSize="@dimen/dp_28"
|
||||
android:textColor="#FFBB00"
|
||||
android:textColor="#FFECA7"
|
||||
android:fontFamily="@font/semibold"
|
||||
tools:text="1"
|
||||
/>
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_l"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="@dimen/dp_80"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
android:background="@mipmap/xlh_hd"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
@@ -26,6 +26,16 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/gift_l"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:background="@drawable/rd_btn_new_p">
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -39,4 +49,19 @@
|
||||
app:layout_constraintEnd_toEndOf="@+id/gift_l"
|
||||
tools:text="请选择礼物"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_gift_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_14"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:textColor="#fff"
|
||||
android:drawableLeft="@mipmap/jinb"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:textSize="@dimen/sp_10"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_gift_name"
|
||||
app:layout_constraintStart_toStartOf="@+id/gift_l"
|
||||
app:layout_constraintEnd_toEndOf="@+id/gift_l"
|
||||
tools:text="请选"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 49 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_bj_h.webp
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/red_bj_h.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xr_ykj.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xr_ykj.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xr_ykj_xz.png
Normal file
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/xr_ykj_xz.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -531,7 +531,7 @@ public class MainActivity extends BaseMvpActivity<HomePresenter, ActivityMainBin
|
||||
//// RoomManager.instance( CommonAppContext.getInstance()).joinRoomWithRoomId(CommonAppContext.getInstance().playId, true);
|
||||
// return;
|
||||
// }
|
||||
|
||||
CommonAppContext.getInstance().upMqtt();
|
||||
MvpPre.loginIm();
|
||||
Logger.i("MainActivity", "onResume");
|
||||
// Beta.checkAppUpgrade(false, false);
|
||||
|
||||
@@ -92,6 +92,10 @@ public class RedResultActivity extends BaseMvpActivity<RedEnvelopesPresenter, Fr
|
||||
|
||||
@Override
|
||||
public void redPacketDetail(RedpacketDetail redpacketDetail) {
|
||||
// 检查 Activity 是否已经销毁
|
||||
if (isFinishing() || isDestroyed()) {
|
||||
return;
|
||||
}
|
||||
if (redpacketDetail != null) {
|
||||
ImageUtils.loadHeadCC(redpacketDetail.getRedpacket_info().getAvatar(), mBinding.userAvatar);
|
||||
mBinding.userName.setText(redpacketDetail.getRedpacket_info().getNickname());
|
||||
@@ -100,7 +104,7 @@ public class RedResultActivity extends BaseMvpActivity<RedEnvelopesPresenter, Fr
|
||||
if (redpacketDetail.getMy_record() != null) {
|
||||
mBinding.tvRedJb.setText(redpacketDetail.getMy_record().getAmount());
|
||||
}
|
||||
mBinding.tvLq.setText(redpacketDetail.getRecords().size() + "/" + redpacketDetail.getRedpacket_info().getTotal_count());
|
||||
mBinding.tvLq.setText("已领取"+redpacketDetail.getRecords().size() + "/" + redpacketDetail.getRedpacket_info().getTotal_count());
|
||||
redAdapter.setNewData(redpacketDetail.getRecords());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ import com.xscm.moduleutil.rtc.AgoraManager
|
||||
import com.xscm.moduleutil.rtc.MusicPlayBean
|
||||
import com.xscm.moduleutil.service.MyRoomSingleton
|
||||
import com.xscm.moduleutil.utils.*
|
||||
import com.xscm.moduleutil.view.QXRedBagSendView
|
||||
import com.xscm.moduleutil.widget.*
|
||||
import com.xscm.moduleutil.widget.ViewUtils.OnViewCreatedListener
|
||||
import com.xscm.moduleutil.widget.floatingView.Floa
|
||||
@@ -906,6 +905,20 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
mBinding!!.drvRed.visibility = View.GONE
|
||||
mBinding!!.redBj.setOnClickListener {
|
||||
if(qxRedPacketManager!!.getAllRedPackets().size==1){
|
||||
redPacketInfo = qxRedPacketManager!!.getAllRedPackets().get(0)
|
||||
if (qxRedPacketManager!!.getAllRedPackets().get(0)!=null && qxRedPacketManager!!.getAllRedPackets().get(0).is_qiang==1){
|
||||
ARouter.getInstance().build(ARouteConstants.ROOM_RED_RESULT).withString("redpacketId", qxRedPacketManager!!.getAllRedPackets().get(0).getRedpacket_id()).navigation();
|
||||
}else {
|
||||
redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity)
|
||||
redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1)
|
||||
redEnvelopesFragment!!.setFromToComment(false)
|
||||
redEnvelopesFragment!!.setRedPacket(qxRedPacketManager!!.getAllRedPackets().get(0))
|
||||
redEnvelopesFragment!!.show()
|
||||
}
|
||||
return@setOnClickListener
|
||||
}
|
||||
|
||||
redListDialog = RedListDialog(this)
|
||||
redListDialog!!.setOnRedPacketClickListener(object : RedListDialog.OnRedPacketClickListener {
|
||||
|
||||
@@ -1541,9 +1554,38 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
|
||||
} else if (msgType == 1060) {
|
||||
qxRedPacketManager!!.addRedPacket(messageEvent.text.redpacketInfo)
|
||||
}else if (msgType == 1061){
|
||||
qxRedPacketManager!!.removeRedPacket(messageEvent.text.redpacket_id)
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun onMessageEvent(messageEvent: MqttXlhEnd) {
|
||||
val xlhBean: XLHBean = GsonUtils.fromJson<XLHBean>(messageEvent.message, XLHBean::class.java)
|
||||
if(xlhBean.from_type==100){
|
||||
if (xlhBean.xlh_data != null) {
|
||||
if (xlhBean.xlh_data.status == 1) {
|
||||
mBinding!!.xlhRk.visibility = View.VISIBLE
|
||||
xlhDjs(xlhBean.xlh_data.end_time)
|
||||
} else {
|
||||
mBinding!!.xlhRk.visibility = View.INVISIBLE
|
||||
releaseCountDownTimer1()
|
||||
}
|
||||
}
|
||||
}else if(xlhBean.from_type==103){
|
||||
val existingFragment =
|
||||
supportFragmentManager.findFragmentByTag("TourClubDialogFragment") as TourClubDialogFragment?
|
||||
if (existingFragment != null && existingFragment.isVisible) {
|
||||
existingFragment.onMessageReceived(messageEvent)
|
||||
} else {
|
||||
LogUtils.e("TourClubDialogFragment", "巡乐会界面未打开")
|
||||
// EventBus.getDefault().post(messageEvent)
|
||||
}
|
||||
xlhDjs(xlhBean.end_time)
|
||||
}else if(xlhBean.from_type==104){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private var endTime: Long = 0
|
||||
|
||||
@@ -2609,7 +2651,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
// mBinding.inputMenu1.bringToFront(); // 强制将该 View 置于最上层
|
||||
// mBinding.inputMenu1.show();
|
||||
|
||||
dialogDismiss()
|
||||
dialogDismiss(1)
|
||||
}
|
||||
} else if (id == R.id.rl_mic) {
|
||||
if (mRoomInfoResp!!.user_info.is_mute_pit != null && mRoomInfoResp!!.user_info.is_mute_pit == "1") {
|
||||
@@ -3100,7 +3142,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
@SuppressLint("MissingInflatedId")
|
||||
fun dialogDismiss() {
|
||||
fun dialogDismiss(type:Int) {
|
||||
// // 使用 AlertDialog.Builder
|
||||
|
||||
val builder = AlertDialog.Builder(this)
|
||||
@@ -3152,6 +3194,14 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
etContent.setText("")
|
||||
countDownTimer()
|
||||
if(type==2) {
|
||||
if (redPacketInfo != null){
|
||||
LogUtils.e("输入口令红包",redPacketInfo)
|
||||
LogUtils.e("输入口令红包","# 口令红包 "+redPacketInfo!!.password,"inputSting",inputSting)
|
||||
if (intRed_num==null || intRed_num!!.isEmpty()){
|
||||
return@OnClickListener
|
||||
}
|
||||
if (inputSting!!.toString() == intRed_num.toString()){
|
||||
if (redEnvelopesFragment != null) {
|
||||
redEnvelopesFragment = RedEnvelopesFragment(this@RoomActivity)
|
||||
redEnvelopesFragment!!.setIsCollectedRoom(mRoomUserBean!!.is_collect == 1)
|
||||
@@ -3159,6 +3209,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
redEnvelopesFragment!!.setRedPacket(redPacketInfo)
|
||||
redEnvelopesFragment!!.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
inputSting = ""
|
||||
dialog.dismiss()
|
||||
})
|
||||
|
||||
@@ -3171,9 +3225,15 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (inputSting != null) {
|
||||
etContent.setText(inputSting)
|
||||
}
|
||||
// 监听对话框关闭事件
|
||||
dialog.setOnDismissListener {
|
||||
// 对话框关闭时执行的代码
|
||||
inputSting=""
|
||||
LogUtils.e("AlertDialog已关闭")
|
||||
}
|
||||
dialog.show()
|
||||
addActiveDialog(dialog) // 添加到管理列表
|
||||
inputSting = ""
|
||||
|
||||
}
|
||||
|
||||
private fun countDownTimer() {
|
||||
@@ -3198,15 +3258,20 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
}
|
||||
|
||||
var inputSting: String? = null
|
||||
var intRed_num: String? = null
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
fun roomInfoEvent(messageEvent: UserInfo) {
|
||||
if (messageEvent != null && messageEvent.red_num != null) {
|
||||
inputSting = messageEvent.red_num
|
||||
} else {
|
||||
inputSting ="# 口令红包 "+ messageEvent.red_num
|
||||
intRed_num=inputSting
|
||||
dialogDismiss(2)
|
||||
} else if (messageEvent!=null && messageEvent.ta != null){
|
||||
intRed_num=""
|
||||
inputSting = "@" + messageEvent.nickname
|
||||
dialogDismiss(1)
|
||||
}
|
||||
dialogDismiss()
|
||||
|
||||
}
|
||||
|
||||
override fun getLayoutId(): Int {
|
||||
@@ -3683,44 +3748,10 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
MvpPre!!.postRoomInfo(CommonAppContext.getInstance().playId)
|
||||
}
|
||||
|
||||
// // 正常启动或从后台恢复
|
||||
// if (isInBackground) {
|
||||
// isInBackground = false;
|
||||
// // 从后台回到前台时调用
|
||||
// if (MvpPre != null && roomId != null) {
|
||||
// if (mRoomInfoResp != null && mRoomInfoResp.getRoom_info() != null) {
|
||||
// if (mRoomInfoResp.getRoom_info().getType_id().equals("1")
|
||||
// || mRoomInfoResp.getRoom_info().getType_id().equals("3") ||
|
||||
// mRoomInfoResp.getRoom_info().getType_id().equals("4")||
|
||||
// mRoomInfoResp.getRoom_info().getType_id().equals("8")) {
|
||||
// if (mRoomInfoResp.getRoom_info().getLabel_id().equals("2")) {
|
||||
//
|
||||
// } else {
|
||||
// MvpPre.postRoomInfo(roomId);
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// MvpPre.postRoomInfo(roomId);
|
||||
// }
|
||||
// } else {
|
||||
// ToastUtils.showLong("您已经掉线,需要重新进入房间!");
|
||||
// ARouter.getInstance().build(ARouteConstants.ME)
|
||||
// .navigation();
|
||||
// cleanupResources();
|
||||
// finish();
|
||||
// }
|
||||
// }
|
||||
// if (appStateListener != null && appStateListener.isAppInBackground()) {
|
||||
// MvpPre.postRoomInfo(roomId);
|
||||
// }
|
||||
|
||||
|
||||
// 检查是否从最小化状态恢复
|
||||
if (isMinimized) {
|
||||
isMinimized = false
|
||||
clearMinimizeState()
|
||||
|
||||
|
||||
// 恢复房间状态
|
||||
resumeRoomState()
|
||||
setupEffectView()
|
||||
@@ -4207,7 +4238,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
cleanupResources()
|
||||
}
|
||||
if (qxRedPacketManager != null) {
|
||||
qxRedPacketManager!!.endCheckTimer();
|
||||
qxRedPacketManager!!.destroyRedpacketInfo()
|
||||
}
|
||||
// 确保父类的 onDestroy 被调用
|
||||
super.onDestroy()
|
||||
@@ -4554,6 +4585,7 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
// 处理移除红包的逻辑
|
||||
if (remainingCount == 0) {
|
||||
mBinding!!.drvRed.visibility = View.GONE
|
||||
qxRedPacketManager!!.removeAllRedPackets()
|
||||
} else {
|
||||
mBinding!!.drvRed.visibility = View.VISIBLE
|
||||
}
|
||||
@@ -4583,25 +4615,33 @@ class RoomActivity : BaseMvpActivity<RoomPresenter?, ActivityRoomBinding?>(),
|
||||
if (redEnvelopesFragment!!.mRedPacketInfo.conditions.contains("1")) {
|
||||
//有收藏房间条件
|
||||
if (mRoomInfoResp!!.user_info.is_collect == 1) {
|
||||
if(packet!!.redpacket_id==redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) {
|
||||
//需要满足收藏在倒计时
|
||||
redEnvelopesFragment!!.setNeedTime(packetTime)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(packet!!.redpacket_id==redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) {
|
||||
redEnvelopesFragment!!.setNeedTime(packetTime)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (redEnvelopesFragment!!.isFromToComment) {
|
||||
if (redEnvelopesFragment!!.mRedPacketInfo.conditions.contains("1")) {
|
||||
//有收藏房间条件
|
||||
if (mRoomInfoResp!!.user_info.is_collect == 1) {
|
||||
if(packet!!.redpacket_id==redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) {
|
||||
redEnvelopesFragment!!.setNeedTime(packetTime)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(packet!!.redpacket_id==redEnvelopesFragment!!.mRedPacketInfo.redpacket_id) {
|
||||
redEnvelopesFragment!!.setNeedTime(packetTime)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (redListDialog != null) {
|
||||
if (redListDialog!!.isShowing && redListDialog!!.adapter != null) {
|
||||
val adapter = redListDialog!!.adapter
|
||||
|
||||
@@ -29,8 +29,7 @@ public class RedBagAdapter extends BaseQuickAdapter<RedPacketInfo, BaseViewHolde
|
||||
ImageView iv_red_bag= helper.getView(R.id.iv_red_bag);
|
||||
if (item.getIs_qiang()==1){
|
||||
iv_red_bag.setImageResource(com.xscm.moduleutil.R.mipmap.red_bj_h);
|
||||
helper.setVisible(R.id.tv_user_name,false);
|
||||
helper.setVisible(R.id.tv_djs,false);
|
||||
helper.setText(R.id.tv_djs, "已领取");
|
||||
}else {
|
||||
iv_red_bag.setImageResource(com.xscm.moduleutil.R.mipmap.red);
|
||||
|
||||
|
||||
@@ -44,19 +44,25 @@ public class RoomHourlyAdapter extends BaseQuickAdapter<RoomHourBean.RoomListBea
|
||||
|
||||
ImageUtils.loadHeadCC(roomListBean.getRoom_cover(), baseViewHolder.getView(R.id.room_tx));
|
||||
if (roomListBean.getXlh_status()==1){
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.VISIBLE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.VISIBLE);
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.GONE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.GONE);
|
||||
baseViewHolder.setText(R.id.tv_sta, "进行中");
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_sta, com.xscm.moduleutil.R.mipmap.jxz);
|
||||
}else if (roomListBean.getXlh_status()==2){
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.VISIBLE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.VISIBLE);
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.GONE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.GONE);
|
||||
baseViewHolder.setText(R.id.tv_sta, "即将开始");
|
||||
baseViewHolder.setBackgroundRes(R.id.tv_sta, com.xscm.moduleutil.R.mipmap.jiks);
|
||||
}else {
|
||||
baseViewHolder.getView(R.id.im_xlh).setVisibility(View.GONE);
|
||||
baseViewHolder.getView(R.id.tv_sta).setVisibility(View.GONE);
|
||||
}
|
||||
if (roomListBean.getRedpacket_status()==0){
|
||||
baseViewHolder.getView(R.id.im_red).setVisibility(View.GONE);
|
||||
}else {
|
||||
baseViewHolder.getView(R.id.im_red).setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
baseViewHolder.setText(R.id.room_name, roomListBean.getRoom_name());
|
||||
ImageUtils.loadHeadCC(roomListBean.getLabel_icon(), baseViewHolder.getView(R.id.iv_type));
|
||||
baseViewHolder.setText(R.id.room_hr, roomListBean.getTotal_price()+"");
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.blankj.utilcode.util.ScreenUtils;
|
||||
import com.example.moduleroom.R;
|
||||
import com.example.moduleroom.databinding.DialogRedBagSendBinding;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.bean.WalletBean;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.http.RetrofitClient;
|
||||
@@ -49,6 +50,8 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
return R.layout.dialog_red_bag_send;
|
||||
}
|
||||
|
||||
private boolean diaj=false;
|
||||
|
||||
@Override
|
||||
public void initView() {
|
||||
|
||||
@@ -56,7 +59,8 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
setCanceledOnTouchOutside(false);
|
||||
Window window = getWindow();
|
||||
// window.setLayout(345, 454);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 345.f / 345), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
// window.setLayout((int) (ScreenUtils.getScreenWidth() * 345.f / 345), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 0.9), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
setView(1);
|
||||
mBinding.edText.setKeyListener(DigitsKeyListener.getInstance("0123456789"));
|
||||
@@ -67,7 +71,7 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
public void onClick(View v) {
|
||||
if (type != 3) {
|
||||
setView(3);
|
||||
setWebView("https://www.baidu.com");
|
||||
setWebView(CommonAppContext.getInstance().getCurrentEnvironment().getServerUrl()+"api/Page/page_show?id=25");
|
||||
} else {
|
||||
setView(stype);
|
||||
}
|
||||
@@ -85,25 +89,38 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mBinding.butSub.getText().equals("下一步")) {
|
||||
if (redType==2){
|
||||
if (TextUtils.isEmpty(mBinding.evKl.getText().toString().trim())){
|
||||
ToastUtils.show("请输入口令");
|
||||
return;
|
||||
}
|
||||
}
|
||||
setView(2);
|
||||
setFRed();
|
||||
} else {
|
||||
if (diaj){
|
||||
return;
|
||||
}
|
||||
diaj=true;
|
||||
// 验证输入
|
||||
String numStr = mBinding.etNum.getText().toString().trim();
|
||||
String textStr = mBinding.edText.getText().toString().trim();
|
||||
|
||||
// 检查是否为空
|
||||
if (TextUtils.isEmpty(numStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入数量");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(textStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入金额");
|
||||
return;
|
||||
}
|
||||
if (redType==2){
|
||||
if (TextUtils.isEmpty(mBinding.evKl.getText().toString().trim())){
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入口令");
|
||||
return;
|
||||
}
|
||||
@@ -115,6 +132,7 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
int text = Integer.parseInt(textStr);
|
||||
|
||||
if (text <= num) {
|
||||
diaj=false;
|
||||
ToastUtils.show("金额必须大于数量");
|
||||
return;
|
||||
}
|
||||
@@ -123,6 +141,7 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
sendRedPacket();
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入有效的数字");
|
||||
return;
|
||||
}
|
||||
@@ -233,16 +252,19 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
|
||||
// 验证输入
|
||||
if (TextUtils.isEmpty(numStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入数量");
|
||||
return;
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(textStr)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入金额");
|
||||
return;
|
||||
}
|
||||
|
||||
if (redType == 2 && TextUtils.isEmpty(kl)) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入口令");
|
||||
return;
|
||||
}
|
||||
@@ -252,6 +274,7 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
int text = Integer.parseInt(textStr);
|
||||
|
||||
if (text <= num) {
|
||||
diaj=false;
|
||||
ToastUtils.show("金额必须大于数量");
|
||||
return;
|
||||
}
|
||||
@@ -274,12 +297,14 @@ public class RedBagSendDialog extends BaseDialog<DialogRedBagSendBinding> {
|
||||
@Override
|
||||
public void onNext(@NotNull String redPacketBean) {
|
||||
ToastUtils.show("发送成功");
|
||||
diaj=false;
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
} catch (NumberFormatException e) {
|
||||
diaj=false;
|
||||
ToastUtils.show("请输入有效的数字");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,7 +45,8 @@ public class RedListDialog extends BaseDialog<DialogRedListBinding> {
|
||||
Window window = getWindow();
|
||||
qxRedPacketManager=QXRedPacketManager.getInstance();
|
||||
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 375.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
window.setLayout((int) (ScreenUtils.getScreenWidth() * 0.8), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
// window.setLayout((int) (ScreenUtils.getScreenWidth() * 375.f / 375), WindowManager.LayoutParams.WRAP_CONTENT);
|
||||
mBinding.ivClose.setOnClickListener(v -> dismiss());
|
||||
GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 3); // 每行显示3个
|
||||
mBinding.recyclerView.setLayoutManager(layoutManager);
|
||||
@@ -88,7 +89,7 @@ public class RedListDialog extends BaseDialog<DialogRedListBinding> {
|
||||
int maxRows = Math.min(rows, 2);
|
||||
|
||||
// 计算总高度:2行 × item高度 + 间距
|
||||
int itemHeight = getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_60);
|
||||
int itemHeight = getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_80);
|
||||
int spacing = getResources().getDimensionPixelSize(com.xscm.moduleutil.R.dimen.dp_10);
|
||||
int totalHeight = maxRows * itemHeight + (maxRows + 1) * spacing;
|
||||
|
||||
|
||||
@@ -182,6 +182,7 @@ public class RoomUserInfoFragment extends BaseMvpDialogFragment<RoomUserPresente
|
||||
.create()
|
||||
.showAsDropDown(mBinding.roomMCz, 0, 20);
|
||||
} else if (id == R.id.im_room_t) {
|
||||
userInfo.setTa("1");
|
||||
EventBus.getDefault().post(userInfo);
|
||||
dismiss();
|
||||
} else if (id == R.id.im_room_lt) {
|
||||
|
||||
@@ -890,6 +890,7 @@ public class PublicScreenEaseChatFragment extends BaseMvpFragment<PublicScreenEa
|
||||
case 1057:
|
||||
case 1059:
|
||||
case 1060:
|
||||
case 1061:
|
||||
case 1025:
|
||||
case 1058:
|
||||
// EventBus.getDefault().post(message);
|
||||
|
||||
@@ -608,8 +608,9 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:text="名称"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
tools:text="名称"
|
||||
android:textColor="#FFFF0B"
|
||||
android:textStyle="bold"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintStart_toEndOf="@+id/head_avate"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
@@ -620,9 +621,10 @@
|
||||
android:layout_height="@dimen/dp_18"
|
||||
android:layout_marginStart="@dimen/dp_4"
|
||||
android:gravity="center"
|
||||
android:text="内容"
|
||||
tools:text="内容"
|
||||
android:textColor="@color/color_FFFFF0F0"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/head_avate"
|
||||
app:layout_constraintTop_toBottomOf="@+id/headName"/>
|
||||
|
||||
@@ -5,18 +5,20 @@
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:background="@color/color_transparent">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="454dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/red_f_bj"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
@@ -67,7 +69,8 @@
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_15"
|
||||
android:background="@drawable/bg_r8_fff"
|
||||
android:visibility="gone">
|
||||
android:visibility="gone"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_hiti"
|
||||
@@ -211,7 +214,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
@@ -226,7 +229,7 @@
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
android:text="1分钟"/>
|
||||
@@ -238,7 +241,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
@@ -252,7 +255,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:layout_marginEnd="@dimen/dp_5"
|
||||
@@ -266,7 +269,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@null"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp_15"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:textColor="#fff"
|
||||
android:layout_marginStart="@dimen/dp_5"
|
||||
android:background="@drawable/selector_red_bag_radio_button"
|
||||
@@ -364,6 +367,7 @@
|
||||
app:layout_constraintTop_toBottomOf="@+id/im_red_close"
|
||||
app:layout_constraintEnd_toEndOf="@+id/im_red_close"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
/>
|
||||
|
||||
<!-- 金额 -->
|
||||
@@ -378,6 +382,7 @@
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="-15dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<TextView
|
||||
@@ -434,6 +439,7 @@
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<TextView
|
||||
@@ -489,7 +495,8 @@
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone">
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
@@ -510,16 +517,18 @@
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginBottom="@dimen/dp_5"
|
||||
android:layout_marginStart="@dimen/dp_15">
|
||||
android:layout_marginStart="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_10">
|
||||
|
||||
<!-- 无 -->
|
||||
<Button
|
||||
android:id="@+id/bt_none"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="0.8"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="无"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:background="@drawable/selector_red_bag_condition_button"
|
||||
@@ -528,11 +537,12 @@
|
||||
<!-- 收藏房间 -->
|
||||
<Button
|
||||
android:id="@+id/bt_favorite_room"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="收藏房间"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:background="@drawable/selector_red_bag_condition_button"
|
||||
@@ -541,11 +551,12 @@
|
||||
<!-- 仅麦上用户 -->
|
||||
<Button
|
||||
android:id="@+id/bt_mic_user"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1.2"
|
||||
android:layout_height="@dimen/dp_30"
|
||||
android:text="仅麦上用户"
|
||||
android:textColor="#fff"
|
||||
android:textSize="@dimen/sp_14"
|
||||
android:textSize="@dimen/sp_13"
|
||||
android:paddingStart="@dimen/dp_10"
|
||||
android:paddingEnd="@dimen/dp_10"
|
||||
android:background="@drawable/selector_red_bag_condition_button"
|
||||
@@ -565,6 +576,7 @@
|
||||
android:layout_marginEnd="@dimen/dp_16"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
>
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp_24"
|
||||
android:layout_marginTop="@dimen/dp_55"
|
||||
android:text="已领取5/10"
|
||||
tools:text="已领取5/10"
|
||||
android:textColor="#999"
|
||||
android:textSize="@dimen/sp_13"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
||||
@@ -41,6 +41,20 @@
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:background="@mipmap/hourly_d"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_red"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_60"
|
||||
android:src="@mipmap/red_bj"
|
||||
android:scaleType="fitCenter"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/im_xlh"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_xlh"
|
||||
@@ -53,6 +67,7 @@
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_marginBottom="@dimen/dp_15"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
@@ -66,7 +81,8 @@
|
||||
android:background="@mipmap/jxz"
|
||||
android:gravity="center"
|
||||
tools:text="进行中"
|
||||
android:textSize="@dimen/sp_10"/>
|
||||
android:textSize="@dimen/sp_10"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/room_name"
|
||||
|
||||
@@ -150,4 +150,25 @@ public class UserHomepageActivity extends BaseMvpActivity<UserHomepagePresenter,
|
||||
public void setLikeZone() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
// 清理 ViewPager
|
||||
if (mBinding.viewPager.getAdapter() != null) {
|
||||
mBinding.viewPager.setAdapter(null);
|
||||
}
|
||||
|
||||
// 清理 XBanner 资源
|
||||
if (mBinding.xbanner != null) {
|
||||
mBinding.xbanner.stopAutoPlay();
|
||||
}
|
||||
|
||||
// 通知 Presenter 页面销毁
|
||||
if (MvpPre != null) {
|
||||
MvpPre= null;
|
||||
}
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import android.app.Activity;
|
||||
|
||||
import com.xscm.moduleutil.activity.IPresenter;
|
||||
import com.xscm.moduleutil.activity.IView;
|
||||
import com.xscm.moduleutil.bean.ActivitiesPermission;
|
||||
|
||||
|
||||
public final class VoiceContacts {
|
||||
@@ -12,6 +13,7 @@ public final class VoiceContacts {
|
||||
// void setBanners(List<BannerResp> list);
|
||||
|
||||
void hideRecommend(boolean hideRecommend,boolean hideGame);
|
||||
void activitiesPermissionSuccess(ActivitiesPermission activitiesPermission);
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +22,9 @@ public final class VoiceContacts {
|
||||
void getBanners();
|
||||
|
||||
void getNameAuthResult(int type);
|
||||
|
||||
void activitiesPermission();//活动弹框权限
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.Intent;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.blankj.utilcode.util.ToastUtils;
|
||||
import com.example.modulevoice.R;
|
||||
import com.example.modulevoice.activity.RankingListActivity;
|
||||
import com.example.modulevoice.activity.SearchActivity;
|
||||
@@ -13,6 +14,10 @@ import com.example.modulevoice.databinding.FragmentVoiceBinding;
|
||||
import com.example.modulevoice.presenter.VoicePresenter;
|
||||
import com.xscm.moduleutil.adapter.MyFragmentPagerAdapter;
|
||||
import com.xscm.moduleutil.base.BaseMvpFragment;
|
||||
import com.xscm.moduleutil.bean.ActivitiesPermission;
|
||||
import com.xscm.moduleutil.bean.FirstChargeGiftBean;
|
||||
import com.xscm.moduleutil.dialog.FirstChargeDialog;
|
||||
import com.xscm.moduleutil.dialog.RechargeDialogFragment;
|
||||
import com.xscm.moduleutil.dialog.YouthModelDialog;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
@@ -118,12 +123,50 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
// 记录已经显示过青少年模式弹窗
|
||||
SpUtil.setBooleanValue("youth_model_shown", true);
|
||||
dialog.dismiss();
|
||||
MvpPre.activitiesPermission();
|
||||
|
||||
// 在这里可以继续显示其他弹窗,如首充弹窗
|
||||
// showFirstChargeDialog();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: 2025/10/12 首充好礼
|
||||
private void firstCharge(){
|
||||
FirstChargeDialog firstChargeDialog = new FirstChargeDialog(getActivity());
|
||||
firstChargeDialog.show();
|
||||
firstChargeDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
//首充弹窗关闭后,弹首充
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
firstChargeDialog.setOnFirstChargeListener(new FirstChargeDialog.OnFirstChargeListener() {
|
||||
@Override
|
||||
public void onFirstChargeConfirmed(FirstChargeGiftBean giftBean, int type) {
|
||||
String s = "";
|
||||
String gift_bag_id= "";
|
||||
if (giftBean.getGift_bag().size()!=0) {
|
||||
gift_bag_id = giftBean.getGift_bag().get(0).getGift_bag_id();
|
||||
s = giftBean.getGift_bag().get(0).getMoney();
|
||||
}
|
||||
if (s == null) {
|
||||
ToastUtils.showShort("暂无礼物");
|
||||
return;
|
||||
}
|
||||
|
||||
RechargeDialogFragment.show(null, s, getChildFragmentManager(),gift_bag_id,"1");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFirstChargeCancelled() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initListener () {
|
||||
super.initListener();
|
||||
@@ -146,4 +189,13 @@ public class VoiceFragment extends BaseMvpFragment<VoicePresenter, FragmentVoice
|
||||
fragments.add(VoiceCategoryFragment.newInstance());
|
||||
mBinding.viewPager.setAdapter(new MyFragmentPagerAdapter(fragments, getChildFragmentManager()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activitiesPermissionSuccess(ActivitiesPermission activitiesPermission) {
|
||||
if (activitiesPermission != null) {
|
||||
if (activitiesPermission.getFirst_charge_permission() == 1) {
|
||||
firstCharge();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,19 @@ package com.example.modulevoice.presenter;
|
||||
import android.content.Context;
|
||||
|
||||
import com.example.modulevoice.contacts.VoiceContacts;
|
||||
import com.xscm.moduleutil.bean.ActivitiesPermission;
|
||||
import com.xscm.moduleutil.http.BaseObserver;
|
||||
import com.xscm.moduleutil.presenter.BasePresenter;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
public class VoicePresenter extends BasePresenter<VoiceContacts.View> implements VoiceContacts.IIndexPre {
|
||||
|
||||
private VoiceContacts.View mView;
|
||||
public VoicePresenter(VoiceContacts.View view, Context context) {
|
||||
super(view, context);
|
||||
this.mView = view;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -107,4 +114,22 @@ public class VoicePresenter extends BasePresenter<VoiceContacts.View> implements
|
||||
// ARouter.getInstance().build(ARouteConstants.ME_NAME_AUTH).withString("from","我的界面").navigation();
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
public void activitiesPermission() {
|
||||
api.activitiesPermission(new BaseObserver<ActivitiesPermission>() {
|
||||
@Override
|
||||
public void onSubscribe(@NotNull Disposable d) {
|
||||
addDisposable( d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NotNull ActivitiesPermission activitiesPermission) {
|
||||
if (MvpRef==null){
|
||||
MvpRef=new WeakReference<>(mView);
|
||||
}
|
||||
MvpRef.get().activitiesPermissionSuccess(activitiesPermission);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user