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

Use removeGlobalOnLayoutListener for API 15+ #12

Closed
mattleibow opened this issue Jul 19, 2017 · 6 comments
Closed

Use removeGlobalOnLayoutListener for API 15+ #12

mattleibow opened this issue Jul 19, 2017 · 6 comments

Comments

@mattleibow
Copy link

Have you considered using removeGlobalOnLayoutListener here:

https://github.com/team-supercharge/ShimmerLayout/blob/master/shimmerlayout/src/main/java/io/supercharge/shimmerlayout/ShimmerLayout.java#L98

This way, you can drop the minimum version of Android required to API 15 (v4.0.3). Although not a major jump, this makes this library available a few more devices.

@mattleibow
Copy link
Author

@WonderCsabo
Copy link
Member

What is the issue with the getColor method?

@mattleibow
Copy link
Author

The return getContext().getColor(id); does not exist on API 14. It does on 15+.

@WonderCsabo
Copy link
Member

Actually Context.getColor() was added in API 23 and as you can see, we only call that above for older versions we fallback on code which is compatible with API 1.

@mattleibow
Copy link
Author

ah, you are right! my mind skipped over the whole if statement :)

@veghtomi veghtomi mentioned this issue Jul 21, 2017
veghtomi added a commit that referenced this issue Jul 25, 2017
@veghtomi
Copy link
Collaborator

Now the minimum API is 14.

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

No branches or pull requests

3 participants