feat: comment placement | tagging

This commit is contained in:
rebelonion 2024-02-26 03:01:11 -06:00
parent 8a922bd083
commit 7f943d34ac
20 changed files with 548 additions and 293 deletions

View file

@ -1,168 +0,0 @@
<?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"
android:background="?android:colorBackground"
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_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"
android:textColor="?attr/colorPrimary"
android:textSize="16sp" />
<ImageView
android:id="@+id/commentSort"
android:layout_width="24dp"
android:layout_height="24dp"
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"
app:tint="?attr/colorOnBackground" />
</LinearLayout>
<ProgressBar
android:id="@+id/commentsProgressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginTop="64dp" />
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/commentsRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:layout_marginBottom="58dp"
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:listitem="@layout/item_comments"
tools:visibility="visible" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
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:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
android:visibility="gone"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="@+id/commentReplyTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
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"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/commentReplyToCancel"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_round_close_24"
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/commentInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
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:layout_marginStart="12dp"
android:scaleType="center"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
<EditText
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: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:maxLength="300"
android:maxLines="15"
android:padding="8dp"
android:textSize="12sp"
tools:ignore="HardcodedText" />
<ImageButton
android:id="@+id/commentSend"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginEnd="12dp"
android:background="@drawable/ic_round_send_24"
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -234,7 +234,7 @@
android:id="@+id/mediaViewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:nestedScrollingEnabled="false"
android:nestedScrollingEnabled="true"
tools:ignore="SpeakableTextPresentCheck" />
</LinearLayout>
@ -248,7 +248,7 @@
android:translationZ="1dp"
app:itemActiveIndicatorStyle="@style/BottomNavBar"
app:itemIconTint="@color/tab_layout_icon"
app:itemRippleColor="?attr/colorPrimary"
app:itemRippleColor="#00000000"
app:itemTextAppearanceActive="@style/NavBarText"
app:itemTextAppearanceInactive="@style/NavBarText"
app:itemTextColor="@color/tab_layout_icon"

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<EditText
android:id="@+id/dialogEditText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
android:maxLines="1"
android:maxLength="4"
android:autofillHints="e.g. 1" />
</LinearLayout>

View file

@ -0,0 +1,195 @@
<?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"
android:background="?android:colorBackground"
android:fitsSystemWindows="true">
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/commentsRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/commentInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
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:layout_marginStart="12dp"
android:scaleType="center"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
<EditText
android:id="@+id/commentInput"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_weight="1"
android:layout_gravity="start|center_vertical"
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:maxLength="300"
android:maxLines="8"
android:padding="8dp"
android:textSize="12sp"
tools:ignore="HardcodedText" />
<ImageButton
android:id="@+id/commentLabel"
android:layout_width="42dp"
android:layout_height="42dp"
android:scaleType="center"
android:scaleX="0.6"
android:scaleY="0.6"
android:translationX="100dp"
android:background="@drawable/ic_label_off_24"
android:visibility="gone"/>
<ImageButton
android:id="@+id/commentSend"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginEnd="12dp"
android:translationX="100dp"
android:scaleType="center"
android:scaleX="0.85"
android:scaleY="0.85"
android:background="@drawable/ic_round_send_24"
tools:ignore="ContentDescription"
android:visibility="gone"/>
</LinearLayout>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="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:gravity="end"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="@+id/commentFilter"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="12dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/sort_by"
app:srcCompat="@drawable/ic_round_filter_alt_24"
app:tint="?attr/colorOnBackground" />
<ImageView
android:id="@+id/commentSort"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginEnd="12dp"
android:background="?android:attr/selectableItemBackground"
android:contentDescription="@string/sort_by"
app:srcCompat="@drawable/ic_round_sort_24"
app:tint="?attr/colorOnBackground" />
</LinearLayout>
<ProgressBar
android:id="@+id/commentsProgressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|center_horizontal"
android:layout_marginTop="64dp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/commentsList"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"
android:visibility="gone"
tools:listitem="@layout/item_comments"
tools:visibility="visible" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
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:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:orientation="horizontal"
android:visibility="gone"
tools:ignore="UseCompoundDrawables">
<TextView
android:id="@+id/commentReplyTo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
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"
tools:ignore="HardcodedText" />
<ImageView
android:id="@+id/commentReplyToCancel"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_gravity="center_vertical"
android:layout_marginEnd="16dp"
android:background="?android:attr/selectableItemBackground"
app:srcCompat="@drawable/ic_round_close_24"
app:tint="?attr/colorOnBackground"
tools:ignore="ContentDescription" />
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -19,22 +19,6 @@
android:orientation="vertical"
android:padding="32dp">
<Button
android:id="@+id/animeComments"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:backgroundTint="?attr/colorSurfaceVariant"
android:fontFamily="@font/poppins_bold"
android:insetTop="0dp"
android:insetBottom="0dp"
android:text="@string/comments"
android:textAlignment="center"
android:textColor="@color/bg_white"
android:visibility="gone"
tools:ignore="TextContrastCheck"
tools:visibility="visible"/>
<TextView
android:id="@+id/animeSourceTitle"
android:layout_width="match_parent"

View file

@ -27,6 +27,7 @@
android:layout_width="36dp"
android:layout_height="36dp"
android:scaleType="center"
android:layout_gravity="center_horizontal"
style="@style/CircularImageView"
app:srcCompat="@drawable/ic_round_add_circle_24"
tools:ignore="ContentDescription,ImageContrastCheck" />
@ -42,8 +43,37 @@
android:alpha="0.6"
tools:ignore="HardcodedText" />
<LinearLayout
android:id="@+id/commentUserTagLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/commentTag"
android:layout_width="16dp"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:src="@drawable/ic_label_24" />
<TextView
android:id="@+id/commentUserTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:paddingTop="2dp"
android:text="9999"
android:maxLines="1"
android:textSize="12sp"
android:alpha="0.6"
android:layout_marginEnd="12dp"
android:layout_gravity="center_vertical"
tools:ignore="HardcodedText" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -116,7 +146,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/poppins_semi_bold"
android:maxLines="4"
android:maxLines="8"
android:scrollHorizontally="false"
android:ellipsize="end"
android:text="@string/slogan"
@ -132,6 +162,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:paddingTop="1dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="Reply"
android:textSize="12sp"
@ -143,6 +174,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:paddingTop="1dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="Edit"
android:textSize="12sp"
@ -154,6 +186,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:paddingTop="1dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="Delete"
android:textSize="12sp"
@ -165,6 +198,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="12dp"
android:alpha="0.6"
android:paddingTop="1dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="Report"
android:textSize="12sp"
@ -175,6 +209,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:alpha="0.6"
android:paddingTop="1dp"
android:fontFamily="@font/poppins_semi_bold"
android:text="Ban User"
android:textSize="12sp"