Compare commits
11 Commits
powerbell-
...
powerbell-
| Author | SHA1 | Date | |
|---|---|---|---|
| c524a21429 | |||
| a148de2ab8 | |||
| de34e823b6 | |||
| fd0833476e | |||
| 361b533b0d | |||
| f277f76468 | |||
| ec54865a8e | |||
| 6b3682994e | |||
| 7145bff552 | |||
| 4c3b60128f | |||
| 29d30f3831 |
@@ -1,8 +1,8 @@
|
|||||||
#Created by .winboll/winboll_app_build.gradle
|
#Created by .winboll/winboll_app_build.gradle
|
||||||
#Wed Dec 10 16:54:47 HKT 2025
|
#Wed Dec 10 18:38:00 HKT 2025
|
||||||
stageCount=5
|
stageCount=10
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.12
|
baseVersion=15.12
|
||||||
publishVersion=15.12.4
|
publishVersion=15.12.9
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.12.5
|
baseBetaVersion=15.12.10
|
||||||
|
|||||||
@@ -150,12 +150,6 @@ public class MainActivity extends WinBoLLActivity {
|
|||||||
_mMainActivity = null;
|
_mMainActivity = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostCreate(Bundle savedInstanceState) {
|
|
||||||
super.onPostCreate(savedInstanceState);
|
|
||||||
reloadBackground();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import android.content.Context;
|
|||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.BitmapFactory;
|
import android.graphics.BitmapFactory;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.ColorDrawable;
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.ImageView.ScaleType;
|
import android.widget.ImageView.ScaleType;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@@ -55,8 +55,8 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
LogUtils.d(TAG, "=== initView 启动 ===");
|
LogUtils.d(TAG, "=== initView 启动 ===");
|
||||||
// 1. 配置当前控件:全屏+透明
|
// 1. 配置当前控件:全屏+透明
|
||||||
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
|
||||||
setBackgroundColor(0x00000000);
|
//setBackgroundColor(0x00000000);
|
||||||
setBackground(new ColorDrawable(0x00000000));
|
//setBackground(new ColorDrawable(0x00000000));
|
||||||
|
|
||||||
// 2. 初始化主容器LinearLayout
|
// 2. 初始化主容器LinearLayout
|
||||||
initLinearLayout();
|
initLinearLayout();
|
||||||
@@ -64,8 +64,9 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
// 3. 初始化ImageView
|
// 3. 初始化ImageView
|
||||||
initImageView();
|
initImageView();
|
||||||
|
|
||||||
// 4. 初始设置透明背景
|
// 初始设置透明背景
|
||||||
setDefaultTransparentBackground();
|
setDefaultTransparentBackground();
|
||||||
|
|
||||||
LogUtils.d(TAG, "=== initView 完成 ===");
|
LogUtils.d(TAG, "=== initView 完成 ===");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,11 +102,11 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void loadBackgroundBean(BackgroundBean bean) {
|
public void loadBackgroundBean(BackgroundBean bean) {
|
||||||
if(!bean.isUseBackgroundFile()) {
|
if (!bean.isUseBackgroundFile()) {
|
||||||
setDefaultTransparentBackground();
|
setDefaultTransparentBackground();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(bean.isUseBackgroundScaledCompressFile()) {
|
if (bean.isUseBackgroundScaledCompressFile()) {
|
||||||
loadImage(bean.getBackgroundScaledCompressFilePath());
|
loadImage(bean.getBackgroundScaledCompressFilePath());
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -132,6 +133,8 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mIvBackground.setVisibility(View.GONE);
|
||||||
|
|
||||||
// 计算原图比例
|
// 计算原图比例
|
||||||
if (!calculateImageAspectRatio(imageFile)) {
|
if (!calculateImageAspectRatio(imageFile)) {
|
||||||
setDefaultTransparentBackground();
|
setDefaultTransparentBackground();
|
||||||
@@ -199,9 +202,9 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
* 调整ImageView尺寸(保持原图比例,在LinearLayout中居中平铺)
|
* 调整ImageView尺寸(保持原图比例,在LinearLayout中居中平铺)
|
||||||
*/
|
*/
|
||||||
private void adjustImageViewSize() {
|
private void adjustImageViewSize() {
|
||||||
LogUtils.d(TAG, "=== adjustImageViewSize 启动 ===");
|
//LogUtils.d(TAG, "=== adjustImageViewSize 启动 ===");
|
||||||
if (mLlContainer == null || mIvBackground == null) {
|
if (mLlContainer == null || mIvBackground == null) {
|
||||||
LogUtils.e(TAG, "控件为空");
|
//LogUtils.e(TAG, "控件为空");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,7 +217,7 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
public void run() {
|
public void run() {
|
||||||
adjustImageViewSize();
|
adjustImageViewSize();
|
||||||
}
|
}
|
||||||
}, 10);
|
}, 100);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,9 +237,11 @@ public class BackgroundView extends RelativeLayout {
|
|||||||
params.height = ivHeight;
|
params.height = ivHeight;
|
||||||
mIvBackground.setLayoutParams(params);
|
mIvBackground.setLayoutParams(params);
|
||||||
mIvBackground.setScaleType(ScaleType.FIT_CENTER); // 确保居中平铺
|
mIvBackground.setScaleType(ScaleType.FIT_CENTER); // 确保居中平铺
|
||||||
|
mIvBackground.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
LogUtils.d(TAG, "ImageView尺寸:" + ivWidth + "x" + ivHeight);
|
|
||||||
LogUtils.d(TAG, "=== adjustImageViewSize 完成 ===");
|
//LogUtils.d(TAG, "ImageView尺寸:" + ivWidth + "x" + ivHeight);
|
||||||
|
//LogUtils.d(TAG, "=== adjustImageViewSize 完成 ===");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaultTransparentBackground() {
|
private void setDefaultTransparentBackground() {
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="#FF7381FF"
|
|
||||||
android:id="@+id/fragmentmainviewBackgroundView1"/>
|
android:id="@+id/fragmentmainviewBackgroundView1"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
|||||||
Reference in New Issue
Block a user