ASR-Android/app/src/main/res/layout/activity_main.xml

181 lines
7.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- 顶栏:正常态只有左上角「历史会议」;历史态显示 标题+返回 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="12dp"
android:paddingEnd="12dp">
<Button
android:id="@+id/history_button"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/history_button"
android:textSize="13sp" />
<TextView
android:id="@+id/history_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:maxLines="1"
android:paddingStart="8dp"
android:textColor="#666666"
android:textSize="13sp"
android:visibility="gone" />
<Button
android:id="@+id/lang_button"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/lang_button"
android:textSize="13sp" />
<Button
android:id="@+id/history_back"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/history_back"
android:textSize="13sp"
android:visibility="gone" />
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2.5">
<!-- subtitle dialog stream, one item per speaker line;
tap the underlined speaker label to (re)name that speaker -->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/subtitle_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:padding="24dp"
android:scrollbars="vertical"
android:visibility="gone" />
<!-- status / loading text, swapped with the subtitle list -->
<TextView
android:id="@+id/my_text"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="24dp"
android:scrollbars="vertical"
android:singleLine="false"
android:text="@string/hint"
android:gravity="bottom"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</FrameLayout>
<!-- 录音控制紧贴字幕区下方:开始/停止一眼可见 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="4dp"
android:paddingBottom="4dp">
<Button
android:id="@+id/record_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/start" />
<Button
android:id="@+id/pause_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="@string/pause" />
</LinearLayout>
<!-- 纪要面板:状态一行 + 正文(hint 占位/markdown 正文叠放) -->
<TextView
android:id="@+id/minutes_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:textColor="#666666"
android:textSize="12sp"
android:visibility="gone" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1.2">
<TextView
android:id="@+id/minutes_hint"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="16dp"
android:text="@string/minutes_hint"
android:textColor="#999999"
android:textSize="13sp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="12dp">
<TextView
android:id="@+id/minutes_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textIsSelectable="true"
android:textSize="13sp" />
</ScrollView>
</FrameLayout>
<!-- 纪要操作按钮与纪要面板放在同一区,贴底部 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="12dp">
<Button
android:id="@+id/summarize_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/generate_minutes" />
<Button
android:id="@+id/copy_minutes_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="@string/copy_minutes" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>