Comments in Channel Fragment Layout

This commit is contained in:
Bnyro 2022-05-18 11:51:34 +02:00
parent d66af8d55d
commit bd784ef3c1
3 changed files with 44 additions and 24 deletions

View File

@ -208,7 +208,7 @@ class PlayerFragment : Fragment() {
if (playerDescription.isVisible) View.GONE else View.VISIBLE
}
view.findViewById<ConstraintLayout>(R.id.comments_toggle).setOnClickListener {
view.findViewById<com.google.android.material.card.MaterialCardView>(R.id.comments_toggle).setOnClickListener {
commentsRecView.visibility = if (commentsRecView.isVisible) View.GONE else View.VISIBLE
relatedRecView.visibility = if (relatedRecView.isVisible) View.GONE else View.VISIBLE
}

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:height="14dp"
android:width="14dp"
android:viewportHeight="160"
android:viewportWidth="160"
android:tint="?attr/colorControlNormal">
<path android:fillColor="#FF000000" android:pathData="M30.24,64.96C27.52,67.61 23.16,67.55 20.51,64.82 17.86,62.1 17.92,57.74 20.64,55.09L75.43,1.97 80.23,6.9 75.42,1.95c2.74,-2.65 7.1,-2.58 9.76,0.15 0.08,0.08 0.15,0.16 0.23,0.24L139.36,55.1c2.72,2.65 2.78,7.01 0.13,9.73 -2.65,2.72 -7,2.78 -9.73,0.14L80.21,16.5Z"/>
<path android:fillColor="#FF000000" android:pathData="M129.76,95.05C132.48,92.4 136.84,92.46 139.49,95.19 142.14,97.91 142.08,102.27 139.36,104.92L84.57,158.04 79.77,153.11 84.58,158.06c-2.74,2.65 -7.1,2.58 -9.76,-0.15 -0.08,-0.08 -0.15,-0.16 -0.23,-0.24L20.64,104.91c-2.72,-2.65 -2.78,-7.01 -0.13,-9.73 2.65,-2.72 7,-2.78 9.73,-0.14L79.79,143.51Z"/>
</vector>

View File

@ -202,6 +202,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="15dp"
android:background="?android:attr/selectableItemBackground"
@ -250,35 +251,45 @@
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants">
<androidx.constraintlayout.widget.ConstraintLayout
<com.google.android.material.card.MaterialCardView
android:id="@+id/comments_toggle"
style="@style/Widget.Material3.CardView.Elevated"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="18dp"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal">
android:layout_marginBottom="17dp"
app:cardCornerRadius="27dp">
<TextView
android:id="@+id/commentsToggle_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/comments"
android:textSize="17sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/commentsToggle_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:src="@drawable/ic_arrow_down"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/commentsToggle_textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:text="@string/comments"
android:textSize="17sp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<ImageView
android:id="@+id/commentsToggle_imageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="3dp"
android:src="@drawable/ic_arrow_up_down"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/comments_recView"