Compare commits
18 Commits
powerbell-
...
powerbell-
| Author | SHA1 | Date | |
|---|---|---|---|
| 9f4211c83e | |||
| 447a786632 | |||
| ff0f239ffc | |||
| 7c59a982fc | |||
| 895cc4630d | |||
| 851a539364 | |||
| d79f2937ba | |||
| 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 20:37:42 HKT 2025
|
||||||
stageCount=5
|
stageCount=13
|
||||||
libraryProject=
|
libraryProject=
|
||||||
baseVersion=15.12
|
baseVersion=15.12
|
||||||
publishVersion=15.12.4
|
publishVersion=15.12.12
|
||||||
buildCount=0
|
buildCount=0
|
||||||
baseBetaVersion=15.12.5
|
baseBetaVersion=15.12.13
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -4,13 +4,14 @@ import android.util.JsonReader;
|
|||||||
import android.util.JsonWriter;
|
import android.util.JsonWriter;
|
||||||
import cc.winboll.studio.libappbase.BaseBean;
|
import cc.winboll.studio.libappbase.BaseBean;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author ZhanGSKen<zhangsken@qq.com>
|
* @Author ZhanGSKen<zhangsken@qq.com>
|
||||||
* @Date 2024/07/18 11:52:28
|
* @Date 2024/07/18 11:52:28
|
||||||
* @Describe 应用背景图片数据类(存储正式/预览背景配置,支持JSON序列化/反序列化)
|
* @Describe 应用背景图片数据类(存储正式/预览背景配置,支持JSON序列化/反序列化)
|
||||||
*/
|
*/
|
||||||
public class BackgroundBean extends BaseBean {
|
public class BackgroundBean extends BaseBean implements Serializable {
|
||||||
|
|
||||||
public static final String TAG = "BackgroundPictureBean";
|
public static final String TAG = "BackgroundPictureBean";
|
||||||
|
|
||||||
|
|||||||
@@ -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,44 +202,47 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取LinearLayout尺寸
|
// 获取LinearLayout尺寸
|
||||||
int llWidth = mLlContainer.getWidth();
|
int llWidth = mLlContainer.getWidth();
|
||||||
int llHeight = mLlContainer.getHeight();
|
int llHeight = mLlContainer.getHeight();
|
||||||
if (llWidth == 0 || llHeight == 0) {
|
// if (llWidth == 0 || llHeight == 0) {
|
||||||
postDelayed(new Runnable() {
|
// postDelayed(new Runnable() {
|
||||||
@Override
|
// @Override
|
||||||
public void run() {
|
// public void run() {
|
||||||
adjustImageViewSize();
|
// adjustImageViewSize();
|
||||||
}
|
// }
|
||||||
}, 10);
|
// }, 100);
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 计算ImageView尺寸(保持比例,不超出LinearLayout)
|
if (llWidth != 0 && llHeight != 0) {
|
||||||
int ivWidth, ivHeight;
|
// 计算ImageView尺寸(保持比例,不超出LinearLayout)
|
||||||
if (mImageAspectRatio >= 1.0f) {
|
int ivWidth, ivHeight;
|
||||||
ivWidth = Math.min((int) (llHeight * mImageAspectRatio), llWidth);
|
if (mImageAspectRatio >= 1.0f) {
|
||||||
ivHeight = (int) (ivWidth / mImageAspectRatio);
|
ivWidth = Math.min((int) (llHeight * mImageAspectRatio), llWidth);
|
||||||
} else {
|
ivHeight = (int) (ivWidth / mImageAspectRatio);
|
||||||
ivHeight = Math.min((int) (llWidth / mImageAspectRatio), llHeight);
|
} else {
|
||||||
ivWidth = (int) (ivHeight * mImageAspectRatio);
|
ivHeight = Math.min((int) (llWidth / mImageAspectRatio), llHeight);
|
||||||
}
|
ivWidth = (int) (ivHeight * mImageAspectRatio);
|
||||||
|
}
|
||||||
|
|
||||||
// 应用尺寸
|
// 应用尺寸
|
||||||
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mIvBackground.getLayoutParams();
|
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mIvBackground.getLayoutParams();
|
||||||
params.width = ivWidth;
|
params.width = ivWidth;
|
||||||
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, "ImageView尺寸:" + ivWidth + "x" + ivHeight);
|
||||||
LogUtils.d(TAG, "=== adjustImageViewSize 完成 ===");
|
//LogUtils.d(TAG, "=== adjustImageViewSize 完成 ===");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaultTransparentBackground() {
|
private void setDefaultTransparentBackground() {
|
||||||
|
|||||||
@@ -1,252 +1,259 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.ASupportToolbar
|
<!-- 顶部Toolbar(首屏核心,同步加载,保留原有ASupportToolbar) -->
|
||||||
android:layout_width="match_parent"
|
<cc.winboll.studio.libaes.views.ASupportToolbar
|
||||||
android:layout_height="@dimen/toolbar_height"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/toolbar"
|
android:layout_height="@dimen/toolbar_height"
|
||||||
android:gravity="center_vertical"
|
android:id="@+id/toolbar"
|
||||||
style="@style/DefaultAToolbar"/>
|
android:gravity="center_vertical"
|
||||||
|
style="@style/DefaultAToolbar"/>
|
||||||
|
|
||||||
<RelativeLayout
|
<!-- 主内容区(优化层级,减少冗余RelativeLayout) -->
|
||||||
android:layout_width="match_parent"
|
<RelativeLayout
|
||||||
android:layout_height="0dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_weight="1.0">
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
<RelativeLayout
|
<!-- 首屏核心容器(合并原冗余RelativeLayout,减少层级) -->
|
||||||
android:layout_width="match_parent"
|
<RelativeLayout
|
||||||
android:layout_height="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:id="@+id/activitymainRelativeLayout1"/>
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/activitymainRelativeLayout1">
|
||||||
|
|
||||||
<RelativeLayout
|
<!-- 1. 背景视图(首屏核心,同步加载,保留原有) -->
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
<cc.winboll.studio.powerbell.views.BackgroundView
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:id="@+id/fragmentmainviewBackgroundView1"/>
|
||||||
|
|
||||||
<cc.winboll.studio.powerbell.views.BackgroundView
|
<!-- 2. 功能控件容器(首屏核心,同步加载,保留原有结构) -->
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
<LinearLayout
|
||||||
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"/>
|
|
||||||
|
|
||||||
<LinearLayout
|
<!-- 服务总开关布局 -->
|
||||||
android:orientation="vertical"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:orientation="vertical"
|
||||||
android:layout_height="match_parent">
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/fragmentmainviewLinearLayout3"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="10dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/fragmentmainviewLinearLayout3"
|
android:gravity="center_vertical"
|
||||||
android:layout_marginLeft="10dp"
|
android:background="@drawable/bg_frame">
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="10dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<Switch
|
||||||
android:orientation="horizontal"
|
android:layout_width="0dp"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:id="@+id/fragmentandroidviewSwitch1"
|
||||||
android:gravity="center_vertical"
|
android:padding="10dp"
|
||||||
android:background="@drawable/bg_frame">
|
android:layout_weight="1.0"
|
||||||
|
android:textSize="@dimen/text_title_size"/>
|
||||||
|
|
||||||
<Switch
|
</LinearLayout>
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/fragmentandroidviewSwitch1"
|
|
||||||
android:padding="10dp"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:textSize="@dimen/text_title_size"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- 电量控制核心布局(SeekBar+图标) -->
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
android:orientation="horizontal"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1.0"
|
android:layout_weight="1.0">
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<!-- 耗电提醒布局 -->
|
||||||
android:orientation="horizontal"
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:orientation="vertical"
|
||||||
android:layout_height="match_parent"
|
android:layout_width="50dp"
|
||||||
android:layout_weight="1.0">
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:id="@+id/fragmentmainviewLinearLayout1">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:orientation="vertical"
|
android:layout_width="36dp"
|
||||||
android:layout_width="50dp"
|
android:layout_height="36dp"
|
||||||
android:layout_height="match_parent"
|
android:background="@drawable/usege"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_marginTop="10dp"/>
|
||||||
android:id="@+id/fragmentmainviewLinearLayout1">
|
|
||||||
|
|
||||||
<ImageView
|
<CheckBox
|
||||||
android:layout_width="36dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/usege"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginTop="10dp"/>
|
android:id="@+id/fragmentmainviewCheckBox2"/>
|
||||||
|
|
||||||
<CheckBox
|
<cc.winboll.studio.powerbell.views.VerticalSeekBar
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:id="@+id/fragmentandroidviewVerticalSeekBar2"
|
||||||
android:layout_marginTop="10dp"
|
android:progressTint="@color/colorUsege"
|
||||||
android:id="@+id/fragmentmainviewCheckBox2"/>
|
android:progressBackgroundTint="@color/colorUsege"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:layout_margin="10dp"/>
|
||||||
|
|
||||||
<cc.winboll.studio.powerbell.views.VerticalSeekBar
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/fragmentandroidviewVerticalSeekBar2"
|
|
||||||
android:progressTint="@color/colorUsege"
|
|
||||||
android:progressBackgroundTint="@color/colorUsege"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:layout_margin="10dp"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- 耗电提醒数值+图标 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="80dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent">
|
android:text="100%"
|
||||||
|
android:textSize="@dimen/text_title_size"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:id="@+id/fragmentandroidviewTextView3"
|
||||||
|
android:gravity="center_horizontal"/>
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="100%"
|
android:id="@+id/fragmentandroidviewImageView2"
|
||||||
android:textSize="@dimen/text_title_size"
|
android:layout_weight="1.0"/>
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:id="@+id/fragmentandroidviewTextView3"
|
|
||||||
android:gravity="center_horizontal"/>
|
|
||||||
|
|
||||||
<ImageView
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/fragmentandroidviewImageView2"
|
|
||||||
android:layout_weight="1.0"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- 当前电量数值+图标 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1.0">
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:text="100%"
|
||||||
android:layout_weight="1.0">
|
android:textSize="@dimen/text_title_size"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:id="@+id/fragmentandroidviewTextView4"/>
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="100%"
|
android:id="@+id/fragmentandroidviewImageView1"
|
||||||
android:textSize="@dimen/text_title_size"
|
android:layout_weight="1.0"/>
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:id="@+id/fragmentandroidviewTextView4"/>
|
|
||||||
|
|
||||||
<ImageView
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/fragmentandroidviewImageView1"
|
|
||||||
android:layout_weight="1.0"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- 充电提醒数值+图标 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="80dp"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:orientation="vertical"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="80dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent">
|
android:text="100%"
|
||||||
|
android:textSize="@dimen/text_title_size"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:id="@+id/fragmentandroidviewTextView2"
|
||||||
|
android:gravity="center_horizontal"/>
|
||||||
|
|
||||||
<TextView
|
<ImageView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="100%"
|
android:id="@+id/fragmentandroidviewImageView3"
|
||||||
android:textSize="@dimen/text_title_size"
|
android:layout_weight="1.0"/>
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:id="@+id/fragmentandroidviewTextView2"
|
|
||||||
android:gravity="center_horizontal"/>
|
|
||||||
|
|
||||||
<ImageView
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/fragmentandroidviewImageView3"
|
|
||||||
android:layout_weight="1.0"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- 充电提醒布局 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="50dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginBottom="20dp"
|
||||||
|
android:layout_marginTop="20dp"
|
||||||
|
android:id="@+id/fragmentmainviewLinearLayout2">
|
||||||
|
|
||||||
<LinearLayout
|
<ImageView
|
||||||
android:orientation="vertical"
|
android:layout_width="36dp"
|
||||||
android:layout_width="50dp"
|
android:layout_height="36dp"
|
||||||
android:layout_height="match_parent"
|
android:background="@drawable/charge"
|
||||||
android:layout_marginBottom="20dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="20dp"
|
android:layout_marginTop="10dp"/>
|
||||||
android:id="@+id/fragmentmainviewLinearLayout2">
|
|
||||||
|
|
||||||
<ImageView
|
<CheckBox
|
||||||
android:layout_width="36dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="36dp"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/charge"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginTop="10dp"/>
|
android:id="@+id/fragmentmainviewCheckBox1"/>
|
||||||
|
|
||||||
<CheckBox
|
<cc.winboll.studio.powerbell.views.VerticalSeekBar
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:id="@+id/fragmentandroidviewVerticalSeekBar1"
|
||||||
android:layout_marginTop="10dp"
|
android:progressTint="@color/colorCharge"
|
||||||
android:id="@+id/fragmentmainviewCheckBox1"/>
|
android:progressBackgroundTint="@color/colorCharge"
|
||||||
|
android:layout_weight="1.0"
|
||||||
|
android:layout_margin="10dp"/>
|
||||||
|
|
||||||
<cc.winboll.studio.powerbell.views.VerticalSeekBar
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/fragmentandroidviewVerticalSeekBar1"
|
|
||||||
android:progressTint="@color/colorCharge"
|
|
||||||
android:progressBackgroundTint="@color/colorCharge"
|
|
||||||
android:layout_weight="1.0"
|
|
||||||
android:layout_margin="10dp"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- Tips文本 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent">
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Tips"
|
||||||
|
android:textSize="@dimen/text_content_size"
|
||||||
|
android:id="@+id/fragmentandroidviewTextView1"
|
||||||
|
android:background="@drawable/bg_frame"
|
||||||
|
android:padding="10dp"/>
|
||||||
|
|
||||||
<TextView
|
</LinearLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="Tips"
|
|
||||||
android:textSize="@dimen/text_content_size"
|
|
||||||
android:id="@+id/fragmentandroidviewTextView1"
|
|
||||||
android:background="@drawable/bg_frame"
|
|
||||||
android:padding="10dp"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
<!-- 3. 广告视图:关键优化→用ViewStub延迟加载(替代原直接加载的ADsBannerView) -->
|
||||||
|
<!-- 首次启动仅占位(1px),不inflate真实广告视图,减少首次耗时 -->
|
||||||
|
<ViewStub
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/stub_ads_banner"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout="@layout/view_ads_banner"/> <!-- 广告视图独立布局文件 -->
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<cc.winboll.studio.libaes.views.ADsBannerView
|
</RelativeLayout>
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:id="@+id/adsbanner"
|
|
||||||
android:layout_alignParentBottom="true"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
7
powerbell/src/main/res/layout/view_ads_banner.xml
Normal file
7
powerbell/src/main/res/layout/view_ads_banner.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- 广告视图独立布局(供ViewStub延迟加载) -->
|
||||||
|
<cc.winboll.studio.libaes.views.ADsBannerView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/adsbanner"/>
|
||||||
Reference in New Issue
Block a user