From a87a7009b0e1d0bc8ae04a780fd013eba5a54d1c Mon Sep 17 00:00:00 2001 From: Peter_Liang Date: Thu, 7 May 2020 15:31:22 +0800 Subject: [PATCH] Refines the animated image to fit the screen display. Root cause: The width and height of animated image are wrap_content. It causes the gif or drawable which are non-transparent background to have a little weird display under dark mode. Next: 1. Revise the width from wrap_content to match_parent, and add the fit center scale type. 2. Correct the function usage Bug: 155946967 Test: manual test Change-Id: I7470efb945a2b3bedb695e1b6f34475c6f190f9d --- res/layout/preference_animated_image.xml | 3 ++- .../settings/accessibility/AnimatedImagePreference.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/res/layout/preference_animated_image.xml b/res/layout/preference_animated_image.xml index 305b03630e1..e7d9b52518a 100644 --- a/res/layout/preference_animated_image.xml +++ b/res/layout/preference_animated_image.xml @@ -24,9 +24,10 @@ diff --git a/src/com/android/settings/accessibility/AnimatedImagePreference.java b/src/com/android/settings/accessibility/AnimatedImagePreference.java index 61e439f6ca5..2ca13f33fe2 100644 --- a/src/com/android/settings/accessibility/AnimatedImagePreference.java +++ b/src/com/android/settings/accessibility/AnimatedImagePreference.java @@ -60,7 +60,7 @@ public class AnimatedImagePreference extends Preference { } if (mMaxHeight > -1) { - imageView.setMaxWidth(mMaxHeight); + imageView.setMaxHeight(mMaxHeight); } }