Browse Source

feat: add bottom gradient

master
Bettenbuk Zoltan 6 years ago
parent
commit
a25a504a59

+ 24
- 3
react/features/conference/components/native/Conference.js View File

2
 
2
 
3
 import React from 'react';
3
 import React from 'react';
4
 import { NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
4
 import { NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
5
+import LinearGradient from 'react-native-linear-gradient';
5
 
6
 
6
 import { appNavigate } from '../../../app';
7
 import { appNavigate } from '../../../app';
7
 import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
8
 import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
34
 } from '../AbstractConference';
35
 } from '../AbstractConference';
35
 import Labels from './Labels';
36
 import Labels from './Labels';
36
 import NavigationBar from './NavigationBar';
37
 import NavigationBar from './NavigationBar';
37
-import styles from './styles';
38
+import styles, { NAVBAR_GRADIENT_COLORS } from './styles';
38
 
39
 
39
 import type { AbstractProps } from '../AbstractConference';
40
 import type { AbstractProps } from '../AbstractConference';
40
 
41
 
199
     render() {
200
     render() {
200
         const {
201
         const {
201
             _connecting,
202
             _connecting,
203
+            _filmstripVisible,
202
             _largeVideoParticipantId,
204
             _largeVideoParticipantId,
203
             _reducedUI,
205
             _reducedUI,
204
-            _shouldDisplayTileView
206
+            _shouldDisplayTileView,
207
+            _toolboxVisible
205
         } = this.props;
208
         } = this.props;
209
+        const showGradient = _toolboxVisible;
210
+        const applyGradientStretching = _filmstripVisible && isNarrowAspectRatio(this) && !_shouldDisplayTileView;
206
 
211
 
207
         return (
212
         return (
208
             <Container style = { styles.conference }>
213
             <Container style = { styles.conference }>
242
                     pointerEvents = 'box-none'
247
                     pointerEvents = 'box-none'
243
                     style = { styles.toolboxAndFilmstripContainer }>
248
                     style = { styles.toolboxAndFilmstripContainer }>
244
 
249
 
250
+                    { showGradient && <LinearGradient
251
+                        colors = { NAVBAR_GRADIENT_COLORS }
252
+                        end = {{
253
+                            x: 0.0,
254
+                            y: 0.0
255
+                        }}
256
+                        pointerEvents = 'none'
257
+                        start = {{
258
+                            x: 0.0,
259
+                            y: applyGradientStretching ? 0.5 : 1.0
260
+                        }}
261
+                        style = { [
262
+                            styles.bottomGradient,
263
+                            applyGradientStretching ? styles.gradientStretchBottom : undefined
264
+                        ] } />}
265
+
245
                     <Labels />
266
                     <Labels />
246
 
267
 
247
                     <Captions onPress = { this._onClick } />
268
                     <Captions onPress = { this._onClick } />
249
                     { _shouldDisplayTileView || <DisplayNameLabel participantId = { _largeVideoParticipantId } /> }
270
                     { _shouldDisplayTileView || <DisplayNameLabel participantId = { _largeVideoParticipantId } /> }
250
 
271
 
251
                     {/*
272
                     {/*
252
-                      * The Toolbox is in a stacking layer bellow the Filmstrip.
273
+                      * The Toolbox is in a stacking layer below the Filmstrip.
253
                       */}
274
                       */}
254
                     <Toolbox />
275
                     <Toolbox />
255
 
276
 

+ 25
- 11
react/features/conference/components/native/styles.js View File

1
-import {
2
-    BoxModel,
3
-    ColorPalette,
4
-    createStyleSheet,
5
-    fixAndroidViewClipping
6
-} from '../../../base/styles';
1
+import { BoxModel, ColorPalette, fixAndroidViewClipping } from '../../../base/styles';
7
 
2
 
8
 import { FILMSTRIP_SIZE } from '../../../filmstrip';
3
 import { FILMSTRIP_SIZE } from '../../../filmstrip';
9
 
4
 
10
-export const NAVBAR_GRADIENT_COLORS = [ 'black', '#00000000' ];
5
+export const NAVBAR_GRADIENT_COLORS = [ '#0000007F', '#00000000' ];
6
+
7
+// From brand guideline
8
+const GRADIENT_HEIGHT = 116;
11
 
9
 
12
 /**
10
 /**
13
  * The styles of the feature conference.
11
  * The styles of the feature conference.
14
  */
12
  */
15
-export default createStyleSheet({
13
+export default {
14
+
15
+    bottomGradient: {
16
+        bottom: 0,
17
+        flexDirection: 'column',
18
+        justifyContent: 'flex-end',
19
+        minHeight: GRADIENT_HEIGHT,
20
+        left: 0,
21
+        position: 'absolute',
22
+        right: 0
23
+    },
24
+
16
     /**
25
     /**
17
      * {@code Conference} style.
26
      * {@code Conference} style.
18
      */
27
      */
30
         flex: 1
39
         flex: 1
31
     },
40
     },
32
 
41
 
42
+    gradientStretchBottom: {
43
+        height: GRADIENT_HEIGHT + FILMSTRIP_SIZE
44
+    },
45
+
33
     gradientStretch: {
46
     gradientStretch: {
34
-        height: 116
47
+        height: GRADIENT_HEIGHT
35
     },
48
     },
36
 
49
 
37
     /**
50
     /**
112
      * the {@link Toolbox}.
125
      * the {@link Toolbox}.
113
      */
126
      */
114
     toolboxAndFilmstripContainer: {
127
     toolboxAndFilmstripContainer: {
115
-        bottom: BoxModel.margin,
128
+        bottom: 0,
116
         flexDirection: 'column',
129
         flexDirection: 'column',
117
         justifyContent: 'flex-end',
130
         justifyContent: 'flex-end',
118
         left: 0,
131
         left: 0,
132
+        paddingBottom: BoxModel.padding,
119
         position: 'absolute',
133
         position: 'absolute',
120
         right: 0,
134
         right: 0,
121
 
135
 
124
         // not enough.
138
         // not enough.
125
         top: BoxModel.margin * 3
139
         top: BoxModel.margin * 3
126
     }
140
     }
127
-});
141
+};

Loading…
Cancel
Save