- 按钮高度 40dp→50dp,文字 15sp→20sp - NavBar 图标 14sp→18sp,电量 16sp→20sp - 提示弹窗图标 48sp→56sp - 确认弹窗按钮 36sp→44sp - NavBar 高度 60dp→40dp(图标放大后不需要过高) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
109 lines
3.8 KiB
XML
109 lines
3.8 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- NavBarView:顶部导航栏,每个 Fragment 通过 <include> 引入
|
||
左/中/右三栏布局:
|
||
- 首页:左=状态图标(蓝牙/4G/NFC),中=时间,右=电量
|
||
- 子页面:左=返回按钮,中=标题,右=电量 -->
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||
android:id="@+id/navBar"
|
||
android:layout_width="match_parent"
|
||
android:layout_height="@dimen/nav_bar_height"
|
||
android:background="@color/background"
|
||
android:gravity="center_vertical"
|
||
android:orientation="horizontal"
|
||
android:paddingStart="@dimen/safe_area_left"
|
||
android:paddingEnd="@dimen/safe_area_right">
|
||
|
||
<!-- 左侧区域(状态图标 或 返回按钮) -->
|
||
<FrameLayout
|
||
android:id="@+id/navLeft"
|
||
android:layout_width="0dp"
|
||
android:layout_height="match_parent"
|
||
android:layout_weight="1"
|
||
android:gravity="center_vertical">
|
||
|
||
<!-- 返回按钮(子页面用,默认隐藏) -->
|
||
<TextView
|
||
android:id="@+id/btnBack"
|
||
android:layout_width="@dimen/touch_min_size"
|
||
android:layout_height="@dimen/touch_min_size"
|
||
android:layout_gravity="center_vertical"
|
||
android:gravity="center"
|
||
android:text="\ue6bd"
|
||
android:textColor="@color/text_secondary"
|
||
android:textSize="22sp"
|
||
android:visibility="gone" />
|
||
|
||
<!-- 状态图标组(首页用,默认显示) -->
|
||
<LinearLayout
|
||
android:id="@+id/statusIcons"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="match_parent"
|
||
android:gravity="center_vertical"
|
||
android:orientation="horizontal">
|
||
|
||
<!-- 蓝牙状态 -->
|
||
<TextView
|
||
android:id="@+id/iconBluetooth"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:text="\ue6da"
|
||
android:textColor="@color/text_primary"
|
||
android:textSize="18sp"
|
||
android:paddingEnd="8dp" />
|
||
|
||
<!-- 4G 状态 -->
|
||
<TextView
|
||
android:id="@+id/icon4G"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:text="\ue6dc"
|
||
android:textColor="@color/text_primary"
|
||
android:textSize="18sp"
|
||
android:paddingEnd="8dp" />
|
||
|
||
<!-- NFC 状态 -->
|
||
<TextView
|
||
android:id="@+id/iconNfc"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:text="\ue6d8"
|
||
android:textColor="@color/text_primary"
|
||
android:textSize="18sp" />
|
||
|
||
</LinearLayout>
|
||
|
||
</FrameLayout>
|
||
|
||
<!-- 中间区域(时间 或 标题) -->
|
||
<TextView
|
||
android:id="@+id/navTitle"
|
||
android:layout_width="0dp"
|
||
android:layout_height="wrap_content"
|
||
android:layout_weight="2"
|
||
android:ellipsize="end"
|
||
android:gravity="center"
|
||
android:maxLines="1"
|
||
android:textColor="@color/text_primary"
|
||
android:textSize="@dimen/text_body" />
|
||
|
||
<!-- 右侧区域(电量图标) -->
|
||
<LinearLayout
|
||
android:layout_width="0dp"
|
||
android:layout_height="match_parent"
|
||
android:layout_weight="1"
|
||
android:gravity="center_vertical|end"
|
||
android:orientation="horizontal">
|
||
|
||
<!-- 电量图标 -->
|
||
<TextView
|
||
android:id="@+id/iconBattery"
|
||
android:layout_width="wrap_content"
|
||
android:layout_height="wrap_content"
|
||
android:text="\ue6ce"
|
||
android:textColor="@color/success"
|
||
android:textSize="20sp" />
|
||
|
||
</LinearLayout>
|
||
|
||
</LinearLayout>
|