summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jeff DeCew <jeffdq@google.com> 2023-02-22 01:06:40 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-02-22 01:06:40 +0000
commitfa013ccc8e96b90baacecace8e14a0512cb1eca5 (patch)
tree97d9d4f73de19298cb6e67c84a7cc2c37728a1e6
parent78cc1a573e21a0a22b6243a12e0d125c8be2f031 (diff)
parent2c9f4857c5de720794a719f805607cafa1d9eb67 (diff)
Merge "Add the ability to disable the resource cache for a particular lottie illustration." into tm-qpr-dev
-rw-r--r--packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java b/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java
index 3b902757c43e..37ae2d45e614 100644
--- a/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java
+++ b/packages/SettingsLib/IllustrationPreference/src/com/android/settingslib/widget/IllustrationPreference.java
@@ -55,6 +55,7 @@ public class IllustrationPreference extends Preference {
private int mMaxHeight = SIZE_UNSPECIFIED;
private int mImageResId;
+ private boolean mCacheComposition = true;
private boolean mIsAutoScale;
private Uri mImageUri;
private Drawable mImageDrawable;
@@ -133,6 +134,7 @@ public class IllustrationPreference extends Preference {
lp.width = screenWidth < screenHeight ? screenWidth : screenHeight;
illustrationFrame.setLayoutParams(lp);
+ illustrationView.setCacheComposition(mCacheComposition);
handleImageWithAnimation(illustrationView);
handleImageFrameMaxHeight(backgroundView, illustrationView);
@@ -427,6 +429,8 @@ public class IllustrationPreference extends Preference {
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.LottieAnimationView, 0 /*defStyleAttr*/, 0 /*defStyleRes*/);
mImageResId = a.getResourceId(R.styleable.LottieAnimationView_lottie_rawRes, 0);
+ mCacheComposition = a.getBoolean(
+ R.styleable.LottieAnimationView_lottie_cacheComposition, true);
a = context.obtainStyledAttributes(attrs,
R.styleable.IllustrationPreference, 0 /*defStyleAttr*/, 0 /*defStyleRes*/);