react-native-material-ripple icon indicating copy to clipboard operation
react-native-material-ripple copied to clipboard

Ripple is not working inside function call.

Open Parameshvadivel opened this issue 4 years ago • 1 comments

Here is my code.

      <View style={{ backgroundColor: 'blue', width: '100%', height: 900, top: 0 }}>
            {this.state.ImageViewVisible == false ?
                <View style={{ backgroundColor: 'yellow', top: 50, height: 180 }}>
                    <IconView>
                        <UploadIconSvg style={{ left: 120 }} />
                        <Text style={{ fontSize: 20, color: '#96A9C3', fontFamily: 'avenirBook', lineHeight: 28, textAlign: 'center', top: 10 }}>Upload your custom {'\n'}icon</Text>
                    </IconView>
                    <Ripple onPress={() => this._pickImage()} style={styles.Btn}>
                        <Text style={{ fontSize: 15, color: '#ffff', fontFamily: 'avenirMedium', textAlign: 'center' }}>Upload Icon</Text>
                    </Ripple>
                </View>

                :

                <View style={{ backgroundColor: 'red', top: 50, height: 180 }}>
                    <ImageView>
                        {image && <Img source={{ uri: image }} />}
                        <Ripple onPress={() => this.onRemoveImg()} rippleOpacity={0} style={styles.ImgClose}>
                            <Ionicons name="ios-close-circle" size={30} color="black" />
                        </Ripple>
                    </ImageView>

                    <Ripple onPress={() => console.log('tapped icon')} style={styles.Btn}>
                        <Text style={{ fontSize: 15, color: '#ffff', fontFamily: 'avenirMedium', textAlign: 'center' }}>Set Icon</Text>
                    </Ripple>
                </View>
            }
        </View>

Help much appreciated pls...

Parameshvadivel avatar Dec 19 '20 20:12 Parameshvadivel

You can use function below put onLongPress const onLongPressHandle = () => { if (typeof onLongPress === 'function') { onLongPress(); } else { onPress(); } };

khuongsatou avatar Apr 27 '21 05:04 khuongsatou