fix: 考勤页面交互全面优化
1. 半屏下拉面板(不是全屏页面) 2. 去掉状态文字,按钮即状态 3. 点击空白收回面板 4. 增加时间+日期显示(每秒更新) 5. NFC开启时播放语音+振动(planId=8开启/planId=4成功/planId=7失败) 6. NFC扫描时按钮变"NFC扫描中..."(不弹窗) 7. 点击扫描中的按钮可取消扫描 8. 10秒超时自动关闭+振动提示 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,106 +1,88 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 考勤打卡页面(按原型图V3)
|
||||
顶部:状态栏
|
||||
中间:时间 + 考勤状态 + 按钮
|
||||
底部:低耗电提示 -->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<!-- 考勤打卡(半屏下拉面板)
|
||||
上半:时间+按钮(黑色背景)
|
||||
下半:透明,点击收回 -->
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/background"
|
||||
android:orientation="vertical">
|
||||
android:background="#00000000">
|
||||
|
||||
<!-- 固定状态栏 -->
|
||||
<com.xiaoqu.watch.ui.widget.StatusBarView
|
||||
android:id="@+id/statusBar"
|
||||
<!-- 点击空白收回 -->
|
||||
<View
|
||||
android:id="@+id/dismissArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginStart="21dp"
|
||||
android:layout_marginTop="27dp"
|
||||
android:layout_marginEnd="21dp" />
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<!-- 居中内容区(可上滑返回) -->
|
||||
<!-- 上半屏面板 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/contentArea"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="top"
|
||||
android:background="@color/background"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="21dp"
|
||||
android:paddingEnd="21dp">
|
||||
android:paddingTop="27dp"
|
||||
android:paddingEnd="21dp"
|
||||
android:paddingBottom="21dp">
|
||||
|
||||
<!-- 考勤状态("未上班" / "已上班 07:02" / "已下班 17:05") -->
|
||||
<!-- 时间 -->
|
||||
<TextView
|
||||
android:id="@+id/tvPunchStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="26sp"
|
||||
android:layout_marginBottom="27dp" />
|
||||
|
||||
<!-- 主按钮区域 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/tvTime"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="48sp"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:layout_marginBottom="5dp" />
|
||||
|
||||
<!-- 主按钮(上班打卡 / 下班打卡) -->
|
||||
<TextView
|
||||
android:id="@+id/btnPunch"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<!-- 撤销按钮(已上班+已下班时显示) -->
|
||||
<TextView
|
||||
android:id="@+id/btnRevoke"
|
||||
android:layout_width="250dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="14dp"
|
||||
android:background="@color/grey_button"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="22sp"
|
||||
android:text="撤销打卡"
|
||||
android:layout_marginTop="11dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 低耗电模式提示(下班后显示) -->
|
||||
<LinearLayout
|
||||
android:id="@+id/lowPowerHint"
|
||||
android:layout_width="wrap_content"
|
||||
<!-- 日期 -->
|
||||
<TextView
|
||||
android:id="@+id/tvDate"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="21dp"
|
||||
android:visibility="gone">
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginBottom="16dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="低耗电模式"
|
||||
android:textColor="@color/warning"
|
||||
android:textSize="22sp"
|
||||
android:textStyle="bold" />
|
||||
<!-- 主按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btnPunch"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="16dp"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="26sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="蓝牙扫描已停止\nNFC 已关闭"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center"
|
||||
android:lineSpacingMultiplier="1.5"
|
||||
android:layout_marginTop="8dp" />
|
||||
<!-- 撤销按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btnRevoke"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:padding="14dp"
|
||||
android:background="@color/grey_button"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="22sp"
|
||||
android:text="撤销打卡"
|
||||
android:layout_marginTop="8dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
<!-- 低耗电提示 -->
|
||||
<TextView
|
||||
android:id="@+id/tvLowPower"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="低耗电模式已开启"
|
||||
android:textColor="@color/warning"
|
||||
android:textSize="18sp"
|
||||
android:layout_marginTop="11dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
Reference in New Issue
Block a user