File tree 5 files changed +80
-1
lines changed
5 files changed +80
-1
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,13 @@ Reference: https://github.com/brentvatne/react-native-scrollable-tab-view
160
160
161
161
![ day24] ( https://raw.githubusercontent.com/fangwei716/ThirtyDaysOfReactNative/master/screenshot/day24.gif )
162
162
163
+ ## Day 25
164
+ Custome in-app browser
165
+
166
+ Reference: https://github.com/d-a-n/react-native-webbrowser
167
+
168
+ ![ day25] ( https://raw.githubusercontent.com/fangwei716/ThirtyDaysOfReactNative/master/screenshot/day25.gif )
169
+
163
170
## License
164
171
165
172
ThirtyDaysOfReactNative is under the MIT license.
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ import Day21 from './view/day21';
33
33
import Day22 from './view/day22' ;
34
34
import Day23 from './view/day23' ;
35
35
import Day24 from './view/day24' ;
36
+ import Day25 from './view/day25' ;
36
37
37
38
class MainView extends Component {
38
39
constructor ( ) {
@@ -254,6 +255,15 @@ class MainView extends Component {
254
255
size :50 ,
255
256
color :"#e32524" ,
256
257
hideNav : true ,
258
+ } , {
259
+ key :24 ,
260
+ title :"custome in-app browser" ,
261
+ component : Day25 ,
262
+ isFA : false ,
263
+ icon : "ios-world" ,
264
+ size :50 ,
265
+ color :"#00ab6b" ,
266
+ hideNav : true ,
257
267
} ]
258
268
}
259
269
}
@@ -318,7 +328,7 @@ class ThirtyDaysOfReactNative extends Component{
318
328
title :"30 Days of RN" ,
319
329
// title:"Time Picker",
320
330
component : MainView ,
321
- // component: Day24 ,
331
+ // component: Day25 ,
322
332
// titleTextColor:"#ff6b6b",
323
333
backButtonTitle : 'back' ,
324
334
shadowHidden : true ,
Original file line number Diff line number Diff line change 22
22
"react-native-touch-id" : " ^1.2.4" ,
23
23
"react-native-vector-icons" : " ^1.3.2" ,
24
24
"react-native-video" : " ^0.7.1" ,
25
+ "react-native-webbrowser" : " 0.0.6" ,
25
26
"react-timer-mixin" : " ^0.13.3"
26
27
}
27
28
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Day 25
3
+ * custom refresh control
4
+ */
5
+ 'use strict' ;
6
+
7
+ import React , {
8
+ Component ,
9
+ Image ,
10
+ StyleSheet ,
11
+ Text ,
12
+ TouchableHighlight ,
13
+ ActionSheetIOS ,
14
+ View
15
+ } from 'react-native' ;
16
+ import Util from './utils' ;
17
+ import Webbrowser from 'react-native-webbrowser' ;
18
+ import Icon from 'react-native-vector-icons/Ionicons' ;
19
+
20
+ export default class extends Component {
21
+ _showShareActionSheet ( ) {
22
+ console . log ( this . refs . browser . state . status ) ;
23
+ ActionSheetIOS . showShareActionSheetWithOptions ( {
24
+ url : this . refs . browser . state . currentUrl ,
25
+ message : this . refs . browser . state . status ,
26
+ } ,
27
+ ( error ) => console . log ( error ) ,
28
+ ( success , method ) => {
29
+ } ) ;
30
+ }
31
+
32
+ render ( ) {
33
+ return (
34
+ < View style = { { paddingTop :20 , flex :1 , backgroundColor :"#00ab6b" } } >
35
+ < Webbrowser
36
+ ref = "browser"
37
+ url = "https://github.com"
38
+ hideHomeButton = { true }
39
+ hideToolbar = { false }
40
+ hideAddressBar = { false }
41
+ hideStatusBar = { true }
42
+ hideActivityIndicator = { true }
43
+ foregroundColor = { '#555' }
44
+ backgroundColor = { '#00ab6b' }
45
+ />
46
+ < TouchableHighlight underlayColor = "transparent" onPress = { ( ) => this . _showShareActionSheet ( ) } >
47
+ < Icon name = "ios-upload-outline" style = { styles . shareIcon } color = "#268260" size = { 30 } />
48
+ </ TouchableHighlight >
49
+ </ View >
50
+ ) ;
51
+ }
52
+ }
53
+
54
+ const styles = StyleSheet . create ( {
55
+ shareIcon :{
56
+ position :"absolute" ,
57
+ bottom :0 ,
58
+ left : 170 ,
59
+ }
60
+ } ) ;
61
+
You can’t perform that action at this time.
0 commit comments