1:添加更换设置服务器地址

2:添加关闭红包声音图标
This commit is contained in:
2025-12-22 14:04:19 +08:00
parent e21345ba61
commit f5287becee
14 changed files with 94 additions and 35 deletions

View File

@@ -75,7 +75,7 @@ import lombok.Setter;
* Created by cxf on 2017/8/3.
*/
public class CommonAppContext extends MultiDexApplication implements Application.ActivityLifecycleCallbacks {
public class CommonAppContext extends MultiDexApplication implements Application.ActivityLifecycleCallbacks {
private static CommonAppContext sInstance;
private static Handler sMainThreadHandler;
@@ -95,17 +95,17 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
public boolean isShowAg;
public boolean isRoomJoininj=false;
public boolean isRoomJoininj = false;
public String playCover;
public boolean showSelf;//盲盒是否能送自己
public String playName;
private MqttConnect mqttConnect=null;
private MqttConnect mqttConnect = null;
// 添加后台状态标记
private boolean wasInBackground = false;
public boolean isMai=false;
public boolean isMai = false;
public void onAppBackground() {
wasInBackground = true;
@@ -123,17 +123,17 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
private AppStateListener appStateListener;
private boolean isListeningUnreadCount = false;
public boolean onConnectFailed=false;//是否重连
public boolean onConnectFailed = false;//是否重连
@Getter
@Setter
public Map<String, Integer> onlineMap=new HashMap<>();
public Map<String, Integer> onlineMap = new HashMap<>();
@Setter
@Getter
public UnreadCountEvent unreadCountEvent;
public static int statusRelease = 11;
public static int selectRelease = -1;
@Override
public void onCreate() {
@@ -156,14 +156,18 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
CrashHandler.init(this);
if (SpUtil.getShelf()!=0) {
if (SpUtil.getShelf() != 0) {
SpUtil.setShelf(1);
}
if (SpUtil.getTaskService()==1){
selectRelease = 2;
}
//设置mqtt环境 false 测试环境 true 正式环境
// ExternalResConstants.INSTANCE.setIS_MQTT_RELEASE(false);
//设置http环境 false 测试环境 true 正式环境
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(statusRelease == 1);
ExternalResConstants.INSTANCE.setIS_HTTP_RELEASE(selectRelease != -1);
currentEnvironment = ExternalResConstants.INSTANCE.HTTP_PATH();
initialization();
@@ -230,17 +234,19 @@ public class CommonAppContext extends MultiDexApplication implements Applicatio
// 通知未读数变化的方法可以发送广播或EventBus事件
private void notifyUnreadCountChanged(long unreadCount) {
UnreadCountEvent event =unreadCountEvent;
if (event==null){
event=new UnreadCountEvent();
UnreadCountEvent event = unreadCountEvent;
if (event == null) {
event = new UnreadCountEvent();
}
event.setALong(unreadCount);
// 使用EventBus通知
CommonAppContext.getInstance().setUnreadCountEvent(event);
EventBus.getDefault().post(event);
EventBus.getDefault().post(event);
}
/**
* 检查网络是否可用
*
* @return true表示网络可用false表示网络不可用
*/
public boolean isNetworkAvailable() {

View File

@@ -34,5 +34,7 @@ public class SPConstants {
public static final String FLOATING_SCREEN = "floatingScreen";
public static final String SHELF="shelf";
public static final String SHELF = "shelf";//货架
public static final String TASK_SERVICE="taskService";//切换服务器
}

View File

@@ -335,6 +335,14 @@ public class SpUtil {
return shelf;
}
public static int setTaskService(int taskService){
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put(SPConstants.TASK_SERVICE, taskService);
return taskService;
}
public static int getTaskService(){
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt(SPConstants.TASK_SERVICE);
}
//获取SharedPreferences音乐轮播方式
public static int getPlayPattern() {
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt(SPConstants.PLAY_MODE, 1);

View File

@@ -20,7 +20,7 @@
android:layout_marginStart="60dp"
android:layout_marginEnd="@dimen/dp_2"
android:ellipsize="start"
android:maxLines="1"
android:maxLines="2"
android:text="礼品"
android:textColor="#FFDE77"
android:textSize="14sp"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB