修复接收分享图片后的主界面更新问题。
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Thu Dec 25 16:23:58 GMT 2025
|
#Thu Dec 25 18:53:54 GMT 2025
|
||||||
stageCount=34
|
stageCount=34
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.14
|
baseVersion=15.14
|
||||||
publishVersion=15.14.33
|
publishVersion=15.14.33
|
||||||
buildCount=11
|
buildCount=39
|
||||||
baseBetaVersion=15.14.34
|
baseBetaVersion=15.14.34
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ public class App extends GlobalApplication {
|
|||||||
private static final int INVALID_BATTERY_VALUE = -1;
|
private static final int INVALID_BATTERY_VALUE = -1;
|
||||||
|
|
||||||
// ===================== 静态属性区(按工具类优先级排序) =====================
|
// ===================== 静态属性区(按工具类优先级排序) =====================
|
||||||
|
// 应用单例
|
||||||
|
private static App sApp;
|
||||||
|
|
||||||
// 数据配置工具
|
// 数据配置工具
|
||||||
public static AppConfigUtils sAppConfigUtils;
|
public static AppConfigUtils sAppConfigUtils;
|
||||||
private static AppCacheUtils sAppCacheUtils;
|
private static AppCacheUtils sAppCacheUtils;
|
||||||
@@ -49,19 +52,26 @@ public class App extends GlobalApplication {
|
|||||||
public static BitmapCacheUtils sBitmapCacheUtils;
|
public static BitmapCacheUtils sBitmapCacheUtils;
|
||||||
|
|
||||||
// 全局视图控件缓存工具(极致强制保持:一旦初始化,永不销毁)
|
// 全局视图控件缓存工具(极致强制保持:一旦初始化,永不销毁)
|
||||||
// 核心修改:改为私有静态,通过实例方法获取,避免全局通用暴露
|
|
||||||
private static MemoryCachedBackgroundView sMemoryCachedBackgroundView;
|
private static MemoryCachedBackgroundView sMemoryCachedBackgroundView;
|
||||||
|
|
||||||
|
// 电池状态
|
||||||
public static volatile int sQuantityOfElectricity = INVALID_BATTERY_VALUE;
|
public static volatile int sQuantityOfElectricity = INVALID_BATTERY_VALUE;
|
||||||
|
|
||||||
|
// 通知管理工具
|
||||||
|
private static NotificationManagerUtils sNotificationManagerUtils;
|
||||||
|
|
||||||
// ===================== 成员属性区(按生命周期关联度排序) =====================
|
// ===================== 成员属性区(按生命周期关联度排序) =====================
|
||||||
// 全局广播接收器
|
// 全局广播接收器
|
||||||
private GlobalApplicationReceiver mGlobalReceiver;
|
private GlobalApplicationReceiver mGlobalReceiver;
|
||||||
|
|
||||||
// 通知管理工具
|
// ===================== 公共静态方法区(工具类实例获取/单例) =====================
|
||||||
private static NotificationManagerUtils sNotificationManagerUtils;
|
/**
|
||||||
private static App sApp;
|
* 获取应用单例实例
|
||||||
|
*/
|
||||||
|
public static App getInstance() {
|
||||||
|
return sApp;
|
||||||
|
}
|
||||||
|
|
||||||
// ===================== 公共静态方法区(工具类实例获取) =====================
|
|
||||||
/**
|
/**
|
||||||
* 获取应用配置工具实例
|
* 获取应用配置工具实例
|
||||||
*/
|
*/
|
||||||
@@ -88,13 +98,6 @@ public class App extends GlobalApplication {
|
|||||||
return sAppCacheUtils;
|
return sAppCacheUtils;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取应用单例实例
|
|
||||||
*/
|
|
||||||
public static App getInstance() {
|
|
||||||
return sApp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===================== 公共成员方法区(业务功能) =====================
|
// ===================== 公共成员方法区(业务功能) =====================
|
||||||
/**
|
/**
|
||||||
* 清除电池历史数据
|
* 清除电池历史数据
|
||||||
@@ -139,12 +142,26 @@ public class App extends GlobalApplication {
|
|||||||
return sMemoryCachedBackgroundView;
|
return sMemoryCachedBackgroundView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送调试通知
|
||||||
|
*/
|
||||||
|
public static void notifyMessage(String title, String content) {
|
||||||
|
LogUtils.d(TAG, String.format("notifyMessage() 调用 | title=%s | content=%s", title, content));
|
||||||
|
if (isDebugging() && sApp != null && sNotificationManagerUtils != null) {
|
||||||
|
NotificationMessage message = new NotificationMessage(title, content, "");
|
||||||
|
sNotificationManagerUtils.showMessageNotification(sApp, message);
|
||||||
|
LogUtils.d(TAG, "notifyMessage():调试通知发送成功");
|
||||||
|
} else {
|
||||||
|
LogUtils.d(TAG, "notifyMessage():调试通知发送失败(条件不满足)");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ===================== 生命周期方法区(按执行顺序排序) =====================
|
// ===================== 生命周期方法区(按执行顺序排序) =====================
|
||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
sApp = this;
|
|
||||||
LogUtils.d(TAG, "onCreate() 应用启动,开始初始化");
|
LogUtils.d(TAG, "onCreate() 应用启动,开始初始化");
|
||||||
|
sApp = this;
|
||||||
|
|
||||||
// 初始化调试模式
|
// 初始化调试模式
|
||||||
setIsDebugging(BuildConfig.DEBUG);
|
setIsDebugging(BuildConfig.DEBUG);
|
||||||
@@ -152,7 +169,6 @@ public class App extends GlobalApplication {
|
|||||||
|
|
||||||
// 初始化基础工具
|
// 初始化基础工具
|
||||||
initBaseTools();
|
initBaseTools();
|
||||||
//App.notifyMessage(TAG, "onCreate() 应用启动中。。。");
|
|
||||||
// 初始化工具类实例(核心:极致强制缓存,永不销毁)
|
// 初始化工具类实例(核心:极致强制缓存,永不销毁)
|
||||||
initUtils();
|
initUtils();
|
||||||
// 初始化广播接收器
|
// 初始化广播接收器
|
||||||
@@ -201,15 +217,14 @@ public class App extends GlobalApplication {
|
|||||||
|
|
||||||
// ===================== 私有初始化方法区(按初始化顺序排序) =====================
|
// ===================== 私有初始化方法区(按初始化顺序排序) =====================
|
||||||
/**
|
/**
|
||||||
* 初始化基础工具(Activity管理、Toast)
|
* 初始化基础工具(Activity管理、Toast、通知工具)
|
||||||
*/
|
*/
|
||||||
private void initBaseTools() {
|
private void initBaseTools() {
|
||||||
LogUtils.d(TAG, "initBaseTools() 开始初始化基础工具");
|
LogUtils.d(TAG, "initBaseTools() 开始初始化基础工具");
|
||||||
WinBoLLActivityManager.init(this);
|
WinBoLLActivityManager.init(this);
|
||||||
ToastUtils.init(this);
|
ToastUtils.init(this);
|
||||||
LogUtils.d(TAG, "initBaseTools() 基础工具初始化完成");
|
|
||||||
sNotificationManagerUtils = new NotificationManagerUtils(this);
|
sNotificationManagerUtils = new NotificationManagerUtils(this);
|
||||||
LogUtils.d(TAG, "initBaseTools() 工具类初始化完成,极致强制缓存策略已生效");
|
LogUtils.d(TAG, "initBaseTools() 基础工具+通知工具初始化完成,极致强制缓存策略已生效");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -217,22 +232,31 @@ public class App extends GlobalApplication {
|
|||||||
*/
|
*/
|
||||||
private void initUtils() {
|
private void initUtils() {
|
||||||
LogUtils.d(TAG, "initUtils() 开始初始化工具类,启用极致强制缓存策略");
|
LogUtils.d(TAG, "initUtils() 开始初始化工具类,启用极致强制缓存策略");
|
||||||
//App.notifyMessage(TAG, "initUtils() 开始初始化工具类,启用极致强制缓存策略");
|
// 初始化配置&缓存工具
|
||||||
sAppConfigUtils = getAppConfigUtils(this);
|
sAppConfigUtils = getAppConfigUtils(this);
|
||||||
sAppCacheUtils = getAppCacheUtils(this);
|
sAppCacheUtils = getAppCacheUtils(this);
|
||||||
|
|
||||||
|
// 初始化背景资源工具
|
||||||
sBackgroundSourceUtils = BackgroundSourceUtils.getInstance(this);
|
sBackgroundSourceUtils = BackgroundSourceUtils.getInstance(this);
|
||||||
sBackgroundSourceUtils.loadSettings();
|
sBackgroundSourceUtils.loadSettings();
|
||||||
|
LogUtils.d(TAG, "initUtils() 背景资源工具已初始化");
|
||||||
|
|
||||||
// 极致强制初始化Bitmap缓存工具(必初始化,永不销毁)
|
// 极致强制初始化Bitmap缓存工具(必初始化,永不销毁)
|
||||||
sBitmapCacheUtils = BitmapCacheUtils.getInstance();
|
sBitmapCacheUtils = BitmapCacheUtils.getInstance();
|
||||||
LogUtils.d(TAG, "initUtils() Bitmap缓存工具已初始化(极致强制保持,永不销毁)");
|
LogUtils.d(TAG, "initUtils() Bitmap缓存工具已初始化(极致强制保持,永不销毁)");
|
||||||
|
|
||||||
// 极致强制初始化视图控件缓存工具(必初始化,永不销毁)
|
// 极致强制初始化视图控件缓存工具(必初始化,永不销毁)
|
||||||
|
// if(sMemoryCachedBackgroundView == null) {
|
||||||
|
// App.notifyMessage(TAG, "sMemoryCachedBackgroundView == null");
|
||||||
|
// }
|
||||||
sMemoryCachedBackgroundView = MemoryCachedBackgroundView.getLastInstance(this);
|
sMemoryCachedBackgroundView = MemoryCachedBackgroundView.getLastInstance(this);
|
||||||
if (sMemoryCachedBackgroundView == null) {
|
if (sMemoryCachedBackgroundView == null) {
|
||||||
//App.notifyMessage(TAG, "sMemoryCachedBackgroundView == null");
|
|
||||||
sMemoryCachedBackgroundView = MemoryCachedBackgroundView.getInstance(this, sBackgroundSourceUtils.getCurrentBackgroundBean(), true);
|
sMemoryCachedBackgroundView = MemoryCachedBackgroundView.getInstance(this, sBackgroundSourceUtils.getCurrentBackgroundBean(), true);
|
||||||
|
LogUtils.d(TAG, "initUtils() 视图控件缓存工具已新建实例");
|
||||||
|
//App.notifyMessage(TAG, "没有使用缓存控件");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//App.notifyMessage(TAG, "initUtils() 视图控件缓存工具已初始化(极致强制保持,永不销毁)");
|
||||||
LogUtils.d(TAG, "initUtils() 视图控件缓存工具已初始化(极致强制保持,永不销毁)");
|
LogUtils.d(TAG, "initUtils() 视图控件缓存工具已初始化(极致强制保持,永不销毁)");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -302,12 +326,5 @@ public class App extends GlobalApplication {
|
|||||||
}
|
}
|
||||||
LogUtils.d(TAG, "logDetailedCacheStatus() 详细缓存状态记录完成,所有缓存均极致强制保持");
|
LogUtils.d(TAG, "logDetailedCacheStatus() 详细缓存状态记录完成,所有缓存均极致强制保持");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void notifyMessage(String title, String content) {
|
|
||||||
if (isDebugging() && sApp != null && sNotificationManagerUtils != null) {
|
|
||||||
NotificationMessage message = new NotificationMessage(title, content, "");
|
|
||||||
sNotificationManagerUtils.showMessageNotification(sApp, message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
|
|||||||
if (isReloadBackgroundView) {
|
if (isReloadBackgroundView) {
|
||||||
LogUtils.d(TAG, "接收到刷新背景视图指令");
|
LogUtils.d(TAG, "接收到刷新背景视图指令");
|
||||||
// 执行背景刷新逻辑
|
// 执行背景刷新逻辑
|
||||||
App.notifyMessage(TAG, "reloadBackgroundView");
|
//App.notifyMessage(TAG, "reloadBackgroundView");
|
||||||
reloadBackgroundView();
|
reloadBackgroundView();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,9 +154,11 @@ public class MainContentView {
|
|||||||
mainLayout = (RelativeLayout) rootView.findViewById(R.id.activitymainRelativeLayout1);
|
mainLayout = (RelativeLayout) rootView.findViewById(R.id.activitymainRelativeLayout1);
|
||||||
mllBackgroundView = (LinearLayout) rootView.findViewById(R.id.ll_backgroundview);
|
mllBackgroundView = (LinearLayout) rootView.findViewById(R.id.ll_backgroundview);
|
||||||
|
|
||||||
backgroundView = App.getInstance().getMemoryCachedBackgroundView().getLastInstance(mContext);
|
backgroundView = App.getInstance().getMemoryCachedBackgroundView();
|
||||||
if (backgroundView == null) {
|
if (backgroundView == null) {
|
||||||
reloadBackgroundView();
|
App.sBackgroundSourceUtils.loadSettings();
|
||||||
|
BackgroundBean backgroundBean = App.sBackgroundSourceUtils.getCurrentBackgroundBean();
|
||||||
|
backgroundView = App.getInstance().getMemoryCachedBackgroundView().getInstance(mContext, backgroundBean, true);
|
||||||
}
|
}
|
||||||
if (backgroundView.getParent() != null) {
|
if (backgroundView.getParent() != null) {
|
||||||
((ViewGroup) backgroundView.getParent()).removeView(backgroundView);
|
((ViewGroup) backgroundView.getParent()).removeView(backgroundView);
|
||||||
@@ -196,9 +198,12 @@ public class MainContentView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void reloadBackgroundView() {
|
public void reloadBackgroundView() {
|
||||||
|
if (backgroundView != null) {
|
||||||
App.sBackgroundSourceUtils.loadSettings();
|
App.sBackgroundSourceUtils.loadSettings();
|
||||||
BackgroundBean backgroundBean = App.sBackgroundSourceUtils.getCurrentBackgroundBean();
|
BackgroundBean backgroundBean = App.sBackgroundSourceUtils.getCurrentBackgroundBean();
|
||||||
backgroundView = App.getInstance().getMemoryCachedBackgroundView().getInstance(mContext, backgroundBean, true);
|
backgroundView.loadByBackgroundBean(backgroundBean, true);
|
||||||
|
//App.notifyMessage(TAG, "reloadBackgroundView");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user