瀏覽代碼

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

master
Mihai-Andrei Uscat 4 年之前
父節點
當前提交
2209394d09
沒有連結到貢獻者的電子郵件帳戶。

+ 1
- 0
css/_variables.scss 查看文件

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

+ 14
- 1
css/filmstrip/_tile_view.scss 查看文件

35
         display: flex;
35
         display: flex;
36
         justify-content: center;
36
         justify-content: center;
37
         align-items: center;
37
         align-items: center;
38
+        transition: margin-bottom .3s ease-in;
38
     }
39
     }
39
 
40
 
40
     .filmstrip {
41
     .filmstrip {
52
                 margin-left: $sidebarWidth;
53
                 margin-left: $sidebarWidth;
53
                 width: calc(100% - #{$sidebarWidth});
54
                 width: calc(100% - #{$sidebarWidth});
54
 
55
 
55
-                .remote-videos{
56
+                .remote-videos {
56
                     width: calc(100vw - #{$sidebarWidth});
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 查看文件

10
     sendAnalytics
10
     sendAnalytics
11
 } from '../../../analytics';
11
 } from '../../../analytics';
12
 import { getToolbarButtons } from '../../../base/config';
12
 import { getToolbarButtons } from '../../../base/config';
13
+import { isMobileBrowser } from '../../../base/environment/utils';
13
 import { translate } from '../../../base/i18n';
14
 import { translate } from '../../../base/i18n';
14
 import { Icon, IconMenuDown, IconMenuUp } from '../../../base/icons';
15
 import { Icon, IconMenuDown, IconMenuUp } from '../../../base/icons';
15
 import { connect } from '../../../base/redux';
16
 import { connect } from '../../../base/redux';
17
 import { isButtonEnabled, isToolboxVisible } from '../../../toolbox/functions.web';
18
 import { isButtonEnabled, isToolboxVisible } from '../../../toolbox/functions.web';
18
 import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
19
 import { LAYOUTS, getCurrentLayout } from '../../../video-layout';
19
 import { setFilmstripVisible, setVisibleRemoteParticipants } from '../../actions';
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
 import { shouldRemoteVideosBeVisible } from '../../functions';
28
 import { shouldRemoteVideosBeVisible } from '../../functions';
22
 
29
 
23
 import AudioTracksContainer from './AudioTracksContainer';
30
 import AudioTracksContainer from './AudioTracksContainer';
485
     const reduceHeight = state['features/toolbox'].visible && toolbarButtons.length;
492
     const reduceHeight = state['features/toolbox'].visible && toolbarButtons.length;
486
     const remoteVideosVisible = shouldRemoteVideosBeVisible(state);
493
     const remoteVideosVisible = shouldRemoteVideosBeVisible(state);
487
     const { isOpen: shiftRight } = state['features/chat'];
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
     const {
495
     const {
493
         gridDimensions = {},
496
         gridDimensions = {},
494
         filmstripHeight,
497
         filmstripHeight,
496
         thumbnailSize: tileViewThumbnailSize
499
         thumbnailSize: tileViewThumbnailSize
497
     } = state['features/filmstrip'].tileViewDimensions;
500
     } = state['features/filmstrip'].tileViewDimensions;
498
     const _currentLayout = getCurrentLayout(state);
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
     let _thumbnailSize, remoteFilmstripHeight, remoteFilmstripWidth;
525
     let _thumbnailSize, remoteFilmstripHeight, remoteFilmstripWidth;
500
 
526
 
501
     switch (_currentLayout) {
527
     switch (_currentLayout) {
502
     case LAYOUTS.TILE_VIEW:
528
     case LAYOUTS.TILE_VIEW:
503
         _thumbnailSize = tileViewThumbnailSize;
529
         _thumbnailSize = tileViewThumbnailSize;
504
-        remoteFilmstripHeight = filmstripHeight;
530
+        remoteFilmstripHeight = filmstripHeight - (collapseTileView && filmstripPadding > 0 ? filmstripPadding : 0);
505
         remoteFilmstripWidth = filmstripWidth;
531
         remoteFilmstripWidth = filmstripWidth;
506
         break;
532
         break;
507
     case LAYOUTS.VERTICAL_FILMSTRIP_VIEW: {
533
     case LAYOUTS.VERTICAL_FILMSTRIP_VIEW: {

+ 5
- 0
react/features/filmstrip/constants.js 查看文件

163
  */
163
  */
164
 export const TOOLBAR_HEIGHT = 72;
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
  * The size of the horizontal border of a thumbnail.
172
  * The size of the horizontal border of a thumbnail.
168
  *
173
  *

Loading…
取消
儲存