Compare commits

..

8 Commits

7 changed files with 125 additions and 52 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Thu Dec 25 16:51:19 HKT 2025 #Fri Dec 26 02:58:19 HKT 2025
stageCount=33 stageCount=35
libraryProject= libraryProject=
baseVersion=15.14 baseVersion=15.14
publishVersion=15.14.32 publishVersion=15.14.34
buildCount=0 buildCount=0
baseBetaVersion=15.14.33 baseBetaVersion=15.14.35

View File

@@ -52,6 +52,7 @@
<application <application
android:name=".App" android:name=".App"
android:process=":main"
android:allowBackup="true" android:allowBackup="true"
android:icon="@drawable/ic_launcher" android:icon="@drawable/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
@@ -65,7 +66,7 @@
<!-- 主活动(主进程) --> <!-- 主活动(主进程) -->
<activity <activity
android:process=".main" android:process=":main"
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/app_name" android:label="@string/app_name"
android:exported="true" android:exported="true"
@@ -122,19 +123,19 @@
<!-- 功能活动(主进程) --> <!-- 功能活动(主进程) -->
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.CrashActivity" android:name=".activities.CrashActivity"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.ClearRecordActivity" android:name=".activities.ClearRecordActivity"
android:parentActivityName="cc.winboll.studio.powerbell.MainActivity" android:parentActivityName="cc.winboll.studio.powerbell.MainActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.BackgroundSettingsActivity" android:name=".activities.BackgroundSettingsActivity"
android:parentActivityName="cc.winboll.studio.powerbell.MainActivity" android:parentActivityName="cc.winboll.studio.powerbell.MainActivity"
android:exported="true" android:exported="true"
@@ -151,53 +152,53 @@
</activity> </activity>
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.BatteryReporterActivity" android:name=".activities.BatteryReporterActivity"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.PixelPickerActivity" android:name=".activities.PixelPickerActivity"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.BatteryReportActivity" android:name=".activities.BatteryReportActivity"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name=".unittest.MainUnitTestActivity" android:name=".unittest.MainUnitTestActivity"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.ShortcutActionActivity" android:name=".activities.ShortcutActionActivity"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name=".activities.SettingsActivity" android:name=".activities.SettingsActivity"
android:exported="false"/> android:exported="false"/>
<activity <activity
android:process=".main" android:process=":main"
android:name="cc.winboll.studio.powerbell.unittest.MainUnitTest2Activity" android:name="cc.winboll.studio.powerbell.unittest.MainUnitTest2Activity"
android:exported="false"/> android:exported="false"/>
<!-- 第三方活动(主进程) --> <!-- 第三方活动(主进程) -->
<activity <activity
android:process=".main" android:process=":main"
android:name="com.yalantis.ucrop.UCropActivity" android:name="com.yalantis.ucrop.UCropActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" android:theme="@style/Theme.AppCompat.Light.NoActionBar"
android:exported="true"/> android:exported="true"/>
<!-- 广播接收器(主进程) --> <!-- 广播接收器(主进程) -->
<receiver <receiver
android:process=":main"
android:name=".receivers.MainReceiver" android:name=".receivers.MainReceiver"
android:enabled="true" android:enabled="true"
android:exported="true" android:exported="true"
android:process=".main"
android:directBootAware="true"> android:directBootAware="true">
<intent-filter android:priority="1000"> <intent-filter android:priority="1000">
<action android:name="android.intent.action.BOOT_COMPLETED"/> <action android:name="android.intent.action.BOOT_COMPLETED"/>
@@ -212,7 +213,8 @@
android:priority="1000" android:priority="1000"
android:enabled="true" android:enabled="true"
android:exported="false" android:exported="false"
android:process=".main" android:process=":main"
android:stopWithTask="false"
android:foregroundServiceType="dataSync"> android:foregroundServiceType="dataSync">
<property <property
android:name="android.app.PROPERTY_SPECIAL_USE_FOREGROUND_SERVICE" android:name="android.app.PROPERTY_SPECIAL_USE_FOREGROUND_SERVICE"
@@ -223,7 +225,8 @@
android:name=".services.AssistantService" android:name=".services.AssistantService"
android:enabled="true" android:enabled="true"
android:exported="false" android:exported="false"
android:process=".assistant" android:process=":assistant"
android:stopWithTask="false"
android:foregroundServiceType="dataSync"> android:foregroundServiceType="dataSync">
<property <property
android:name="android.app.PROPERTY_SPECIAL_USE_FOREGROUND_SERVICE" android:name="android.app.PROPERTY_SPECIAL_USE_FOREGROUND_SERVICE"
@@ -236,7 +239,7 @@
android:authorities="${applicationId}.fileprovider" android:authorities="${applicationId}.fileprovider"
android:exported="false" android:exported="false"
android:grantUriPermissions="true" android:grantUriPermissions="true"
android:process=".main"> android:process=":main">
<meta-data <meta-data
android:name="android.support.FILE_PROVIDER_PATHS" android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider"/> android:resource="@xml/file_provider"/>

View File

@@ -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,25 +52,32 @@ 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;
}
// ===================== 公共静态方法区(工具类实例获取) =====================
/** /**
* 获取应用配置工具实例 * 获取应用配置工具实例
*/ */
public static AppConfigUtils getAppConfigUtils(Context context) { public static AppConfigUtils getAppConfigUtils(Context context) {
LogUtils.d(TAG, String.format("getAppConfigUtils() 调用 | 传入Context类型=%s", LogUtils.d(TAG, String.format("getAppConfigUtils() 调用 | 传入Context类型=%s",
context != null ? context.getClass().getSimpleName() : "null")); context != null ? context.getClass().getSimpleName() : "null"));
if (sAppConfigUtils == null) { if (sAppConfigUtils == null) {
sAppConfigUtils = AppConfigUtils.getInstance(context); sAppConfigUtils = AppConfigUtils.getInstance(context);
LogUtils.d(TAG, "getAppConfigUtils()AppConfigUtils实例已初始化"); LogUtils.d(TAG, "getAppConfigUtils()AppConfigUtils实例已初始化");
@@ -80,7 +90,7 @@ public class App extends GlobalApplication {
*/ */
public static AppCacheUtils getAppCacheUtils(Context context) { public static AppCacheUtils getAppCacheUtils(Context context) {
LogUtils.d(TAG, String.format("getAppCacheUtils() 调用 | 传入Context类型=%s", LogUtils.d(TAG, String.format("getAppCacheUtils() 调用 | 传入Context类型=%s",
context != null ? context.getClass().getSimpleName() : "null")); context != null ? context.getClass().getSimpleName() : "null"));
if (sAppCacheUtils == null) { if (sAppCacheUtils == null) {
sAppCacheUtils = AppCacheUtils.getInstance(context); sAppCacheUtils = AppCacheUtils.getInstance(context);
LogUtils.d(TAG, "getAppCacheUtils()AppCacheUtils实例已初始化"); LogUtils.d(TAG, "getAppCacheUtils()AppCacheUtils实例已初始化");
@@ -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();
// 初始化广播接收器 // 初始化广播接收器
@@ -185,7 +201,7 @@ public class App extends GlobalApplication {
super.onTrimMemory(level); super.onTrimMemory(level);
// 极致强制缓存:禁止任何缓存清理操作,仅记录日志 // 极致强制缓存:禁止任何缓存清理操作,仅记录日志
LogUtils.w(TAG, String.format("%s onTrimMemory() 调用 | 内存等级level=%d | 极致强制保持所有缓存", LogUtils.w(TAG, String.format("%s onTrimMemory() 调用 | 内存等级level=%d | 极致强制保持所有缓存",
CACHE_PROTECT_TAG, level)); CACHE_PROTECT_TAG, level));
// 记录详细缓存状态,不执行任何清理 // 记录详细缓存状态,不执行任何清理
logDetailedCacheStatus(); logDetailedCacheStatus();
} }
@@ -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() 视图控件缓存工具已初始化(极致强制保持,永不销毁)");
} }
@@ -290,7 +314,7 @@ public class App extends GlobalApplication {
LogUtils.d(TAG, String.format("%s Bitmap缓存数量=%d", CACHE_PROTECT_TAG, cacheCount)); LogUtils.d(TAG, String.format("%s Bitmap缓存数量=%d", CACHE_PROTECT_TAG, cacheCount));
} catch (Exception e) { } catch (Exception e) {
LogUtils.d(TAG, String.format("%s Bitmap缓存数量获取失败不影响缓存| 异常信息=%s", LogUtils.d(TAG, String.format("%s Bitmap缓存数量获取失败不影响缓存| 异常信息=%s",
CACHE_PROTECT_TAG, e.getMessage())); CACHE_PROTECT_TAG, e.getMessage()));
} }
} }
// 视图控件缓存状态 // 视图控件缓存状态
@@ -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);
}
}
} }

View File

@@ -48,6 +48,7 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
// ======================== 静态常量(置顶统一,抽离魔法值)======================== // ======================== 静态常量(置顶统一,抽离魔法值)========================
public static final String TAG = "MainActivity"; public static final String TAG = "MainActivity";
private static final int REQUEST_BACKGROUND_SETTINGS_ACTIVITY = 1001; private static final int REQUEST_BACKGROUND_SETTINGS_ACTIVITY = 1001;
public static final String EXTRA_ISRELOAD_BACKGROUNDVIEW = "EXTRA_ISRELOAD_BACKGROUNDVIEW";
private static final long DELAY_LOAD_NON_CRITICAL = 500L; private static final long DELAY_LOAD_NON_CRITICAL = 500L;
public static final int MSG_RELOAD_APPCONFIG = 0; public static final int MSG_RELOAD_APPCONFIG = 0;
public static final int MSG_CURRENTVALUEBATTERY = 1; public static final int MSG_CURRENTVALUEBATTERY = 1;
@@ -98,14 +99,45 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
initCriticalView(); initCriticalView();
initCoreUtilsAsync(); initCoreUtilsAsync();
loadNonCriticalViewDelayed(); loadNonCriticalViewDelayed();
// 处理首次启动的参数
handleReloadBackgroundParam(getIntent());
} }
@Override
protected void onNewIntent(Intent intent) {
super.onNewIntent(intent);
// 关键:将新 Intent 赋值给 Activity 的 Intent确保后续 getIntent() 获取最新值
setIntent(intent);
// 统一处理参数
handleReloadBackgroundParam(intent);
}
/**
* 统一处理刷新背景的参数
* @param intent 启动 MainActivity 的 Intent
*/
private void handleReloadBackgroundParam(Intent intent) {
if (intent == null) {
LogUtils.d(TAG, "handleReloadBackgroundParam: Intent 为空");
return;
}
// 获取传递的参数,默认值为 false
boolean isReloadBackgroundView = intent.getBooleanExtra(EXTRA_ISRELOAD_BACKGROUNDVIEW, false);
if (isReloadBackgroundView) {
LogUtils.d(TAG, "接收到刷新背景视图指令");
// 执行背景刷新逻辑
//App.notifyMessage(TAG, "reloadBackgroundView");
reloadBackgroundView();
}
}
@Override @Override
protected void onPostCreate(Bundle savedInstanceState) { protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState); super.onPostCreate(savedInstanceState);
LogUtils.d(TAG, String.format("onPostCreate() | savedInstanceState=%s", savedInstanceState)); LogUtils.d(TAG, String.format("onPostCreate() | savedInstanceState=%s", savedInstanceState));
mPermissionUtils.startPermissionRequest(this); mPermissionUtils.startPermissionRequest(this);
LogUtils.d(TAG, "onPostCreate: 发起权限申请");
} }
@Override @Override
@@ -304,6 +336,10 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
LogUtils.d(TAG, "initMainContentView: 核心内容视图已初始化"); LogUtils.d(TAG, "initMainContentView: 核心内容视图已初始化");
} }
private void reloadBackgroundView() {
mMainContentView.reloadBackgroundView();
}
private void initCriticalView() { private void initCriticalView() {
LogUtils.d(TAG, "initCriticalView()"); LogUtils.d(TAG, "initCriticalView()");
sMainActivity = this; sMainActivity = this;

View File

@@ -25,6 +25,8 @@ import androidx.core.content.FileProvider;
import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog; import cc.winboll.studio.libaes.dialogs.YesNoAlertDialog;
import cc.winboll.studio.libappbase.LogUtils; import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.libappbase.ToastUtils; import cc.winboll.studio.libappbase.ToastUtils;
import cc.winboll.studio.powerbell.App;
import cc.winboll.studio.powerbell.MainActivity;
import cc.winboll.studio.powerbell.R; import cc.winboll.studio.powerbell.R;
import cc.winboll.studio.powerbell.dialogs.BackgroundPicturePreviewDialog; import cc.winboll.studio.powerbell.dialogs.BackgroundPicturePreviewDialog;
import cc.winboll.studio.powerbell.dialogs.ColorPaletteDialog; import cc.winboll.studio.powerbell.dialogs.ColorPaletteDialog;
@@ -937,6 +939,10 @@ public class BackgroundSettingsActivity extends WinBoLLActivity {
mBgSourceUtils.commitPreviewSourceToCurrent(); mBgSourceUtils.commitPreviewSourceToCurrent();
isCommitSettings = true; isCommitSettings = true;
finish(); finish();
//App.notifyMessage(TAG, "startActivity");
Intent mainIntent = new Intent(BackgroundSettingsActivity.this, MainActivity.class);
mainIntent.putExtra(MainActivity.EXTRA_ISRELOAD_BACKGROUNDVIEW, true);
startActivity(mainIntent);
} }
@Override @Override

View File

@@ -9,6 +9,7 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.Toast; import android.widget.Toast;
import cc.winboll.studio.libappbase.LogUtils; import cc.winboll.studio.libappbase.LogUtils;
import cc.winboll.studio.powerbell.App;
import cc.winboll.studio.powerbell.MainActivity; import cc.winboll.studio.powerbell.MainActivity;
import cc.winboll.studio.powerbell.R; import cc.winboll.studio.powerbell.R;
import cc.winboll.studio.powerbell.activities.BackgroundSettingsActivity; import cc.winboll.studio.powerbell.activities.BackgroundSettingsActivity;
@@ -135,6 +136,7 @@ public class BackgroundPicturePreviewDialog extends Dialog {
// 解析Uri为文件路径 // 解析Uri为文件路径
String szSrcImage = UriUtils.getFilePathFromUri(mContext, mUriRecivedPicture); String szSrcImage = UriUtils.getFilePathFromUri(mContext, mUriRecivedPicture);
//App.notifyMessage(TAG, "szSrcImage : " + szSrcImage);
if (TextUtils.isEmpty(szSrcImage)) { if (TextUtils.isEmpty(szSrcImage)) {
LogUtils.w(TAG, "【previewRecivedPicture】解析的文件路径为空"); LogUtils.w(TAG, "【previewRecivedPicture】解析的文件路径为空");
Toast.makeText(mContext, TOAST_MSG_EMPTY_FILE, Toast.LENGTH_SHORT).show(); Toast.makeText(mContext, TOAST_MSG_EMPTY_FILE, Toast.LENGTH_SHORT).show();

View File

@@ -154,7 +154,7 @@ 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) {
App.sBackgroundSourceUtils.loadSettings(); App.sBackgroundSourceUtils.loadSettings();
BackgroundBean backgroundBean = App.sBackgroundSourceUtils.getCurrentBackgroundBean(); BackgroundBean backgroundBean = App.sBackgroundSourceUtils.getCurrentBackgroundBean();
@@ -197,6 +197,15 @@ public class MainContentView {
LogUtils.d(TAG, "【bindViews】视图绑定完成"); LogUtils.d(TAG, "【bindViews】视图绑定完成");
} }
public void reloadBackgroundView() {
if (backgroundView != null) {
App.sBackgroundSourceUtils.loadSettings();
BackgroundBean backgroundBean = App.sBackgroundSourceUtils.getCurrentBackgroundBean();
backgroundView.loadByBackgroundBean(backgroundBean, true);
//App.notifyMessage(TAG, "reloadBackgroundView");
}
}
/** /**
* 初始化电池 Drawable集成 BatteryDrawable默认能量风格适配小米机型渲染 * 初始化电池 Drawable集成 BatteryDrawable默认能量风格适配小米机型渲染
*/ */