-
Notifications
You must be signed in to change notification settings - Fork 168
Button android ripple #2103
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
Merged
Merged
Button android ripple #2103
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rurikoaraki
reviewed
Sep 9, 2022
rurikoaraki
reviewed
Sep 9, 2022
Saadnajmi
reviewed
Sep 14, 2022
Saadnajmi
reviewed
Sep 14, 2022
rurikoaraki
reviewed
Sep 15, 2022
rurikoaraki
reviewed
Sep 15, 2022
rurikoaraki
reviewed
Sep 15, 2022
rurikoaraki
reviewed
Sep 15, 2022
rurikoaraki
reviewed
Sep 15, 2022
rurikoaraki
reviewed
Sep 15, 2022
This reverts commit 6842dbe.
289f4c6 to
62b0f3d
Compare
0755069 to
fe92c4b
Compare
…luentui-react-native into button-android-ripple
Saadnajmi
reviewed
Oct 21, 2022
Saadnajmi
reviewed
Oct 21, 2022
Saadnajmi
reviewed
Oct 21, 2022
Saadnajmi
reviewed
Oct 21, 2022
Saadnajmi
reviewed
Oct 21, 2022
Saadnajmi
reviewed
Oct 21, 2022
Saadnajmi
reviewed
Oct 24, 2022
Saadnajmi
approved these changes
Oct 26, 2022
10 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Platforms Impacted
Description of changes
Added ripple effect for button on Android -
Ripple effect is taken care by React Native's Pressable component. Using it however caused Fluent RN's Fork of Pressable to not be hit anymore, this caused the state of button ('pressed', 'hovered', 'focused') to not change anymore and the associated styles were not being applied.
Changes made -
Added a 'Ripple' Pressable layer that provides the animation
(Did not replace the 'Root' view since Pressable needed to be wrapped with a View to handle curved borders)
Split styles and props as required between Root and Pressable Layer
Added a function to separate out margins from style to be applied onto the wrapper view
Added a hook ripplePressed to trigger styling change onPress
Resolutions tried -
Tried to apply "useAsButton" props directly on the Pressable component / call functions associated with state directly, had no effect.
Tried to change the state of button explicitly by calling the setPressed function defined in useAsPressable in the onPress of the new Pressable layer. But it did not cause the Button to re-render even after changing the state value.
Attempted to add the ripple animation using the Animated library provided by RN, but abandoned the approach due to excessive complexity
Verification
(how the change was tested, including both manual and automated tests)
Pull request checklist
This PR has considered (when applicable):