2024-05-08 19:14:44 +08:00
|
|
|
<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">
|
|
|
|
|
2024-05-11 11:06:19 +08:00
|
|
|
<androidx.core.widget.NestedScrollView
|
|
|
|
android:id="@+id/nestedScrollView"
|
|
|
|
android:layout_width="0dp"
|
|
|
|
android:layout_height="0dp"
|
2024-05-12 15:34:48 +08:00
|
|
|
app:layout_constraintBottom_toTopOf="@id/chatbot_bottom"
|
2024-05-11 11:06:19 +08:00
|
|
|
app:layout_constraintLeft_toLeftOf="parent"
|
|
|
|
app:layout_constraintRight_toRightOf="parent"
|
|
|
|
app:layout_constraintTop_toBottomOf="@id/chatbot_title">
|
|
|
|
|
|
|
|
<LinearLayout
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="match_parent"
|
|
|
|
android:orientation="vertical">
|
|
|
|
|
|
|
|
<!-- RecyclerView 聊天区域 -->
|
|
|
|
<androidx.recyclerview.widget.RecyclerView
|
|
|
|
android:id="@+id/chatRecyclerView"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content" />
|
|
|
|
|
|
|
|
<!-- Question Container -->
|
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/questionContainer"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_marginTop="16dp"
|
|
|
|
android:orientation="vertical">
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
android:id="@+id/question1"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_marginLeft="8dp"
|
|
|
|
android:layout_marginRight="8dp"
|
|
|
|
android:layout_marginBottom="8dp"
|
|
|
|
android:background="@drawable/rounded_question_background"
|
|
|
|
android:padding="4dp"
|
|
|
|
android:text="请告诉我更多。"
|
|
|
|
android:textColor="@android:color/black"
|
|
|
|
android:textSize="14sp" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
android:id="@+id/question2"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_marginLeft="8dp"
|
|
|
|
android:layout_marginRight="8dp"
|
|
|
|
android:layout_marginBottom="8dp"
|
|
|
|
android:background="@drawable/rounded_question_background"
|
|
|
|
android:padding="4dp"
|
|
|
|
android:text="testtesttesttesttesttest"
|
|
|
|
android:textColor="@android:color/black"
|
|
|
|
android:textSize="14sp"
|
|
|
|
android:visibility="gone" />
|
|
|
|
|
|
|
|
<TextView
|
|
|
|
android:id="@+id/question3"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_marginLeft="8dp"
|
|
|
|
android:layout_marginRight="8dp"
|
|
|
|
android:layout_marginBottom="8dp"
|
|
|
|
android:background="@drawable/rounded_question_background"
|
|
|
|
android:padding="4dp"
|
|
|
|
android:text="testtesttesttesttesttest"
|
|
|
|
android:textColor="@android:color/black"
|
|
|
|
android:textSize="14sp"
|
|
|
|
android:visibility="gone" />
|
|
|
|
|
|
|
|
</LinearLayout>
|
|
|
|
</LinearLayout>
|
|
|
|
</androidx.core.widget.NestedScrollView>
|
|
|
|
|
|
|
|
<ImageView
|
|
|
|
android:id="@+id/chat_return"
|
|
|
|
android:layout_width="40dp"
|
|
|
|
android:layout_height="40dp"
|
2024-05-12 15:34:48 +08:00
|
|
|
android:padding="4dp"
|
2024-05-11 11:06:19 +08:00
|
|
|
android:src="@drawable/ic_return"
|
|
|
|
app:layout_constraintStart_toStartOf="parent"
|
|
|
|
app:layout_constraintEnd_toStartOf="@id/chatbot_title"
|
|
|
|
app:layout_constraintTop_toTopOf="parent"
|
|
|
|
app:layout_constraintBottom_toBottomOf="@id/chatbot_title" />
|
|
|
|
|
2024-05-08 19:14:44 +08:00
|
|
|
<!-- 标题栏 -->
|
2024-05-12 15:34:48 +08:00
|
|
|
|
2024-05-08 19:14:44 +08:00
|
|
|
<TextView
|
|
|
|
android:id="@+id/chatbot_title"
|
|
|
|
android:layout_width="0dp"
|
|
|
|
android:layout_height="wrap_content"
|
2024-05-12 15:34:48 +08:00
|
|
|
android:layout_marginTop="6dp"
|
|
|
|
android:gravity="center"
|
2024-05-08 19:14:44 +08:00
|
|
|
android:text="书名"
|
2024-05-11 11:06:19 +08:00
|
|
|
android:textSize="22sp"
|
|
|
|
app:layout_constraintEnd_toEndOf="parent"
|
2024-05-12 15:34:48 +08:00
|
|
|
app:layout_constraintStart_toEndOf="@id/chat_return"
|
2024-05-11 11:06:19 +08:00
|
|
|
app:layout_constraintTop_toTopOf="parent" />
|
2024-05-08 19:14:44 +08:00
|
|
|
|
2024-05-12 15:34:48 +08:00
|
|
|
<LinearLayout
|
|
|
|
android:id="@+id/chatbot_bottom"
|
|
|
|
android:layout_width="match_parent"
|
2024-05-08 19:14:44 +08:00
|
|
|
android:layout_height="wrap_content"
|
2024-05-12 15:34:48 +08:00
|
|
|
android:orientation="vertical"
|
|
|
|
android:layout_marginBottom="8dp"
|
2024-05-08 19:14:44 +08:00
|
|
|
app:layout_constraintBottom_toBottomOf="parent"
|
|
|
|
app:layout_constraintLeft_toLeftOf="parent"
|
2024-05-12 15:34:48 +08:00
|
|
|
app:layout_constraintRight_toRightOf="parent">
|
|
|
|
<LinearLayout
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:orientation="horizontal">
|
|
|
|
<!-- 输入框 -->
|
|
|
|
<EditText
|
|
|
|
android:id="@+id/inputEditText"
|
|
|
|
android:layout_width="0dp"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:layout_weight="1"
|
|
|
|
android:layout_marginLeft="16dp"
|
|
|
|
android:layout_marginRight="8dp"
|
|
|
|
android:hint="与阅读小助手交谈..." />
|
|
|
|
|
|
|
|
<ImageView
|
|
|
|
android:id="@+id/sendButton"
|
|
|
|
android:layout_width="40dp"
|
|
|
|
android:layout_height="40dp"
|
|
|
|
android:layout_marginRight="16dp"
|
|
|
|
android:src="@drawable/ic_send"
|
|
|
|
android:layout_gravity="right|bottom" />
|
|
|
|
</LinearLayout>
|
|
|
|
<TextView
|
|
|
|
android:id="@+id/textView_Cite"
|
|
|
|
android:layout_width="match_parent"
|
|
|
|
android:layout_height="wrap_content"
|
|
|
|
android:text="引用:"
|
|
|
|
android:textSize="14sp"
|
|
|
|
android:ellipsize="end"
|
|
|
|
android:maxLines="1"
|
|
|
|
android:visibility="gone"
|
|
|
|
android:layout_marginLeft="16dp"
|
|
|
|
android:layout_marginTop="6dp"
|
|
|
|
android:layout_marginRight="40dp" />
|
|
|
|
</LinearLayout>
|
|
|
|
|
2024-05-08 19:14:44 +08:00
|
|
|
|
|
|
|
</androidx.constraintlayout.widget.ConstraintLayout>
|