JianShu/hwtxtreaderlib/src/main/res/layout/activity_chatwithgpt.xml

153 lines
6.1 KiB
XML

<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">
<androidx.core.widget.NestedScrollView
android:id="@+id/nestedScrollView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/chatbot_bottom"
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"
android:padding="4dp"
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" />
<!-- 标题栏 -->
<TextView
android:id="@+id/chatbot_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center"
android:text="书名"
android:textSize="22sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/chat_return"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout
android:id="@+id/chatbot_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
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>
</androidx.constraintlayout.widget.ConstraintLayout>