Skip to content

Commit

Permalink
Add cacheKey to LottieCompositionFactory call
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel Peal committed Aug 28, 2020
1 parent ba6d6ee commit 82b251e
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 82b251e

Please sign in to comment.