Git Product home page Git Product logo

Comments (7)

Cordazar avatar Cordazar commented on May 31, 2024

I tried to implement this but ran into a bug when trying to apply an animated value to the offsetShadow height property.
facebook/react-native#3911

So until that issue is resolved there is no way of adding proper material design animations.

from react-native-action-button.

EQuimper avatar EQuimper commented on May 31, 2024

+1

from react-native-action-button.

iSimonWeb avatar iSimonWeb commented on May 31, 2024

I need this feature too and I think it can be resolved by adding a _renderButton property on ActionButton, so we can use our customized TouchableNativeFeedback.

from react-native-action-button.

mastermoo avatar mastermoo commented on May 31, 2024

@iSimonWeb how would your renderButton function look like?

from react-native-action-button.

iSimonWeb avatar iSimonWeb commented on May 31, 2024

I think it could be a function of (props) and it should return a React Component.
This could break a lot of your component functionalities set by props, but you can provide an ActionButton.Default (or whatchamacallit) that will rely on the current configuration.

So then, if I don't need a custom button, I can continue to use legacy configuration via props:
<ActionButton size={64} offsetX={20} offsetY={20} buttonColor="#F00" />
either way I can pass my own button that will update based on props:
<ActionButton size={64} offsetX={20} offsetY={20} renderButton={(props) => <MyActionButton {...props} />} />

We can discuss on positioning. As embedded in my example, position can still be controlled by the ActionButton component wrapping the button in a <View /> and giving to it the current button positioning styles.

from react-native-action-button.

mastermoo avatar mastermoo commented on May 31, 2024

Sorry, I probably wasn't clear with my question. I'm more interested in your MyActionButton component. How exactly would the implementation of your custom component look like? Maybe we can give the ripple effect to everyone without them having to make use of a custom render method.

from react-native-action-button.

iSimonWeb avatar iSimonWeb commented on May 31, 2024

Well then I suppose you can just add a useNativeFeedback prop to switch TouchableOpacity/TouchableNativeFeedback inside ActionButton._renderButton().
TouchableNativeFeedback additional props are background and useForeground, it would be useful to have them configurable too.

Anyway, I'm also trying to shrink the main button size while the sub-items are visible, having a fully customizable renderButton would perfectly fit for anyone who needs complete control over styles.

from react-native-action-button.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.