Code Monkey home page Code Monkey logo

Comments (6)

avishayil avatar avishayil commented on July 20, 2024

+1 on this.

from react-native-material-design.

Ehesp avatar Ehesp commented on July 20, 2024

Hey, so the Ripple uses TouchableNativeFeedback if your device supports it, but then defaults to a custom implementation if it doesn't.

On the button it's implemented here: https://github.com/react-native-material-design/react-native-material-design/blob/master/lib/Button.js#L216

Need to figure out how to deal with it, if it's even possible with RNs solution.

from react-native-material-design.

Ehesp avatar Ehesp commented on July 20, 2024

@dazziola @avishayil Just had a play around with this, and it should be possible, however I'm getting a React Native issue which is blocking it. But my plan is to do this:

  1. Add delayPressIn to the touch to 1. This instantly fires the Ripple.
  2. Add delayPressOut to the touch with a 300ms delay (or whatever it is in Android).
  3. Move the onPress handler into the onPressOut function.

Problem I've having is that delayPressOut doesn't actually seem to work... see issue facebook/react-native#5337

from react-native-material-design.

Ehesp avatar Ehesp commented on July 20, 2024

This is now waiting on facebook/react-native#5376 and whenever it's in a release.

from react-native-material-design.

efkan avatar efkan commented on July 20, 2024

I've tried to improve the Polyfill Ripple animation here #46 for old Android versions.

On the other hand, -if I'm not mistaken- the above issue appears as released here. But it's not look good on my emulator.

Has anybody tested out it on Android 6.0?

from react-native-material-design.

akash-cp avatar akash-cp commented on July 20, 2024

I have tested on android 6 and its very slow.
My code:


<TouchableNativeFeedback
                     delayPressIn={1}
                     background={TouchableNativeFeedback.Ripple('#777')}
                       onPress={() => this._navigateTo(item.route)}>
</TouchableNativeFeedback>

from react-native-material-design.

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.