6
6
View ,
7
7
TextField ,
8
8
Image ,
9
+ Button ,
9
10
Colors ,
10
11
Switch ,
11
12
Constants ,
@@ -23,7 +24,8 @@ const URIs = [
23
24
'https://static.pexels.com/photos/60628/flower-garden-blue-sky-hokkaido-japan-60628.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260'
24
25
} ,
25
26
{
26
- uri : 'https://images.pexels.com/photos/140234/pexels-photo-140234.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260'
27
+ uri :
28
+ 'https://images.pexels.com/photos/140234/pexels-photo-140234.jpeg?auto=compress&cs=tinysrgb&dpr=3&h=750&w=1260'
27
29
}
28
30
] ;
29
31
@@ -42,25 +44,49 @@ export default class KeyboardTrackingViewScreen extends PureComponent {
42
44
const { trackInteractive} = this . state ;
43
45
44
46
return (
45
- < View flex bg-dark80 >
47
+ < View flex bg-dark80 paddingT-page >
46
48
< ScrollView
47
49
contentContainerStyle = { styles . scrollContainer }
48
50
keyboardDismissMode = { trackInteractive ? 'interactive' : 'none' }
49
51
>
50
- < Text text40 dark10 marginV-20 >
52
+ < Text h1 dark10 marginB-s1 >
51
53
Keyboard Tracking View
52
54
</ Text >
53
- < View row marginV-20 centerV >
54
- < Text text60 > Track interactive:</ Text >
55
- < Switch value = { trackInteractive } onValueChange = { this . toggleTrackInteractive } marginL-10 />
55
+ < Text marginB-s4 grey10 >
56
+ Attach a custom view to that will track the keyboard position
57
+ </ Text >
58
+ < View row marginV-20 centerV spread >
59
+ < Text text70 > Dismiss Keyboard with Drag</ Text >
60
+ < Switch
61
+ value = { trackInteractive }
62
+ onValueChange = { this . toggleTrackInteractive }
63
+ marginL-10
64
+ />
56
65
</ View >
57
66
{ URIs . map ( ( uri , index ) => (
58
- < Image style = { styles . image } source = { uri } key = { index } />
67
+ < Image style = { styles . image } source = { uri } key = { index } />
59
68
) ) }
60
69
</ ScrollView >
61
- < KeyboardTrackingView style = { styles . trackingToolbarContainer } trackInteractive = { trackInteractive } >
62
- < View centerV bg-white paddingH-s5 paddingV-s2 >
63
- < TextField text70 placeholder = { 'Message' } floatingPlaceholder floatOnFocus />
70
+ < KeyboardTrackingView
71
+ style = { styles . trackingToolbarContainer }
72
+ trackInteractive = { trackInteractive }
73
+ >
74
+ < View bg-white row spread centerV paddingH-s5 paddingV-s3 >
75
+ < TextField
76
+ containerStyle = { {
77
+ flex : 1 ,
78
+ backgroundColor : Colors . grey60 ,
79
+ paddingVertical : Spacings . s2 ,
80
+ paddingHorizontal : Spacings . s4 ,
81
+ borderRadius : 8
82
+ } }
83
+ hideUnderline
84
+ placeholder = { 'Message' }
85
+ floatingPlaceholder = { false }
86
+ floatOnFocus
87
+ enableErrors = { false }
88
+ />
89
+ < Button label = "Send" link marginL-s4 />
64
90
</ View >
65
91
</ KeyboardTrackingView >
66
92
</ View >
0 commit comments