feat: basic replying

This commit is contained in:
rebelonion 2024-02-19 01:28:11 -06:00
parent 98b227876b
commit 0c2e2db1dc
6 changed files with 245 additions and 115 deletions

View file

@ -1,29 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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/commentsLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fitsSystemWindows="true"
android:id="@+id/commentsLayout">
android:fitsSystemWindows="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="@+id/commentTitle"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:layout_gravity=""
android:layout_marginStart="32dp"
android:layout_marginEnd="32dp"
android:layout_weight="1"
android:fontFamily="@font/poppins_bold"
android:gravity="center|start"
android:text="@string/comments"
@ -34,8 +36,8 @@
android:id="@+id/commentSort"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="16dp"
android:layout_gravity="center"
android:layout_marginEnd="16dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/sort_by"
app:srcCompat="@drawable/ic_round_sort_24"
@ -59,42 +61,44 @@
android:clipChildren="false"
android:clipToPadding="false">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/commentsList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible"
tools:listitem="@layout/item_comments" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/commentsList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:listitem="@layout/item_comments"
tools:visibility="visible" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="bottom|end"
android:windowSoftInputMode="adjustResize"
android:background="@color/nav_bg">
android:background="@color/nav_bg"
android:orientation="vertical"
android:windowSoftInputMode="adjustResize">
<LinearLayout
android:id="@+id/commentReplyToContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="@+id/commentReplyTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:singleLine="true"
android:layout_weight="1"
android:ellipsize="end"
android:fontFamily="@font/poppins_semi_bold"
android:singleLine="true"
android:text="Replying to "
android:textColor="?attr/colorOnBackground"
android:textSize="14sp"
@ -112,22 +116,23 @@
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/commentInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="8dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:windowSoftInputMode="adjustResize">
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/commentUserAvatar"
style="@style/CircularImageView"
android:layout_width="42dp"
android:layout_height="42dp"
android:scaleType="center"
android:layout_marginStart="12dp"
style="@style/CircularImageView"
android:scaleType="center"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
@ -135,19 +140,19 @@
android:id="@+id/commentInput"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:textSize="12sp"
android:autofillHints="The One Piece is real"
android:background="@drawable/card_outline"
android:fontFamily="@font/poppins_semi_bold"
android:hint="Add a comment..."
android:inputType="textMultiLine"
android:padding="8dp"
android:background="@drawable/card_outline"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:maxLength="300"
android:maxLines="15"
tools:ignore="HardcodedText"
android:autofillHints="The One Piece is real" />
android:padding="8dp"
android:textSize="12sp"
tools:ignore="HardcodedText" />
<ImageButton
android:id="@+id/commentSend"

View file

@ -99,7 +99,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:maxLines="3"
android:maxLines="4"
android:scrollHorizontally="false"
android:ellipsize="end"
android:text="@string/slogan"
android:textSize="12sp" />
@ -185,19 +186,6 @@
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/commentTotalRepliesContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<View
android:layout_width="32dp"
android:layout_height="3dp"
android:layout_gravity="center"
android:layout_marginStart="44dp"
android:background="@color/nav_tab" />
<TextView
android:id="@+id/commentTotalReplies"
@ -210,5 +198,14 @@
android:textSize="12sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/commentRepliesList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="8dp"
android:visibility="visible"
tools:visibility="visible"
tools:listitem="@layout/item_comments"
tools:ignore="RtlSymmetry" />
</LinearLayout>