feat: 考勤面板UI优化(5项改进)
1. 打卡状态文字:显示"已上班 07:02"/"已下班 17:05" 2. NFC扫描倒计时:显示"请贴近信标(8s)" 3. 底部收回指示条:灰色短横线,点击可收回面板 4. 药丸形按钮:大圆角28dp + 蓝色渐变(源码#4CBAF1→#339AFB) 5. 撤销按钮主次分明:窄灰底红字(0.4) + 宽蓝色下班(0.6) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
22
app/src/main/res/drawable/bg_btn_pill_blue.xml
Normal file
22
app/src/main/res/drawable/bg_btn_pill_blue.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 药丸形蓝色渐变按钮(对应源码 #4CBAF1→#339AFB) -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:startColor="#FF2B8AD4" android:endColor="#FF2780C8" android:angle="0" />
|
||||
<corners android:radius="28dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_enabled="false">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FF333333" />
|
||||
<corners android:radius="28dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:startColor="#FF4CBAF1" android:endColor="#FF339AFB" android:angle="0" />
|
||||
<corners android:radius="28dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
16
app/src/main/res/drawable/bg_btn_pill_gray.xml
Normal file
16
app/src/main/res/drawable/bg_btn_pill_gray.xml
Normal file
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 药丸形灰色按钮(撤销用) -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FF424242" />
|
||||
<corners android:radius="28dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FF2C2C2E" />
|
||||
<corners android:radius="28dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
7
app/src/main/res/drawable/bg_dismiss_bar.xml
Normal file
7
app/src/main/res/drawable/bg_dismiss_bar.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 底部收回指示条(灰色圆角短横线) -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#4DFFFFFF" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
@@ -25,7 +25,7 @@
|
||||
android:paddingStart="28dp"
|
||||
android:paddingTop="27dp"
|
||||
android:paddingEnd="28dp"
|
||||
android:paddingBottom="20dp">
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
<!-- 时间显示(大字体,老年用户) -->
|
||||
<TextView
|
||||
@@ -37,13 +37,23 @@
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="48sp" />
|
||||
|
||||
<!-- NFC 扫描提示(默认隐藏) -->
|
||||
<!-- 考勤状态文字:"已上班 07:02" / "已下班 17:05"(默认隐藏) -->
|
||||
<TextView
|
||||
android:id="@+id/tvPunchStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:textColor="@color/success"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- NFC 扫描提示 + 倒计时(默认隐藏) -->
|
||||
<TextView
|
||||
android:id="@+id/tvNfcHint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="请将手表贴近打卡信标"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="请贴近信标"
|
||||
android:textColor="@color/warning"
|
||||
android:textSize="18sp"
|
||||
android:visibility="gone" />
|
||||
@@ -57,48 +67,56 @@
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<!-- 上班打卡按钮 -->
|
||||
<!-- 上班打卡按钮(药丸形,蓝色渐变) -->
|
||||
<TextView
|
||||
android:id="@+id/btnPunchIn"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_btn_primary"
|
||||
android:background="@drawable/bg_btn_pill_blue"
|
||||
android:gravity="center"
|
||||
android:text="上班打卡"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 下班打卡按钮 -->
|
||||
<!-- 撤销打卡按钮(窄,灰底红字) -->
|
||||
<TextView
|
||||
android:id="@+id/btnRevoke"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_weight="0.4"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_btn_pill_gray"
|
||||
android:gravity="center"
|
||||
android:text="撤销"
|
||||
android:textColor="@color/error"
|
||||
android:textSize="18sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 下班打卡按钮(宽,蓝色渐变) -->
|
||||
<TextView
|
||||
android:id="@+id/btnPunchOut"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_btn_primary"
|
||||
android:layout_weight="0.6"
|
||||
android:background="@drawable/bg_btn_pill_blue"
|
||||
android:gravity="center"
|
||||
android:text="下班打卡"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="20sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 撤销打卡按钮 -->
|
||||
<TextView
|
||||
android:id="@+id/btnRevoke"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:background="@drawable/bg_btn_secondary"
|
||||
android:gravity="center"
|
||||
android:text="撤销打卡"
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="18sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 底部收回指示条 -->
|
||||
<View
|
||||
android:id="@+id/dismissBar"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="4dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/bg_dismiss_bar" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
Reference in New Issue
Block a user