@@ -1,251 +1,259 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android= "http://schemas.android.com/apk/res/android"
xmlns:app= "http://schemas.android.com/apk/res-auto"
android:layout_width= "match_parent"
android:layout_height= "match_parent"
android:orientation= "vertical" >
xmlns:android= "http://schemas.android.com/apk/res/android"
xmlns:app= "http://schemas.android.com/apk/res-auto"
android:layout_width= "match_parent"
android:layout_height= "match_parent"
android:orientation= "vertical" >
<cc.winboll.studio.libaes.views. ASupportToolbar
android:layout_width= "match_parent"
android:layout_height= "@dimen/toolbar_heigh t"
android:id= "@+id /toolbar"
android:gravity= "center_vertical "
style= "@style/DefaultAToolbar" />
<!-- 顶部Toolbar( 首屏核心, 同步加载, 保留原有 ASupportToolbar) -->
<cc.winboll.studio.libaes.views.ASupportToolbar
android:layout_width= "match_paren t"
android:layout_height= "@dimen /toolbar_height "
android:id= "@+id/toolbar "
android:gravity= "center_vertical"
style= "@style/DefaultAToolbar" />
< RelativeLayout
android:layout_width= "match_parent"
android:layout_height= "0dp "
android:layout_w eight= "1.0" >
<!-- 主内容区(优化层级,减少冗余 RelativeLayout) -->
<RelativeLayout
android:layout_width= "match_parent "
android:layout_h eight= "0dp"
android:layout_weight= "1.0" >
< RelativeLayout
android:layout_width= "match_parent"
android:layout_height = "match_parent"
android:id= "@+id/activitymainRelativeLayout1" />
<!-- 首屏核心容器(合并原冗余 RelativeLayout,减少层级) -->
<RelativeLayout
android:layout_width = "match_parent"
android:layout_height= "match_parent"
android:id= "@+id/activitymainRelativeLayout1" >
<RelativeLayout
xmlns:android= "http://schemas.android.com/apk/res/android"
android:orientation= "vertical "
android:layout_width = "match_parent"
android:layout_height= "match_parent " >
<!-- 1. 背景视图(首屏核心,同步加载,保留原有) -->
<cc.winboll.studio.powerbell.views.BackgroundView
android:layout_width= "match_parent "
android:layout_height = "match_parent"
android:id= "@+id/fragmentmainviewBackgroundView1 " / >
<cc.winboll.studio.powerbell.views.BackgroundView
xmlns:app= "http://schemas.android.com/apk/res-auto"
android:orientation= "vertical"
android:layout_width= "match_parent"
android:layout_height= "match_parent"
android:id= "@+id/fragmentmainviewBackgroundView1" />
<!-- 2. 功能控件容器(首屏核心,同步加载,保留原有结构) -->
<LinearLayout
android:orientation= "vertical"
android:layout_width= "match_parent"
android:layout_height= "match_parent" >
<LinearLayout
android:orientation= "vertical"
android:layout_width= "match_parent "
android:layout_height = "match_parent" >
<!-- 服务总开关布局 -->
<LinearLayout
android:orientation= "vertical "
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
android:orientation= "vertic al"
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
android:orientation= "horizont al"
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:gravity= "center_vertical "
android:background= "@drawable/bg_frame" >
<LinearLayout
android:orientation= "horizontal "
android:layout_width= "match_par ent"
android:layout_height= "wrap_content "
android:gravity= "center_vertical "
android:background= "@drawable/bg_frame" >
<Switch
android:layout_width= "0dp "
android:layout_height= "wrap_cont ent"
android:id= "@+id/fragmentandroidviewSwitch1 "
android:padding= "10dp "
android:layout_weight= "1.0"
android:textSize= "@dimen/text_title_size" />
<Switch
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>
</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
android:orientation= "vertic al"
android:layout_width= "match_parent"
android:layout_height= "wrap_cont ent"
android:layout_weight= "1.0"
android:layout_marginLeft= "10dp"
android:layout_marginRight= "10dp" >
<LinearLayout
android:orientation= "horizont al"
android:layout_width= "match_parent"
android:layout_height= "match_par ent"
android:layout_weight= "1.0" >
<LinearLayout
android:orientation= "horizontal"
android:layout_width= "match_parent "
android:layout_height= "match_parent "
android:layout_w eight= "1.0" >
<!-- 耗电提醒布局 -->
<LinearLayout
android:orientation= "vertical "
android:layout_width= "50dp "
android:layout_h eight= "match_parent"
android:layout_marginTop= "20dp"
android:layout_marginBottom= "20dp"
android:id= "@+id/fragmentmainviewLinearLayout1" >
<LinearLayout
android:orientation= "vertical "
android:layout_width = "50 dp"
android:layout_height= "match_parent "
android:layout_marginTop= "20dp "
android:layout_marginBottom = "2 0dp"
android:id= "@+id/fragmentmainviewLinearLayout1" >
<ImageView
android:layout_width= "36dp "
android:layout_height = "36 dp"
android:background= "@drawable/usege "
android:layout_gravity= "center_horizontal "
android:layout_marginTop = "1 0dp" />
<ImageView
android:layout_width= "36dp "
android:layout_height= "36dp "
android:background= "@drawable/usege "
android:layout_gravity= "center_horizontal "
android:layout_marginTop= "10dp " />
<CheckBox
android:layout_width= "wrap_content "
android:layout_height= "wrap_content "
android:layout_gravity= "center_horizontal "
android:layout_marginTop= "10dp "
android:id= "@+id/fragmentmainviewCheckBox2 " />
<CheckBox
android:layout_width= "wrap_cont ent"
android:layout_height= "wrap_content"
android:layout_gravity= "center_horizontal "
android:layout_marginTop= "10dp "
android:id= "@+id/fragmentmainviewCheckBox2" />
<cc.winboll.studio.powerbell.views.VerticalSeekBar
android:layout_width= "match_par ent"
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" />
<cc.winboll.studio.powerbell.views.VerticalSeekBar
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 >
<!-- 耗电提醒数值+图标 -- >
<LinearLayout
android:orientation= "vertical"
android:layout_width= "80dp"
android:layout_height= "match_parent" >
<LinearLayout
android:orientation= "vertical "
android:layout_width= "80dp "
android:layout_height= "match_parent" >
<TextView
android:layout_width= "match_parent "
android:layout_height= "wrap_content "
android:text= "100%"
android:textSize= "@dimen/text_title_size"
android:layout_gravity= "center_horizontal"
android:id= "@+id/fragmentandroidviewTextView3"
android:gravity= "center_horizontal" />
<Text View
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:text= "100% "
android:textSize= "@dimen/text_title_size"
android:layout_gravity= "center_horizontal"
android:id= "@+id/fragmentandroidviewTextView3"
android:gravity= "center_horizontal" />
<Image View
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:id= "@+id/fragmentandroidviewImageView2 "
android:layout_weight= "1.0" />
<ImageView
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:id= "@+id/fragmentandroidviewImageView2"
android:layout_weight= "1.0" />
</LinearLayout>
</LinearLayout >
<!-- 当前电量数值+图标 -- >
<LinearLayout
android:orientation= "vertical"
android:layout_width= "wrap_content"
android:layout_height= "match_parent"
android:layout_weight= "1.0" >
<LinearLayout
android:orientation= "vertical "
android:layout_width = "wrap_content"
android:layout_height= "match_parent "
android:layout_weight= "1.0" >
<TextView
android:layout_width= "match_parent "
android:layout_height = "wrap_content"
android:text= "100% "
android:textSize= "@dimen/text_title_size"
android:layout_gravity= "center_horizontal"
android:gravity= "center_horizontal"
android:id= "@+id/fragmentandroidviewTextView4" />
<Text View
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:text= "100% "
android:textSize= "@dimen/text_title_size"
android:layout_gravity= "center_horizontal"
android:gravity= "center_horizontal"
android:id= "@+id/fragmentandroidviewTextView4" />
<Image View
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:id= "@+id/fragmentandroidviewImageView1 "
android:layout_weight= "1.0" />
<ImageView
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:id= "@+id/fragmentandroidviewImageView1"
android:layout_weight= "1.0" />
</LinearLayout>
</LinearLayout >
<!-- 充电提醒数值+图标 -- >
<LinearLayout
android:orientation= "vertical"
android:layout_width= "80dp"
android:layout_height= "match_parent" >
<LinearLayout
android:orientation= "vertical "
android:layout_width= "80dp "
android:layout_height= "match_parent" >
<TextView
android:layout_width= "match_parent "
android:layout_height= "wrap_content "
android:text= "100%"
android:textSize= "@dimen/text_title_size"
android:layout_gravity= "center_horizontal"
android:id= "@+id/fragmentandroidviewTextView2"
android:gravity= "center_horizontal" />
<Text View
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:text= "100% "
android:textSize= "@dimen/text_title_size"
android:layout_gravity= "center_horizontal"
android:id= "@+id/fragmentandroidviewTextView2"
android:gravity= "center_horizontal" />
<Image View
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:id= "@+id/fragmentandroidviewImageView3 "
android:layout_weight= "1.0" />
<ImageView
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:id= "@+id/fragmentandroidviewImageView3"
android:layout_weight= "1.0" />
</LinearLayout>
</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
android:orientation= "vertical "
android:layout_width = "50 dp"
android:layout_height= "match_parent "
android:layout_marginBottom= "20dp "
android:layout_marginTop= "2 0dp"
android:id= "@+id/fragmentmainviewLinearLayout2" >
<ImageView
android:layout_width= "36dp "
android:layout_height = "36 dp"
android:background= "@drawable/charge "
android:layout_gravity= "center_horizontal "
android:layout_marginTop= "1 0dp" />
<ImageView
android:layout_width= "36dp "
android:layout_height= "36dp "
android:background= "@drawable/charge "
android:layout_gravity= "center_horizontal "
android:layout_marginTop= "10dp " />
<CheckBox
android:layout_width= "wrap_content "
android:layout_height= "wrap_content "
android:layout_gravity= "center_horizontal "
android:layout_marginTop= "10dp "
android:id= "@+id/fragmentmainviewCheckBox1 " />
<CheckBox
android:layout_width= "wrap_cont ent"
android:layout_height= "wrap_content"
android:layout_gravity= "center_horizontal "
android:layout_marginTop= "10dp "
android:id= "@+id/fragmentmainviewCheckBox1" />
<cc.winboll.studio.powerbell.views.VerticalSeekBar
android:layout_width= "match_par ent"
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" />
<cc.winboll.studio.powerbell.views.VerticalSeekBar
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>
</LinearLayout >
<!-- Tips文本 -- >
<LinearLayout
android:layout_height= "wrap_content"
android:layout_width= "match_parent" >
<LinearLayout
android:layout_height= "wrap_cont ent"
android:layout_width= "match_par ent" >
<TextView
android:layout_width= "match_par ent"
android:layout_height= "wrap_cont ent"
android:text= "Tips"
android:textSize= "@dimen/text_content_size"
android:id= "@+id/fragmentandroidviewTextView1"
android:background= "@drawable/bg_frame"
android:padding= "10dp" />
<TextView
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>
</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
android:layout_width= "match_parent"
android:layout_height= "wrap_content"
android:id= "@+id/adsbanner"
android:layout_alignParentBottom= "true" />
</RelativeLayout>
</RelativeLayout>
</LinearLayout>