背景图片控件测试通过,现在的问题就剩下,应用全局位图缓存问题与图片路径传递问题。

This commit is contained in:
2025-12-11 18:48:42 +08:00
parent 1db7c9bf80
commit 2c77bf775b
2 changed files with 5 additions and 5 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Thu Dec 11 05:06:43 GMT 2025 #Thu Dec 11 10:46:09 GMT 2025
stageCount=15 stageCount=15
libraryProject= libraryProject=
baseVersion=15.12 baseVersion=15.12
publishVersion=15.12.14 publishVersion=15.12.14
buildCount=23 buildCount=26
baseBetaVersion=15.12.15 baseBetaVersion=15.12.15

View File

@@ -35,7 +35,7 @@ public class MainUnitTestActivity extends AppCompatActivity {
BackgroundView mBackgroundView; BackgroundView mBackgroundView;
// 测试图片路径用Environment获取适配低版本避免硬编码 // 测试图片路径用Environment获取适配低版本避免硬编码
String szTestSource = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) String szTestSource = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)
+ "/PowerBell/unittest/2ae9dc9e-7a73-49d4-840a-7ff1712d868c1764798674763.jpeg"; + "/PowerBell/unittest/1764946782079.jpeg";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@@ -90,7 +90,7 @@ public class MainUnitTestActivity extends AppCompatActivity {
LogUtils.d(TAG, "【裁剪测试】创建输出目录:" + outputDir.getAbsolutePath()); LogUtils.d(TAG, "【裁剪测试】创建输出目录:" + outputDir.getAbsolutePath());
} }
String dstOutputPath = outputDir.getAbsolutePath() String dstOutputPath = outputDir.getAbsolutePath()
+ "/SelectCompress_2ae9dc9e-7a73-49d4-840a-7ff1712d868c1764798674763.jpeg"; + "/1764946782079-crop.jpeg";
// 修复3自由裁剪时比例传0避免100:100过大导致机型崩溃 // 修复3自由裁剪时比例传0避免100:100过大导致机型崩溃
ImageCropUtils.startImageCrop( ImageCropUtils.startImageCrop(
@@ -161,7 +161,7 @@ public class MainUnitTestActivity extends AppCompatActivity {
// 裁剪完成后回收权限 // 裁剪完成后回收权限
if (requestCode == REQUEST_CROP_IMAGE) { if (requestCode == REQUEST_CROP_IMAGE) {
String dstOutputPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES) String dstOutputPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)
+ "/PowerBell/unittest/SelectCompress_2ae9dc9e-7a73-49d4-840a-7ff1712d868c1764798674763.jpeg"; + "/PowerBell/unittest/1764946782079-crop.jpeg";
//Uri outputUri = ImageCropUtils.getFileProviderUriPublic(this, new File(dstOutputPath)); //Uri outputUri = ImageCropUtils.getFileProviderUriPublic(this, new File(dstOutputPath));
//ImageCropUtils.releaseCropPermission(this, outputUri); //ImageCropUtils.releaseCropPermission(this, outputUri);
mBackgroundView.loadImage(dstOutputPath); mBackgroundView.loadImage(dstOutputPath);