Просмотр исходного кода

[RN] Wrap PagedList navigator with SafeAreaView

j8
Bettenbuk Zoltan 6 лет назад
Родитель
Сommit
20c1b1cfae

+ 4
- 4
react/features/base/react/components/native/PagedList.js Просмотреть файл

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React, { Component } from 'react';
3
 import React, { Component } from 'react';
4
-import { Text, TouchableOpacity, View } from 'react-native';
4
+import { SafeAreaView, Text, TouchableOpacity, View } from 'react-native';
5
 import { connect } from 'react-redux';
5
 import { connect } from 'react-redux';
6
 
6
 
7
 import { Icon } from '../../../font-icons';
7
 import { Icon } from '../../../font-icons';
215
                 {
215
                 {
216
                     this._renderPage(pages[pageIndex], disabled)
216
                     this._renderPage(pages[pageIndex], disabled)
217
                 }
217
                 }
218
-                <View style = { styles.pageIndicatorContainer }>
218
+                <SafeAreaView style = { styles.pageIndicatorContainer }>
219
                     {
219
                     {
220
                         pages.map((page, index) => this._renderPageIndicator(
220
                         pages.map((page, index) => this._renderPageIndicator(
221
                             page, index, disabled
221
                             page, index, disabled
222
                         ))
222
                         ))
223
                     }
223
                     }
224
-                </View>
224
+                </SafeAreaView>
225
             </View>
225
             </View>
226
         );
226
         );
227
     }
227
     }
247
                 key = { index }
247
                 key = { index }
248
                 onPress = { this._onSelectPage(index) }
248
                 onPress = { this._onSelectPage(index) }
249
                 style = { styles.pageIndicator } >
249
                 style = { styles.pageIndicator } >
250
-                <View style = { styles.pageIndicator }>
250
+                <View style = { styles.pageIndicatorContent }>
251
                     <Icon
251
                     <Icon
252
                         name = { page.icon }
252
                         name = { page.icon }
253
                         style = { [
253
                         style = { [

+ 9
- 4
react/features/base/react/components/native/styles.js Просмотреть файл

104
      */
104
      */
105
     pageIndicator: {
105
     pageIndicator: {
106
         alignItems: 'center',
106
         alignItems: 'center',
107
-        flex: 1,
108
         flexDirection: 'column',
107
         flexDirection: 'column',
109
-        justifyContent: 'center'
108
+        justifyContent: 'center',
109
+        padding: BoxModel.padding / 2
110
     },
110
     },
111
 
111
 
112
     /**
112
     /**
120
      * Container for the page indicators (Android).
120
      * Container for the page indicators (Android).
121
      */
121
      */
122
     pageIndicatorContainer: {
122
     pageIndicatorContainer: {
123
-        alignItems: 'stretch',
123
+        alignItems: 'center',
124
         backgroundColor: ColorPalette.blue,
124
         backgroundColor: ColorPalette.blue,
125
         flexDirection: 'row',
125
         flexDirection: 'row',
126
-        height: 56,
126
+        justifyContent: 'space-around'
127
+    },
128
+
129
+    pageIndicatorContent: {
130
+        alignItems: 'center',
131
+        flexDirection: 'column',
127
         justifyContent: 'center'
132
         justifyContent: 'center'
128
     },
133
     },
129
 
134
 

Загрузка…
Отмена
Сохранить