Bladeren bron

feat(Filmstrip): Collapse filmstrip to avoid toolbar overlap on mobile

master
Mihai-Andrei Uscat 4 jaren geleden
bovenliggende
commit
2209394d09
No account linked to committer's email address

+ 1
- 0
css/_variables.scss Bestand weergeven

@@ -46,6 +46,7 @@ $menuBG:#242528;
46 46
 $newToolbarFontSize: 24px;
47 47
 $newToolbarHangupFontSize: 32px;
48 48
 $newToolbarSize: 48px;
49
+$newToolbarSizeMobile: 60px;
49 50
 $newToolbarSizeWithPadding: calc(#{$newToolbarSize} + 24px);
50 51
 $toolbarTitleFontSize: 19px;
51 52
 $overflowMenuItemColor: #fff;

+ 14
- 1
css/filmstrip/_tile_view.scss Bestand weergeven

@@ -35,6 +35,7 @@
35 35
         display: flex;
36 36
         justify-content: center;
37 37
         align-items: center;
38
+        transition: margin-bottom .3s ease-in;
38 39
     }
39 40
 
40 41
     .filmstrip {
@@ -52,11 +53,23 @@
52 53
                 margin-left: $sidebarWidth;
53 54
                 width: calc(100% - #{$sidebarWidth});
54 55
 
55
-                .remote-videos{
56
+                .remote-videos {
56 57
                     width: calc(100vw - #{$sidebarWidth});
57 58
                 }
58 59
             }
59 60
         }
61
+
62
+        &.collapse {
63
+            #remoteVideos {
64
+                height: calc(100% - #{$newToolbarSizeMobile}) !important;
65
+                margin-bottom: $newToolbarSizeMobile;
66
+            }
67
+
68
+            .remote-videos {
69
+                // !important is needed here as overflow is set via element.style in a FixedSizeGrid.
70
+                overflow: hidden auto !important;
71
+            }
72
+        }
60 73
     }
61 74
 
62 75
     /**

+ 32
- 6
react/features/filmstrip/components/web/Filmstrip.js Bestand weergeven

@@ -10,6 +10,7 @@ import {
10 10
     sendAnalytics
11 11
 } from '../../../analytics';
12 12
 import { getToolbarButtons } from '../../../base/config';
13
+import { isMobileBrowser } from '../../../base/environment/utils';
13 14
 import { translate } from '../../../base/i18n';
14 15
 import { Icon, IconMenuDown, IconMenuUp } from '../../../base/icons';
15 16
 import { connect } from '../../../base/redux';
@@ -17,7 +18,13 @@ import { showToolbox } from '../../../toolbox/actions.web';
17 18
 import { isButtonEnabled, isToolboxVisible } from '../../../toolbox/functions.web';
18 19
 import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
19 20
 import { setFilmstripVisible, setVisibleRemoteParticipants } from '../../actions';
20
-import { TILE_HORIZONTAL_MARGIN, TILE_VERTICAL_MARGIN, TOOLBAR_HEIGHT } from '../../constants';
21
+import {
22
+    ASPECT_RATIO_BREAKPOINT,
23
+    TILE_HORIZONTAL_MARGIN,
24
+    TILE_VERTICAL_MARGIN,
25
+    TOOLBAR_HEIGHT,
26
+    TOOLBAR_HEIGHT_MOBILE
27
+} from '../../constants';
21 28
 import { shouldRemoteVideosBeVisible } from '../../functions';
22 29
 
23 30
 import AudioTracksContainer from './AudioTracksContainer';
@@ -485,10 +492,6 @@ function _mapStateToProps(state) {
485 492
     const reduceHeight = state['features/toolbox'].visible && toolbarButtons.length;
486 493
     const remoteVideosVisible = shouldRemoteVideosBeVisible(state);
487 494
     const { isOpen: shiftRight } = state['features/chat'];
488
-    const className = `${remoteVideosVisible ? '' : 'hide-videos'} ${
489
-        reduceHeight ? 'reduce-height' : ''
490
-    } ${shiftRight ? 'shift-right' : ''}`.trim();
491
-    const videosClassName = `filmstrip__videos${visible ? '' : ' hidden'}`;
492 495
     const {
493 496
         gridDimensions = {},
494 497
         filmstripHeight,
@@ -496,12 +499,35 @@ function _mapStateToProps(state) {
496 499
         thumbnailSize: tileViewThumbnailSize
497 500
     } = state['features/filmstrip'].tileViewDimensions;
498 501
     const _currentLayout = getCurrentLayout(state);
502
+
503
+    const { clientHeight, clientWidth } = state['features/base/responsive-ui'];
504
+    const availableSpace = clientHeight - filmstripHeight;
505
+    let filmstripPadding = 0;
506
+
507
+    if (availableSpace > 0) {
508
+        const paddingValue = TOOLBAR_HEIGHT_MOBILE - availableSpace;
509
+
510
+        if (paddingValue > 0) {
511
+            filmstripPadding = paddingValue;
512
+        }
513
+    } else {
514
+        filmstripPadding = TOOLBAR_HEIGHT_MOBILE;
515
+    }
516
+
517
+    const collapseTileView = reduceHeight
518
+        && isMobileBrowser()
519
+        && clientWidth <= ASPECT_RATIO_BREAKPOINT;
520
+
521
+    const className = `${remoteVideosVisible ? '' : 'hide-videos'} ${
522
+        reduceHeight ? 'reduce-height' : ''
523
+    } ${shiftRight ? 'shift-right' : ''} ${collapseTileView ? 'collapse' : ''}`.trim();
524
+    const videosClassName = `filmstrip__videos${visible ? '' : ' hidden'}`;
499 525
     let _thumbnailSize, remoteFilmstripHeight, remoteFilmstripWidth;
500 526
 
501 527
     switch (_currentLayout) {
502 528
     case LAYOUTS.TILE_VIEW:
503 529
         _thumbnailSize = tileViewThumbnailSize;
504
-        remoteFilmstripHeight = filmstripHeight;
530
+        remoteFilmstripHeight = filmstripHeight - (collapseTileView && filmstripPadding > 0 ? filmstripPadding : 0);
505 531
         remoteFilmstripWidth = filmstripWidth;
506 532
         break;
507 533
     case LAYOUTS.VERTICAL_FILMSTRIP_VIEW: {

+ 5
- 0
react/features/filmstrip/constants.js Bestand weergeven

@@ -163,6 +163,11 @@ export const TILE_HORIZONTAL_MARGIN = 4;
163 163
  */
164 164
 export const TOOLBAR_HEIGHT = 72;
165 165
 
166
+/**
167
+ * The height of the whole toolbar.
168
+ */
169
+export const TOOLBAR_HEIGHT_MOBILE = 60;
170
+
166 171
 /**
167 172
  * The size of the horizontal border of a thumbnail.
168 173
  *

Laden…
Annuleren
Opslaan