aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res/layout/item_post.xml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2019-10-28 13:17:09 +0000
committerAlex Ning <chineseperson5@gmail.com>2019-10-28 13:17:09 +0000
commit3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e (patch)
tree59ae7eb6da709afd0899a3493f671b84351f2c4a /app/src/main/res/layout/item_post.xml
parent8d5bf2c6466c518523ed1068092c09c74d857654 (diff)
downloadinfinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.gz
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.bz2
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.lz
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.xz
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.tar.zst
infinity-for-reddit-3a81ca17e864dd76d77d4a6bd41ccfdcc54bbe1e.zip
Use FlowLayout to host all the information of a post in item_post and item_post_detail.
Diffstat (limited to 'app/src/main/res/layout/item_post.xml')
-rw-r--r--app/src/main/res/layout/item_post.xml144
1 files changed, 51 insertions, 93 deletions
diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml
index c09582f5..c702e529 100644
--- a/app/src/main/res/layout/item_post.xml
+++ b/app/src/main/res/layout/item_post.xml
@@ -94,10 +94,13 @@
android:textSize="?attr/content_font_default"
android:ellipsize="end" />
- <androidx.constraintlayout.widget.ConstraintLayout
+ <com.nex3z.flowlayout.FlowLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp">
+ android:padding="16dp"
+ app:flChildSpacing="16dp"
+ app:flChildSpacingForLastRow="align"
+ app:flRowSpacing="8dp">
<com.libRG.CustomTextView
android:id="@+id/type_text_view_item_post"
@@ -106,118 +109,40 @@
android:padding="4dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toStartOf="parent"
- app:layout_constraintTop_toTopOf="parent"
app:lib_setRoundedBGColor="@color/backgroundColorPrimaryDark"
app:lib_setRoundedBorderColor="@color/backgroundColorPrimaryDark"
app:lib_setRadius="3dp"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
- <ImageView
- android:id="@+id/gilded_image_view_item_post"
- android:layout_width="20dp"
- android:layout_height="20dp"
- android:layout_marginStart="16dp"
- android:src="@drawable/gold"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/type_text_view_item_post"
- app:layout_constraintTop_toTopOf="parent" />
-
- <TextView
- android:id="@+id/gilded_number_text_view_item_post"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginStart="4dp"
- android:textColor="@color/gold"
- android:textSize="?attr/font_default"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/gilded_image_view_item_post"
- app:layout_constraintTop_toTopOf="parent" />
-
- <ImageView
- android:id="@+id/archived_image_view_item_post"
- android:layout_width="20dp"
- android:layout_height="20dp"
- android:layout_marginStart="16dp"
- android:src="@drawable/ic_archive_outline"
- android:tint="@color/archivedTint"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/gilded_number_text_view_item_post"
- app:layout_constraintTop_toTopOf="parent" />
-
- <ImageView
- android:id="@+id/locked_image_view_item_post"
- android:layout_width="20dp"
- android:layout_height="20dp"
- android:layout_marginStart="16dp"
- android:src="@drawable/ic_outline_lock"
- android:tint="@color/lockedIconTint"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/archived_image_view_item_post"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintHorizontal_bias="0" />
-
- <ImageView
- android:id="@+id/crosspost_image_view_item_post"
- android:layout_width="20dp"
- android:layout_height="20dp"
- android:layout_marginStart="16dp"
- android:src="@drawable/crosspost"
- android:tint="@color/colorAccent"
- android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@+id/locked_image_view_item_post"
- app:layout_constraintTop_toTopOf="parent" />
-
<com.libRG.CustomTextView
- android:id="@+id/nsfw_text_view_item_post"
+ android:id="@+id/spoiler_custom_text_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:padding="4dp"
- android:text="@string/nsfw"
+ android:layout_gravity="center"
+ android:text="@string/spoiler"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
+ android:padding="4dp"
android:visibility="gone"
- app:layout_constraintBottom_toBottomOf="parent"
- app:layout_constraintStart_toEndOf="@id/crosspost_image_view_item_post"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintTop_toTopOf="parent"
- app:layout_constraintHorizontal_bias="1"
- app:lib_setRoundedBGColor="@color/colorAccent"
- app:lib_setRoundedBorderColor="@color/colorAccent"
app:lib_setRadius="3dp"
+ app:lib_setRoundedBGColor="@color/spoilerBackgroundColor"
+ app:lib_setRoundedBorderColor="@color/spoilerBackgroundColor"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
- </androidx.constraintlayout.widget.ConstraintLayout>
-
- <LinearLayout
- android:id="@+id/spoiler_flair_linear_layout_item_post"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginBottom="16dp"
- android:visibility="gone">
-
<com.libRG.CustomTextView
- android:id="@+id/spoiler_custom_text_view_item_post"
+ android:id="@+id/nsfw_text_view_item_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_gravity="center"
- android:layout_marginStart="16dp"
- android:text="@string/spoiler"
+ android:padding="4dp"
+ android:text="@string/nsfw"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
- android:padding="4dp"
android:visibility="gone"
+ app:lib_setRoundedBGColor="@color/colorAccent"
+ app:lib_setRoundedBorderColor="@color/colorAccent"
app:lib_setRadius="3dp"
- app:lib_setRoundedBGColor="@color/spoilerBackgroundColor"
- app:lib_setRoundedBorderColor="@color/spoilerBackgroundColor"
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
@@ -226,7 +151,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
- android:layout_marginStart="16dp"
android:textSize="?attr/font_12"
android:textColor="@android:color/white"
android:padding="4dp"
@@ -237,7 +161,41 @@
app:lib_setRoundedView="true"
app:lib_setShape="rectangle" />
- </LinearLayout>
+ <TextView
+ android:id="@+id/gilded_number_text_view_item_post"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textColor="@color/gold"
+ android:textSize="?attr/font_default"
+ android:drawableStart="@drawable/gold"
+ android:drawablePadding="4dp"
+ android:visibility="gone" />
+
+ <ImageView
+ android:id="@+id/archived_image_view_item_post"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:src="@drawable/ic_archive_outline"
+ android:tint="@color/archivedTint"
+ android:visibility="gone" />
+
+ <ImageView
+ android:id="@+id/locked_image_view_item_post"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:src="@drawable/ic_outline_lock"
+ android:tint="@color/lockedIconTint"
+ android:visibility="gone" />
+
+ <ImageView
+ android:id="@+id/crosspost_image_view_item_post"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:src="@drawable/crosspost"
+ android:tint="@color/colorAccent"
+ android:visibility="gone" />
+
+ </com.nex3z.flowlayout.FlowLayout>
<TextView
android:id="@+id/link_text_view_item_post"