58 lines
2.2 KiB
XML
58 lines
2.2 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=".ui.ChatWithGptActivity">
|
||
|
|
||
|
<!-- 标题栏 -->
|
||
|
<TextView
|
||
|
android:id="@+id/chatbot_title"
|
||
|
android:layout_width="0dp"
|
||
|
android:layout_height="wrap_content"
|
||
|
android:text="书名"
|
||
|
android:textSize="20sp"
|
||
|
android:gravity="center"
|
||
|
android:layout_marginTop="16dp"
|
||
|
app:layout_constraintTop_toTopOf="parent"
|
||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||
|
app:layout_constraintRight_toRightOf="parent"/>
|
||
|
|
||
|
<!-- RecyclerView 聊天区域 -->
|
||
|
<androidx.recyclerview.widget.RecyclerView
|
||
|
android:id="@+id/chatRecyclerView"
|
||
|
android:layout_width="0dp"
|
||
|
android:layout_height="0dp"
|
||
|
android:layout_marginTop="8dp"
|
||
|
app:layout_constraintTop_toBottomOf="@id/chatbot_title"
|
||
|
app:layout_constraintBottom_toTopOf="@id/inputEditText"
|
||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||
|
app:layout_constraintRight_toRightOf="parent"/>
|
||
|
|
||
|
<!-- 输入框 -->
|
||
|
<EditText
|
||
|
android:id="@+id/inputEditText"
|
||
|
android:layout_width="0dp"
|
||
|
android:layout_height="wrap_content"
|
||
|
android:layout_marginBottom="16dp"
|
||
|
android:hint="输入消息..."
|
||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||
|
app:layout_constraintRight_toLeftOf="@id/sendButton"
|
||
|
android:layout_marginLeft="16dp"
|
||
|
android:layout_marginRight="8dp" />
|
||
|
|
||
|
<!-- 发送按钮 -->
|
||
|
<Button
|
||
|
android:id="@+id/sendButton"
|
||
|
android:layout_width="wrap_content"
|
||
|
android:layout_height="wrap_content"
|
||
|
android:text="发送"
|
||
|
android:layout_marginBottom="16dp"
|
||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||
|
app:layout_constraintRight_toRightOf="parent"
|
||
|
android:layout_marginRight="16dp" />
|
||
|
|
||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|