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

Make LottieAnimationView reusable #7

Merged
merged 1 commit into from
Nov 8, 2016

Conversation

ngsilverman
Copy link
Collaborator

@ngsilverman ngsilverman commented Nov 7, 2016

Also added Cycle to the sample app that cycles through all the available animation using the same LottieAnimationView.

try {
adapter.setFiles(getContext().getAssets().list(""));
adapter.setFiles(AssetUtils.getJsonAssets(getContext(), ""));
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Directories were appearing in the list and caused a crash when tapped, so this filters out any non-json assets.

@ngsilverman ngsilverman force-pushed the nsilverman-reusable-lottieanimationview branch 2 times, most recently from 971eb1b to 2b5468b Compare November 7, 2016 18:37
@@ -163,34 +167,54 @@ protected void onDetachedFromWindow() {
public void recycleBitmaps() {
if (mainBitmap != null) {
mainBitmap.recycle();
mainBitmap = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ah, thank you

@@ -260,16 +293,30 @@ private void setJsonSync(JSONObject json) {
setComposition(composition);
}

private void onAnimationLoadingFail() {
isAnimationLoading = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe set playAnimationWhenCompositionSet to false?

Copy link
Collaborator Author

@ngsilverman ngsilverman Nov 7, 2016

Choose a reason for hiding this comment

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

Good point. Done.

@ngsilverman ngsilverman force-pushed the nsilverman-reusable-lottieanimationview branch from 2b5468b to 0eca9b5 Compare November 7, 2016 19:04
@ngsilverman ngsilverman merged commit f26c1eb into master Nov 8, 2016
@ngsilverman ngsilverman deleted the nsilverman-reusable-lottieanimationview branch November 8, 2016 00:03
This was referenced Dec 19, 2018
@wlj190785060 wlj190785060 mentioned this pull request Nov 22, 2021
Copy link

@Edward601 Edward601 left a comment

Choose a reason for hiding this comment

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

I won't to string everything back to real data

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.

3 participants