diff options
author | Alex Ning <chineseperson5@gmail.com> | 2018-10-01 05:45:02 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2018-10-01 05:45:02 +0000 |
commit | 17ccccfa0e80df0eea1894382cfe85f7e47bcaef (patch) | |
tree | 6fff8dae78aab1d490dc51f5fa66273a0c3a2c61 /app/src/main/res/layout | |
parent | 1bd9ba61c6cccd1fc318f1698fddc0d13e4723cf (diff) | |
download | infinity-for-reddit-17ccccfa0e80df0eea1894382cfe85f7e47bcaef.tar infinity-for-reddit-17ccccfa0e80df0eea1894382cfe85f7e47bcaef.tar.gz infinity-for-reddit-17ccccfa0e80df0eea1894382cfe85f7e47bcaef.tar.bz2 infinity-for-reddit-17ccccfa0e80df0eea1894382cfe85f7e47bcaef.tar.lz infinity-for-reddit-17ccccfa0e80df0eea1894382cfe85f7e47bcaef.tar.xz infinity-for-reddit-17ccccfa0e80df0eea1894382cfe85f7e47bcaef.tar.zst infinity-for-reddit-17ccccfa0e80df0eea1894382cfe85f7e47bcaef.zip |
Add an error view when loading the image fails in ViewImageActivity.
Diffstat (limited to 'app/src/main/res/layout')
-rw-r--r-- | app/src/main/res/layout/activity_view_image.xml | 17 | ||||
-rw-r--r-- | app/src/main/res/layout/item_post.xml | 20 |
2 files changed, 29 insertions, 8 deletions
diff --git a/app/src/main/res/layout/activity_view_image.xml b/app/src/main/res/layout/activity_view_image.xml index 066557bd..3ffcb7ff 100644 --- a/app/src/main/res/layout/activity_view_image.xml +++ b/app/src/main/res/layout/activity_view_image.xml @@ -20,4 +20,21 @@ android:layout_height="match_parent" app:gest_fillViewport="true" /> + <LinearLayout + android:id="@+id/load_image_error_linear_layout_view_image_activity" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:visibility="gone"> + + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:drawableTop="@drawable/ic_error_outline_white_24dp" + android:layout_gravity="center" + android:gravity="center" + android:textColor="@android:color/white" + android:text="@string/tap_to_retry" /> + + </LinearLayout> + </RelativeLayout> diff --git a/app/src/main/res/layout/item_post.xml b/app/src/main/res/layout/item_post.xml index c34ee582..2813669a 100644 --- a/app/src/main/res/layout/item_post.xml +++ b/app/src/main/res/layout/item_post.xml @@ -11,6 +11,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" + android:background="#FFFFFF" android:id="@+id/linear_layout_view_post_detail"> <RelativeLayout @@ -18,9 +19,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="8dp" - android:layout_marginLeft="16dp" android:layout_marginStart="16dp" - android:layout_marginRight="16dp" android:layout_marginEnd="16dp" android:layout_marginTop="16dp"> @@ -34,11 +33,13 @@ <TextView android:id="@+id/subreddit_text_view_best_post_item" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_marginStart="16dp" + android:layout_marginEnd="8dp" 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:gravity="center_vertical" android:textColor="#E91E63"/> <ImageView @@ -48,14 +49,16 @@ android:layout_toStartOf="@id/post_time_text_view_best_post_item" android:layout_marginStart="8dp" android:layout_marginEnd="8dp" - android:tint="@color/colorPrimary"/> + android:tint="@color/colorPrimary" + android:visibility="gone"/> <TextView android:id="@+id/post_time_text_view_best_post_item" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:layout_alignParentEnd="true" - android:layout_centerVertical="true"/> + android:layout_centerVertical="true" + android:gravity="center_vertical"/> </RelativeLayout> @@ -82,7 +85,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/rounded_corner" - android:layout_marginEnd="16dp" + android:layout_marginEnd="8dp" android:layout_centerVertical="true" android:textColor="@android:color/white"/> @@ -92,6 +95,7 @@ android:layout_height="24dp" android:layout_toEndOf="@id/type_text_view_item_best_post" android:layout_centerVertical="true" + android:layout_marginStart="8dp" android:visibility="gone"/> <TextView @@ -224,6 +228,6 @@ <View android:layout_width="match_parent" android:layout_height="1dp" - android:background="#E0E0E0"/> + android:background="#F0F0F0"/> </LinearLayout>
\ No newline at end of file |