Merge "Add the getter APIs to fetch the drawable / resId easily" into sc-v2-dev am: c3e670559a

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15401460

Change-Id: I7c7d996ade37a36585e79371fd6e8422a335abf9
This commit is contained in:
Jason Hsu
2021-08-02 06:30:11 +00:00
committed by Automerger Merge Worker

View File

@@ -170,7 +170,14 @@ public class IllustrationPreference extends Preference {
} }
/** /**
* Sets image drawable to display image in {@link LottieAnimationView} * Gets the lottie illustration resource id.
*/
public int getLottieAnimationResId() {
return mImageResId;
}
/**
* Sets the image drawable to display image in {@link LottieAnimationView}.
* *
* @param imageDrawable the drawable of an image * @param imageDrawable the drawable of an image
*/ */
@@ -183,7 +190,16 @@ public class IllustrationPreference extends Preference {
} }
/** /**
* Sets image uri to display image in {@link LottieAnimationView} * Gets the image drawable from display image in {@link LottieAnimationView}.
*
* @return the drawable of an image
*/
public Drawable getImageDrawable() {
return mImageDrawable;
}
/**
* Sets the image uri to display image in {@link LottieAnimationView}.
* *
* @param imageUri the Uri of an image * @param imageUri the Uri of an image
*/ */
@@ -195,6 +211,15 @@ public class IllustrationPreference extends Preference {
} }
} }
/**
* Gets the image uri from display image in {@link LottieAnimationView}.
*
* @return the Uri of an image
*/
public Uri getImageUri() {
return mImageUri;
}
private void resetImageResourceCache() { private void resetImageResourceCache() {
mImageDrawable = null; mImageDrawable = null;
mImageUri = null; mImageUri = null;