diff --git a/powerbell/build.gradle b/powerbell/build.gradle index dc50cadf..aac6f431 100644 --- a/powerbell/build.gradle +++ b/powerbell/build.gradle @@ -78,7 +78,7 @@ dependencies { //api 'androidx.fragment:fragment:1.1.0' implementation 'cc.winboll.studio:libaes:15.11.8' - implementation 'cc.winboll.studio:libappbase:15.11.0' + implementation 'cc.winboll.studio:libappbase:15.11.2' //api fileTree(dir: 'libs', include: ['*.aar']) api fileTree(dir: 'libs', include: ['*.jar']) diff --git a/powerbell/build.properties b/powerbell/build.properties index a13b5f61..be4a8199 100644 --- a/powerbell/build.properties +++ b/powerbell/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Thu Nov 27 13:48:13 GMT 2025 +#Fri Nov 28 18:45:48 GMT 2025 stageCount=11 libraryProject= baseVersion=15.11 publishVersion=15.11.10 -buildCount=21 +buildCount=29 baseBetaVersion=15.11.11 diff --git a/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundPictureActivity.java b/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundPictureActivity.java index dac5108c..c26381cb 100644 --- a/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundPictureActivity.java +++ b/powerbell/src/main/java/cc/winboll/studio/powerbell/activities/BackgroundPictureActivity.java @@ -53,16 +53,18 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr private File mfPictureDir; // 拍照与剪裁临时文件夹 private File mfTakePhoto; // 拍照文件 private File mfRecivedPicture; // 接收的图片文件 - private File mfTempCropPicture; // 剪裁临时文件 - + // 背景视图预览图片的文件名 private String preViewFilePathBackgroundView = ""; BackgroundView bvPreviewBackground; boolean isCommitSettings = false; // 静态变量 - //public static String _mszRecivedCropPicture = "RecivedCrop.jpg"; - // 源文件的剪裁图片保存名称 + // 源文件的临时剪裁图片保存名称 + private static String _mSourceCropTempFileName = "SourceCropTemp.jpg"; + // 源文件的临时剪裁图片保存文件对象 + private static File _mSourceCropTempFile; + // 源文件的剪裁图片保存名称 private static String _mSourceCroppedFileName = "SourceCropped.jpg"; // 源文件的剪裁图片保存文件对象 private static File _mSourceCroppedFile; @@ -102,9 +104,10 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr // 初始化文件对象 mfTakePhoto = new File(mfPictureDir, "TakePhoto.jpg"); - mfTempCropPicture = new File(mfPictureDir, "TempCrop.jpg"); + //mfTempCropPicture = new File(mfPictureDir, "TempCrop.jpg"); mfRecivedPicture = getRecivedPictureFile(); + _mSourceCropTempFile = new File(mfBackgroundDir, _mSourceCropTempFileName); _mSourceCroppedFile = new File(mfBackgroundDir, _mSourceCroppedFileName); _mSourceCroppedFilePath = _mSourceCroppedFile.getAbsolutePath().toString(); LogUtils.d(TAG, String.format("_mSourceCroppedFilePath : %s", _mSourceCroppedFilePath)); @@ -359,19 +362,20 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr Uri uri = UriUtil.getUriForFile(this, mfRecivedPicture); LogUtils.d(TAG, "uri : " + uri.toString()); - if (mfTempCropPicture.exists()) { - mfTempCropPicture.delete(); + if (_mSourceCropTempFile.exists()) { + _mSourceCropTempFile.delete(); } + try { - mfTempCropPicture.createNewFile(); + _mSourceCropTempFile.createNewFile(); } catch (IOException e) { LogUtils.d(TAG, e, Thread.currentThread().getStackTrace()); ToastUtils.show("剪裁临时文件创建失败"); return; } - Uri cropOutPutUri = Uri.fromFile(mfTempCropPicture); - LogUtils.d(TAG, "mfTempCropPicture : " + mfTempCropPicture.getPath()); + Uri cropOutPutUri = Uri.fromFile(_mSourceCropTempFile); + LogUtils.d(TAG, "mfTempCropPicture : " + _mSourceCropTempFile.getPath()); Intent intent = new Intent("com.android.camera.action.CROP"); intent.setDataAndType(uri, "image/" + _mszCommonFileType); @@ -547,8 +551,9 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr // 方案1:通过Intent获取剪裁后的Bitmap if (data != null && data.hasExtra("data")) { cropBitmap = data.getParcelableExtra("data"); - } else if (mfTempCropPicture.exists()) { - cropBitmap = BitmapFactory.decodeFile(mfTempCropPicture.getPath()); + } else if (_mSourceCropTempFile.exists()) { + LogUtils.d(TAG, String.format("_mSourceCropTempFile Exists, Path is :%s ", _mSourceCropTempFile.getPath())); + cropBitmap = BitmapFactory.decodeFile(_mSourceCropTempFile.getPath()); } else { ToastUtils.show("剪裁文件不存在"); return; @@ -696,7 +701,7 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr @Override public void onYes() { - bvPreviewBackground.saveToBackgroundSources(preViewFilePathBackgroundView); + bvPreviewBackground.setImageViewSource(preViewFilePathBackgroundView); isCommitSettings = true; finish(); } 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 88e0a9be..30cdebc4 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 @@ -106,7 +106,7 @@ public class BackgroundView extends RelativeLayout { /** * 拷贝图片文件到背景资源目录(正式背景) */ - public void saveToBackgroundSources(String srcBackgroundPath) { + public void setImageViewSource(String srcBackgroundPath) { initBackgroundImagePath(); if (backgroundSourceFilePath == null) { LogUtils.e(TAG, "目标路径初始化失败,无法保存背景图片");