218 lines
7.8 KiB
XML
218 lines
7.8 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"
|
|
android:background="#606060"
|
|
tools:context="com.digitalperson.Live2DChatActivity">
|
|
|
|
<android.opengl.GLSurfaceView
|
|
android:id="@+id/live2d_view"
|
|
android:layout_width="0dp"
|
|
android:layout_height="0dp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent" />
|
|
|
|
<FrameLayout
|
|
android:id="@+id/face_preview_container"
|
|
android:layout_width="220dp"
|
|
android:layout_height="300dp"
|
|
android:layout_margin="12dp"
|
|
android:background="#55000000"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintTop_toTopOf="parent">
|
|
|
|
<androidx.camera.view.PreviewView
|
|
android:id="@+id/camera_preview"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent"
|
|
app:implementationMode="compatible"
|
|
app:scaleType="fitCenter" />
|
|
|
|
<com.digitalperson.face.FaceOverlayView
|
|
android:id="@+id/face_overlay"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="match_parent" />
|
|
</FrameLayout>
|
|
|
|
<ImageView
|
|
android:id="@+id/ref_match_image"
|
|
android:layout_width="200dp"
|
|
android:layout_height="200dp"
|
|
android:layout_margin="12dp"
|
|
android:background="#66000000"
|
|
android:scaleType="fitCenter"
|
|
android:visibility="gone"
|
|
app:layout_constraintBottom_toTopOf="@+id/button_row"
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
tools:visibility="visible" />
|
|
|
|
<ScrollView
|
|
android:id="@+id/scroll_view"
|
|
android:layout_width="0dp"
|
|
android:layout_height="200dp"
|
|
android:fillViewport="true"
|
|
app:layout_constraintBottom_toTopOf="@+id/llm_mode_switch_row"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent">
|
|
|
|
<TextView
|
|
android:id="@+id/my_text"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:background="@android:color/transparent"
|
|
android:padding="16dp"
|
|
android:scrollbars="vertical"
|
|
android:text="@string/hint"
|
|
android:textIsSelectable="true" />
|
|
</ScrollView>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/llm_mode_switch_row"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:padding="16dp"
|
|
app:layout_constraintBottom_toTopOf="@+id/streaming_switch_row"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent">
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="16dp"
|
|
android:text="本地LLM"
|
|
android:textSize="16sp" />
|
|
|
|
<Switch
|
|
android:id="@+id/llm_mode_switch"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:checked="false" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/streaming_switch_row"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:padding="16dp"
|
|
app:layout_constraintBottom_toTopOf="@+id/tts_mode_switch_row"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent">
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="16dp"
|
|
android:text="流式输出"
|
|
android:textSize="16sp" />
|
|
|
|
<Switch
|
|
android:id="@+id/streaming_switch"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:checked="false" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/tts_mode_switch_row"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center_vertical"
|
|
android:orientation="horizontal"
|
|
android:padding="16dp"
|
|
app:layout_constraintBottom_toTopOf="@+id/button_row"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent">
|
|
|
|
<TextView
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="16dp"
|
|
android:text="腾讯云TTS"
|
|
android:textSize="16sp" />
|
|
|
|
<Switch
|
|
android:id="@+id/tts_mode_switch"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:checked="true" />
|
|
</LinearLayout>
|
|
|
|
<LinearLayout
|
|
android:id="@+id/button_row"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:gravity="center"
|
|
android:orientation="horizontal"
|
|
android:padding="16dp"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent"
|
|
app:layout_constraintStart_toStartOf="parent">
|
|
|
|
<!-- 传统按钮 -->
|
|
<LinearLayout
|
|
android:id="@+id/traditional_buttons"
|
|
android:layout_width="match_parent"
|
|
android:layout_height="wrap_content"
|
|
android:orientation="horizontal"
|
|
android:gravity="center">
|
|
|
|
<Button
|
|
android:id="@+id/start_button"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_marginEnd="12dp"
|
|
android:layout_weight="1"
|
|
android:text="@string/start" />
|
|
|
|
<Button
|
|
android:id="@+id/stop_button"
|
|
android:layout_width="0dp"
|
|
android:layout_height="wrap_content"
|
|
android:layout_weight="1"
|
|
android:text="@string/stop" />
|
|
</LinearLayout>
|
|
</LinearLayout>
|
|
|
|
<!-- 按住录音按钮 - 右下角 -->
|
|
<FrameLayout
|
|
android:id="@+id/record_button_container"
|
|
android:layout_width="120dp"
|
|
android:layout_height="120dp"
|
|
android:layout_margin="14dp"
|
|
android:layout_marginBottom="14dp"
|
|
android:visibility="gone"
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
app:layout_constraintEnd_toEndOf="parent">
|
|
|
|
<View
|
|
android:id="@+id/record_button_glow"
|
|
android:layout_width="120dp"
|
|
android:layout_height="120dp"
|
|
android:layout_gravity="center"
|
|
android:background="@drawable/record_button_glow"
|
|
android:visibility="gone" />
|
|
|
|
<Button
|
|
android:id="@+id/record_button"
|
|
android:layout_width="100dp"
|
|
android:layout_height="100dp"
|
|
android:layout_gravity="center"
|
|
android:text="按住说话"
|
|
android:textColor="@android:color/white"
|
|
android:textSize="14sp"
|
|
android:textAllCaps="false"
|
|
android:background="@drawable/record_button_background"
|
|
app:backgroundTint="#4CAF50"
|
|
android:stateListAnimator="@animator/button_elevation" />
|
|
</FrameLayout>
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|