fix chat activity

This commit is contained in:
shaulascr
2025-05-02 07:13:17 +07:00
parent adeb0537f3
commit 3a06f65e96
23 changed files with 747 additions and 592 deletions

View File

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#211E1E" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M16.5,6v11.5c0,2.21 -1.79,4 -4,4s-4,-1.79 -4,-4V5c0,-1.38 1.12,-2.5 2.5,-2.5s2.5,1.12 2.5,2.5v10.5c0,0.55 -0.45,1 -1,1s-1,-0.45 -1,-1V6H10v9.5c0,1.38 1.12,2.5 2.5,2.5s2.5,-1.12 2.5,-2.5V5c0,-2.21 -1.79,-4 -4,-4S7,2.79 7,5v12.5c0,3.04 2.46,5.5 5.5,5.5s5.5,-2.46 5.5,-5.5V6h-1.5z"/>
</vector>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#F5F5F5" />
<corners android:radius="20dp" />
<padding
android:bottom="8dp"
android:left="12dp"
android:right="12dp"
android:top="8dp" />
</shape>

View File

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#211E1E" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M18,7l-1.41,-1.41 -6.34,6.34 1.41,1.41L18,7zM22.24,5.59L11.66,16.17 7.48,12l-1.41,1.41L11.66,19l12,-12 -1.42,-1.41zM0.41,13.41L6,19l1.41,-1.41L1.83,12 0.41,13.41z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#489EC6" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M18,7l-1.41,-1.41 -6.34,6.34 1.41,1.41L18,7zM22.24,5.59L11.66,16.17 7.48,12l-1.41,1.41L11.66,19l12,-12 -1.42,-1.41zM0.41,13.41L6,19l1.41,-1.41L1.83,12 0.41,13.41z"/>
</vector>

View File

@ -0,0 +1,5 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#211E1E" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M9,16.2L4.8,12l-1.4,1.4L9,19 21,7l-1.4,-1.4L9,16.2z"/>
</vector>

View File

@ -2,11 +2,12 @@
<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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:theme="@style/Theme.Ecommerce_serang"
tools:context=".ui.chat.ChatActivity">
<!-- Top Toolbar -->
<androidx.appcompat.widget.Toolbar
android:id="@+id/chatToolbar"
android:layout_width="match_parent"
@ -175,9 +176,23 @@
android:clipToPadding="false"
android:paddingTop="8dp"
android:paddingBottom="8dp"
app:layout_constraintBottom_toTopOf="@+id/layoutChatInput"
app:layout_constraintBottom_toTopOf="@+id/tvTypingIndicator"
app:layout_constraintTop_toBottomOf="@+id/cardProduct" />
<!-- Typing indicator -->
<TextView
android:id="@+id/tvTypingIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="User is typing..."
android:textColor="#666666"
android:textSize="12sp"
android:textStyle="italic"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/layoutChatInput"
tools:visibility="visible" />
<!-- Chat input area -->
<LinearLayout
android:id="@+id/layoutChatInput"
@ -196,7 +211,7 @@
android:layout_gravity="center_vertical"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Attachment"
android:src="@drawable/ic_attachment" />
android:src="@drawable/baseline_attach_file_24" />
<EditText
android:id="@+id/editTextMessage"
@ -205,7 +220,9 @@
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/bg_edit_text_background"
android:hint="Tulis pesan"
android:fontFamily="@font/dmsans_regular"
android:inputType="textMultiLine"
android:maxLines="4"
android:minHeight="40dp"
@ -218,60 +235,7 @@
android:layout_gravity="center_vertical"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Send"
android:src="@drawable/ic_send" />
android:src="@drawable/baseline_attach_file_24" />
</LinearLayout>
<TextView
android:id="@+id/tvTypingIndicator"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="4dp"
android:text="User is typing..."
android:textColor="#666666"
android:textSize="12sp"
android:textStyle="italic"
android:visibility="gone"
app:layout_constraintBottom_toTopOf="@+id/layoutChatInput"
tools:visibility="visible" />
<!-- Bottom navigation -->
<LinearLayout
android:id="@+id/bottomNavigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFFFFF"
android:elevation="8dp"
android:orientation="horizontal"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent">
<ImageButton
android:id="@+id/btnHome"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Home"
android:src="@drawable/ic_home" />
<ImageButton
android:id="@+id/btnMenu"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Menu"
android:src="@drawable/ic_menu" />
<ImageButton
android:id="@+id/btnNotification"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Notification"
android:src="@drawable/ic_notification" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -3,8 +3,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context=".ui.chat.ChatFragment">
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.appcompat.widget.Toolbar
android:id="@+id/chatToolbar"
@ -235,7 +234,7 @@
android:layout_gravity="center_vertical"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Attachment"
android:src="@drawable/ic_attachment" />
android:src="@drawable/baseline_attach_file_24" />
<EditText
android:id="@+id/editTextMessage"
@ -244,7 +243,7 @@
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:background="@drawable/bg_edit_text_rounded"
android:background="@drawable/bg_edit_text_background"
android:hint="Tulis pesan"
android:inputType="textMultiLine"
android:maxLines="4"
@ -258,7 +257,7 @@
android:layout_gravity="center_vertical"
android:background="?attr/selectableItemBackgroundBorderless"
android:contentDescription="Send"
android:src="@drawable/ic_send" />
android:src="@drawable/baseline_attach_file_24" />
</LinearLayout>

View File

@ -10,4 +10,10 @@
android:layout_height="match_parent"
android:text="Hello" />
<Button
android:id="@+id/btn_trial"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="trial button"/>
</FrameLayout>

View File

@ -13,7 +13,7 @@
android:id="@+id/imgAvatar"
android:layout_width="32dp"
android:layout_height="32dp"
android:src="@drawable/profile_placeholder"
android:src="@drawable/ic_person"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/layoutMessage" />

View File

@ -117,5 +117,25 @@
<item>Other reason</item>
</string-array>
<!-- Chat Activity -->
<string name="image_attached">Image attached</string>
<string name="write_message">Tulis pesan</string>
<string name="options">Options</string>
<string name="block_user">Block User</string>
<string name="report">Report</string>
<string name="clear_chat">Clear Chat</string>
<string name="block_user_selected">Block user selected</string>
<string name="report_selected">Report selected</string>
<string name="clear_chat_selected">Clear chat selected</string>
<string name="permission_denied">Permission denied</string>
<string name="take_photo">Take Photo</string>
<string name="choose_from_gallery">Choose from Gallery</string>
<string name="select_attachment">Select Attachment</string>
<string name="image_selected">Image selected</string>
<string name="connecting">Connecting...</string>
<string name="disconnected_reconnecting">Disconnected. Reconnecting...</string>
<string name="connection_error">Connection error: %1$s</string>
<string name="typing">User is typing...</string>
</resources>