diff options
author | Alex Ning <chineseperson5@gmail.com> | 2018-08-24 02:38:37 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2018-08-24 02:38:37 +0000 |
commit | d83ded01933d653ac7ea62e9f5f9c4915263a5ca (patch) | |
tree | 77bb0898c7bcdc54de7a049611ab6e527b9a444c /app/src/main/res/layout | |
parent | f90bd4d1cce5f5ca523e4cae395a652a67811615 (diff) | |
download | infinity-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')
-rw-r--r-- | app/src/main/res/layout/activity_view_post_detail.xml | 21 | ||||
-rw-r--r-- | app/src/main/res/layout/item_post.xml | 46 |
2 files changed, 58 insertions, 9 deletions
diff --git a/app/src/main/res/layout/activity_view_post_detail.xml b/app/src/main/res/layout/activity_view_post_detail.xml index d3b0b3ce..64a648c2 100644 --- a/app/src/main/res/layout/activity_view_post_detail.xml +++ b/app/src/main/res/layout/activity_view_post_detail.xml @@ -103,6 +103,27 @@ android:background="@drawable/rounded_corner" android:textColor="@android:color/white" /> + <ImageView + android:id="@+id/gilded_image_view_view_post_detail" + android:layout_width="24dp" + android:layout_height="24dp" + android:layout_toEndOf="@id/type_text_view_view_post_detail" + android:layout_centerVertical="true" + android:visibility="gone"/> + + <TextView + android:id="@+id/gilded_number_text_view_view_post_detail" + 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_view_post_detail" + android:layout_toStartOf="@id/nsfw_text_view_view_post_detail" + android:layout_centerVertical="true" + android:visibility="gone" + android:textSize="20sp" + android:textColor="@color/gold"/> + <TextView android:id="@+id/nsfw_text_view_view_post_detail" android:layout_width="wrap_content" 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"/> |