From 17ccccfa0e80df0eea1894382cfe85f7e47bcaef Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 1 Oct 2018 13:45:02 +0800 Subject: Add an error view when loading the image fails in ViewImageActivity. --- .../res/drawable/ic_error_outline_white_24dp.xml | 5 +++++ app/src/main/res/layout/activity_view_image.xml | 17 +++++++++++++++++ app/src/main/res/layout/item_post.xml | 20 ++++++++++++-------- 3 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 app/src/main/res/drawable/ic_error_outline_white_24dp.xml (limited to 'app/src/main/res') diff --git a/app/src/main/res/drawable/ic_error_outline_white_24dp.xml b/app/src/main/res/drawable/ic_error_outline_white_24dp.xml new file mode 100644 index 00000000..93db1791 --- /dev/null +++ b/app/src/main/res/drawable/ic_error_outline_white_24dp.xml @@ -0,0 +1,5 @@ + + + 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" /> + + + + + + 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"> @@ -34,11 +33,13 @@ + android:tint="@color/colorPrimary" + android:visibility="gone"/> + android:layout_centerVertical="true" + android:gravity="center_vertical"/> @@ -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"/> + android:background="#F0F0F0"/> \ No newline at end of file -- cgit v1.2.3