From ca66120e55be85e18cd8205224f531126a4546e4 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Wed, 3 Dec 2025 20:19:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=83=8C=E6=99=AF=E5=B8=83=E5=B1=80=E8=B0=83?= =?UTF-8?q?=E8=AF=95...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- powerbell/build.properties | 4 +-- .../unittest/BackgroundViewTestFragment.java | 29 +++++++++++++++---- .../powerbell/views/BackgroundView.java | 10 +++---- .../layout/fragment_test_backgroundview.xml | 17 +++++++---- 4 files changed, 43 insertions(+), 17 deletions(-) diff --git a/powerbell/build.properties b/powerbell/build.properties index 67353b5c..c71193ca 100644 --- a/powerbell/build.properties +++ b/powerbell/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Wed Dec 03 11:30:35 GMT 2025 +#Wed Dec 03 12:17:39 GMT 2025 stageCount=13 libraryProject= baseVersion=15.11 publishVersion=15.11.12 -buildCount=131 +buildCount=137 baseBetaVersion=15.11.13 diff --git a/powerbell/src/main/java/cc/winboll/studio/powerbell/unittest/BackgroundViewTestFragment.java b/powerbell/src/main/java/cc/winboll/studio/powerbell/unittest/BackgroundViewTestFragment.java index 10f820f1..6f7eead4 100644 --- a/powerbell/src/main/java/cc/winboll/studio/powerbell/unittest/BackgroundViewTestFragment.java +++ b/powerbell/src/main/java/cc/winboll/studio/powerbell/unittest/BackgroundViewTestFragment.java @@ -11,6 +11,9 @@ import cc.winboll.studio.powerbell.R; import android.widget.Button; import cc.winboll.studio.powerbell.MainActivity; import android.content.Intent; +import cc.winboll.studio.powerbell.model.BackgroundBean; +import cc.winboll.studio.powerbell.utils.BackgroundSourceUtils; +import cc.winboll.studio.powerbell.views.BackgroundView; /** * @Author ZhanGSKen&豆包大模型 @@ -22,17 +25,18 @@ public class BackgroundViewTestFragment extends Fragment { public static final String TAG = "BackgroundViewTestFragment"; View mainView; + BackgroundSourceUtils mBgSourceUtils; + BackgroundView mBackgroundView; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { //super.onCreateView(inflater, container, savedInstanceState); - // 非调试状态就结束本线程 - if (!GlobalApplication.isDebugging()) { - Thread.currentThread().destroy(); - } + mBgSourceUtils = BackgroundSourceUtils.getInstance(getActivity()); + mBgSourceUtils.loadSettings(); mainView = inflater.inflate(R.layout.fragment_test_backgroundview, container, false); + mBackgroundView = mainView.findViewById(R.id.backgroundview); ((Button)mainView.findViewById(R.id.btn_main_activity)).setOnClickListener(new View.OnClickListener(){ @@ -41,8 +45,23 @@ public class BackgroundViewTestFragment extends Fragment { getActivity().startActivity(new Intent(getActivity(), MainActivity.class)); } }); - + + loadBackground(); ToastUtils.show(String.format("%s onCreate", TAG)); return mainView; } + + @Override + public void onResume() { + super.onResume(); + loadBackground(); + } + + + + void loadBackground() { + mBgSourceUtils.loadSettings(); + BackgroundBean bean = mBgSourceUtils.getCurrentBackgroundBean(); + mBackgroundView.loadBackground(bean); + } } 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 5f40076c..894b50c3 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 @@ -370,11 +370,11 @@ public class BackgroundView extends RelativeLayout { layoutParams.height = imageViewHeight; mivBackground.setLayoutParams(layoutParams); -// LogUtils.d(TAG, "【adjustImageViewSize】尺寸调整成功"); -// LogUtils.d(TAG, "→ 父控件尺寸:" + parentWidth + "x" + parentHeight); -// LogUtils.d(TAG, "→ ImageView调整后尺寸:" + imageViewWidth + "x" + imageViewHeight); -// LogUtils.d(TAG, "→ 图片宽高比:" + mnImageAspectRatio); -// LogUtils.d(TAG, "=== adjustImageViewSize(调整ImageView尺寸)完成(调整成功)==="); + LogUtils.d(TAG, "【adjustImageViewSize】尺寸调整成功"); + LogUtils.d(TAG, "→ 父控件尺寸:" + parentWidth + "x" + parentHeight); + LogUtils.d(TAG, "→ ImageView调整后尺寸:" + imageViewWidth + "x" + imageViewHeight); + LogUtils.d(TAG, "→ 图片宽高比:" + mnImageAspectRatio); + LogUtils.d(TAG, "=== adjustImageViewSize(调整ImageView尺寸)完成(调整成功)==="); } /** diff --git a/powerbell/src/main/res/layout/fragment_test_backgroundview.xml b/powerbell/src/main/res/layout/fragment_test_backgroundview.xml index ee0828d5..9fb71aba 100644 --- a/powerbell/src/main/res/layout/fragment_test_backgroundview.xml +++ b/powerbell/src/main/res/layout/fragment_test_backgroundview.xml @@ -1,15 +1,22 @@ - + android:background="#FF0C6BBF"> + + + android:layout_height="wrap_content" + android:background="#AF4FDA4E">