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

View File

@@ -1,5 +1,7 @@
package com.xscm.modulemain.activity.user.activity;
import static android.view.View.GONE;
import android.annotation.SuppressLint;
import android.content.DialogInterface;
import android.content.Intent;
@@ -80,16 +82,22 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
mBinding.swit.setChecked(false);
}
} else {
mBinding.llQhdz.setVisibility(View.GONE);
mBinding.llQhdz.setVisibility(GONE);
}
if (userInfo.getMobile()!=null && !userInfo.getMobile().equals("")) {
if (userInfo.getMobile() != null && !userInfo.getMobile().equals("")) {
mBinding.tvPhoneTitle.setText("手机换绑");
mBinding.tvPhone.setText(TextViewUtils.formatAnyPhone(userInfo.getMobile()));
}else {
} else {
mBinding.tvPhoneTitle.setText("手机绑定");
mBinding.tvPhone.setText("");
}
}
if (CommonAppContext.selectRelease == 1){
mBinding.llQh.setVisibility(GONE);
}else {
mBinding.llQh.setVisibility(View.VISIBLE);
}
mBinding.switQh.setChecked(SpUtil.getTaskService()==1);
}
@Override
@@ -115,6 +123,7 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
mBinding.llBbh.setOnClickListener(this::onClick);
mBinding.tvShare.setOnClickListener(this::onClick);
mBinding.llSendLog.setOnClickListener(this::onClick);
mBinding.switQh.setOnClickListener(this::onClick);
}
@SuppressLint("CheckResult")
@@ -139,9 +148,9 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
startActivity(new Intent(this, ChangPassActivity.class));
} else if (id == R.id.ll_shb) {
LogUtils.e("点击了", SpUtil.getUserBean().getMobile());
if (TextUtils.isEmpty(SpUtil.getUserBean().getMobile())){
if (TextUtils.isEmpty(SpUtil.getUserBean().getMobile())) {
startActivity(new Intent(this, PhoneReplacementActivity.class));
}else {
} else {
startActivity(new Intent(this, MobilePhoneActivity.class));
}
} else if (id == R.id.ll_smrz) {//实名认证
@@ -290,6 +299,16 @@ public class SettingActivity extends BaseMvpActivity<SettingPresenter, ActivityS
// }
// }
// });
} else if (id == R.id.swit_qh) {
if (mBinding.switQh.isChecked()) {
SpUtil.setTaskService(1);
CommonAppContext.selectRelease = 2;
} else {
SpUtil.setTaskService(0);
CommonAppContext.selectRelease = -1;
}
// MvpPre.clearLoginInfo();
}
// 通过 ID 获取资源名称
String viewName = "";

View File

@@ -139,7 +139,7 @@ public class HorizontalListAdapter extends RecyclerView.Adapter<HorizontalListAd
case RoomSettingBean.QXRoomSettingTypeRoomTimeSpace:
return com.xscm.moduleutil.R.mipmap.time_space;
case RoomSettingBean.QXRoomSettingTypeRoomTimeRedSound:
return b ? com.xscm.moduleutil.R.mipmap.room_voice_g : com.xscm.moduleutil.R.mipmap.y_won;
return b ? com.xscm.moduleutil.R.mipmap.red_effect_off : com.xscm.moduleutil.R.mipmap.red_effect_on;
default:
return 0;
}

View File

@@ -46,14 +46,13 @@
android:layout_height="0.5dp"
android:layout_alignParentBottom="true"
android:background="#E2E2E2"
android:visibility="gone"/>
android:visibility="gone" />
<LinearLayout
android:id="@+id/ll_youth"
style="@style/My_Info_Item_LL_Style"
android:background="@drawable/bg_r15_white"
>
android:background="@drawable/bg_r15_white">
<TextView
style="@style/My_Info_Item_Title_Style"
@@ -116,8 +115,7 @@
style="@style/My_Info_Item_LL_Style"
android:background="@drawable/bg_r15_white"
android:visibility="gone"
tools:visibility="visible"
>
tools:visibility="visible">
<TextView
style="@style/My_Info_Item_Title_Style"
@@ -150,12 +148,13 @@
android:layout_width="0dp"
android:layout_weight="1"
android:text="@string/bind_phone" />
<TextView
android:id="@+id/tv_phone"
style="@style/My_Info_Item_Title_Style"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center|end"/>
android:gravity="center|end" />
<ImageView style="@style/My_Info_Item_Arrow_Style" />
</LinearLayout>
@@ -196,6 +195,7 @@
android:layout_width="0dp"
android:layout_weight="1"
android:text="@string/version_number" />
<TextView
android:id="@+id/tv_bbh"
style="@style/My_Info_Item_Subtitle_Style"
@@ -307,6 +307,31 @@
<ImageView style="@style/My_Info_Item_Arrow_Style" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:layout_alignParentBottom="true"
android:background="@color/color_e2e2e2" />
<LinearLayout
android:id="@+id/ll_qh"
style="@style/My_Info_Item_LL_Style"
android:background="@drawable/bg_r15_white"
android:visibility="visible">
<TextView
style="@style/My_Info_Item_Title_Style"
android:text="切换服务器" />
<Switch
android:id="@+id/swit_qh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right|center"
android:gravity="right"
tools:ignore="UseSwitchCompatOrMaterialXml" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
@@ -328,7 +353,6 @@
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
@@ -415,14 +439,14 @@
<TextView
android:id="@+id/tv_share"
android:visibility="gone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start"
android:padding="@dimen/dp_40"
android:layout_marginTop="-50dp"
android:clickable="false"
android:focusable="false"
android:layout_marginTop="-50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
android:padding="@dimen/dp_40"
android:visibility="gone" />
</LinearLayout>

View File

@@ -28,8 +28,8 @@ isBuildModule=false
#org.gradle.deamon=false
android.injected.testOnly=false
APP_VERSION_NAME=1.0.8.7
APP_VERSION_CODE=77
APP_VERSION_NAME=1.0.8.8
APP_VERSION_CODE=78
org.gradle.jvm.toolchain.useLegacyAdapters=false
#org.gradle.java.home=C\:\\Users\\qx\\.jdks\\ms-17.0.15