浏览代码

rn,overflow-menu: add a "more options" button

master
Saúl Ibarra Corretgé 5 年前
父节点
当前提交
a4333d3a80

+ 2
- 0
lang/main.json 查看文件

590
             "lockRoom": "Toggle meeting password",
590
             "lockRoom": "Toggle meeting password",
591
             "moreActions": "Toggle more actions menu",
591
             "moreActions": "Toggle more actions menu",
592
             "moreActionsMenu": "More actions menu",
592
             "moreActionsMenu": "More actions menu",
593
+            "moreOptions": "Show more options",
593
             "mute": "Toggle mute audio",
594
             "mute": "Toggle mute audio",
594
             "pip": "Toggle Picture-in-Picture mode",
595
             "pip": "Toggle Picture-in-Picture mode",
595
             "privateMessage": "Send private message",
596
             "privateMessage": "Send private message",
632
         "logout": "Logout",
633
         "logout": "Logout",
633
         "lowerYourHand": "Lower your hand",
634
         "lowerYourHand": "Lower your hand",
634
         "moreActions": "More actions",
635
         "moreActions": "More actions",
636
+        "moreOptions": "More options",
635
         "mute": "Mute / Unmute",
637
         "mute": "Mute / Unmute",
636
         "noAudioSignalTitle": "There is no input coming from your mic!",
638
         "noAudioSignalTitle": "There is no input coming from your mic!",
637
         "noAudioSignalDesc": "If you did not purposely mute it from system settings or hardware, consider switching the device.",
639
         "noAudioSignalDesc": "If you did not purposely mute it from system settings or hardware, consider switching the device.",

+ 2
- 8
react/features/base/dialog/components/native/BottomSheet.js 查看文件

44
     /**
44
     /**
45
      * Callback to be attached to the custom swipe event of the BottomSheet.
45
      * Callback to be attached to the custom swipe event of the BottomSheet.
46
      */
46
      */
47
-    onSwipe?: Function,
48
-
49
-    /**
50
-     * Function to render a bottom sheet header element, if necessary.
51
-     */
52
-    renderHeader: ?Function
47
+    onSwipe?: Function
53
 };
48
 };
54
 
49
 
55
 /**
50
 /**
80
      * @returns {ReactElement}
75
      * @returns {ReactElement}
81
      */
76
      */
82
     render() {
77
     render() {
83
-        const { _styles, renderHeader } = this.props;
78
+        const { _styles } = this.props;
84
 
79
 
85
         return (
80
         return (
86
             <SlidingView
81
             <SlidingView
93
                     <View
88
                     <View
94
                         pointerEvents = 'box-none'
89
                         pointerEvents = 'box-none'
95
                         style = { styles.sheetAreaCover } />
90
                         style = { styles.sheetAreaCover } />
96
-                    { renderHeader && renderHeader() }
97
                     <SafeAreaView
91
                     <SafeAreaView
98
                         style = { [
92
                         style = { [
99
                             styles.sheetItemContainer,
93
                             styles.sheetItemContainer,

+ 0
- 6
react/features/base/dialog/components/native/styles.js 查看文件

172
         underlayColor: ColorPalette.overflowMenuItemUnderlay
172
         underlayColor: ColorPalette.overflowMenuItemUnderlay
173
     },
173
     },
174
 
174
 
175
-    expandIcon: {
176
-        color: schemeColor('icon'),
177
-        fontSize: 16,
178
-        opacity: 0.7
179
-    },
180
-
181
     /**
175
     /**
182
      * Bottom sheet's base style.
176
      * Bottom sheet's base style.
183
      */
177
      */

+ 0
- 1
react/features/base/icons/svg/drag-handle.svg 查看文件

1
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" viewBox="0 0 24 24"><defs><path id="a" d="M0 0h24v24H0V0z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)" d="M20 9H4v2h16V9zM4 15h16v-2H4v2z"/></svg>

+ 0
- 1
react/features/base/icons/svg/index.js 查看文件

25
 export { default as IconDeviceSpeaker } from './volume.svg';
25
 export { default as IconDeviceSpeaker } from './volume.svg';
26
 export { default as IconDominantSpeaker } from './dominant-speaker.svg';
26
 export { default as IconDominantSpeaker } from './dominant-speaker.svg';
27
 export { default as IconDownload } from './download.svg';
27
 export { default as IconDownload } from './download.svg';
28
-export { default as IconDragHandle } from './drag-handle.svg';
29
 export { default as IconEventNote } from './event_note.svg';
28
 export { default as IconEventNote } from './event_note.svg';
30
 export { default as IconExitFullScreen } from './exit-full-screen.svg';
29
 export { default as IconExitFullScreen } from './exit-full-screen.svg';
31
 export { default as IconFeedback } from './feedback.svg';
30
 export { default as IconFeedback } from './feedback.svg';

+ 21
- 0
react/features/toolbox/components/native/MoreOptionsButton.js 查看文件

1
+// @flow
2
+
3
+import { translate } from '../../../base/i18n';
4
+import { IconMenu } from '../../../base/icons';
5
+import { AbstractButton } from '../../../base/toolbox';
6
+import type { AbstractButtonProps } from '../../../base/toolbox';
7
+
8
+
9
+type Props = AbstractButtonProps;
10
+
11
+/**
12
+ * An implementation of a button to show more menu options.
13
+ */
14
+class MoreOptionsButton extends AbstractButton<Props, any> {
15
+    accessibilityLabel = 'toolbar.accessibilityLabel.moreOptions';
16
+    icon = IconMenu;
17
+    label = 'toolbar.moreOptions';
18
+}
19
+
20
+
21
+export default translate(MoreOptionsButton);

+ 11
- 30
react/features/toolbox/components/native/OverflowMenu.js 查看文件

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React, { PureComponent } from 'react';
3
 import React, { PureComponent } from 'react';
4
-import { Platform, TouchableOpacity, View } from 'react-native';
4
+import { Platform } from 'react-native';
5
 import Collapsible from 'react-native-collapsible';
5
 import Collapsible from 'react-native-collapsible';
6
 
6
 
7
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
7
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
8
 import { BottomSheet, hideDialog, isDialogOpen } from '../../../base/dialog';
8
 import { BottomSheet, hideDialog, isDialogOpen } from '../../../base/dialog';
9
-import { IconDragHandle } from '../../../base/icons';
10
 import { CHAT_ENABLED, IOS_RECORDING_ENABLED, getFeatureFlag } from '../../../base/flags';
9
 import { CHAT_ENABLED, IOS_RECORDING_ENABLED, getFeatureFlag } from '../../../base/flags';
11
 import { connect } from '../../../base/redux';
10
 import { connect } from '../../../base/redux';
12
 import { StyleType } from '../../../base/styles';
11
 import { StyleType } from '../../../base/styles';
21
 import HelpButton from '../HelpButton';
20
 import HelpButton from '../HelpButton';
22
 
21
 
23
 import AudioOnlyButton from './AudioOnlyButton';
22
 import AudioOnlyButton from './AudioOnlyButton';
23
+import MoreOptionsButton from './MoreOptionsButton';
24
 import RaiseHandButton from './RaiseHandButton';
24
 import RaiseHandButton from './RaiseHandButton';
25
 import ToggleCameraButton from './ToggleCameraButton';
25
 import ToggleCameraButton from './ToggleCameraButton';
26
-import styles from './styles';
27
 
26
 
28
 /**
27
 /**
29
  * The type of the React {@code Component} props of {@link OverflowMenu}.
28
  * The type of the React {@code Component} props of {@link OverflowMenu}.
100
         this._onCancel = this._onCancel.bind(this);
99
         this._onCancel = this._onCancel.bind(this);
101
         this._onSwipe = this._onSwipe.bind(this);
100
         this._onSwipe = this._onSwipe.bind(this);
102
         this._onToggleMenu = this._onToggleMenu.bind(this);
101
         this._onToggleMenu = this._onToggleMenu.bind(this);
103
-        this._renderMenuExpandToggle = this._renderMenuExpandToggle.bind(this);
104
     }
102
     }
105
 
103
 
106
     /**
104
     /**
119
             styles: _bottomSheetStyles.buttons
117
             styles: _bottomSheetStyles.buttons
120
         };
118
         };
121
 
119
 
120
+        const moreOptionsButtonProps = {
121
+            ...buttonProps,
122
+            afterClick: this._onToggleMenu,
123
+            visible: !showMore
124
+        };
125
+
122
         return (
126
         return (
123
             <BottomSheet
127
             <BottomSheet
124
                 onCancel = { this._onCancel }
128
                 onCancel = { this._onCancel }
125
-                onSwipe = { this._onSwipe }
126
-                renderHeader = { this._renderMenuExpandToggle }>
129
+                onSwipe = { this._onSwipe }>
127
                 <AudioRouteButton { ...buttonProps } />
130
                 <AudioRouteButton { ...buttonProps } />
128
                 <ToggleCameraButton { ...buttonProps } />
131
                 <ToggleCameraButton { ...buttonProps } />
129
                 <AudioOnlyButton { ...buttonProps } />
132
                 <AudioOnlyButton { ...buttonProps } />
133
+                <MoreOptionsButton { ...moreOptionsButtonProps } />
130
                 <Collapsible collapsed = { !showMore }>
134
                 <Collapsible collapsed = { !showMore }>
131
                     <RoomLockButton { ...buttonProps } />
135
                     <RoomLockButton { ...buttonProps } />
132
                     <ClosedCaptionButton { ...buttonProps } />
136
                     <ClosedCaptionButton { ...buttonProps } />
149
         );
153
         );
150
     }
154
     }
151
 
155
 
152
-    _renderMenuExpandToggle: () => React$Element<any>;
153
-
154
-    /**
155
-     * Function to render the menu toggle in the bottom sheet header area.
156
-     *
157
-     * @returns {React$Element}
158
-     */
159
-    _renderMenuExpandToggle() {
160
-        return (
161
-            <View
162
-                style = { [
163
-                    this.props._bottomSheetStyles.sheet,
164
-                    styles.expandMenuContainer
165
-                ] }>
166
-                <TouchableOpacity onPress = { this._onToggleMenu }>
167
-                    { /* $FlowFixMeProps */ }
168
-                    <IconDragHandle style = { this.props._bottomSheetStyles.expandIcon } />
169
-                </TouchableOpacity>
170
-            </View>
171
-        );
172
-    }
173
-
174
     _onCancel: () => boolean;
156
     _onCancel: () => boolean;
175
 
157
 
176
     /**
158
     /**
240
  */
222
  */
241
 function _mapStateToProps(state) {
223
 function _mapStateToProps(state) {
242
     return {
224
     return {
243
-        _bottomSheetStyles:
244
-            ColorSchemeRegistry.get(state, 'BottomSheet'),
225
+        _bottomSheetStyles: ColorSchemeRegistry.get(state, 'BottomSheet'),
245
         _chatEnabled: getFeatureFlag(state, CHAT_ENABLED, true),
226
         _chatEnabled: getFeatureFlag(state, CHAT_ENABLED, true),
246
         _isOpen: isDialogOpen(state, OverflowMenu_),
227
         _isOpen: isDialogOpen(state, OverflowMenu_),
247
         _recordingEnabled: Platform.OS !== 'ios' || getFeatureFlag(state, IOS_RECORDING_ENABLED)
228
         _recordingEnabled: Platform.OS !== 'ios' || getFeatureFlag(state, IOS_RECORDING_ENABLED)

+ 0
- 10
react/features/toolbox/components/native/styles.js 查看文件

55
  */
55
  */
56
 const styles = {
56
 const styles = {
57
 
57
 
58
-    expandMenuContainer: {
59
-        alignItems: 'center',
60
-        flexDirection: 'column'
61
-    },
62
-
63
-    sheetGestureRecognizer: {
64
-        alignItems: 'stretch',
65
-        flexDirection: 'column'
66
-    },
67
-
68
     /**
58
     /**
69
      * The style of the toolbar.
59
      * The style of the toolbar.
70
      */
60
      */

正在加载...
取消
保存