aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/res/layout/item_post.xml
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2018-08-24 02:38:37 +0000
committerAlex Ning <chineseperson5@gmail.com>2018-08-24 02:38:37 +0000
commitd83ded01933d653ac7ea62e9f5f9c4915263a5ca (patch)
tree77bb0898c7bcdc54de7a049611ab6e527b9a444c /app/src/main/res/layout/item_post.xml
parentf90bd4d1cce5f5ca523e4cae395a652a67811615 (diff)
downloadinfinity-for-reddit-d83ded01933d653ac7ea62e9f5f9c4915263a5ca.tar
infinity-for-reddit-d83ded01933d653ac7ea62e9f5f9c4915263a5ca.tar.gz
infinity-for-reddit-d83ded01933d653ac7ea62e9f5f9c4915263a5ca.tar.bz2
infinity-for-reddit-d83ded01933d653ac7ea62e9f5f9c4915263a5ca.tar.lz
infinity-for-reddit-d83ded01933d653ac7ea62e9f5f9c4915263a5ca.tar.xz
infinity-for-reddit-d83ded01933d653ac7ea62e9f5f9c4915263a5ca.tar.zst
infinity-for-reddit-d83ded01933d653ac7ea62e9f5f9c4915263a5ca.zip
Display a thumbtack icon if the post is stickied on top. Display a gold icon and the number of gold if the post is gilded. Load subreddit icons in LoadSubredditIconAsyncTaskListener instead of loading the icons in onPostExecute() of LoadSubredditIconAsyncTask in order to avoid loading icons on a destroyed activity when start the Activity and then press back or up button immediately.
Diffstat (limited to 'app/src/main/res/layout/item_post.xml')
-rw-r--r--app/src/main/res/layout/item_post.xml46
1 files changed, 37 insertions, 9 deletions
diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml
index 5978957c..871125d8 100644
--- a/app/src/main/res/layout/item_post.xml
+++ b/app/src/main/res/layout/item_post.xml
@@ -34,10 +34,20 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
+ android:layout_toStartOf="@id/stickied_post_image_view_best_post_item"
android:layout_toEndOf="@id/subreddit_icon_circle_image_view_best_post_item"
android:layout_centerVertical="true"
android:textColor="#E91E63"/>
+ <ImageView
+ android:id="@+id/stickied_post_image_view_best_post_item"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_toStartOf="@id/post_time_text_view_best_post_item"
+ android:layout_marginStart="8dp"
+ android:layout_marginEnd="8dp"
+ android:tint="@color/colorPrimary"/>
+
<TextView
android:id="@+id/post_time_text_view_best_post_item"
android:layout_width="wrap_content"
@@ -60,20 +70,41 @@
<RelativeLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp">
<TextView
android:id="@+id/type_text_view_item_best_post"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/rounded_corner"
- android:layout_marginTop="8dp"
- android:layout_marginLeft="16dp"
- android:layout_marginStart="16dp"
- android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
+ android:layout_centerVertical="true"
android:textColor="@android:color/white"/>
+ <ImageView
+ android:id="@+id/gilded_image_view_item_best_post"
+ android:layout_width="24dp"
+ android:layout_height="24dp"
+ android:layout_toEndOf="@id/type_text_view_item_best_post"
+ android:layout_centerVertical="true"
+ android:visibility="gone"/>
+
+ <TextView
+ android:id="@+id/gilded_number_text_view_item_best_post"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginEnd="8dp"
+ android:layout_toEndOf="@id/gilded_image_view_item_best_post"
+ android:layout_toStartOf="@id/nsfw_text_view_item_best_post"
+ android:layout_centerVertical="true"
+ android:visibility="gone"
+ android:textSize="20sp"
+ android:textColor="@color/gold"/>
+
<TextView
android:id="@+id/nsfw_text_view_item_best_post"
android:text="@string/nsfw"
@@ -81,11 +112,8 @@
android:layout_height="wrap_content"
android:background="@drawable/nsfw_rounded_corner"
android:layout_alignParentEnd="true"
- android:layout_marginTop="8dp"
- android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
- android:layout_marginRight="16dp"
- android:layout_marginEnd="16dp"
+ android:layout_centerVertical="true"
android:textColor="@android:color/white"
android:visibility="gone"/>