Преглед изворни кода

feat: add bottom gradient

master
Bettenbuk Zoltan пре 6 година
родитељ
комит
a25a504a59

+ 24
- 3
react/features/conference/components/native/Conference.js Прегледај датотеку

@@ -2,6 +2,7 @@
2 2
 
3 3
 import React from 'react';
4 4
 import { NativeModules, SafeAreaView, StatusBar, View } from 'react-native';
5
+import LinearGradient from 'react-native-linear-gradient';
5 6
 
6 7
 import { appNavigate } from '../../../app';
7 8
 import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
@@ -34,7 +35,7 @@ import {
34 35
 } from '../AbstractConference';
35 36
 import Labels from './Labels';
36 37
 import NavigationBar from './NavigationBar';
37
-import styles from './styles';
38
+import styles, { NAVBAR_GRADIENT_COLORS } from './styles';
38 39
 
39 40
 import type { AbstractProps } from '../AbstractConference';
40 41
 
@@ -199,10 +200,14 @@ class Conference extends AbstractConference<Props, *> {
199 200
     render() {
200 201
         const {
201 202
             _connecting,
203
+            _filmstripVisible,
202 204
             _largeVideoParticipantId,
203 205
             _reducedUI,
204
-            _shouldDisplayTileView
206
+            _shouldDisplayTileView,
207
+            _toolboxVisible
205 208
         } = this.props;
209
+        const showGradient = _toolboxVisible;
210
+        const applyGradientStretching = _filmstripVisible && isNarrowAspectRatio(this) && !_shouldDisplayTileView;
206 211
 
207 212
         return (
208 213
             <Container style = { styles.conference }>
@@ -242,6 +247,22 @@ class Conference extends AbstractConference<Props, *> {
242 247
                     pointerEvents = 'box-none'
243 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 266
                     <Labels />
246 267
 
247 268
                     <Captions onPress = { this._onClick } />
@@ -249,7 +270,7 @@ class Conference extends AbstractConference<Props, *> {
249 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 275
                     <Toolbox />
255 276
 

+ 25
- 11
react/features/conference/components/native/styles.js Прегледај датотеку

@@ -1,18 +1,27 @@
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 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 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 26
      * {@code Conference} style.
18 27
      */
@@ -30,8 +39,12 @@ export default createStyleSheet({
30 39
         flex: 1
31 40
     },
32 41
 
42
+    gradientStretchBottom: {
43
+        height: GRADIENT_HEIGHT + FILMSTRIP_SIZE
44
+    },
45
+
33 46
     gradientStretch: {
34
-        height: 116
47
+        height: GRADIENT_HEIGHT
35 48
     },
36 49
 
37 50
     /**
@@ -112,10 +125,11 @@ export default createStyleSheet({
112 125
      * the {@link Toolbox}.
113 126
      */
114 127
     toolboxAndFilmstripContainer: {
115
-        bottom: BoxModel.margin,
128
+        bottom: 0,
116 129
         flexDirection: 'column',
117 130
         justifyContent: 'flex-end',
118 131
         left: 0,
132
+        paddingBottom: BoxModel.padding,
119 133
         position: 'absolute',
120 134
         right: 0,
121 135
 
@@ -124,4 +138,4 @@ export default createStyleSheet({
124 138
         // not enough.
125 139
         top: BoxModel.margin * 3
126 140
     }
127
-});
141
+};

Loading…
Откажи
Сачувај