1:添加小时榜
2:添加小时榜飘屏
@@ -18,6 +18,9 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -37,6 +40,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.databinding.DataBindingUtil;
|
||||
import androidx.databinding.ViewDataBinding;
|
||||
|
||||
@@ -50,6 +54,7 @@ import com.xscm.moduleutil.R;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
import com.xscm.moduleutil.base.RoomManager;
|
||||
import com.xscm.moduleutil.bean.XLHBean;
|
||||
import com.xscm.moduleutil.event.HourlyBean;
|
||||
import com.xscm.moduleutil.event.MqttBean;
|
||||
import com.xscm.moduleutil.utils.ARouteConstants;
|
||||
import com.xscm.moduleutil.utils.BackgroundManager;
|
||||
@@ -66,6 +71,7 @@ import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -410,6 +416,232 @@ public abstract class BaseAppCompatActivity<VDB extends ViewDataBinding> extends
|
||||
private View currentMqttView = null; // 当前正在播放的MQTT视图
|
||||
private View currentXlhView = null; // 当前正在播放的XLH视图
|
||||
|
||||
private final List<HourlyBean> hourlyMessageQueue = new ArrayList<>(); // 小时榜消息队列
|
||||
private final Map<Integer, View> currentHourlyViews = new HashMap<>(); // 当前显示的小时榜视图
|
||||
private final Object hourlyQueueLock = new Object(); // 小时榜队列同步锁
|
||||
private boolean isHourlyProcessing = false; // 小时榜处理状态标志
|
||||
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageReceived(List<HourlyBean> hourlyBean) {
|
||||
LogUtils.e("收到小时榜", hourlyBean);
|
||||
if (hourlyBean == null) return;
|
||||
if (SpUtil.getFloatingScreen() == 1) {
|
||||
synchronized (hourlyQueueLock) {
|
||||
hourlyMessageQueue.addAll(hourlyBean);
|
||||
if (!isHourlyProcessing) {
|
||||
isHourlyProcessing = true;
|
||||
processHourlyMessages();
|
||||
}
|
||||
}
|
||||
}else {
|
||||
hourlyMessageQueue.clear();
|
||||
clearAllHourlyViews();
|
||||
}
|
||||
}
|
||||
|
||||
private void processHourlyMessages() {
|
||||
List<HourlyBean> messagesToProcess;
|
||||
synchronized (hourlyQueueLock) {
|
||||
if (hourlyMessageQueue.isEmpty()) {
|
||||
isHourlyProcessing = false;
|
||||
return;
|
||||
}
|
||||
// 最多处理3条数据
|
||||
int processCount = Math.min(3, hourlyMessageQueue.size());
|
||||
messagesToProcess = new ArrayList<>(hourlyMessageQueue.subList(0, processCount));
|
||||
// 从队列中移除已处理的数据
|
||||
for (int i = 0; i < processCount; i++) {
|
||||
hourlyMessageQueue.remove(0);
|
||||
}
|
||||
}
|
||||
|
||||
// 同时展示多条数据
|
||||
for (int i = 0; i < messagesToProcess.size(); i++) {
|
||||
HourlyBean bean = messagesToProcess.get(i);
|
||||
showHourlyFloatingMessage(bean, i);
|
||||
}
|
||||
}
|
||||
|
||||
private void showHourlyFloatingMessage(HourlyBean hourlyBean, int positionIndex) {
|
||||
try {
|
||||
ViewGroup decorView = (ViewGroup) getWindow().getDecorView();
|
||||
|
||||
// 创建新的视图
|
||||
View hourlyView = LayoutInflater.from(this).inflate(R.layout.item_hourly_floating, null);
|
||||
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(
|
||||
FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT);
|
||||
|
||||
// 根据位置设置不同的垂直间距
|
||||
int baseMargin = com.sunfusheng.marqueeview.DisplayUtil.dip2px(this, 70);
|
||||
int verticalSpacing = com.sunfusheng.marqueeview.DisplayUtil.dip2px(this, 50);
|
||||
layoutParams.topMargin = baseMargin + (positionIndex * verticalSpacing);
|
||||
layoutParams.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
|
||||
hourlyView.setLayoutParams(layoutParams);
|
||||
|
||||
decorView.addView(hourlyView);
|
||||
|
||||
// 保存视图引用
|
||||
currentHourlyViews.put(positionIndex, hourlyView);
|
||||
|
||||
// 更新视图数据
|
||||
updateHourlyFloatingViewData(hourlyView, hourlyBean);
|
||||
|
||||
// 根据类型获取展示时间
|
||||
long displayDuration = getDisplayDurationByType(Integer.parseInt(hourlyBean.getRank_number()));
|
||||
|
||||
// 启动动画
|
||||
resetAndStartHourlyAnimation(hourlyView, displayDuration, () -> {
|
||||
// 动画结束后清理视图
|
||||
if (hourlyView.getParent() != null) {
|
||||
decorView.removeView(hourlyView);
|
||||
}
|
||||
currentHourlyViews.remove(positionIndex);
|
||||
|
||||
// 检查是否还有更多消息需要处理
|
||||
synchronized (hourlyQueueLock) {
|
||||
if (hourlyMessageQueue.isEmpty() && currentHourlyViews.isEmpty()) {
|
||||
isHourlyProcessing = false;
|
||||
} else if (!hourlyMessageQueue.isEmpty() && currentHourlyViews.isEmpty()) {
|
||||
// 所有当前视图都已消失,处理下一批消息
|
||||
processHourlyMessages();
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("显示小时榜飘屏失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
private long getDisplayDurationByType(int type) {
|
||||
// 根据不同类型设置不同的展示时间(毫秒)
|
||||
switch (type) {
|
||||
case 1: // 第一名
|
||||
return 5000; // 5秒
|
||||
case 2: // 第二名
|
||||
return 4000; // 4秒
|
||||
case 3: // 第三名
|
||||
return 3000; // 3秒
|
||||
default:
|
||||
return 3000; // 默认3秒
|
||||
}
|
||||
}
|
||||
|
||||
private void updateHourlyFloatingViewData(View view, HourlyBean hourlyBean) {
|
||||
TextView tvName = view.findViewById(R.id.tv_name);
|
||||
ImageView ivAvatar = view.findViewById(R.id.im_h_t);
|
||||
|
||||
if (hourlyBean != null) {
|
||||
// 根据排名设置不同的显示
|
||||
switch (hourlyBean.getRank_number()) {
|
||||
case "1":
|
||||
// tvName.setText("新科状元! ["+hourlyBean.getRoom_name()+"] 独占鳌头!");
|
||||
setColoredText(tvName, "新科状元! [", hourlyBean.getRoom_name(), "] 独占鳌头!", R.color.color_FFFA63);
|
||||
ivAvatar.setImageResource(R.mipmap.hourl_top1);
|
||||
break;
|
||||
case "2":
|
||||
// tvName.setText("金榜榜眼! ["+hourlyBean.getRoom_name()+"] 才气逼人!");
|
||||
setColoredText(tvName, "金榜榜眼! [", hourlyBean.getRoom_name(), "] 才气逼人!", R.color.color_FFFA63);
|
||||
|
||||
ivAvatar.setImageResource(R.mipmap.hourl_top2);
|
||||
break;
|
||||
case "3":
|
||||
setColoredText(tvName, "风采探花! [", hourlyBean.getRoom_name(), "] 实力绽放!", R.color.color_1FFFE5);
|
||||
// tvName.setText("风采探花! ["+hourlyBean.getRoom_name()+"] 实力绽放!");
|
||||
|
||||
ivAvatar.setImageResource(R.mipmap.hourl_top3);
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
// 设置带颜色的文本
|
||||
// 设置带颜色的文本
|
||||
private void setColoredText(TextView textView, String prefix, String roomName, String suffix, int colorRes) {
|
||||
String fullText = prefix + roomName + suffix;
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder(fullText);
|
||||
|
||||
// 先为整个文本设置白色
|
||||
builder.setSpan(
|
||||
new ForegroundColorSpan(ContextCompat.getColor(this, R.color.white)),
|
||||
0,
|
||||
fullText.length(),
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
);
|
||||
|
||||
// 查找房间名在文本中的位置
|
||||
int start = fullText.indexOf("[");
|
||||
int end = fullText.indexOf("]") + 1;
|
||||
|
||||
if (start >= 0 && end > start) {
|
||||
// 为房间名部分设置指定颜色
|
||||
builder.setSpan(
|
||||
new ForegroundColorSpan(ContextCompat.getColor(this, colorRes)),
|
||||
start,
|
||||
end,
|
||||
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
);
|
||||
}
|
||||
|
||||
textView.setText(builder);
|
||||
}
|
||||
|
||||
private void resetAndStartHourlyAnimation(View view, long displayDuration, Runnable onAnimationEnd) {
|
||||
try {
|
||||
int screenWidth = getScreenWidth();
|
||||
// 设置初始位置:在屏幕右侧外部
|
||||
view.setTranslationX(screenWidth);
|
||||
|
||||
// 进入动画
|
||||
ObjectAnimator enterAnimator = ObjectAnimator.ofFloat(view, "translationX", screenWidth, 0f);
|
||||
enterAnimator.setDuration(500);
|
||||
enterAnimator.setInterpolator(new DecelerateInterpolator());
|
||||
enterAnimator.start();
|
||||
|
||||
// 停留后退出动画
|
||||
view.postDelayed(() -> {
|
||||
try {
|
||||
ObjectAnimator exitAnimator = ObjectAnimator.ofFloat(view, "translationX", 0f, -screenWidth);
|
||||
exitAnimator.setDuration(500);
|
||||
exitAnimator.setInterpolator(new AccelerateInterpolator());
|
||||
exitAnimator.addListener(new AnimatorListenerAdapter() {
|
||||
@Override
|
||||
public void onAnimationEnd(Animator animation) {
|
||||
onAnimationEnd.run();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAnimationCancel(Animator animation) {
|
||||
onAnimationEnd.run();
|
||||
}
|
||||
});
|
||||
exitAnimator.start();
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("小时榜退出动画执行失败", e);
|
||||
onAnimationEnd.run();
|
||||
}
|
||||
}, displayDuration); // 根据类型设置的展示时间
|
||||
|
||||
} catch (Exception e) {
|
||||
LogUtils.e("小时榜动画启动失败", e);
|
||||
onAnimationEnd.run();
|
||||
}
|
||||
}
|
||||
|
||||
private void clearAllHourlyViews() {
|
||||
ViewGroup decorView = (ViewGroup) getWindow().getDecorView();
|
||||
for (View view : currentHourlyViews.values()) {
|
||||
if (view.getParent() != null) {
|
||||
decorView.removeView(view);
|
||||
}
|
||||
}
|
||||
currentHourlyViews.clear();
|
||||
}
|
||||
|
||||
/// 礼物特效 - MQTT消息处理
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onMessageReceived(MqttBean mqttBean) {
|
||||
|
||||
@@ -114,6 +114,8 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
|
||||
// 添加后台状态标记
|
||||
private boolean wasInBackground = false;
|
||||
|
||||
public boolean isMai=false;
|
||||
|
||||
public void onAppBackground() {
|
||||
wasInBackground = true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.xscm.moduleutil.bean.room;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
/**
|
||||
*@author qx
|
||||
*@data 2025/9/29
|
||||
*@description:小时榜实体类
|
||||
*/
|
||||
@Data
|
||||
public class RoomHourBean {
|
||||
private String time_range;
|
||||
private List<RoomListBean> lists;
|
||||
|
||||
@Data
|
||||
public class RoomListBean {
|
||||
private String room_id;
|
||||
private String room_name;
|
||||
private int label_id;
|
||||
private String room_cover;
|
||||
private int total_price;
|
||||
private String label_icon;
|
||||
private int xlh_status;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,6 +30,7 @@ public class RoomInfoResp implements Serializable {
|
||||
private List<RoomPitBean> song_pit_list;
|
||||
private FriendInfo friend_info;
|
||||
private GiftXlh gift_cycle;
|
||||
private int hour_ranking_open;//1:开启 0:关闭
|
||||
|
||||
|
||||
//弹出麦位操作弹出
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.xscm.moduleutil.event;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 小时榜飘屏
|
||||
*/
|
||||
@Data
|
||||
public class HourlyBean {
|
||||
private String room_id;
|
||||
private String room_name;
|
||||
private String text;
|
||||
private String rank_number;
|
||||
}
|
||||
@@ -63,13 +63,7 @@ import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.bean.room.AuctionBean;
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomApplyListBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||
import com.xscm.moduleutil.bean.room.RoomBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.bean.room.*;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
import com.xscm.moduleutil.widget.Constants;
|
||||
|
||||
@@ -95,6 +89,9 @@ public interface ApiServer {
|
||||
@POST(Constants.LOGIN)
|
||||
Call<BaseModel<List<UserBean>>> login(@Field("user_login") String user_login, @Field("sms_code") String sms_code);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST(Constants.ROOM_HOUR_BEAN)
|
||||
Call<BaseModel<RoomHourBean>> getRoomHourRanking(@Field("page") String page,@Field("page_limit")String page_limit);
|
||||
@FormUrlEncoded //手机换绑
|
||||
@POST(Constants.MODIFY_MOBILE)
|
||||
Call<BaseModel<String>> mobileView(@Field("mobile") String mobile, @Field("new_mobile") String new_mobile, @Field("sms_code") String sms_code);
|
||||
|
||||
@@ -80,13 +80,7 @@ import com.xscm.moduleutil.bean.WithdrawalBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindBoxBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.BlindReslutBean;
|
||||
import com.xscm.moduleutil.bean.blindboxwheel.XlhDrawBean;
|
||||
import com.xscm.moduleutil.bean.room.AuctionBean;
|
||||
import com.xscm.moduleutil.bean.room.FriendUserBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomApplyListBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomAuction;
|
||||
import com.xscm.moduleutil.bean.room.RoomBean;
|
||||
import com.xscm.moduleutil.bean.room.RoomInfoResp;
|
||||
import com.xscm.moduleutil.bean.room.RoomOnline;
|
||||
import com.xscm.moduleutil.bean.room.*;
|
||||
import com.xscm.moduleutil.bean.zhuangb.ZhuangBanShangChengBean;
|
||||
import com.xscm.moduleutil.listener.MessageListenerSingleton;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
@@ -351,6 +345,29 @@ public class RetrofitClient {
|
||||
});
|
||||
}
|
||||
|
||||
public void getRoomHourRanking(String page, String page_limit, BaseObserver<RoomHourBean> observer){
|
||||
sApiServer.getRoomHourRanking(page, page_limit).enqueue(new Callback<BaseModel<RoomHourBean>>() {
|
||||
@Override
|
||||
public void onResponse(Call<BaseModel<RoomHourBean>> call, Response<BaseModel<RoomHourBean>> response) {
|
||||
if (response.code() == 200) {
|
||||
BaseModel<RoomHourBean> listBaseModel = response.body();
|
||||
if (listBaseModel != null) {
|
||||
if (listBaseModel.getCode()==1) {
|
||||
observer.onNext(listBaseModel.getData());
|
||||
}else {
|
||||
ToastUtils.showShort(listBaseModel.getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onFailure(Call<BaseModel<RoomHourBean>> call, Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void userLogin(String mobile, String password, BaseObserver<List<UserBean>> observer) {
|
||||
sApiServer.userLogin(mobile, password).enqueue(new Callback<BaseModel<List<UserBean>>>() {
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,7 @@ public class MqttConnect {
|
||||
// 订阅主题
|
||||
public static String shutdown = "";
|
||||
public static String update_app = "";
|
||||
public static String qx_hour_ranking = "";
|
||||
Handler handler = new Handler(Looper.getMainLooper());
|
||||
String[] topic;
|
||||
int[] qos = {1,2,3,0,0,0,0,0,0,0,0,0,0}; // 消息质量
|
||||
@@ -44,10 +45,12 @@ public class MqttConnect {
|
||||
// 这里是你自己需要订阅的主题
|
||||
shutdown = "qx_room_topic"; // 关机
|
||||
update_app = "qx_xunlehui"; // 发送更新APP
|
||||
qx_hour_ranking = "qx_hour_ranking";
|
||||
|
||||
ArrayList<String> topicList = new ArrayList<>();
|
||||
topicList.add(shutdown);
|
||||
topicList.add(update_app);
|
||||
topicList.add(qx_hour_ranking);
|
||||
topic = topicList.toArray(new String[0]);
|
||||
}
|
||||
|
||||
@@ -82,6 +85,7 @@ public class MqttConnect {
|
||||
// sub(topic,qos);
|
||||
sub(shutdown);
|
||||
sub(update_app);
|
||||
sub(qx_hour_ranking);
|
||||
// uiTip("MQTT连接成功");
|
||||
}catch (MqttException e){
|
||||
// uiTip("MQTT连接失败,准备重连。。。:"+e.getMessage());
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.hjq.toast.ToastUtils;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.xscm.moduleutil.bean.MqttXlhEnd;
|
||||
import com.xscm.moduleutil.bean.XLHBean;
|
||||
import com.xscm.moduleutil.event.HourlyBean;
|
||||
import com.xscm.moduleutil.event.RoomGiftRunable;
|
||||
import com.xscm.moduleutil.utils.SpUtil;
|
||||
|
||||
@@ -20,6 +21,8 @@ import org.eclipse.paho.client.mqttv3.MqttCallback;
|
||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class MqttInitCallback implements MqttCallback {
|
||||
private String Tag = "MqttInitCallback";
|
||||
private String HOST;
|
||||
@@ -58,6 +61,59 @@ public class MqttInitCallback implements MqttCallback {
|
||||
} else if (topic.equals("qx_xunlehui")) {
|
||||
// ToastUtils.show("收到轮盘飘屏");
|
||||
receiveXlhMessage(messageStr);
|
||||
}else if (topic.equals("qx_hour_ranking")){
|
||||
receiveQXHourRanking(topic, messageStr);
|
||||
}
|
||||
}
|
||||
|
||||
private void receiveQXHourRanking(String topic, String data) {
|
||||
try {
|
||||
JSONObject jsonObject = JSON.parseObject(data);
|
||||
int type = jsonObject.getIntValue("type");
|
||||
String message = jsonObject.getString("msg");
|
||||
|
||||
// 将事件处理放到主线程执行
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
processMessage(topic, message);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
Log.e("MQTT", "解析MQTT消息异常", e);
|
||||
// ToastUtils.show("收到礼物飘屏,解析异常");
|
||||
}
|
||||
}
|
||||
|
||||
private void processMessage(String topic, String data){
|
||||
try {
|
||||
// 如果 data 是集合字符串
|
||||
if (isJsonArray(data)) {
|
||||
// 解析为集合
|
||||
List<HourlyBean> dataList = JSON.parseArray(data, HourlyBean.class);
|
||||
|
||||
// 在主线程处理集合数据
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
processDataList(dataList);
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("MQTT", "解析MQTT消息异常", e);
|
||||
}
|
||||
}
|
||||
// 处理集合数据
|
||||
private void processDataList(List<HourlyBean> dataList) {
|
||||
// 遍历集合并发送每个元素
|
||||
// for (HourlyBean dataItem : dataList) {
|
||||
// EventBus.getDefault().post(dataItem);
|
||||
// }
|
||||
|
||||
// 或者发送整个集合
|
||||
EventBus.getDefault().post(dataList);
|
||||
}
|
||||
// 判断是否为 JSON 数组
|
||||
private boolean isJsonArray(String jsonString) {
|
||||
try {
|
||||
return JSON.parseArray(jsonString) != null;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
private void receiveMessage(String topic, String data) {
|
||||
|
||||
@@ -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; // 出错时默认返回生产环境
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -538,7 +538,7 @@ public abstract class BaseWheatView extends ConstraintLayout implements IBaseWhe
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
@Override
|
||||
public void subscribeMessages(RoomBeckoningEvent roomBeckoningEvent) {
|
||||
if (roomId.equals(roomBeckoningEvent.getRoomId())) {
|
||||
if (roomId != null && roomId.equals(roomBeckoningEvent.getRoomId())) {
|
||||
mCharmView.setVisibility(roomBeckoningEvent.isOpen() ? VISIBLE : INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,6 +392,7 @@ public class Constants {
|
||||
public static final String GET_GIFT_PACK_LIST_COUNT = "/api/UserGiftPack/get_gift_pack_list_count";//背包礼物总价值
|
||||
public static final String ROOM_USER_RECONNECT = "/api/Room/user_reconnect";//用户重连
|
||||
public static final String USER_ROOM_BACK = "/api/Room/user_in_room_background";//用户在房间内切后台保留数据操作
|
||||
public static final String ROOM_HOUR_BEAN = "/api/RoomHourRanking/room_hour_ranking";//房间小时榜
|
||||
|
||||
|
||||
|
||||
|
||||
70
moduleUtil/src/main/res/layout/item_hourly_floating.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?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="match_parent"
|
||||
android:layout_height="@dimen/dp_90">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_h_t"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_90"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/hourl_top1"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="60dp"
|
||||
android:layout_marginEnd="@dimen/dp_2"
|
||||
android:ellipsize="start"
|
||||
android:maxLines="1"
|
||||
android:text="礼品"
|
||||
android:textColor="#FFDE77"
|
||||
android:textSize="@dimen/sp_12"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_to_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_8"
|
||||
android:text="...."
|
||||
android:textColor="#FFDE77"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/tv_name"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_piaoping"
|
||||
android:layout_width="@dimen/dp_20"
|
||||
android:layout_height="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
android:src="@mipmap/default_avatar"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_num"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_num"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_47"
|
||||
android:text="x1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_12"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
BIN
moduleUtil/src/main/res/mipmap-xhdpi/hourly_xlh_sta.webp
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/top1.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/top2.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
moduleUtil/src/main/res/mipmap-xhdpi/top3.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxhdpi/dcl.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/hourl_top1.webp
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/hourl_top2.webp
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
moduleUtil/src/main/res/mipmap-xxxhdpi/hourl_top3.webp
Normal file
|
After Width: | Height: | Size: 25 KiB |
@@ -23,6 +23,8 @@
|
||||
<color name="color_ffe5f7">#ffe5f7</color>
|
||||
<color name="color_ff8acc">#FF8ACC</color>
|
||||
<color name="color_45d08c">#45D08C</color>
|
||||
<color name="color_1FFFE5">#1FFFE5</color>
|
||||
<color name="color_FFFA63">#FFFA63</color>
|
||||
<color name="color_959595">#959595</color>
|
||||
<color name="color_ff2727">#FF2727</color>
|
||||
<!-- 透明度60% -->
|
||||
|
||||