更正基础类库,方便调试,继续调试。。。
This commit is contained in:
@@ -78,7 +78,7 @@ dependencies {
|
|||||||
//api 'androidx.fragment:fragment:1.1.0'
|
//api 'androidx.fragment:fragment:1.1.0'
|
||||||
|
|
||||||
implementation 'cc.winboll.studio:libaes:15.11.8'
|
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: ['*.aar'])
|
||||||
api fileTree(dir: 'libs', include: ['*.jar'])
|
api fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#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
|
stageCount=11
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.11
|
baseVersion=15.11
|
||||||
publishVersion=15.11.10
|
publishVersion=15.11.10
|
||||||
buildCount=21
|
buildCount=29
|
||||||
baseBetaVersion=15.11.11
|
baseBetaVersion=15.11.11
|
||||||
|
|||||||
@@ -53,16 +53,18 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr
|
|||||||
private File mfPictureDir; // 拍照与剪裁临时文件夹
|
private File mfPictureDir; // 拍照与剪裁临时文件夹
|
||||||
private File mfTakePhoto; // 拍照文件
|
private File mfTakePhoto; // 拍照文件
|
||||||
private File mfRecivedPicture; // 接收的图片文件
|
private File mfRecivedPicture; // 接收的图片文件
|
||||||
private File mfTempCropPicture; // 剪裁临时文件
|
|
||||||
|
|
||||||
// 背景视图预览图片的文件名
|
// 背景视图预览图片的文件名
|
||||||
private String preViewFilePathBackgroundView = "";
|
private String preViewFilePathBackgroundView = "";
|
||||||
BackgroundView bvPreviewBackground;
|
BackgroundView bvPreviewBackground;
|
||||||
boolean isCommitSettings = false;
|
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 String _mSourceCroppedFileName = "SourceCropped.jpg";
|
||||||
// 源文件的剪裁图片保存文件对象
|
// 源文件的剪裁图片保存文件对象
|
||||||
private static File _mSourceCroppedFile;
|
private static File _mSourceCroppedFile;
|
||||||
@@ -102,9 +104,10 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr
|
|||||||
|
|
||||||
// 初始化文件对象
|
// 初始化文件对象
|
||||||
mfTakePhoto = new File(mfPictureDir, "TakePhoto.jpg");
|
mfTakePhoto = new File(mfPictureDir, "TakePhoto.jpg");
|
||||||
mfTempCropPicture = new File(mfPictureDir, "TempCrop.jpg");
|
//mfTempCropPicture = new File(mfPictureDir, "TempCrop.jpg");
|
||||||
|
|
||||||
mfRecivedPicture = getRecivedPictureFile();
|
mfRecivedPicture = getRecivedPictureFile();
|
||||||
|
_mSourceCropTempFile = new File(mfBackgroundDir, _mSourceCropTempFileName);
|
||||||
_mSourceCroppedFile = new File(mfBackgroundDir, _mSourceCroppedFileName);
|
_mSourceCroppedFile = new File(mfBackgroundDir, _mSourceCroppedFileName);
|
||||||
_mSourceCroppedFilePath = _mSourceCroppedFile.getAbsolutePath().toString();
|
_mSourceCroppedFilePath = _mSourceCroppedFile.getAbsolutePath().toString();
|
||||||
LogUtils.d(TAG, String.format("_mSourceCroppedFilePath : %s", _mSourceCroppedFilePath));
|
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);
|
Uri uri = UriUtil.getUriForFile(this, mfRecivedPicture);
|
||||||
LogUtils.d(TAG, "uri : " + uri.toString());
|
LogUtils.d(TAG, "uri : " + uri.toString());
|
||||||
|
|
||||||
if (mfTempCropPicture.exists()) {
|
if (_mSourceCropTempFile.exists()) {
|
||||||
mfTempCropPicture.delete();
|
_mSourceCropTempFile.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
mfTempCropPicture.createNewFile();
|
_mSourceCropTempFile.createNewFile();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
LogUtils.d(TAG, e, Thread.currentThread().getStackTrace());
|
||||||
ToastUtils.show("剪裁临时文件创建失败");
|
ToastUtils.show("剪裁临时文件创建失败");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Uri cropOutPutUri = Uri.fromFile(mfTempCropPicture);
|
Uri cropOutPutUri = Uri.fromFile(_mSourceCropTempFile);
|
||||||
LogUtils.d(TAG, "mfTempCropPicture : " + mfTempCropPicture.getPath());
|
LogUtils.d(TAG, "mfTempCropPicture : " + _mSourceCropTempFile.getPath());
|
||||||
|
|
||||||
Intent intent = new Intent("com.android.camera.action.CROP");
|
Intent intent = new Intent("com.android.camera.action.CROP");
|
||||||
intent.setDataAndType(uri, "image/" + _mszCommonFileType);
|
intent.setDataAndType(uri, "image/" + _mszCommonFileType);
|
||||||
@@ -547,8 +551,9 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr
|
|||||||
// 方案1:通过Intent获取剪裁后的Bitmap
|
// 方案1:通过Intent获取剪裁后的Bitmap
|
||||||
if (data != null && data.hasExtra("data")) {
|
if (data != null && data.hasExtra("data")) {
|
||||||
cropBitmap = data.getParcelableExtra("data");
|
cropBitmap = data.getParcelableExtra("data");
|
||||||
} else if (mfTempCropPicture.exists()) {
|
} else if (_mSourceCropTempFile.exists()) {
|
||||||
cropBitmap = BitmapFactory.decodeFile(mfTempCropPicture.getPath());
|
LogUtils.d(TAG, String.format("_mSourceCropTempFile Exists, Path is :%s ", _mSourceCropTempFile.getPath()));
|
||||||
|
cropBitmap = BitmapFactory.decodeFile(_mSourceCropTempFile.getPath());
|
||||||
} else {
|
} else {
|
||||||
ToastUtils.show("剪裁文件不存在");
|
ToastUtils.show("剪裁文件不存在");
|
||||||
return;
|
return;
|
||||||
@@ -696,7 +701,7 @@ public class BackgroundPictureActivity extends WinBoLLActivity implements Backgr
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onYes() {
|
public void onYes() {
|
||||||
bvPreviewBackground.saveToBackgroundSources(preViewFilePathBackgroundView);
|
bvPreviewBackground.setImageViewSource(preViewFilePathBackgroundView);
|
||||||
isCommitSettings = true;
|
isCommitSettings = true;
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
/**
|
/**
|
||||||
* 拷贝图片文件到背景资源目录(正式背景)
|
* 拷贝图片文件到背景资源目录(正式背景)
|
||||||
*/
|
*/
|
||||||
public void saveToBackgroundSources(String srcBackgroundPath) {
|
public void setImageViewSource(String srcBackgroundPath) {
|
||||||
initBackgroundImagePath();
|
initBackgroundImagePath();
|
||||||
if (backgroundSourceFilePath == null) {
|
if (backgroundSourceFilePath == null) {
|
||||||
LogUtils.e(TAG, "目标路径初始化失败,无法保存背景图片");
|
LogUtils.e(TAG, "目标路径初始化失败,无法保存背景图片");
|
||||||
|
|||||||
Reference in New Issue
Block a user