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 ripple effect style of new Android versions #49957
Comments
@dnfield After studying the Android 10 ripple effect animation carefully, I edited the code of It's tested on I hope it will help you at some point. |
@sarsamurmu Would you be able to open a pull request with your changes? I'm happy to help with code review. |
@justinmc I'm kind of confused. Where should I open the PR? Making a new file? Where should I make the new file? |
Fork the repository and clone the fork locally. Create a new branch. Make your changes to ink_splash.dart and commit. Push your commit to your branch. Then Github should prompt you to open a pull request if you visit the page for your fork in your browser. Let me know if that doesn't make sense or if you need any help! |
@justinmc But what about that it needs |
I'm not sure, you might have to give me an example. Are you using something like withOpacity? |
See this - https://youtu.be/LdvmL9NRyOw. You can notice while the ripple is expanding, whole item is being highlighted with grey. In newer Android versions, there is no highlighting, only ripple. So if we want to implement the new ripple effect, we've to set |
Thanks for the video, I see what you mean about the difference now. I'm not sure what to do about highlight color. Is it totally irrelevant now in the new Android 9 animation? It would be a breaking change, but maybe we could think about removing it... |
@justinmc yes. You probably didn't realize, but if you get an Android device and tap anywhere, the effect is so fast and big that it totally replaces the highlightcolor. |
Yes, the highlighting is totally irrelevant in newer Android versions. |
@bernaferrari @justinmc @sarsamurmu I'm interested in spending some time working to move a solution forward here, but I'm not completely clear on what would be the best path forward. Would it be helpful if I opened a PR with @sarsamurmu's changes? Maybe an intermediate fix would exclude the removal of the highlight color, which could be addressed separately? Or I could open a PR with those changes, including the removal of the highlight color? |
I've spent some time going through @sarsamurmu's gist, the current source code, and the commits that landed most of the code in the current source, and I'm not convinced that the gist above represents the most appropriate solution. After coming to understand the current structure of the
It's hard for me to know which direction to head in, without having more clarity on:
So, specifically, I'm wondering if either @Hixie or @HansMuller can provide context here? Specifically, I'm trying to understand the original motivation behind #13986, which introduced the abstraction that I'm now questioning. Looking forward to being corrected/getting more context on any of this—thank y'all! |
The ripple effect is configurable in the Theme, right? |
So yes, you can choose which factory you use for the ripple—I think the issue here is that both the So depending on the original purpose is of having each of these factories (is |
If it's configurable, I'd probably recommend making a new class that does the new style, and having the default theme use that class (with documentation showing how to use the other classes, not to mention making your own, etc). Presumably the highlight color is also configurable, so same deal there. @HansMuller would know if the various classes are supposed to match the new style or if they're different older variants and we need yet another third type of ripple. |
Great—thanks for the quick response/input! I can get started on an implementation and respond to any incoming input/context from @HansMuller 👍 |
Use case
Ripple effects of flutter app is looking kind of old fashioned in new Android versions.
Proposal
As you may know Android 9 introduced new animations, with those new animations we got a new kind of ripple effect animation, if there can be feature in flutter to use the new ripple effects that would look more native on new Android versions.
The text was updated successfully, but these errors were encountered: