Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cacheKey to LottieCompositionFactory call #1617

Merged
merged 1 commit into from
Aug 28, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static LottieTask<LottieComposition> fromRawRes(Context context, @RawRes
*
* Pass null as the cache key to skip caching.
*/
public static LottieTask<LottieComposition> fromRawRes(Context context, @RawRes final int rawRes, @Nullable String cacheKey) {
public static LottieTask<LottieComposition> fromRawRes(Context context, @RawRes final int rawRes, @Nullable final String cacheKey) {
// Prevent accidentally leaking an Activity.
final WeakReference<Context> contextRef = new WeakReference<>(context);
final Context appContext = context.getApplicationContext();
Expand All @@ -216,7 +216,7 @@ public static LottieTask<LottieComposition> fromRawRes(Context context, @RawRes
public LottieResult<LottieComposition> call() {
@Nullable Context originalContext = contextRef.get();
Context context = originalContext != null ? originalContext : appContext;
return fromRawResSync(context, rawRes);
return fromRawResSync(context, rawRes, cacheKey);
}
});
}
Expand Down