fix: 考勤页面优化

1. 下拉区域扩大到上半屏(140dp),只拦截垂直不拦截水平
2. 考勤页布局优化:居中考勤状态+按钮+低耗电提示
3. 按钮固定宽度250dp,更美观
4. 添加上滑返回手势(考勤页上滑回首页)
5. 去掉底部"上滑返回"文字(已有手势)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dongliang
2026-04-28 19:53:04 +09:30
parent b59fee4bb7
commit d9ee5f2059
4 changed files with 103 additions and 73 deletions

View File

@@ -1,34 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 首页容器:固定状态栏 + ViewPager2 左右滑动 -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<!-- 首页容器:状态栏 + ViewPager2 + 下拉触摸层(上半屏) -->
<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:paddingStart="21dp"
android:paddingTop="27dp"
android:paddingEnd="21dp">
android:background="@color/background">
<!-- 固定状态栏(不随 ViewPager2 滑动)+ 下拉触摸区域 -->
<FrameLayout
android:id="@+id/pullDownArea"
<!-- 底层:状态栏 + ViewPager2 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="3dp">
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingStart="21dp"
android:paddingTop="27dp"
android:paddingEnd="21dp">
<!-- 固定状态栏 -->
<com.xiaoqu.watch.ui.widget.StatusBarView
android:id="@+id/statusBar"
android:layout_width="match_parent"
android:layout_height="24dp"
android:layout_gravity="center_vertical" />
android:layout_marginBottom="3dp" />
</FrameLayout>
<!-- ViewPager2 -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
<!-- ViewPager2 在状态栏下方滑动 -->
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
</LinearLayout>
<!-- 上层:下拉触摸区域(上半屏,透明,不拦截水平滑动) -->
<View
android:id="@+id/pullDownArea"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
android:layout_height="140dp"
android:layout_gravity="top" />
</LinearLayout>
</FrameLayout>