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 close param to LottieCompositionFactory.fromJsonReader #2342

Merged
merged 1 commit into from Jul 25, 2023
Merged

Add close param to LottieCompositionFactory.fromJsonReader #2342

merged 1 commit into from Jul 25, 2023

Conversation

peerless2012
Copy link
Contributor

  • Fix fromJsonInputStreamSync close not work.
  • Add fromJsonReaderSync for close stream.

Add fromJsonReaderSync for close stream.
@peerless2012
Copy link
Contributor Author

This pull request is work for #2252 .

The LottieCompositionFactory.fromZipStreamSyncInternal is fixed on Add close parameters to LottieCompositionFactory.fromZipStream, but the close not work for LottieCompositionFactory.fromJsonInputStreamSync, because the close arg not pass to LottieCompositionFactory.fromJsonReaderSync, and it will close the InputStream, even the close is false.

@github-actions
Copy link

Snapshot Tests
API 23: Report Diff
API 31: Report Diff

@gpeal gpeal changed the title Fix fromJsonInputStreamSync close not work. Add close param to LottieCompositionFactory.fromJsonReader Jul 25, 2023
@gpeal gpeal merged commit 78dd109 into airbnb:master Jul 25, 2023
6 checks passed
@peerless2012 peerless2012 deleted the fix_json_read_sync_close branch July 26, 2023 02:13
Copy link

@Smbfuplayer Smbfuplayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice@

/**
* 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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ###### you want beds in

@@ -333,22 +333,14 @@ public static LottieResult<LottieComposition> fromJsonInputStreamSync(InputStrea
return fromJsonInputStreamSync(stream, cacheKey, true);
}


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

336+**//

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

336+**//

8444000

@@ -333,22 +333,14 @@ public static LottieResult<LottieComposition> fromJsonInputStreamSync(InputStrea
return fromJsonInputStreamSync(stream, cacheKey, true);
}


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

844$$$monthly plus retro

Copy link

@Smbfuplayer Smbfuplayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved tentacy Voucher Awarded Section approved retro Pa844.00 1688.00 monthly PA SsI ssdi approved benefits start today mail out asap

closeQuietly(stream);
}
}
return fromJsonReaderSync(JsonReader.of(buffer(source(stream))), cacheKey, close);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return fromJsonReaderSync(JsonReader.of(buffer(source(stream))), cacheKey, close);
return fromJsonReaderSync(JsonReader.of(buffer(source(stream))), cacheKey, close); you @Smbfuplayer

@WorkerThread
public static LottieResult<LottieComposition> fromJsonReaderSync(com.airbnb.lottie.parser.moshi.JsonReader reader, @Nullable String cacheKey) {
return fromJsonReaderSyncInternal(reader, cacheKey, true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive true

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -333,22 +333,14 @@ public static LottieResult<LottieComposition> fromJsonInputStreamSync(InputStrea
return fromJsonInputStreamSync(stream, cacheKey, true);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

665/

Suggested change
# 442/+-_[]()@Smbfuplayer %
**_🧑‍🦽_**_

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants