Commit f6d0e972 authored by Mahima Induvara's avatar Mahima Induvara

Modify the List item in Chatbot UI

parent cf6e76cf
...@@ -21,7 +21,7 @@ class AdapterChatBot : RecyclerView.Adapter<AdapterChatBot.MyViewHolder>() { ...@@ -21,7 +21,7 @@ class AdapterChatBot : RecyclerView.Adapter<AdapterChatBot.MyViewHolder>() {
txtChat.setTextColor(Color.BLACK) txtChat.setTextColor(Color.BLACK)
txtChat.text = chat.chat txtChat.text = chat.chat
}else{ }else{
txtChat.setBackgroundColor(Color.GRAY) txtChat.setBackgroundColor(Color.YELLOW)
txtChat.setTextColor(Color.BLACK) txtChat.setTextColor(Color.BLACK)
txtChat.text = chat.chat txtChat.text = chat.chat
} }
......
...@@ -20,7 +20,7 @@ class MainActivity : AppCompatActivity() { ...@@ -20,7 +20,7 @@ class MainActivity : AppCompatActivity() {
setContentView(R.layout.activity_chatbot_main) setContentView(R.layout.activity_chatbot_main)
val retrofit = Retrofit.Builder() val retrofit = Retrofit.Builder()
.baseUrl("http://192.168.1.100:5000") .baseUrl("http://192.168.8.101:5000/")
.addConverterFactory(GsonConverterFactory.create()) .addConverterFactory(GsonConverterFactory.create())
.build() .build()
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M12,14c1.66,0 2.99,-1.34 2.99,-3L15,5c0,-1.66 -1.34,-3 -3,-3S9,3.34 9,5v6c0,1.66 1.34,3 3,3zM17.3,11c0,3 -2.54,5.1 -5.3,5.1S6.7,14 6.7,11L5,11c0,3.41 2.72,6.23 6,6.72L11,21h2v-3.28c3.28,-0.48 6,-3.3 6,-6.72h-1.7z"/>
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal"
android:autoMirrored="true">
<path
android:fillColor="@android:color/white"
android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
</vector>
...@@ -5,39 +5,57 @@ ...@@ -5,39 +5,57 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context="chatbot.MainActivity"> tools:context="chatbot.MainActivity">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvChatList" android:id="@+id/rvChatList"
android:layout_width="0dp" android:layout_width="401dp"
android:layout_height="0dp" android:layout_height="665dp"
app:layout_constraintBottom_toTopOf="@+id/etChat" app:layout_constraintBottom_toTopOf="@+id/etChat"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="1.0"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
<EditText <EditText
android:id="@+id/etChat" android:id="@+id/etChat"
android:layout_width="0dp" android:layout_width="245dp"
android:layout_height="wrap_content" android:layout_height="60dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:ems="10" android:ems="10"
android:hint="Chat with bot" android:hint="Chat with bot"
android:inputType="textPersonName" android:inputType="textPersonName"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/btnSend" app:layout_constraintEnd_toStartOf="@+id/btnSend"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />
<Button
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/floatingActionButton2"
android:layout_width="56dp"
android:layout_height="56dp"
android:clickable="true"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.791"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.988"
app:srcCompat="@drawable/ic_baseline_mic_24" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/btnSend" android:id="@+id/btnSend"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="16dp" android:clickable="true"
android:layout_marginRight="16dp" app:layout_constraintBottom_toBottomOf="parent"
android:text="Send"
app:layout_constraintBottom_toBottomOf="@+id/etChat"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@+id/etChat" /> app:layout_constraintHorizontal_bias="0.98"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.988"
app:srcCompat="@drawable/ic_baseline_send_24" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
...@@ -27,8 +27,10 @@ ...@@ -27,8 +27,10 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginLeft="0dp"
> android:layout_marginTop="3dp"
android:gravity="center"
android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="fill_parent" android:layout_width="fill_parent"
...@@ -107,8 +109,7 @@ ...@@ -107,8 +109,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:background="@android:color/transparent" android:background="@android:color/transparent" />
/>
</RelativeLayout> </RelativeLayout>
...@@ -153,8 +154,7 @@ ...@@ -153,8 +154,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:background="@android:color/transparent" android:background="@android:color/transparent" />
/>
</RelativeLayout> </RelativeLayout>
...@@ -209,8 +209,7 @@ ...@@ -209,8 +209,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:background="@android:color/transparent" android:background="@android:color/transparent" />
/>
</RelativeLayout> </RelativeLayout>
...@@ -256,8 +255,7 @@ ...@@ -256,8 +255,7 @@
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_marginTop="0dp" android:layout_marginTop="0dp"
android:background="@android:color/transparent" android:background="@android:color/transparent" />
/>
</RelativeLayout> </RelativeLayout>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android" <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="60dp"
android:layout_gravity="end" android:layout_gravity="end"
android:layout_margin="5dp" android:layout_margin="5dp"
android:elevation="8dp" android:elevation="8dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment