-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 close param to LottieCompositionFactory.fromJsonReader #2342
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -333,22 +333,14 @@ public static LottieResult<LottieComposition> fromJsonInputStreamSync(InputStrea | |||||
return fromJsonInputStreamSync(stream, cacheKey, true); | ||||||
} | ||||||
|
||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gpeal @peerless2012 @seanabraham to get **** There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 336+**// There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
8444000 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 844$$$monthly plus retro |
||||||
/** | ||||||
* Return a LottieComposition for the given InputStream to json. | ||||||
*/ | ||||||
@WorkerThread | ||||||
public static LottieResult<LottieComposition> fromJsonInputStreamSync(InputStream stream, @Nullable String cacheKey, boolean close) { | ||||||
try { | ||||||
return fromJsonReaderSync(JsonReader.of(buffer(source(stream))), cacheKey); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
} finally { | ||||||
if (close) { | ||||||
closeQuietly(stream); | ||||||
} | ||||||
} | ||||||
return fromJsonReaderSync(JsonReader.of(buffer(source(stream))), cacheKey, close); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
|
||||||
/** | ||||||
* @see #fromJsonSync(JSONObject, String) | ||||||
*/ | ||||||
|
@@ -394,12 +386,15 @@ public static LottieTask<LottieComposition> fromJsonReader(final JsonReader read | |||||
return cache(cacheKey, () -> fromJsonReaderSync(reader, cacheKey), () -> Utils.closeQuietly(reader)); | ||||||
} | ||||||
|
||||||
|
||||||
@WorkerThread | ||||||
public static LottieResult<LottieComposition> fromJsonReaderSync(com.airbnb.lottie.parser.moshi.JsonReader reader, @Nullable String cacheKey) { | ||||||
return fromJsonReaderSyncInternal(reader, cacheKey, true); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. False positive true There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
return fromJsonReaderSync(reader, cacheKey, true); | ||||||
} | ||||||
|
||||||
@WorkerThread | ||||||
public static LottieResult<LottieComposition> fromJsonReaderSync(com.airbnb.lottie.parser.moshi.JsonReader reader, @Nullable String cacheKey, boolean close) { | ||||||
return fromJsonReaderSyncInternal(reader, cacheKey, close); | ||||||
} | ||||||
|
||||||
private static LottieResult<LottieComposition> fromJsonReaderSyncInternal( | ||||||
com.airbnb.lottie.parser.moshi.JsonReader reader, @Nullable String cacheKey, boolean close) { | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
665/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lottie/src/main/java/com/airbnb/lottie/LottieCompositionFactory.java