Skip to content

Allow Animations, onPressIn/Out, and Global Button Styles #4

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

zolrath
Copy link

@zolrath zolrath commented Nov 17, 2016

Hi!
I recently used this component in a project of mine and had to make a few changes to suit my applications requirements.

  • I have added Animated to both the final buttons View or the LinearGradient, depending on button type as I needed to shrink the buttons size on press.
  • In order to have the press properly respond to my tap I exposed onPressIn and onPressOut to allow more control of the interaction.
  • I included the this.props.buttonStyle before the currentButtonState.buttonStyle to allow a base style with state specific overrides.
  • Similarly, onPress, onPressIn and onPressOut can optionally be supplied as a prop, allowing a default function to be set and be overridden by currentButtonState.

Thanks for this component, the bit of animation in it really helps bring it to life!

@jacklam718
Copy link
Owner

@zolrath
I'm working now, I'll take a look and try it out in later.
Thank You For Your PR!

@jacklam718
Copy link
Owner

jacklam718 commented Jan 1, 2017

Hi @zolrath if you can add some examples on the example app that would be perfect. That can demonstrate how to use.

Or can you post some example code here? Thanks a lot!

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.

2 participants