77 View ,
88 Alert ,
99 TouchableHighlightProps as RNTouchableHighlightProps ,
10- Button ,
1110} from 'react-native' ;
1211
1312import {
@@ -29,6 +28,7 @@ import { PinchableBox } from '../../recipes/scaleAndRotate';
2928import { PressBox } from '../../basic/multitap' ;
3029
3130import { LoremIpsum } from '../../common' ;
31+ import { InfoButton } from './InfoButton' ;
3232
3333const WrappedSlider = createNativeWrapper ( Slider , {
3434 shouldCancelWhenOutside : false ,
@@ -172,14 +172,41 @@ class Combo extends Component<ComboProps> {
172172 < RectButton
173173 style = { styles . rectButton }
174174 onPress = { ( ) => Alert . alert ( 'First row clicked' ) } >
175- < Button title = "first" />
175+ < Text style = { styles . buttonText } >
176+ Swipe this row & observe highlight delay
177+ </ Text >
178+ { /* Info icon will cancel when you scroll in the direction of the scrollview
179+ but if you move finger horizontally it would allow you to "re-enter" into
180+ an active state. This is typical for most of the buttons on iOS (but not
181+ on Android where the touch cancels as soon as you leave the area of the
182+ button). */ }
183+ < InfoButton name = "first" />
176184 </ RectButton >
177185 </ Swipeable >
178186 < View style = { styles . buttonDelimiter } />
179187 < RectButton
180188 style = { styles . rectButton }
181189 onPress = { ( ) => Alert . alert ( 'Second row clicked' ) } >
182- < Button title = "second" />
190+ < Text style = { styles . buttonText } >
191+ Second info icon will block scrolling
192+ </ Text >
193+ { /* Info icon will block interaction with other gesture handlers including
194+ the scrollview handler its a descendant of. This is typical for buttons
195+ embedded in a scrollable content on iOS. */ }
196+ < InfoButton disallowInterruption name = "second" />
197+ </ RectButton >
198+ < View style = { styles . buttonDelimiter } />
199+ < RectButton
200+ style = { styles . rectButton }
201+ onPress = { ( ) => Alert . alert ( 'Third row clicked' ) } >
202+ < Text style = { styles . buttonText } >
203+ This one will cancel when you drag outside
204+ </ Text >
205+ { /* Info icon will cancel when you drag your finger outside of its bounds and
206+ then back unlike all the previous icons that would activate when you re-enter
207+ their activation area. This is a typical bahaviour for android but less frequent
208+ for most of the iOS native apps. */ }
209+ < InfoButton shouldCancelWhenOutside name = "third" />
183210 </ RectButton >
184211 </ View >
185212 < LoremIpsum />
@@ -219,6 +246,10 @@ const styles = StyleSheet.create({
219246 marginRight : 20 ,
220247 backgroundColor : '#999' ,
221248 } ,
249+ buttonText : {
250+ fontWeight : 'bold' ,
251+ backgroundColor : 'transparent' ,
252+ } ,
222253 slider : {
223254 margin : 10 ,
224255 flex : 1 ,
0 commit comments