feat: 小趣手表APP Android原生重构 - 基础框架搭建
已完成的模块: 1. 项目脚手架 - Gradle配置、28个包目录、核心基类 2. 权限管理 - 确认定制ROM已预授权所有权限 3. 工具类 - DateUtil/DeviceUtil/NetworkUtil/Md5Util 4. 设备信息 - DevicePrefs/UserPrefs (SharedPreferences) 5. 网络层 - OkHttp+Retrofit+MD5签名拦截器+解绑拦截器 6. 基础UI组件 - NavBarView/QuTipDialog/QuConfirmDialog/ActionButton/iconfont Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
108
app/src/main/res/layout/layout_nav_bar.xml
Normal file
108
app/src/main/res/layout/layout_nav_bar.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?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="18sp"
|
||||
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="14sp"
|
||||
android:paddingEnd="6dp" />
|
||||
|
||||
<!-- 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="14sp"
|
||||
android:paddingEnd="6dp" />
|
||||
|
||||
<!-- 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="14sp" />
|
||||
|
||||
</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="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
Reference in New Issue
Block a user