From d17408e2c9f15b95c5d5839a1c9bb1aafddc4fd0 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Sat, 11 Jul 2020 22:54:29 +0800 Subject: Use SubsamplingScaleImageView and BigImageView to display images in ViewImageOrGifActivity and CommentAndPostRecyclerViewAdapter to avoid app crashing. Create another ViewModel, PostDetailGifAutoplayViewHolder in CommentAndPostRecyclerViewAdapter. --- .../main/res/layout/activity_view_image_or_gif.xml | 18 +- .../res/layout/item_post_detail_gif_autoplay.xml | 332 +++++++++++++++++++++ app/src/main/res/layout/item_post_detail_image.xml | 330 ++++++++++++++++++++ .../item_post_detail_image_and_gif_autoplay.xml | 327 -------------------- app/src/main/res/layout/item_post_detail_link.xml | 6 +- .../item_post_detail_video_and_gif_preview.xml | 6 +- .../res/layout/item_post_detail_video_autoplay.xml | 6 +- 7 files changed, 680 insertions(+), 345 deletions(-) create mode 100644 app/src/main/res/layout/item_post_detail_gif_autoplay.xml create mode 100644 app/src/main/res/layout/item_post_detail_image.xml delete mode 100644 app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml (limited to 'app/src/main/res') diff --git a/app/src/main/res/layout/activity_view_image_or_gif.xml b/app/src/main/res/layout/activity_view_image_or_gif.xml index 019bbc7b..0156de76 100644 --- a/app/src/main/res/layout/activity_view_image_or_gif.xml +++ b/app/src/main/res/layout/activity_view_image_or_gif.xml @@ -23,19 +23,13 @@ android:layout_height="wrap_content" android:layout_centerInParent="true" /> - - - - + android:layout_height="match_parent" + app:initScaleType="fitCenter" + app:optimizeDisplay="true" + app:tapToRetry="false" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_post_detail_image.xml b/app/src/main/res/layout/item_post_detail_image.xml new file mode 100644 index 00000000..b31ee7b4 --- /dev/null +++ b/app/src/main/res/layout/item_post_detail_image.xml @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml b/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml deleted file mode 100644 index f4f88d5a..00000000 --- a/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_post_detail_link.xml b/app/src/main/res/layout/item_post_detail_link.xml index c9e7bd2c..ba51e6a5 100644 --- a/app/src/main/res/layout/item_post_detail_link.xml +++ b/app/src/main/res/layout/item_post_detail_link.xml @@ -210,12 +210,14 @@ android:layout_width="match_parent" android:layout_height="wrap_content"> - + android:scaleType="fitStart" + app:zoomEnabled="false" + app:panEnabled="false" /> - + android:scaleType="fitStart" + app:zoomEnabled="false" + app:panEnabled="false" /> - + android:visibility="gone" + app:zoomEnabled="false" + app:panEnabled="false" /> -- cgit v1.2.3