提高应用调试性能
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
#Created by .winboll/winboll_app_build.gradle
|
||||
#Tue Dec 02 05:57:17 GMT 2025
|
||||
#Tue Dec 02 06:01:03 GMT 2025
|
||||
stageCount=13
|
||||
libraryProject=
|
||||
baseVersion=15.11
|
||||
publishVersion=15.11.12
|
||||
buildCount=107
|
||||
buildCount=110
|
||||
baseBetaVersion=15.11.13
|
||||
|
||||
@@ -326,21 +326,19 @@ public class BackgroundView extends RelativeLayout {
|
||||
* 适配场景:控件初始化、图片加载后、父容器尺寸变化(如屏幕旋转)
|
||||
*/
|
||||
private void adjustImageViewSize() {
|
||||
LogUtils.d(TAG, "=== adjustImageViewSize(调整ImageView尺寸)启动 ===");
|
||||
//LogUtils.d(TAG, "=== adjustImageViewSize(调整ImageView尺寸)启动 ===");
|
||||
// 获取当前控件尺寸(已完全填充父视图,即父容器尺寸)
|
||||
int parentWidth = getWidth();
|
||||
int parentHeight = getHeight();
|
||||
|
||||
// 父容器未测量完成(宽/高为0),延迟调整(避免尺寸计算错误)
|
||||
if (parentWidth == 0 || parentHeight == 0) {
|
||||
LogUtils.w(TAG, "【adjustImageViewSize】父容器未测量完成,延迟调整尺寸");
|
||||
post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
adjustImageViewSize(); // 延迟后重新调整
|
||||
}
|
||||
});
|
||||
LogUtils.d(TAG, "=== adjustImageViewSize(调整ImageView尺寸)完成(延迟调整)===");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -372,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尺寸)完成(调整成功)===");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user