改进图片像素背景的绘图方法。
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Tue Dec 23 16:04:47 GMT 2025
|
#Wed Dec 24 04:12:51 GMT 2025
|
||||||
stageCount=28
|
stageCount=28
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.14
|
baseVersion=15.14
|
||||||
publishVersion=15.14.27
|
publishVersion=15.14.27
|
||||||
buildCount=2
|
buildCount=7
|
||||||
baseBetaVersion=15.14.28
|
baseBetaVersion=15.14.28
|
||||||
|
|||||||
@@ -271,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();
|
||||||
@@ -409,18 +409,18 @@ public class MainActivity extends WinBoLLActivity implements MainContentView.OnV
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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()");
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
@@ -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()));
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
}
|
}
|
||||||
// 加载图片
|
// 加载图片
|
||||||
loadImage(targetPath);
|
loadImage(targetPath);
|
||||||
|
setBackgroundColor(bean.getPixelColor());
|
||||||
LogUtils.d(TAG, "=== loadByBackgroundBean 完成 ===");
|
LogUtils.d(TAG, "=== loadByBackgroundBean 完成 ===");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user