Compare commits

...

3 Commits

5 changed files with 27 additions and 29 deletions

View File

@@ -1,8 +1,8 @@
#Created by .winboll/winboll_app_build.gradle #Created by .winboll/winboll_app_build.gradle
#Tue Dec 23 21:02:16 HKT 2025 #Wed Dec 24 12:22:06 HKT 2025
stageCount=28 stageCount=29
libraryProject= libraryProject=
baseVersion=15.14 baseVersion=15.14
publishVersion=15.14.27 publishVersion=15.14.28
buildCount=0 buildCount=0
baseBetaVersion=15.14.28 baseBetaVersion=15.14.29

View File

@@ -45,7 +45,7 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
// ======================== 静态常量(置顶统一,抽离魔法值)======================== // ======================== 静态常量(置顶统一,抽离魔法值)========================
public static final String TAG = "MainActivity"; public static final String TAG = "MainActivity";
private static final int REQUEST_READ_MEDIA_IMAGES = 1001; private static final int REQUEST_BACKGROUND_SETTINGS_ACTIVITY = 1001;
private static final long DELAY_LOAD_NON_CRITICAL = 500L; private static final long DELAY_LOAD_NON_CRITICAL = 500L;
public static final int MSG_RELOAD_APPCONFIG = 0; public static final int MSG_RELOAD_APPCONFIG = 0;
public static final int MSG_CURRENTVALUEBATTERY = 1; public static final int MSG_CURRENTVALUEBATTERY = 1;
@@ -110,10 +110,7 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
LogUtils.d(TAG, "onResume()"); LogUtils.d(TAG, "onResume()");
if (sGlobalHandler != null) {
sGlobalHandler.sendEmptyMessage(MSG_LOAD_BACKGROUND);
sGlobalHandler.sendEmptyMessage(MSG_UPDATE_SERVICE_SWITCH);
}
if (mADsBannerView != null) { if (mADsBannerView != null) {
mADsBannerView.resumeADs(this); mADsBannerView.resumeADs(this);
} }
@@ -167,7 +164,7 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
super.onActivityResult(requestCode, resultCode, data); super.onActivityResult(requestCode, resultCode, data);
LogUtils.d(TAG, "onActivityResult() | requestCode=" + requestCode + " | resultCode=" + resultCode + " | data=" + data); LogUtils.d(TAG, "onActivityResult() | requestCode=" + requestCode + " | resultCode=" + resultCode + " | data=" + data);
mPermissionUtils.handlePermissionRequest(this, requestCode, resultCode, data); mPermissionUtils.handlePermissionRequest(this, requestCode, resultCode, data);
if (requestCode == REQUEST_READ_MEDIA_IMAGES && sGlobalHandler != null) { if (requestCode == REQUEST_BACKGROUND_SETTINGS_ACTIVITY && sGlobalHandler != null) {
sGlobalHandler.sendEmptyMessage(MSG_LOAD_BACKGROUND); sGlobalHandler.sendEmptyMessage(MSG_LOAD_BACKGROUND);
} }
} }
@@ -207,7 +204,7 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
startActivity(new Intent(this, ClearRecordActivity.class)); startActivity(new Intent(this, ClearRecordActivity.class));
break; break;
case R.id.action_changepicture: case R.id.action_changepicture:
startActivityForResult(new Intent(this, BackgroundSettingsActivity.class), REQUEST_READ_MEDIA_IMAGES); startActivityForResult(new Intent(this, BackgroundSettingsActivity.class), REQUEST_BACKGROUND_SETTINGS_ACTIVITY);
break; break;
case R.id.action_unittestactivity: case R.id.action_unittestactivity:
startActivity(new Intent(this, MainUnitTestActivity.class)); startActivity(new Intent(this, MainUnitTestActivity.class));
@@ -274,7 +271,7 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
break; break;
case MSG_LOAD_BACKGROUND: case MSG_LOAD_BACKGROUND:
sMainActivity.reloadBackground(); sMainActivity.reloadBackground();
sMainActivity.setMainLayoutBackgroundColor(); //sMainActivity.setMainLayoutBackgroundColor();
break; break;
case MSG_UPDATE_SERVICE_SWITCH: case MSG_UPDATE_SERVICE_SWITCH:
sMainActivity.updateServiceSwitchUI(); sMainActivity.updateServiceSwitchUI();
@@ -406,24 +403,24 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
} }
BackgroundBean currentBgBean = mBgSourceUtils.getCurrentBackgroundBean(); BackgroundBean currentBgBean = mBgSourceUtils.getCurrentBackgroundBean();
if (currentBgBean != null) { if (currentBgBean != null) {
mMainContentView.backgroundView.loadByBackgroundBean(currentBgBean); mMainContentView.backgroundView.loadByBackgroundBean(currentBgBean, true);
} else { } else {
mMainContentView.backgroundView.setBackgroundResource(R.drawable.default_background); mMainContentView.backgroundView.setBackgroundResource(R.drawable.default_background);
} }
} }
private void setMainLayoutBackgroundColor() { // private void setMainLayoutBackgroundColor() {
LogUtils.d(TAG, "setMainLayoutBackgroundColor()"); // LogUtils.d(TAG, "setMainLayoutBackgroundColor()");
if (isFinishing() || isDestroyed() || mMainContentView == null || mBgSourceUtils == null) { // if (isFinishing() || isDestroyed() || mMainContentView == null || mBgSourceUtils == null) {
LogUtils.e(TAG, "setMainLayoutBackgroundColor: 上下文无效,设置失败"); // LogUtils.e(TAG, "setMainLayoutBackgroundColor: 上下文无效,设置失败");
return; // return;
} // }
BackgroundBean currentBgBean = mBgSourceUtils.getCurrentBackgroundBean(); // BackgroundBean currentBgBean = mBgSourceUtils.getCurrentBackgroundBean();
if (currentBgBean != null) { // if (currentBgBean != null) {
mMainContentView.mainLayout.setBackgroundColor(currentBgBean.getPixelColor()); // mMainContentView.mainLayout.setBackgroundColor(currentBgBean.getPixelColor());
LogUtils.d(TAG, "setMainLayoutBackgroundColor: 主布局背景色设置完成 | color=" + currentBgBean.getPixelColor()); // LogUtils.d(TAG, "setMainLayoutBackgroundColor: 主布局背景色设置完成 | color=" + currentBgBean.getPixelColor2());
} // }
} // }
private void updateServiceSwitchUI() { private void updateServiceSwitchUI() {
LogUtils.d(TAG, "updateServiceSwitchUI()"); LogUtils.d(TAG, "updateServiceSwitchUI()");

View File

@@ -404,7 +404,7 @@ public class BackgroundSettingsActivity extends WinBoLLActivity {
mBgSourceUtils.loadSettings(); mBgSourceUtils.loadSettings();
BackgroundBean previewBean = mBgSourceUtils.getPreviewBackgroundBean(); BackgroundBean previewBean = mBgSourceUtils.getPreviewBackgroundBean();
mBackgroundView.loadByBackgroundBean(previewBean, true); mBackgroundView.loadByBackgroundBean(previewBean, true);
mBackgroundView.setBackgroundColor(previewBean.getPixelColor()); //mBackgroundView.setBackgroundColor(previewBean.getPixelColor());
LogUtils.d(TAG, "【双重刷新】第一重完成"); LogUtils.d(TAG, "【双重刷新】第一重完成");
} catch (Exception e) { } catch (Exception e) {
LogUtils.e(TAG, "【双重刷新】第一重异常:" + e.getMessage()); LogUtils.e(TAG, "【双重刷新】第一重异常:" + e.getMessage());
@@ -420,7 +420,7 @@ public class BackgroundSettingsActivity extends WinBoLLActivity {
mBgSourceUtils.loadSettings(); mBgSourceUtils.loadSettings();
BackgroundBean previewBean = mBgSourceUtils.getPreviewBackgroundBean(); BackgroundBean previewBean = mBgSourceUtils.getPreviewBackgroundBean();
mBackgroundView.loadByBackgroundBean(previewBean, true); mBackgroundView.loadByBackgroundBean(previewBean, true);
mBackgroundView.setBackgroundColor(previewBean.getPixelColor()); //mBackgroundView.setBackgroundColor(previewBean.getPixelColor());
LogUtils.d(TAG, "【双重刷新】第二重完成"); LogUtils.d(TAG, "【双重刷新】第二重完成");
} catch (Exception e) { } catch (Exception e) {
LogUtils.e(TAG, "【双重刷新】第二重异常:" + e.getMessage()); LogUtils.e(TAG, "【双重刷新】第二重异常:" + e.getMessage());

View File

@@ -243,7 +243,7 @@ public class MainUnitTest2Activity extends AppCompatActivity {
// 第一重刷新 // 第一重刷新
try { try {
mMemoryCachedBackgroundView.loadByBackgroundBean(mPreviewBackgroundBean, true); mMemoryCachedBackgroundView.loadByBackgroundBean(mPreviewBackgroundBean, true);
mMemoryCachedBackgroundView.setBackgroundColor(mPreviewBackgroundBean.getPixelColor()); //mMemoryCachedBackgroundView.setBackgroundColor(mPreviewBackgroundBean.getPixelColor());
LogUtils.d(TAG, "doubleRefreshPreview【双重刷新】第一重完成"); LogUtils.d(TAG, "doubleRefreshPreview【双重刷新】第一重完成");
} catch (Exception e) { } catch (Exception e) {
LogUtils.e(TAG, String.format("doubleRefreshPreview【双重刷新】第一重异常 | %s", e.getMessage())); LogUtils.e(TAG, String.format("doubleRefreshPreview【双重刷新】第一重异常 | %s", e.getMessage()));
@@ -257,7 +257,7 @@ public class MainUnitTest2Activity extends AppCompatActivity {
if (mMemoryCachedBackgroundView != null && !isFinishing()) { if (mMemoryCachedBackgroundView != null && !isFinishing()) {
try { try {
mMemoryCachedBackgroundView.loadByBackgroundBean(mPreviewBackgroundBean, true); mMemoryCachedBackgroundView.loadByBackgroundBean(mPreviewBackgroundBean, true);
mMemoryCachedBackgroundView.setBackgroundColor(mPreviewBackgroundBean.getPixelColor()); //mMemoryCachedBackgroundView.setBackgroundColor(mPreviewBackgroundBean.getPixelColor());
LogUtils.d(TAG, "doubleRefreshPreview【双重刷新】第二重完成"); LogUtils.d(TAG, "doubleRefreshPreview【双重刷新】第二重完成");
} catch (Exception e) { } catch (Exception e) {
LogUtils.e(TAG, String.format("doubleRefreshPreview【双重刷新】第二重异常 | %s", e.getMessage())); LogUtils.e(TAG, String.format("doubleRefreshPreview【双重刷新】第二重异常 | %s", e.getMessage()));

View File

@@ -149,6 +149,7 @@ public class BackgroundView extends RelativeLayout {
} }
// 加载图片 // 加载图片
loadImage(targetPath); loadImage(targetPath);
setBackgroundColor(bean.getPixelColor());
LogUtils.d(TAG, "=== loadByBackgroundBean 完成 ==="); LogUtils.d(TAG, "=== loadByBackgroundBean 完成 ===");
} }