1:羽声新版本
This commit is contained in:
@@ -9,6 +9,8 @@ public class ARouteConstants {
|
||||
public static final String USER_ALBUM_DETAIL = "/modulevocal/AlbumDetailActivity";
|
||||
public static final String CREATE_ALBUM = "/modulevocal/CreateAlbumActivity";
|
||||
public static final String ROOM_DETAILS = "/moduleroom/RoomActivity";
|
||||
public static final String ROOM_RED_RESULT = "/moduleroom/RedResultActivity";//红包结果展示页面
|
||||
public static final String UNDERAGE_ACTIVITY = "/modulevocal/UnderageActivity";
|
||||
|
||||
public static final String MY_ROOM = "/modulevocal/MyRoomActivity";
|
||||
public static final String MY_ROOM_DETAILS = "/modulevocal/RoomDetailsActivity";
|
||||
@@ -20,9 +22,9 @@ public class ARouteConstants {
|
||||
public static final String CREATED_ROOM = "/modulevocal/CreatedRoomActivity"; //创建房间
|
||||
public static final String WITHDRAWAL_ACTIVITY = "/modulevocal/WithdrawalActivity"; //提现
|
||||
public static final String REAL_NAME_ACTIVITY ="/modulevocal/RealNameActivity"; //实名认证
|
||||
public static final String REAL_NAME_ACTIVITY2 ="/app/RealNameActivity"; //实名认证
|
||||
public static final String H5 ="/moduleutil/WebViewActivity"; //网页
|
||||
public static final String GIFT_WALL ="/moduleroom/UserGiftWallFragment"; //实名认证
|
||||
public static final String REAL_NAME_ACTIVITY2 ="/modulevocal/RealNameActivity"; //实名认证
|
||||
public static final String H5 ="/moduleUtil/WebViewActivity"; //网页
|
||||
// public static final String GIFT_WALL ="/moduleroom/UserGiftWallFragment"; //实名认证
|
||||
public static final String RECHARGE_ACTIVITY ="/modulevocal/RechargeActivity"; //实名认证
|
||||
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ import java.util.Map;
|
||||
*/
|
||||
public class ColorManager {
|
||||
private static ColorManager instance;
|
||||
private String primaryColor = "#6C49E4"; // 默认主题色
|
||||
private String buttonColor = "#FFFFFF"; // 默认按钮色
|
||||
private String primaryColor = "#3ABC6D"; // 默认主题色
|
||||
private String buttonColor = "#6D6D6D"; // 默认按钮色
|
||||
|
||||
// 监听器列表,用于通知颜色变化
|
||||
private List<ColorChangeListener> listeners = new ArrayList<>();
|
||||
@@ -71,7 +71,7 @@ public class ColorManager {
|
||||
try {
|
||||
return Color.parseColor(primaryColor);
|
||||
} catch (Exception e) {
|
||||
return Color.parseColor("#6C49E4"); // 默认颜色
|
||||
return Color.parseColor("#3ABC6D"); // 默认颜色
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class ColorManager {
|
||||
try {
|
||||
return Color.parseColor(buttonColor);
|
||||
} catch (Exception e) {
|
||||
return Color.parseColor("#FFFFFF"); // 默认颜色
|
||||
return Color.parseColor("#6D6D6D"); // 默认颜色
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -150,25 +150,30 @@ public class ImageUtils {
|
||||
return;
|
||||
}
|
||||
|
||||
// 没有缓存,正常加载
|
||||
SVGAParser parser = SVGAParser.Companion.shareParser();
|
||||
parser.decodeFromInputStream(mImageView.getContext().getResources().openRawResource(resourceId), "", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@NotNull SVGAVideoEntity svgaVideoEntity) {
|
||||
if (mImageView != null) {
|
||||
// 缓存实体
|
||||
svgaCache.put(resourceId, svgaVideoEntity);
|
||||
SVGADrawable svgaDrawable = new SVGADrawable(svgaVideoEntity);
|
||||
mImageView.setImageDrawable(svgaDrawable);
|
||||
mImageView.startAnimation();
|
||||
try {
|
||||
// 没有缓存,正常加载
|
||||
SVGAParser parser = SVGAParser.Companion.shareParser();
|
||||
InputStream inputStream = mImageView.getContext().getResources().openRawResource(resourceId);
|
||||
parser.decodeFromAssets("heart_line_31.svga", new SVGAParser.ParseCompletion() {
|
||||
@Override
|
||||
public void onComplete(@NotNull SVGAVideoEntity svgaVideoEntity) {
|
||||
if (mImageView != null) {
|
||||
// 缓存实体
|
||||
svgaCache.put(resourceId, svgaVideoEntity);
|
||||
SVGADrawable svgaDrawable = new SVGADrawable(svgaVideoEntity);
|
||||
mImageView.setImageDrawable(svgaDrawable);
|
||||
mImageView.startAnimation();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError() {
|
||||
Logger.e("loadDecorationAvatar2 error");
|
||||
}
|
||||
}, true);
|
||||
@Override
|
||||
public void onError() {
|
||||
Logger.e("loadDecorationAvatar2 error, resourceId: " + resourceId);
|
||||
}
|
||||
});
|
||||
} catch (Exception e) {
|
||||
Logger.e("loadDecorationAvatar2 exception, resourceId: " + resourceId, e);
|
||||
}
|
||||
} else {
|
||||
Logger.e("Resource ID is 0 or invalid");
|
||||
}
|
||||
@@ -176,6 +181,7 @@ public class ImageUtils {
|
||||
|
||||
|
||||
|
||||
|
||||
public static void loadHeadCC(String path, ImageView mImageView) {
|
||||
Glide.with(mImageView).load(path).error(R.mipmap.default_avatar).placeholder(R.mipmap.default_avatar).centerCrop().diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
|
||||
@@ -195,6 +201,7 @@ public class ImageUtils {
|
||||
|
||||
public static void loadRes(int path, ImageView mImageView) {
|
||||
Glide.with(mImageView).load(path).diskCacheStrategy(DiskCacheStrategy.ALL).into(mImageView);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -561,5 +568,8 @@ public class ImageUtils {
|
||||
}
|
||||
}
|
||||
|
||||
public static void clearDiskCache(Context context){
|
||||
Glide.get(context).clearDiskCache();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -30,4 +30,6 @@ public class SPConstants {
|
||||
public static final String REAL_NAME = "realName";//是否实名认证
|
||||
|
||||
public static final String USER_INFO = "userInfo";
|
||||
|
||||
public static final String FLOATING_SCREEN = "floatingScreen";
|
||||
}
|
||||
|
||||
@@ -123,6 +123,8 @@ public class SpUtil {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存一个布尔值
|
||||
*/
|
||||
@@ -251,6 +253,14 @@ public class SpUtil {
|
||||
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put("musicVolume", musicVolume, true);
|
||||
}
|
||||
|
||||
public static void setUnderagePassword(String password){
|
||||
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put("underagePassword", password, true);
|
||||
}
|
||||
|
||||
public static String getUnderagePassword(){
|
||||
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getString("underagePassword");
|
||||
}
|
||||
|
||||
public static Integer getMusicVolume() {
|
||||
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt("musicVolume", 50);
|
||||
}
|
||||
@@ -359,6 +369,14 @@ public class SpUtil {
|
||||
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt(SPConstants.OPEN_EFFECT, 1);
|
||||
}
|
||||
|
||||
public static void setFloatingScreen(int i){
|
||||
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put(SPConstants.FLOATING_SCREEN, i);
|
||||
}
|
||||
|
||||
public static int getFloatingScreen(){
|
||||
return SPUtils.getInstance(SPConstants.PREFERENCE_NAME).getInt(SPConstants.FLOATING_SCREEN, 1);
|
||||
}
|
||||
|
||||
//设置耳返
|
||||
public static void setAuricularBack(int i) {
|
||||
SPUtils.getInstance(SPConstants.PREFERENCE_NAME).put(SPConstants.OPEN_AU_BACK, i);
|
||||
|
||||
@@ -122,16 +122,23 @@ public class SystemUtils {
|
||||
return headers;
|
||||
}
|
||||
|
||||
private static String encodeHeadInfo( String headInfo ) {
|
||||
private static String encodeHeadInfo(String headInfo) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
for (int i = 0, length = headInfo.length(); i < length; i++) {
|
||||
char c = headInfo.charAt(i);
|
||||
if (c <= '\u001f' || c >= '\u007f') {
|
||||
stringBuffer.append( String.format ("\\u%04x", (int)c) );
|
||||
stringBuffer.append(String.format("\\u%04x", (int) c));
|
||||
} else {
|
||||
stringBuffer.append(c);
|
||||
}
|
||||
}
|
||||
return stringBuffer.toString();
|
||||
}
|
||||
|
||||
public static int getWidth(int value) {
|
||||
// 获取屏幕宽度
|
||||
int screenWidth = com.blankj.utilcode.util.ScreenUtils.getScreenWidth();
|
||||
// 按照公式计算:value / 375 * screenWidth
|
||||
return (int) ((value / 375.0) * screenWidth);
|
||||
}
|
||||
}
|
||||
@@ -2,33 +2,33 @@ package com.xscm.moduleutil.utils.config;
|
||||
|
||||
public enum EnvironmentEnum {
|
||||
PRODUCTION(//生产环境
|
||||
"http://chat.qxmier.com/",
|
||||
"6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=",
|
||||
"https://oss-cn-hangzhou.aliyuncs.com/",
|
||||
"LTAI5tJ2UYfFNF7K3F4e1siv",
|
||||
"DhpCS82gaigZljYqsWsUWUAZ20dREz",
|
||||
"qx-yusheng",
|
||||
"https://qx-yusheng.oss-cn-hangzhou.aliyuncs.com/",
|
||||
"https://vespa.qxyushen.top/",
|
||||
"KvNmqZc+VMzO4CfGMd5zmG6w6OFwpFO/19TwXUWfHDOBgmnl9DgIuE+kbrjNNnxqhtP3pH7bBrnSaSeFtunr72q6sgpLsfuswcUroMvz2slaTBcNzCaLi+GSnM3gB/GdO47mwLdk+iYBTvPUOCIuT608Z29z09w+vPeUDoMCHJBGXu6uh7Nj6PtV1dfGoUvByk1ZF0WYVjIqKDcb3tXY4jonFh3XAWhzMy8xKwN6F2nuK2IcdIwaSPsvuMZmhatP6f9kOE+vnfweyCHS3RxiG474WIoZGJM8omrl3/pOVqE=",
|
||||
"https://oss-cn-beijing.aliyuncs.com/",
|
||||
"LTAI5tKgrfcFQxH46ZwWYgFW",
|
||||
"ZOjTqAJmUL563EKFKySrUwAHtx4hKt",
|
||||
"midi01",
|
||||
"https://midi01.oss-cn-beijing.aliyuncs.com/",
|
||||
"wxc7681513be9f926b",
|
||||
1600096860,
|
||||
"4a521d6f1c6343998b1c8fd425dea02a",
|
||||
"3e8f3add448d4692bc1d04c75ffe801b",
|
||||
"tcp://81.70.45.221",
|
||||
"https://vespa.qxmier.com"),
|
||||
"https://vespa.qxyushen.top/h5"),
|
||||
TEST(//测试环境
|
||||
"http://tmd.qixing2.top/",
|
||||
"http://tmd.xscmmidi.site/",
|
||||
"6rdWuz058oq5OahdbFiGEybUcdahd12J83L34Uc7MrPIrxtFG+rXiwDvRcqNvjwbClbbmvMrmxKVkIysFByBsl0Qe9kqd2w8T/nhK5G6eXXlk2V9AjYCieIU+jRnjZBB+Cfechr6rCGJ2aeBARIsXcRPW7wm9WFK9euh5T+v6Pyte68yNaNdcYCll3+U4/uCEog7HygCnMIbAU+kqoPdmn2H+51YOHW+VsnsHd4w1+I3f8Tt0xLIXGM4GWnQueZ5GR46GTWiSYMy8dCIh9SPIMRyC91GosVcfGPMJSdcXqc=",
|
||||
"https://oss-cn-hangzhou.aliyuncs.com/",
|
||||
"LTAI5tJ2UYfFNF7K3F4e1siv",
|
||||
"DhpCS82gaigZljYqsWsUWUAZ20dREz",
|
||||
"qx-yusheng",
|
||||
"https://qx-yusheng.oss-cn-hangzhou.aliyuncs.com/",
|
||||
"https://oss-cn-beijing.aliyuncs.com/",
|
||||
"LTAI5tKgrfcFQxH46ZwWYgFW",
|
||||
"ZOjTqAJmUL563EKFKySrUwAHtx4hKt",
|
||||
"midi01",
|
||||
"https://midi01.oss-cn-beijing.aliyuncs.com/",
|
||||
"wxc7681513be9f926b",
|
||||
1600096890,
|
||||
"05b406b4541e413887d8d2bf9be8642c",
|
||||
"tcp://47.120.21.132",
|
||||
"https://chatvespa.qxmier.com");
|
||||
"02f7339ec98947deaeab173599891932",
|
||||
"tcp://1.13.181.248",
|
||||
"https://tmd.xscmmidi.site/h5");
|
||||
|
||||
private final String serverUrl;
|
||||
private final String serverUrl;//服务器地址
|
||||
private final String ALI_AUTH_KEY;//阿里云授权key
|
||||
|
||||
private final String ossEndPoint;
|
||||
@@ -37,15 +37,15 @@ public enum EnvironmentEnum {
|
||||
private final String ossBucketName;
|
||||
private final String ossBaseUrl;
|
||||
|
||||
private final String wxAppId;
|
||||
private final String wxAppId;//微信appId
|
||||
|
||||
private final int sdkAppId;//腾讯云sdkAppId im
|
||||
|
||||
private final String swSdkAppId;
|
||||
private final String swSdkAppId;//声网sdkAppId
|
||||
|
||||
private final String mqttUrl;
|
||||
private final String mqttUrl;//MQTT服务器地址
|
||||
|
||||
private final String H5Url;
|
||||
private final String H5Url;//h5地址
|
||||
|
||||
EnvironmentEnum(String serverUrl, String ALI_AUTH_KEY, String ossEndPoint, String ossaAcessKeyId,
|
||||
String ossAccessKeySecret, String ossBucketName, String ossBaseUrl, String wxAppId,
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.xscm.moduleutil.utils.config;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
import com.blankj.utilcode.BuildConfig;
|
||||
import com.xscm.moduleutil.base.CommonAppContext;
|
||||
|
||||
/**
|
||||
*@author
|
||||
*@data
|
||||
@@ -25,13 +28,34 @@ public class EnvironmentPrefs {
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
// 获取当前选择的环境,默认为 PRODUCTION
|
||||
// 获取当前选择的环境,默认根据构建变体决定
|
||||
public EnvironmentEnum getSelectedEnvironment() {
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.TEST.name());
|
||||
// // 检查是否是debug版本(开发版本)
|
||||
// if (BuildConfig.DEBUG) {
|
||||
// return EnvironmentEnum.TEST;
|
||||
// }
|
||||
//
|
||||
// // 检查flavor类型
|
||||
// if ("dev".equals(BuildConfig.FLAVOR)) {
|
||||
// return EnvironmentEnum.TEST;
|
||||
// }
|
||||
//
|
||||
// // 检查包名判断是否为开发版本
|
||||
// try {
|
||||
// String packageName = CommonAppContext.getInstance().getPackageName();
|
||||
// if (packageName.contains(".test") || packageName.contains(".dev")) {
|
||||
// return EnvironmentEnum.TEST;
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// // 忽略异常
|
||||
// }
|
||||
|
||||
// 默认使用生产环境
|
||||
String envName = sharedPreferences.getString(KEY_ENV, EnvironmentEnum.PRODUCTION.name());
|
||||
try {
|
||||
return EnvironmentEnum.valueOf(envName);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return EnvironmentEnum.TEST; // 出错时默认返回生产环境
|
||||
return EnvironmentEnum.PRODUCTION; // 出错时默认返回生产环境
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public class OSSOperUtils {
|
||||
private static final String accessKeySecret = CommonAppContext.getInstance().getCurrentEnvironment().getOssAccessKeySecret();
|
||||
private static final String bucketName = CommonAppContext.getInstance().getCurrentEnvironment().getOssBucketName();
|
||||
public static final String AliYunOSSURLFile = CommonAppContext.getInstance().getCurrentEnvironment().getOssBaseUrl();
|
||||
public static final String img = "img/";
|
||||
public static final String img = "images/android_images/";
|
||||
public static final String video = "video/";
|
||||
public static final String audio = "audio/";
|
||||
|
||||
@@ -68,13 +68,13 @@ public class OSSOperUtils {
|
||||
if (file.getName().contains(".")) {
|
||||
suffix = file.getName().substring(file.getName().lastIndexOf("."));
|
||||
}
|
||||
if (type == 0) {
|
||||
// if (type == 0) {
|
||||
return img + fileMD5 + suffix;
|
||||
} else if (type == 1) {
|
||||
return audio + fileMD5 + suffix;
|
||||
} else {
|
||||
return video + fileMD5 + suffix;
|
||||
}
|
||||
// } else if (type == 1) {
|
||||
// return audio + fileMD5 + suffix;
|
||||
// } else {
|
||||
// return video + fileMD5 + suffix;
|
||||
// }
|
||||
}
|
||||
|
||||
public static OSSOperUtils newInstance() {
|
||||
|
||||
Reference in New Issue
Block a user