Merge "Add the ability to disable the resource cache for a particular lottie illustration." into tm-qpr-dev am: fa013ccc8e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21483804 Change-Id: Iab06ca1a5c7ba349decc843257432c193b586cc0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -55,6 +55,7 @@ public class IllustrationPreference extends Preference {
|
|||||||
|
|
||||||
private int mMaxHeight = SIZE_UNSPECIFIED;
|
private int mMaxHeight = SIZE_UNSPECIFIED;
|
||||||
private int mImageResId;
|
private int mImageResId;
|
||||||
|
private boolean mCacheComposition = true;
|
||||||
private boolean mIsAutoScale;
|
private boolean mIsAutoScale;
|
||||||
private Uri mImageUri;
|
private Uri mImageUri;
|
||||||
private Drawable mImageDrawable;
|
private Drawable mImageDrawable;
|
||||||
@@ -133,6 +134,7 @@ public class IllustrationPreference extends Preference {
|
|||||||
lp.width = screenWidth < screenHeight ? screenWidth : screenHeight;
|
lp.width = screenWidth < screenHeight ? screenWidth : screenHeight;
|
||||||
illustrationFrame.setLayoutParams(lp);
|
illustrationFrame.setLayoutParams(lp);
|
||||||
|
|
||||||
|
illustrationView.setCacheComposition(mCacheComposition);
|
||||||
handleImageWithAnimation(illustrationView);
|
handleImageWithAnimation(illustrationView);
|
||||||
handleImageFrameMaxHeight(backgroundView, illustrationView);
|
handleImageFrameMaxHeight(backgroundView, illustrationView);
|
||||||
|
|
||||||
@@ -427,6 +429,8 @@ public class IllustrationPreference extends Preference {
|
|||||||
TypedArray a = context.obtainStyledAttributes(attrs,
|
TypedArray a = context.obtainStyledAttributes(attrs,
|
||||||
R.styleable.LottieAnimationView, 0 /*defStyleAttr*/, 0 /*defStyleRes*/);
|
R.styleable.LottieAnimationView, 0 /*defStyleAttr*/, 0 /*defStyleRes*/);
|
||||||
mImageResId = a.getResourceId(R.styleable.LottieAnimationView_lottie_rawRes, 0);
|
mImageResId = a.getResourceId(R.styleable.LottieAnimationView_lottie_rawRes, 0);
|
||||||
|
mCacheComposition = a.getBoolean(
|
||||||
|
R.styleable.LottieAnimationView_lottie_cacheComposition, true);
|
||||||
|
|
||||||
a = context.obtainStyledAttributes(attrs,
|
a = context.obtainStyledAttributes(attrs,
|
||||||
R.styleable.IllustrationPreference, 0 /*defStyleAttr*/, 0 /*defStyleRes*/);
|
R.styleable.IllustrationPreference, 0 /*defStyleAttr*/, 0 /*defStyleRes*/);
|
||||||
|
|||||||
Reference in New Issue
Block a user