Browse Source

feat(rn, thumbnail) Updated indicators on native (#11280)

Remove tint for participant in large view
Change pinned indicator from border to icon
On stage view move screen sharing indicator from top to bottom
On stage view show pinned indicator instead of moderator indicator
factor2
Robert Pintilii 3 years ago
parent
commit
ec0e824a43
No account linked to committer's email address

+ 0
- 5
react/features/base/color-scheme/defaultScheme.js View File

@@ -45,11 +45,6 @@ export default {
45 45
     'LargeVideo': {
46 46
         background: '#040404'
47 47
     },
48
-    'Thumbnail': {
49
-        activeParticipantHighlight: 'rgb(81, 214, 170)',
50
-        activeParticipantTint: 'rgba(49, 183, 106, 0.3)',
51
-        background: '#36383C'
52
-    },
53 48
     'Toolbox': {
54 49
         button: 'rgb(255, 255, 255)',
55 50
         buttonToggled: 'rgb(38, 58, 76)',

+ 3
- 20
react/features/base/participants/components/ParticipantView.native.js View File

@@ -13,7 +13,6 @@ import {
13 13
 } from '../../media';
14 14
 import { Container, TintedView } from '../../react';
15 15
 import { connect } from '../../redux';
16
-import type { StyleType } from '../../styles';
17 16
 import { TestHint } from '../../testing/components';
18 17
 import { getTrackByMediaTypeAndParticipant } from '../../tracks';
19 18
 import { shouldRenderParticipantVideo, getParticipantById } from '../functions';
@@ -91,17 +90,6 @@ type Props = {
91 90
      */
92 91
     t: Function,
93 92
 
94
-    /**
95
-     * If true, a tinting will be applied to the view, regardless of video or
96
-     * avatar is rendered.
97
-     */
98
-    tintEnabled: boolean,
99
-
100
-    /**
101
-     * The style of the tinting when applied.
102
-     */
103
-    tintStyle: StyleType,
104
-
105 93
     /**
106 94
      * The test hint id which can be used to locate the {@code ParticipantView}
107 95
      * on the jitsi-meet-torture side. If not provided, the
@@ -193,15 +181,12 @@ class ParticipantView extends Component<Props> {
193 181
             _renderVideo: renderVideo,
194 182
             _videoTrack: videoTrack,
195 183
             disableVideo,
196
-            onPress,
197
-            tintStyle
184
+            onPress
198 185
         } = this.props;
199 186
 
200 187
         // If the connection has problems, we will "tint" the video / avatar.
201 188
         const connectionProblem
202 189
             = connectionStatus !== JitsiParticipantConnectionStatus.ACTIVE;
203
-        const useTint
204
-            = connectionProblem || this.props.tintEnabled;
205 190
 
206 191
         const testHintId
207 192
             = this.props.testHintId
@@ -241,12 +226,10 @@ class ParticipantView extends Component<Props> {
241 226
                             size = { this.props.avatarSize } />
242 227
                     </View> }
243 228
 
244
-                { useTint
229
+                { connectionProblem
245 230
 
246 231
                     // If the connection has problems, tint the video / avatar.
247
-                    && <TintedView
248
-                        style = {
249
-                            connectionProblem ? undefined : tintStyle } /> }
232
+                    && <TintedView /> }
250 233
 
251 234
                 { this.props.useConnectivityInfoLabel
252 235
                     && this._renderConnectionInfo(connectionStatus) }

+ 17
- 0
react/features/filmstrip/components/native/PinnedIndicator.js View File

@@ -0,0 +1,17 @@
1
+// @flow
2
+
3
+import React from 'react';
4
+
5
+import { IconPinParticipant } from '../../../base/icons';
6
+import { BaseIndicator } from '../../../base/react';
7
+
8
+/**
9
+ * Thumbnail badge for displaying if a participant is pinned.
10
+ *
11
+ * @returns {React$Element<any>}
12
+ */
13
+export default function PinnedIndicator() {
14
+    return (
15
+        <BaseIndicator icon = { IconPinParticipant } />
16
+    );
17
+}

+ 12
- 38
react/features/filmstrip/components/native/Thumbnail.js View File

@@ -4,7 +4,6 @@ import React, { PureComponent } from 'react';
4 4
 import { Image, View } from 'react-native';
5 5
 import type { Dispatch } from 'redux';
6 6
 
7
-import { ColorSchemeRegistry } from '../../../base/color-scheme';
8 7
 import { MEDIA_TYPE, VIDEO_TYPE } from '../../../base/media';
9 8
 import {
10 9
     PARTICIPANT_ROLE,
@@ -18,7 +17,6 @@ import {
18 17
 } from '../../../base/participants';
19 18
 import { Container } from '../../../base/react';
20 19
 import { connect } from '../../../base/redux';
21
-import { StyleType } from '../../../base/styles';
22 20
 import { getTrackByMediaTypeAndParticipant } from '../../../base/tracks';
23 21
 import { ConnectionIndicator } from '../../../connection-indicator';
24 22
 import { DisplayNameLabel } from '../../../display-name';
@@ -32,6 +30,7 @@ import { SQUARE_TILE_ASPECT_RATIO } from '../../constants';
32 30
 
33 31
 import AudioMutedIndicator from './AudioMutedIndicator';
34 32
 import ModeratorIndicator from './ModeratorIndicator';
33
+import PinnedIndicator from './PinnedIndicator';
35 34
 import RaisedHandIndicator from './RaisedHandIndicator';
36 35
 import ScreenShareIndicator from './ScreenShareIndicator';
37 36
 import styles, { AVATAR_SIZE } from './styles';
@@ -79,11 +78,6 @@ type Props = {
79 78
      */
80 79
     _participantId: string,
81 80
 
82
-    /**
83
-     * Indicates whether the participant is displayed on the large video.
84
-     */
85
-    _participantInLargeVideo: boolean,
86
-
87 81
     /**
88 82
      * Indicates whether the participant is pinned or not.
89 83
      */
@@ -104,18 +98,6 @@ type Props = {
104 98
      */
105 99
     _renderModeratorIndicator: boolean,
106 100
 
107
-    /**
108
-     * The color-schemed stylesheet of the feature.
109
-     */
110
-    _styles: StyleType,
111
-
112
-    /**
113
-     * If true, there will be no color overlay (tint) on the thumbnail
114
-     * indicating the participant associated with the thumbnail is displayed on
115
-     * large video. By default there will be a tint.
116
-     */
117
-    disableTint?: boolean,
118
-
119 101
     /**
120 102
      * Invoked to trigger state changes in Redux.
121 103
      */
@@ -208,7 +190,9 @@ class Thumbnail extends PureComponent<Props> {
208 190
             _isFakeParticipant,
209 191
             _renderModeratorIndicator: renderModeratorIndicator,
210 192
             _participantId: participantId,
211
-            renderDisplayName
193
+            _pinned,
194
+            renderDisplayName,
195
+            tileView
212 196
         } = this.props;
213 197
         const indicators = [];
214 198
 
@@ -221,7 +205,7 @@ class Thumbnail extends PureComponent<Props> {
221 205
                 ] }>
222 206
                 <ConnectionIndicator participantId = { participantId } />
223 207
                 <RaisedHandIndicator participantId = { participantId } />
224
-                {isScreenShare && (
208
+                {tileView && isScreenShare && (
225 209
                     <View style = { styles.indicatorContainer }>
226 210
                         <ScreenShareIndicator />
227 211
                     </View>
@@ -232,7 +216,11 @@ class Thumbnail extends PureComponent<Props> {
232 216
                 style = { styles.thumbnailIndicatorContainer }>
233 217
                 <Container style = { (audioMuted || renderModeratorIndicator) && styles.bottomIndicatorsContainer }>
234 218
                     { audioMuted && <AudioMutedIndicator /> }
219
+                    { !tileView && _pinned && <PinnedIndicator />}
235 220
                     { renderModeratorIndicator && <ModeratorIndicator />}
221
+                    { !tileView && isScreenShare
222
+                        && <ScreenShareIndicator />
223
+                    }
236 224
                 </Container>
237 225
                 {
238 226
                     renderDisplayName && <DisplayNameLabel
@@ -257,12 +245,8 @@ class Thumbnail extends PureComponent<Props> {
257 245
             _isScreenShare: isScreenShare,
258 246
             _isFakeParticipant,
259 247
             _participantId: participantId,
260
-            _participantInLargeVideo: participantInLargeVideo,
261
-            _pinned,
262 248
             _raisedHand,
263 249
             _renderDominantSpeakerIndicator,
264
-            _styles,
265
-            disableTint,
266 250
             height,
267 251
             tileView
268 252
         } = this.props;
@@ -281,7 +265,6 @@ class Thumbnail extends PureComponent<Props> {
281 265
                 onLongPress = { this._onThumbnailLongPress }
282 266
                 style = { [
283 267
                     styles.thumbnail,
284
-                    _pinned && !tileView ? _styles.thumbnailPinned : null,
285 268
                     styleOverrides,
286 269
                     _raisedHand ? styles.thumbnailRaisedHand : null,
287 270
                     _renderDominantSpeakerIndicator ? styles.thumbnailDominantSpeaker : null
@@ -295,8 +278,6 @@ class Thumbnail extends PureComponent<Props> {
295 278
                             avatarSize = { tileView ? AVATAR_SIZE * 1.5 : AVATAR_SIZE }
296 279
                             disableVideo = { isScreenShare || _isFakeParticipant }
297 280
                             participantId = { participantId }
298
-                            tintEnabled = { participantInLargeVideo && !disableTint }
299
-                            tintStyle = { _styles.activeThumbnailTint }
300 281
                             zOrder = { 1 } />
301 282
                         {
302 283
                             this._renderIndicators()
@@ -316,13 +297,9 @@ class Thumbnail extends PureComponent<Props> {
316 297
  * @returns {Object}
317 298
  */
318 299
 function _mapStateToProps(state, ownProps) {
319
-    // We need read-only access to the state of features/large-video so that the
320
-    // filmstrip doesn't render the video of the participant who is rendered on
321
-    // the stage i.e. as a large video.
322
-    const largeVideo = state['features/large-video'];
323 300
     const { ownerId } = state['features/shared-video'];
324 301
     const tracks = state['features/base/tracks'];
325
-    const { participantID } = ownProps;
302
+    const { participantID, tileView } = ownProps;
326 303
     const participant = getParticipantByIdOrUndefined(state, participantID);
327 304
     const localParticipantId = getLocalParticipant(state).id;
328 305
     const id = participant?.id;
@@ -334,9 +311,8 @@ function _mapStateToProps(state, ownProps) {
334 311
     const participantCount = getParticipantCount(state);
335 312
     const renderDominantSpeakerIndicator = participant && participant.dominantSpeaker && participantCount > 2;
336 313
     const _isEveryoneModerator = isEveryoneModerator(state);
337
-    const renderModeratorIndicator = !_isEveryoneModerator
314
+    const renderModeratorIndicator = tileView && !_isEveryoneModerator
338 315
         && participant?.role === PARTICIPANT_ROLE.MODERATOR;
339
-    const participantInLargeVideo = id === largeVideo.participantId;
340 316
     const { gifUrl: gifSrc } = getGifForParticipant(state, id);
341 317
     const mode = getGifDisplayMode(state);
342 318
 
@@ -347,13 +323,11 @@ function _mapStateToProps(state, ownProps) {
347 323
         _isScreenShare: isScreenShare,
348 324
         _local: participant?.local,
349 325
         _localVideoOwner: Boolean(ownerId === localParticipantId),
350
-        _participantInLargeVideo: participantInLargeVideo,
351 326
         _participantId: id,
352 327
         _pinned: participant?.pinned,
353 328
         _raisedHand: hasRaisedHand(participant),
354 329
         _renderDominantSpeakerIndicator: renderDominantSpeakerIndicator,
355
-        _renderModeratorIndicator: renderModeratorIndicator,
356
-        _styles: ColorSchemeRegistry.get(state, 'Thumbnail')
330
+        _renderModeratorIndicator: renderModeratorIndicator
357 331
     };
358 332
 }
359 333
 

+ 0
- 1
react/features/filmstrip/components/native/TileView.js View File

@@ -263,7 +263,6 @@ class TileView extends PureComponent<Props> {
263 263
 
264 264
         return (
265 265
             <Thumbnail
266
-                disableTint = { true }
267 266
                 height = { _thumbnailHeight }
268 267
                 key = { item }
269 268
                 participantID = { item }

+ 0
- 27
react/features/filmstrip/components/native/styles.js View File

@@ -1,6 +1,5 @@
1 1
 // @flow
2 2
 
3
-import { ColorSchemeRegistry, schemeColor } from '../../../base/color-scheme';
4 3
 import BaseTheme from '../../../base/ui/components/BaseTheme.native';
5 4
 import { SMALL_THUMBNAIL_SIZE } from '../../constants';
6 5
 
@@ -178,29 +177,3 @@ export default {
178 177
         resizeMode: 'contain'
179 178
     }
180 179
 };
181
-
182
-/**
183
- * Color schemed styles for the @{code Thumbnail} component.
184
- */
185
-ColorSchemeRegistry.register('Thumbnail', {
186
-
187
-    /**
188
-     * Tinting style of the on-stage participant thumbnail.
189
-     */
190
-    activeThumbnailTint: {
191
-        backgroundColor: schemeColor('activeParticipantTint')
192
-    },
193
-
194
-    /**
195
-     * Pinned video thumbnail style.
196
-     */
197
-    thumbnailPinned: {
198
-        borderColor: schemeColor('activeParticipantHighlight'),
199
-        shadowColor: schemeColor('activeParticipantHighlight'),
200
-        shadowOffset: {
201
-            height: 5,
202
-            width: 5
203
-        },
204
-        shadowRadius: 5
205
-    }
206
-});

Loading…
Cancel
Save