diff --git a/powerbell/build.properties b/powerbell/build.properties index 477b97b..c1cb614 100644 --- a/powerbell/build.properties +++ b/powerbell/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Thu Dec 11 11:14:29 GMT 2025 +#Thu Dec 11 12:47:00 GMT 2025 stageCount=15 libraryProject= baseVersion=15.12 publishVersion=15.12.14 -buildCount=28 +buildCount=41 baseBetaVersion=15.12.15 diff --git a/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundSettingsActivity.java b/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundSettingsActivity.java index 2fc4170..3c3ecb6 100644 --- a/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundSettingsActivity.java +++ b/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundSettingsActivity.java @@ -394,7 +394,7 @@ public class BackgroundSettingsActivity extends WinBoLLActivity implements Backg // 第一重刷新 try { mBgSourceUtils.loadSettings(); - mBackgroundView.loadBackgroundBean(mBgSourceUtils.getPreviewBackgroundBean()); + mBackgroundView.loadBackgroundBean(mBgSourceUtils.getPreviewBackgroundBean(), true); LogUtils.d(TAG, "【双重刷新】第一重完成"); } catch (Exception e) { LogUtils.e(TAG, "【双重刷新】第一重异常:" + e.getMessage()); @@ -408,7 +408,7 @@ public class BackgroundSettingsActivity extends WinBoLLActivity implements Backg if (mBackgroundView != null && !isFinishing() && mBgSourceUtils != null) { try { mBgSourceUtils.loadSettings(); - mBackgroundView.loadBackgroundBean(mBgSourceUtils.getPreviewBackgroundBean()); + mBackgroundView.loadBackgroundBean(mBgSourceUtils.getPreviewBackgroundBean(), true); LogUtils.d(TAG, "【双重刷新】第二重完成"); } catch (Exception e) { LogUtils.e(TAG, "【双重刷新】第二重异常:" + e.getMessage()); @@ -817,17 +817,16 @@ public class BackgroundSettingsActivity extends WinBoLLActivity implements Backg */ boolean putUriFileToPreviewSource(File srcFile) { LogUtils.d(TAG, String.format("putUriFileToPreviewSource(File srcFile) srcFile %s", srcFile)); - mBgSourceUtils.loadSettings(); - BackgroundBean previewBean = mBgSourceUtils.getPreviewBackgroundBean(); - // 核心修复:将预览Bean的路径更新为选中图片的路径 - previewBean.setBackgroundFilePath(srcFile.getAbsolutePath()); - // 同步压缩图路径(避免裁剪输出路径错误) - String compressPath = mBgSourceUtils.getBackgroundSourceDirPath() + "/cache/SelectCompress_" + srcFile.getName(); - previewBean.setBackgroundScaledCompressFilePath(compressPath); - mBgSourceUtils.saveSettings(); // 保存修改后的Bean - - File dstFile = new File(previewBean.getBackgroundFilePath()); - return FileUtils.copyFile(srcFile, dstFile); + mBgSourceUtils.loadSettings(); + BackgroundBean previewBean = mBgSourceUtils.getPreviewBackgroundBean(); + File dstFile = new File(previewBean.getBackgroundFilePath()); + LogUtils.d(TAG, String.format("putUriFileToPreviewSource(File srcFile) dstFile %s", dstFile)); + if (FileUtils.copyFile(srcFile, dstFile)) { + LogUtils.d(TAG, "putUriFileToPreviewSource(File srcFile) 文件拷贝成功。 "); + return true; + } + LogUtils.d(TAG, "putUriFileToPreviewSource(File srcFile) 文件无法拷贝。 "); + return false; } /** diff --git a/powerbell/src/main/java/cc/winboll/studio/powerbell/views/BackgroundView.java b/powerbell/src/main/java/cc/winboll/studio/powerbell/views/BackgroundView.java index 39a14c8..058d7d7 100644 --- a/powerbell/src/main/java/cc/winboll/studio/powerbell/views/BackgroundView.java +++ b/powerbell/src/main/java/cc/winboll/studio/powerbell/views/BackgroundView.java @@ -104,6 +104,10 @@ public class BackgroundView extends RelativeLayout { } public void loadBackgroundBean(BackgroundBean bean) { + loadBackgroundBean(bean, false); + } + + public void loadBackgroundBean(BackgroundBean bean, boolean isRefresh) { if (!bean.isUseBackgroundFile()) { setDefaultTransparentBackground(); return; @@ -111,8 +115,18 @@ public class BackgroundView extends RelativeLayout { String targetPath = bean.isUseBackgroundScaledCompressFile() ? bean.getBackgroundScaledCompressFilePath() : bean.getBackgroundFilePath(); - // 调用带路径判断的loadImage方法 - loadImage(targetPath); + + if (!(new File(targetPath).exists())) { + LogUtils.d(TAG, String.format("视图控件图片不存在:%s", targetPath)); + return; + } + + // 调用带路径判断的loadImage方法 + if (isRefresh) { + App._mBitmapCacheUtils.removeCachedBitmap(targetPath); + App._mBitmapCacheUtils.cacheBitmap(targetPath); + } + loadImage(targetPath); } // ====================================== 对外方法 ======================================