Skip to content

Commit 4f400b7

Browse files
HZSamirmastermoo
authored andcommitted
Fix for Platform < 21
1 parent 698b5bf commit 4f400b7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ActionButton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { Component, PropTypes } from 'react';
2-
import { StyleSheet, Text, View, Animated, TouchableOpacity, TouchableNativeFeedback } from 'react-native';
2+
import { StyleSheet, Text, View, Animated, TouchableOpacity, TouchableNativeFeedback, Platform } from 'react-native';
33
import ActionButtonItem from './ActionButtonItem';
44
import { shadowStyle, alignItemsMap, Touchable, isAndroid } from './shared';
55

@@ -107,7 +107,7 @@ export default class ActionButton extends Component {
107107
return (
108108
<View style={{ paddingHorizontal: this.props.offsetX }}>
109109
<Touchable
110-
background={isAndroid && TouchableNativeFeedback.Ripple('rgba(255,255,255,0.75)')}
110+
background={isAndroid && (Platform['Version'] >= 21) ? TouchableNativeFeedback.Ripple('rgba(255,255,255,0.75)') : TouchableNativeFeedback.SelectableBackground()}
111111
activeOpacity={0.85}
112112
onLongPress={this.props.onLongPress}
113113
onPress={() => {

ActionButtonItem.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component, PropTypes } from 'react';
22
import { StyleSheet, Text, View, Animated,
3-
TouchableNativeFeedback, TouchableWithoutFeedback, Dimensions } from 'react-native';
3+
TouchableNativeFeedback, TouchableWithoutFeedback, Dimensions, Platform } from 'react-native';
44
import { shadowStyle, alignItemsMap, Touchable, isAndroid } from './shared';
55

66
const { width: WIDTH } = Dimensions.get('window');
@@ -58,7 +58,7 @@ export default class ActionButtonItem extends Component {
5858
return (
5959
<Animated.View pointerEvents="box-none" style={animatedViewStyle}>
6060
<Touchable
61-
background={isAndroid && TouchableNativeFeedback.Ripple('rgba(255,255,255,0.75)')}
61+
background={isAndroid && (Platform['Version'] >= 21) ? TouchableNativeFeedback.Ripple('rgba(255,255,255,0.75)') : TouchableNativeFeedback.SelectableBackground()}
6262
activeOpacity={this.props.activeOpacity || 0.85}
6363
onPress={this.props.onPress}>
6464
<View
@@ -89,7 +89,7 @@ export default class ActionButtonItem extends Component {
8989

9090
return (
9191
<TextTouchable
92-
background={isAndroid && TouchableNativeFeedback.Ripple(this.props.buttonColor)}
92+
background={isAndroid && (Platform['Version'] >= 21) ? TouchableNativeFeedback.Ripple('rgba(255,255,255,0.75)') : TouchableNativeFeedback.SelectableBackground()}
9393
activeOpacity={this.props.activeOpacity || 0.85}
9494
onPress={this.props.onPress}>
9595
<View style={textStyles}>

0 commit comments

Comments
 (0)