From 34356b8116a3c621a8dc21f7ca2777ec9a43cc69 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Sat, 29 Nov 2025 16:36:37 +0800 Subject: [PATCH] 20251129_163631_757 --- .../studio/powerbell/dialogs/NetworkBackgroundDialog.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/NetworkBackgroundDialog.java b/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/NetworkBackgroundDialog.java index 41bc00e9..82c4c8c8 100644 --- a/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/NetworkBackgroundDialog.java +++ b/powerbell/src/main/java/cc/winboll/studio/powerbell/dialogs/NetworkBackgroundDialog.java @@ -48,6 +48,7 @@ public class NetworkBackgroundDialog extends AlertDialog { private Handler mUiHandler; String previewFilePath; String previewFileUrl; + String downloadSavedPath; // 按钮点击回调接口(Java7 接口实现) public interface OnDialogClickListener { @@ -89,8 +90,8 @@ public class NetworkBackgroundDialog extends AlertDialog { switch (msg.what) { case MSG_IMAGE_LOAD_SUCCESS: // 图片加载成功,获取文件路径并设置背景 - previewFilePath = (String) msg.obj; - setBackgroundFromPath(previewFilePath); + downloadSavedPath = (String) msg.obj; + previewBackground(downloadSavedPath); break; case MSG_IMAGE_LOAD_FAILED: // 图片加载失败,设置默认背景 @@ -191,7 +192,7 @@ public class NetworkBackgroundDialog extends AlertDialog { * 根据文件路径设置 BackgroundView 背景(主线程调用) * @param filePath 图片文件路径 */ - private void setBackgroundFromPath(String filePath) { + private void previewBackground(String filePath) { FileInputStream fis = null; try { File imageFile = new File(filePath); @@ -258,7 +259,6 @@ public class NetworkBackgroundDialog extends AlertDialog { ImageDownloader.getInstance(mContext).downloadImage(previewFileUrl, new ImageDownloader.DownloadCallback(){ @Override public void onSuccess(String savePath) { - ToastUtils.show("下载成功:" + savePath); // 发送消息到主线程,携带图片路径 Message successMsg = mUiHandler.obtainMessage(MSG_IMAGE_LOAD_SUCCESS, savePath); mUiHandler.sendMessage(successMsg);