style: 语音按钮视觉优化
- 背景改为橙色半透明+边框,和指引块风格统一 - 宽度 match_parent,内含声波图标+语音描述+时长 - 播放中切换背景高亮+停止图标,停止后恢复 - 新增 bg_btn_voice_playing.xml 播放状态背景 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 语音播放按钮:橙色圆角(兼容 API 27+) -->
|
||||
<!-- 语音播放按钮:橙色半透明,和指引块风格统一 -->
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFCC8820" />
|
||||
<corners android:radius="24dp" />
|
||||
<solid android:color="#40FFB340" />
|
||||
<corners android:radius="27dp" />
|
||||
<stroke android:width="1dp" android:color="#80FFB340" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="#FFEB9A26" />
|
||||
<corners android:radius="24dp" />
|
||||
<solid android:color="#30FFB340" />
|
||||
<corners android:radius="27dp" />
|
||||
<stroke android:width="1dp" android:color="#50FFB340" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
|
||||
8
app/src/main/res/drawable/bg_btn_voice_playing.xml
Normal file
8
app/src/main/res/drawable/bg_btn_voice_playing.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- 语音按钮播放中状态:橙色更亮,表示活跃 -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#60FFB340" />
|
||||
<corners android:radius="27dp" />
|
||||
<stroke android:width="2dp" android:color="#FFFFB340" />
|
||||
</shape>
|
||||
@@ -134,35 +134,44 @@
|
||||
android:layout_marginBottom="11dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<!-- 语音播放按钮(用户上报任务附带语音) -->
|
||||
<!-- 语音播放按钮(用户上报任务附带语音描述) -->
|
||||
<LinearLayout
|
||||
android:id="@+id/btnVoice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:background="@drawable/bg_btn_voice"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:paddingStart="19dp"
|
||||
android:paddingEnd="19dp"
|
||||
android:layout_marginBottom="11dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<!-- 播放图标 -->
|
||||
<!-- 声波图标(播放中切换为暂停) -->
|
||||
<TextView
|
||||
android:id="@+id/tvVoiceIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="▶"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="24sp" />
|
||||
android:text="🔊"
|
||||
android:textSize="26sp" />
|
||||
|
||||
<!-- 语音标签 -->
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="语音描述"
|
||||
android:textColor="@color/warning"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="11dp" />
|
||||
|
||||
<!-- 语音时长 -->
|
||||
<TextView
|
||||
android:id="@+id/tvVoiceDuration"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/text_primary"
|
||||
android:textSize="24sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginStart="8dp" />
|
||||
android:textColor="@color/text_secondary"
|
||||
android:textSize="22sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user