机器人自动发言

This commit is contained in:
18401019693
2022-12-23 18:28:39 +08:00
parent 7488143037
commit 9158424a25
19 changed files with 797 additions and 192 deletions

View File

@@ -0,0 +1,174 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="400dp"
android:background="#000002">
<LinearLayout
android:id="@+id/line1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
android:id="@+id/bt_cancel"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="5.33dp"
android:layout_marginTop="7.76dp"
android:layout_marginBottom="6.33dp"
android:src="@mipmap/icon_back" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="6.67dp"
android:text="@string/automatic_message_sending"
android:textColor="#CCCCCC"
android:textSize="15sp" />
<View
android:layout_width="0dp"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/robot_add_content"
android:layout_width="67.67dp"
android:layout_height="23.33dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="11dp"
android:background="@drawable/background_81c16d"
android:gravity="center"
android:text="@string/robot_add_content"
android:textColor="#FFFFFF"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/line2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/line1"
android:layout_marginStart="10.33dp"
android:layout_marginEnd="10.67dp"
android:background="@drawable/bg_prank_coin"
android:orientation="horizontal"
android:paddingTop="8.67dp"
android:paddingBottom="7.67dp">
<ImageView
android:layout_width="26dp"
android:layout_height="26dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="13.67dp"
android:src="@mipmap/icon_tip" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="8.33dp"
android:text="@string/robot_add_content_hint1"
android:textColor="#CCCCCC"
android:textSize="12sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="8.33dp"
android:layout_marginTop="6dp"
android:text="@string/robot_add_content_hint2"
android:textColor="#CCCCCC"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/robot_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/line2"
android:layout_marginTop="11dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/robot_automatic_speech_interval"
android:textColor="#FFF"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3.67dp"
android:text="@string/robot_minimum_interval"
android:textColor="#B3B3B3"
android:textSize="10sp" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:id="@+id/robot_time"
android:layout_width="96dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_prank_coin"
android:gravity="center"
android:maxLines="1"
android:textColor="#FFF"
android:textSize="12sp" />
<EditText
android:id="@+id/robot_name_setting"
android:layout_width="96dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_prank_coin"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLines="1"
android:textColor="#FFF"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/robot_messages"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/robot_name" />
</RelativeLayout>

View File

@@ -0,0 +1,264 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#000"
android:paddingBottom="23dp">
<TextView
android:id="@+id/textView6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="14dp"
android:text="@string/speech_robot_setup"
android:textColor="#CCCCCC"
android:textSize="15sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/robot_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/textView6"
android:layout_marginTop="18dp"
android:orientation="horizontal">
<androidx.appcompat.widget.AppCompatTextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="10dp"
android:layout_weight="1"
android:text="@string/robot_switch"
android:textColor="#FFF"
android:textSize="15sp" />
<ImageView
android:layout_width="46dp"
android:layout_height="23dp"
android:layout_marginEnd="10dp"
app:srcCompat="@mipmap/special_icon_off" />
</LinearLayout>
<LinearLayout
android:id="@+id/robot_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/robot_status"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/robot_name_setting"
android:textColor="#FFF"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3.67dp"
android:text="@string/word_limit"
android:textColor="#B3B3B3"
android:textSize="10sp" />
</LinearLayout>
<EditText
android:id="@+id/robot_name_setting"
android:layout_width="96dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_prank_coin"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:textColor="#FFF"
android:textSize="12sp"
android:visibility="gone" />
<TextView
android:id="@+id/robot_name_text"
android:layout_width="96dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_prank_coin"
android:gravity="center"
android:imeOptions="actionDone"
android:inputType="text"
android:maxLines="1"
android:textColor="#FFF"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/robot_say_hello"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/robot_name"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/automatic_greeting_setting"
android:textColor="#FFF"
android:textSize="13sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3.67dp"
android:text="@string/configured_items"
android:textColor="#B3B3B3"
android:textSize="10sp" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/automatic_greeting_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4.67dp"
android:layout_marginTop="3.67dp"
android:textColor="#00B8EB"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="96dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_robot_shape"
android:gravity="center"
android:text="@string/robot_go_setting"
android:textColor="#FFF"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/robot_message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/robot_say_hello"
android:layout_marginTop="20dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:text="@string/automatic_message_sending"
android:textColor="#FFF"
android:textSize="13sp" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="3.67dp"
android:text="@string/configured_items"
android:textColor="#B3B3B3"
android:textSize="10sp" />
<androidx.appcompat.widget.AppCompatTextView
android:id="@+id/automatic_message_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="4.67dp"
android:layout_marginTop="3.67dp"
android:textColor="#00B8EB"
android:textSize="10sp" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/automatic_message_sending"
android:layout_width="96dp"
android:layout_height="27dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="10dp"
android:background="@drawable/bg_robot_shape"
android:gravity="center"
android:text="@string/robot_go_setting"
android:textColor="#FFF"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/robot_message"
android:layout_marginStart="10.33dp"
android:layout_marginTop="29dp"
android:layout_marginEnd="10.67dp"
android:background="@drawable/bg_prank_coin"
android:orientation="horizontal"
android:paddingTop="8.67dp"
android:paddingBottom="7.67dp">
<ImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="13.67dp"
android:src="@mipmap/icon_tip" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="8.33dp"
android:text="@string/robot_hint"
android:textColor="#CCCCCC"
android:textSize="12sp" />
</LinearLayout>
</RelativeLayout>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_dialog"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:gravity="center_horizontal"
android:text="@string/dialog_tip"
android:textColor="#161616"
android:textSize="15sp" />
<EditText
android:id="@+id/content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="10dp"
android:background="@drawable/bg_dialog_input"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:textColor="@color/textColor"
android:textSize="14sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginBottom="23dp"
android:gravity="center">
<TextView
android:id="@+id/btn_cancel"
android:layout_width="87dp"
android:layout_height="33dp"
android:layout_marginRight="7dp"
android:background="@mipmap/tipbox_btn_gray"
android:gravity="center"
android:text="@string/cancel"
android:textColor="#B1B1B1"
android:textSize="14sp" />
<TextView
android:id="@+id/btn_confirm"
android:layout_width="87dp"
android:layout_height="33dp"
android:layout_marginLeft="7dp"
android:background="@mipmap/tipbox_btn_orange"
android:gravity="center"
android:text="@string/confirm"
android:textColor="#FFFFFF"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_weight="1"
android:background="@drawable/bg_prank_coin">
<TextView
android:id="@+id/serial_number"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="13dp"
android:text="1"
android:textColor="@color/white"
android:textSize="20sp" />
<TextView
android:id="@+id/message_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginEnd="19dp"
android:text="测试文字"
android:textColor="#80CEF2"
android:textSize="13sp" />
</LinearLayout>
<ImageView
android:id="@+id/btn_delete"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center_vertical"
android:layout_marginStart="9dp"
android:layout_marginEnd="10.67dp"
android:src="@mipmap/icon_close" />
</LinearLayout>