-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathandroidRippleExample.tsx
More file actions
38 lines (35 loc) · 837 Bytes
/
androidRippleExample.tsx
File metadata and controls
38 lines (35 loc) · 837 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import React from 'react';
import { Platform, StyleSheet, View } from 'react-native';
import TestingBase from './testingBase';
export function RippleExample() {
const buttonOpacity =
Platform.OS === 'android' ? { opacity: 1 } : { opacity: 0.6 };
return (
<View style={styles.container}>
<TestingBase
style={[styles.pressable, buttonOpacity]}
android_ripple={{
color: 'green',
borderless: false,
foreground: false,
}}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center',
gap: 40,
padding: 20,
},
pressable: {
width: 100,
height: 100,
borderWidth: StyleSheet.hairlineWidth,
backgroundColor: 'mediumpurple',
},
});