Browse Source

[RN] Implement a new UI for the Toolbox

- 5 buttons in the (now single) toolbar
- Overflow menu in the form of a BottomSheet
- Filmstrip on the right when in wide mode
master
Saúl Ibarra Corretgé 7 years ago
parent
commit
f54f5df428

+ 5
- 0
react/features/base/toolbox/components/AbstractToolboxItem.js View File

9
      */
9
      */
10
     iconStyle: Object,
10
     iconStyle: Object,
11
 
11
 
12
+    /**
13
+     * Style for te item's label.
14
+     */
15
+    labelStyle: Object,
16
+
12
     /**
17
     /**
13
      * Style for the item itself.
18
      * Style for the item itself.
14
      */
19
      */

+ 40
- 7
react/features/base/toolbox/components/ToolboxItem.native.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import React from 'react';
3
 import React from 'react';
4
-import { TouchableHighlight } from 'react-native';
4
+import { Text, TouchableHighlight, View } from 'react-native';
5
 
5
 
6
 import { Icon } from '../../../base/font-icons';
6
 import { Icon } from '../../../base/font-icons';
7
 
7
 
26
     }
26
     }
27
 
27
 
28
     /**
28
     /**
29
-     * Handles rendering of the actual item.
29
+     * Helper function to render the {@code Icon} part of this item.
30
      *
30
      *
31
-     * TODO: currently no handling for labels is implemented.
31
+     * @private
32
+     * @returns {ReactElement}
33
+     */
34
+    _renderIcon() {
35
+        const { styles } = this.props;
36
+
37
+        return (
38
+            <Icon
39
+                name = { this._getIconName() }
40
+                style = { styles && styles.iconStyle } />
41
+        );
42
+    }
43
+
44
+    /**
45
+     * Handles rendering of the actual item.
32
      *
46
      *
33
      * @protected
47
      * @protected
34
      * @returns {ReactElement}
48
      * @returns {ReactElement}
38
             accessibilityLabel,
52
             accessibilityLabel,
39
             disabled,
53
             disabled,
40
             onClick,
54
             onClick,
55
+            showLabel,
41
             styles
56
             styles
42
         } = this.props;
57
         } = this.props;
43
 
58
 
59
+        let children;
60
+
61
+        if (showLabel) {
62
+            // eslint-disable-next-line no-extra-parens
63
+            children = (
64
+                <View style = { styles && styles.style } >
65
+                    { this._renderIcon() }
66
+                    <Text style = { styles && styles.labelStyle } >
67
+                        { this.label }
68
+                    </Text>
69
+                </View>
70
+            );
71
+        } else {
72
+            children = this._renderIcon();
73
+        }
74
+
75
+        // When using a wrapper view, apply the style to it instead of
76
+        // applying it to the TouchableHighlight.
77
+        const style = showLabel ? undefined : styles && styles.style;
78
+
44
         return (
79
         return (
45
             <TouchableHighlight
80
             <TouchableHighlight
46
                 accessibilityLabel = { accessibilityLabel }
81
                 accessibilityLabel = { accessibilityLabel }
47
                 disabled = { disabled }
82
                 disabled = { disabled }
48
                 onPress = { onClick }
83
                 onPress = { onClick }
49
-                style = { styles && styles.style }
84
+                style = { style }
50
                 underlayColor = { styles && styles.underlayColor } >
85
                 underlayColor = { styles && styles.underlayColor } >
51
-                <Icon
52
-                    name = { this._getIconName() }
53
-                    style = { styles && styles.iconStyle } />
86
+                { children }
54
             </TouchableHighlight>
87
             </TouchableHighlight>
55
         );
88
         );
56
     }
89
     }

+ 1
- 1
react/features/filmstrip/components/styles.js View File

55
         ...filmstrip,
55
         ...filmstrip,
56
         bottom: 0,
56
         bottom: 0,
57
         flexDirection: 'column',
57
         flexDirection: 'column',
58
-        left: 0,
59
         position: 'absolute',
58
         position: 'absolute',
59
+        right: 0,
60
         top: 0
60
         top: 0
61
     },
61
     },
62
 
62
 

+ 91
- 0
react/features/toolbox/components/native/OverflowMenu.js View File

1
+// @flow
2
+
3
+import React, { Component } from 'react';
4
+import { connect } from 'react-redux';
5
+
6
+import { hideDialog, BottomSheet } from '../../../base/dialog';
7
+import { AudioRouteButton } from '../../../mobile/audio-mode';
8
+import { PictureInPictureButton } from '../../../mobile/picture-in-picture';
9
+import { RoomLockButton } from '../../../room-lock';
10
+
11
+import AudioOnlyButton from './AudioOnlyButton';
12
+import ToggleCameraButton from './ToggleCameraButton';
13
+
14
+import { overflowMenuItemStyles } from './styles';
15
+
16
+type Props = {
17
+
18
+    /**
19
+     * Used for hiding the dialog when the selection was completed.
20
+     */
21
+    dispatch: Function,
22
+};
23
+
24
+/**
25
+ * The exported React {@code Component}. We need a reference to the wrapped
26
+ * component in order to be able to hide it using the dialog hiding logic.
27
+ */
28
+
29
+// eslint-disable-next-line prefer-const
30
+let OverflowMenu_;
31
+
32
+/**
33
+ * Implements a React {@code Component} with some extra actions in addition to
34
+ * those in the toolbar.
35
+ */
36
+class OverflowMenu extends Component<Props> {
37
+    /**
38
+     * Initializes a new {@code OverflowMenu} instance.
39
+     *
40
+     * @inheritdoc
41
+     */
42
+    constructor(props: Props) {
43
+        super(props);
44
+
45
+        this._onCancel = this._onCancel.bind(this);
46
+    }
47
+
48
+    /**
49
+     * Implements React's {@link Component#render()}.
50
+     *
51
+     * @inheritdoc
52
+     * @returns {ReactElement}
53
+     */
54
+    render() {
55
+        return (
56
+            <BottomSheet onCancel = { this._onCancel }>
57
+                <AudioRouteButton
58
+                    showLabel = { true }
59
+                    styles = { overflowMenuItemStyles } />
60
+                <ToggleCameraButton
61
+                    showLabel = { true }
62
+                    styles = { overflowMenuItemStyles } />
63
+                <AudioOnlyButton
64
+                    showLabel = { true }
65
+                    styles = { overflowMenuItemStyles } />
66
+                <RoomLockButton
67
+                    showLabel = { true }
68
+                    styles = { overflowMenuItemStyles } />
69
+                <PictureInPictureButton
70
+                    showLabel = { true }
71
+                    styles = { overflowMenuItemStyles } />
72
+            </BottomSheet>
73
+        );
74
+    }
75
+
76
+    _onCancel: () => void;
77
+
78
+    /**
79
+     * Hides the dialog.
80
+     *
81
+     * @private
82
+     * @returns {void}
83
+     */
84
+    _onCancel() {
85
+        this.props.dispatch(hideDialog(OverflowMenu_));
86
+    }
87
+}
88
+
89
+OverflowMenu_ = connect()(OverflowMenu);
90
+
91
+export default OverflowMenu_;

+ 39
- 0
react/features/toolbox/components/native/OverflowMenuButton.js View File

1
+// @flow
2
+
3
+import { connect } from 'react-redux';
4
+
5
+import { openDialog } from '../../../base/dialog';
6
+import { translate } from '../../../base/i18n';
7
+import { AbstractButton } from '../../../base/toolbox';
8
+import type { AbstractButtonProps } from '../../../base/toolbox';
9
+
10
+import OverflowMenu from './OverflowMenu';
11
+
12
+type Props = AbstractButtonProps & {
13
+
14
+    /**
15
+     * The redux {@code dispatch} function.
16
+     */
17
+    dispatch: Function
18
+}
19
+
20
+/**
21
+ * An implementation of a button for showing the {@code OverflowMenu}.
22
+ */
23
+class OverflowMenuButton extends AbstractButton<Props, *> {
24
+    accessibilityLabel = 'Overflow menu';
25
+    iconName = 'icon-thumb-menu';
26
+    label = 'toolbar.moreActions';
27
+
28
+    /**
29
+     * Handles clicking / pressing the button.
30
+     *
31
+     * @private
32
+     * @returns {void}
33
+     */
34
+    _handleClick() {
35
+        this.props.dispatch(openDialog(OverflowMenu));
36
+    }
37
+}
38
+
39
+export default translate(connect()(OverflowMenuButton));

+ 0
- 62
react/features/toolbox/components/native/ToolbarButton.js View File

1
-import PropTypes from 'prop-types';
2
-import React from 'react';
3
-import { TouchableHighlight } from 'react-native';
4
-import { connect } from 'react-redux';
5
-
6
-import { Icon } from '../../../base/font-icons';
7
-
8
-import AbstractToolbarButton from '../AbstractToolbarButton';
9
-
10
-/**
11
- * Represents a button in {@link Toolbar} on React Native.
12
- *
13
- * @extends AbstractToolbarButton
14
- */
15
-class ToolbarButton extends AbstractToolbarButton {
16
-    /**
17
-     * {@code ToolbarButton} component's property types.
18
-     *
19
-     * @static
20
-     */
21
-    static propTypes = {
22
-        ...AbstractToolbarButton.propTypes,
23
-
24
-        /**
25
-         * Indicates whether this {@code ToolbarButton} is disabled.
26
-         */
27
-        disabled: PropTypes.bool
28
-    };
29
-
30
-    /**
31
-     * Renders the button of this {@code ToolbarButton}.
32
-     *
33
-     * @param {Object} children - The children, if any, to be rendered inside
34
-     * the button. Presumably, contains the icon of this {@code ToolbarButton}.
35
-     * @protected
36
-     * @returns {ReactElement} The button of this {@code ToolbarButton}.
37
-     */
38
-    _renderButton(children) {
39
-        const props = {};
40
-
41
-        'accessibilityLabel' in this.props
42
-            && (props.accessibilityLabel = this.props.accessibilityLabel);
43
-        'disabled' in this.props && (props.disabled = this.props.disabled);
44
-        'onClick' in this.props && (props.onPress = this._onClick);
45
-        'style' in this.props && (props.style = this.props.style);
46
-        'underlayColor' in this.props
47
-            && (props.underlayColor = this.props.underlayColor);
48
-
49
-        return React.createElement(TouchableHighlight, props, children);
50
-    }
51
-
52
-    /**
53
-     * Renders the icon of this {@code ToolbarButton}.
54
-     *
55
-     * @inheritdoc
56
-     */
57
-    _renderIcon() {
58
-        return super._renderIcon(Icon);
59
-    }
60
-}
61
-
62
-export default connect()(ToolbarButton);

+ 113
- 116
react/features/toolbox/components/native/Toolbox.js View File

9
     isNarrowAspectRatio,
9
     isNarrowAspectRatio,
10
     makeAspectRatioAware
10
     makeAspectRatioAware
11
 } from '../../../base/responsive-ui';
11
 } from '../../../base/responsive-ui';
12
-import { ColorPalette } from '../../../base/styles';
13
 import { InviteButton } from '../../../invite';
12
 import { InviteButton } from '../../../invite';
14
-import { AudioRouteButton } from '../../../mobile/audio-mode';
15
-import { PictureInPictureButton } from '../../../mobile/picture-in-picture';
16
-import { RoomLockButton } from '../../../room-lock';
17
 
13
 
18
 import AudioMuteButton from '../AudioMuteButton';
14
 import AudioMuteButton from '../AudioMuteButton';
19
-import AudioOnlyButton from './AudioOnlyButton';
20
 import HangupButton from '../HangupButton';
15
 import HangupButton from '../HangupButton';
21
-import styles from './styles';
22
-import ToggleCameraButton from './ToggleCameraButton';
23
 import VideoMuteButton from '../VideoMuteButton';
16
 import VideoMuteButton from '../VideoMuteButton';
24
 
17
 
25
-/**
26
- * Styles for the hangup button.
27
- */
28
-const hangupButtonStyles = {
29
-    iconStyle: styles.whitePrimaryToolbarButtonIcon,
30
-    style: styles.hangup,
31
-    underlayColor: ColorPalette.buttonUnderlay
32
-};
18
+import OverflowMenuButton from './OverflowMenuButton';
19
+import styles, {
20
+    hangupButtonStyles,
21
+    toolbarButtonStyles,
22
+    toolbarToggledButtonStyles
23
+} from './styles';
33
 
24
 
34
 /**
25
 /**
35
- * Styles for buttons in the primary toolbar.
26
+ * Number of buttons in the toolbar.
36
  */
27
  */
37
-const primaryToolbarButtonStyles = {
38
-    iconStyle: styles.primaryToolbarButtonIcon,
39
-    style: styles.primaryToolbarButton
40
-};
28
+const NUM_TOOLBAR_BUTTONS = 4;
41
 
29
 
42
 /**
30
 /**
43
- * Styles for buttons in the primary toolbar.
31
+ * Factor relating the hangup button and other toolbar buttons.
44
  */
32
  */
45
-const primaryToolbarToggledButtonStyles = {
46
-    iconStyle: styles.whitePrimaryToolbarButtonIcon,
47
-    style: styles.whitePrimaryToolbarButton
48
-};
49
-
50
-/**
51
- * Styles for buttons in the secondary toolbar.
52
- */
53
-const secondaryToolbarButtonStyles = {
54
-    iconStyle: styles.secondaryToolbarButtonIcon,
55
-    style: styles.secondaryToolbarButton,
56
-    underlayColor: 'transparent'
57
-};
33
+const TOOLBAR_BUTTON_SIZE_FACTOR = 0.8;
58
 
34
 
59
 /**
35
 /**
60
  * The type of {@link Toolbox}'s React {@code Component} props.
36
  * The type of {@link Toolbox}'s React {@code Component} props.
62
 type Props = {
38
 type Props = {
63
 
39
 
64
     /**
40
     /**
65
-     * The indicator which determines whether the toolbox is enabled.
41
+     * The indicator which determines whether the toolbox is visible.
66
      */
42
      */
67
-    _enabled: boolean,
43
+    _visible: boolean,
68
 
44
 
69
     /**
45
     /**
70
-     * Flag showing whether toolbar is visible.
46
+     * The redux {@code dispatch} function.
71
      */
47
      */
72
-    _visible: boolean
48
+    dispatch: Function
49
+};
50
+
51
+/**
52
+ * The type of {@link Toolbox}'s React {@code Component} state.
53
+ */
54
+type State = {
55
+
56
+    /**
57
+     * The detected width for this component.
58
+     */
59
+    width: number
73
 };
60
 };
74
 
61
 
75
 /**
62
 /**
76
  * Implements the conference toolbox on React Native.
63
  * Implements the conference toolbox on React Native.
77
  */
64
  */
78
-class Toolbox extends Component<Props> {
65
+class Toolbox extends Component<Props, State> {
66
+    state = {
67
+        width: 0
68
+    };
69
+
79
     /**
70
     /**
80
-     * Implements React's {@link Component#render()}.
71
+     *  Initializes a new {@code Toolbox} instance.
81
      *
72
      *
82
      * @inheritdoc
73
      * @inheritdoc
83
-     * @returns {ReactElement}
84
      */
74
      */
85
-    render() {
86
-        if (!this.props._enabled) {
87
-            return null;
88
-        }
75
+    constructor(props: Props) {
76
+        super(props);
89
 
77
 
90
-        const toolboxStyle
91
-            = isNarrowAspectRatio(this)
92
-                ? styles.toolboxNarrow
93
-                : styles.toolboxWide;
94
-
95
-        return (
96
-            <Container
97
-                style = { toolboxStyle }
98
-                visible = { this.props._visible } >
99
-                { this._renderToolbars() }
100
-            </Container>
101
-        );
78
+        this._onLayout = this._onLayout.bind(this);
102
     }
79
     }
103
 
80
 
81
+    _onLayout: (Object) => void;
82
+
104
     /**
83
     /**
105
-     * Renders the toolbar which contains the primary buttons such as hangup,
106
-     * audio and video mute.
84
+     * Handles the "on layout" View's event and stores the width as state.
107
      *
85
      *
86
+     * @param {Object} event - The "on layout" event object/structure passed
87
+     * by react-native.
108
      * @private
88
      * @private
109
-     * @returns {ReactElement}
89
+     * @returns {void}
110
      */
90
      */
111
-    _renderPrimaryToolbar() {
112
-        return (
113
-            <View
114
-                key = 'primaryToolbar'
115
-                pointerEvents = 'box-none'
116
-                style = { styles.primaryToolbar }>
117
-                <AudioMuteButton
118
-                    styles = { primaryToolbarButtonStyles }
119
-                    toggledStyles = { primaryToolbarToggledButtonStyles } />
120
-                <HangupButton styles = { hangupButtonStyles } />
121
-                <VideoMuteButton
122
-                    styles = { primaryToolbarButtonStyles }
123
-                    toggledStyles = { primaryToolbarToggledButtonStyles } />
124
-            </View>
125
-        );
91
+    _onLayout({ nativeEvent: { layout: { width } } }) {
92
+        this.setState({ width });
126
     }
93
     }
127
 
94
 
128
     /**
95
     /**
129
-     * Renders the toolbar which contains the secondary buttons such as toggle
130
-     * camera facing mode.
96
+     * Calculates how large our toolbar buttons can be, given the available
97
+     * width. In the future we might want to have a size threshold, and once
98
+     * it's passed a completely different style could be used, akin to the web.
131
      *
99
      *
132
      * @private
100
      * @private
133
-     * @returns {ReactElement}
101
+     * @returns {number}
134
      */
102
      */
135
-    _renderSecondaryToolbar() {
136
-        return (
137
-            <View
138
-                key = 'secondaryToolbar'
139
-                pointerEvents = 'box-none'
140
-                style = { styles.secondaryToolbar }>
141
-                <AudioRouteButton styles = { secondaryToolbarButtonStyles } />
142
-                <ToggleCameraButton styles = { secondaryToolbarButtonStyles } />
143
-                <AudioOnlyButton styles = { secondaryToolbarButtonStyles } />
144
-                <RoomLockButton styles = { secondaryToolbarButtonStyles } />
145
-                <InviteButton styles = { secondaryToolbarButtonStyles } />
146
-                <PictureInPictureButton
147
-                    styles = { secondaryToolbarButtonStyles } />
148
-            </View>
149
-        );
103
+    _calculateToolbarButtonSize() {
104
+        const width = this.state.width;
105
+        const hangupButtonSize = styles.hangupButton.width;
106
+
107
+        let buttonSize
108
+            = (width - hangupButtonSize
109
+                - (NUM_TOOLBAR_BUTTONS * styles.toolbarButton.margin * 2))
110
+                    / NUM_TOOLBAR_BUTTONS;
111
+
112
+        // Make sure it's an even number.
113
+        buttonSize = 2 * Math.round(buttonSize / 2);
114
+
115
+        // The button should be at most 80% of the hangup button's size.
116
+        return Math.min(
117
+            buttonSize, hangupButtonSize * TOOLBAR_BUTTON_SIZE_FACTOR);
150
     }
118
     }
151
 
119
 
152
     /**
120
     /**
153
-     * Renders the primary and the secondary toolbars.
121
+     * Implements React's {@link Component#render()}.
154
      *
122
      *
155
-     * @private
156
-     * @returns {[ReactElement, ReactElement]}
123
+     * @inheritdoc
124
+     * @returns {ReactElement}
157
      */
125
      */
158
-    _renderToolbars() {
159
-        return [
160
-            this._renderSecondaryToolbar(),
161
-            this._renderPrimaryToolbar()
162
-        ];
126
+    render() {
127
+        const toolboxStyle
128
+            = isNarrowAspectRatio(this)
129
+                ? styles.toolboxNarrow
130
+                : styles.toolboxWide;
131
+        const { _visible } = this.props;
132
+        const buttonStyles = {
133
+            ...toolbarButtonStyles
134
+        };
135
+        const toggledButtonStyles = {
136
+            ...toolbarToggledButtonStyles
137
+        };
138
+
139
+        if (_visible && this.state.width) {
140
+            const buttonSize = this._calculateToolbarButtonSize();
141
+            const extraStyle = {
142
+                borderRadius: buttonSize / 2,
143
+                height: buttonSize,
144
+                width: buttonSize
145
+            };
146
+
147
+            buttonStyles.style = [ buttonStyles.style, extraStyle ];
148
+            toggledButtonStyles.style
149
+                = [ toggledButtonStyles.style, extraStyle ];
150
+        }
151
+
152
+        return (
153
+            <Container
154
+                onLayout = { this._onLayout }
155
+                style = { toolboxStyle }
156
+                visible = { _visible } >
157
+                <View
158
+                    pointerEvents = 'box-none'
159
+                    style = { styles.toolbar }>
160
+                    <InviteButton styles = { buttonStyles } />
161
+                    <AudioMuteButton
162
+                        styles = { buttonStyles }
163
+                        toggledStyles = { toggledButtonStyles } />
164
+                    <HangupButton styles = { hangupButtonStyles } />
165
+                    <VideoMuteButton
166
+                        styles = { buttonStyles }
167
+                        toggledStyles = { toggledButtonStyles } />
168
+                    <OverflowMenuButton
169
+                        styles = { buttonStyles }
170
+                        toggledStyles = { toggledButtonStyles } />
171
+                </View>
172
+            </Container>
173
+        );
163
     }
174
     }
164
 }
175
 }
165
 
176
 
179
     const { enabled, visible } = state['features/toolbox'];
190
     const { enabled, visible } = state['features/toolbox'];
180
 
191
 
181
     return {
192
     return {
182
-        /**
183
-         * The indicator which determines whether the toolbox is enabled.
184
-         *
185
-         * @private
186
-         * @type {boolean}
187
-         */
188
-        _enabled: enabled,
189
-
190
-        /**
191
-         * Flag showing whether toolbox is visible.
192
-         *
193
-         * @protected
194
-         * @type {boolean}
195
-         */
196
-        _visible: visible
193
+        _visible: enabled && visible
197
     };
194
     };
198
 }
195
 }
199
 
196
 

+ 0
- 1
react/features/toolbox/components/native/index.js View File

1
-export { default as ToolbarButton } from './ToolbarButton';
2
 export { default as Toolbox } from './Toolbox';
1
 export { default as Toolbox } from './Toolbox';

+ 118
- 120
react/features/toolbox/components/native/styles.js View File

1
 import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
1
 import { BoxModel, ColorPalette, createStyleSheet } from '../../../base/styles';
2
 
2
 
3
 /**
3
 /**
4
- * The base style for toolbars.
5
- *
6
- * @type {Object}
7
- */
8
-const _toolbar = {
9
-    flex: 0,
10
-    position: 'absolute'
11
-};
12
-
13
-/**
14
- * The base style of toolbar buttons (in primaryToolbar and secondaryToolbar).
15
- *
16
- * @type {Object}
4
+ * The style of toolbar buttons.
17
  */
5
  */
18
-const _toolbarButton = {
19
-    flex: 0,
20
-    justifyContent: 'center',
21
-    opacity: 0.7
22
-};
23
-
24
-/**
25
- * The base icon style of toolbar buttons (in primaryToolbar and
26
- * secondaryToolbar).
27
- *
28
- * @type {Object}
29
- */
30
-const _toolbarButtonIcon = {
31
-    alignSelf: 'center'
32
-};
33
-
34
-/**
35
- * The style of toolbar buttons in primaryToolbar.
36
- */
37
-const primaryToolbarButton = {
38
-    ..._toolbarButton,
6
+const toolbarButton = {
39
     backgroundColor: ColorPalette.white,
7
     backgroundColor: ColorPalette.white,
40
-    borderRadius: 30,
8
+    borderRadius: 20,
41
     borderWidth: 0,
9
     borderWidth: 0,
10
+    flex: 0,
42
     flexDirection: 'row',
11
     flexDirection: 'row',
43
-    height: 60,
12
+    height: 40,
13
+    justifyContent: 'center',
44
     margin: BoxModel.margin,
14
     margin: BoxModel.margin,
45
-    width: 60
15
+    marginBottom: BoxModel.margin / 2,
16
+    opacity: 0.7,
17
+    width: 40
46
 };
18
 };
47
 
19
 
48
 /**
20
 /**
49
- * The icon style of the toolbar buttons in primaryToolbar.
50
- *
51
- * @type {Object}
21
+ * The icon style of the toolbar buttons.
52
  */
22
  */
53
-const primaryToolbarButtonIcon = {
54
-    ..._toolbarButtonIcon,
23
+const toolbarButtonIcon = {
24
+    alignSelf: 'center',
55
     color: ColorPalette.darkGrey,
25
     color: ColorPalette.darkGrey,
56
-    fontSize: 24
57
-};
58
-
59
-/**
60
- * The icon style of the toolbar buttons in secondaryToolbar.
61
- *
62
- * @type {Object}
63
- */
64
-const secondaryToolbarButtonIcon = {
65
-    ..._toolbarButtonIcon,
66
-    color: ColorPalette.white,
67
-    fontSize: 18
26
+    fontSize: 22
68
 };
27
 };
69
 
28
 
70
 /**
29
 /**
71
- * The (conference) Toolbox/Toolbar related styles.
30
+ * The Toolbox and toolbar related styles.
72
  */
31
  */
73
-export default createStyleSheet({
32
+const styles = createStyleSheet({
74
     /**
33
     /**
75
-     * The style of the toolbar button in {@link #primaryToolbar} which
76
-     * hangs the current conference up.
34
+     * The style of the toolbar button which hangs the current conference up.
77
      */
35
      */
78
-    hangup: {
79
-        ...primaryToolbarButton,
80
-        backgroundColor: ColorPalette.red
36
+    hangupButton: {
37
+        ...toolbarButton,
38
+        backgroundColor: ColorPalette.red,
39
+        borderRadius: 30,
40
+        height: 60,
41
+        width: 60
81
     },
42
     },
82
 
43
 
83
     /**
44
     /**
84
-     * The icon style of toolbar buttons in {@link #primaryToolbar} which
85
-     * hangs the current conference up.
45
+     * The icon style of toolbar buttons which hangs the current conference up.
86
      */
46
      */
87
     hangupButtonIcon: {
47
     hangupButtonIcon: {
88
-        ...primaryToolbarButtonIcon,
89
-        color: ColorPalette.white
48
+        ...toolbarButtonIcon,
49
+        color: ColorPalette.white,
50
+        fontSize: 24
90
     },
51
     },
91
 
52
 
92
     /**
53
     /**
93
-     * The style of the toolbar which contains the primary buttons such as
94
-     * hangup, audio and video mute.
54
+     * The style of the toolbar.
95
      */
55
      */
96
-    primaryToolbar: {
97
-        ..._toolbar,
56
+    toolbar: {
57
+        alignItems: 'center',
98
         bottom: 0,
58
         bottom: 0,
59
+        flex: 0,
99
         flexDirection: 'row',
60
         flexDirection: 'row',
100
         justifyContent: 'center',
61
         justifyContent: 'center',
101
         left: 0,
62
         left: 0,
63
+        position: 'absolute',
102
         right: 0
64
         right: 0
103
     },
65
     },
104
 
66
 
105
     /**
67
     /**
106
-     * The style of toolbar buttons in {@link #primaryToolbar}.
107
-     */
108
-    primaryToolbarButton,
109
-
110
-    /**
111
-     * The icon style of the toolbar buttons in {@link #primaryToolbar}.
112
-     */
113
-    primaryToolbarButtonIcon,
114
-
115
-    /**
116
-     * The style of the toolbar which contains the secondary buttons such as
117
-     * toggle camera facing mode.
118
-     */
119
-    secondaryToolbar: {
120
-        ..._toolbar,
121
-        bottom: 0,
122
-        flexDirection: 'column',
123
-        right: 0,
124
-        top: 0
125
-    },
126
-
127
-    /**
128
-     * The style of toolbar buttons in {@link #secondaryToolbar}.
68
+     * The style of toolbar buttons.
129
      */
69
      */
130
-    secondaryToolbarButton: {
131
-        ..._toolbarButton,
132
-        backgroundColor: ColorPalette.darkGrey,
133
-        borderRadius: 20,
134
-        flexDirection: 'column',
135
-        height: 40,
136
-        margin: BoxModel.margin / 2,
137
-        width: 40
138
-    },
70
+    toolbarButton,
139
 
71
 
140
     /**
72
     /**
141
-     * The icon style of the toolbar buttons in {@link #secondaryToolbar}.
73
+     * The icon style of the toolbar buttons.
142
      */
74
      */
143
-    secondaryToolbarButtonIcon,
75
+    toolbarButtonIcon,
144
 
76
 
145
     /**
77
     /**
146
-     * The style of the root/top-level {@link Container} of {@link Toolbox}
147
-     * which contains {@link Toolbar}s. This is narrow layout version which
148
-     * spans from the top of the screen to the top of the filmstrip located at
149
-     * the bottom of the screen.
78
+     * The style of the root/top-level {@link Container} of {@link Toolbox}.
79
+     * This is the narrow layout version which locates the toolbar on top of
80
+     * the filmstrip, at the bottom of the screen.
150
      */
81
      */
151
     toolboxNarrow: {
82
     toolboxNarrow: {
152
         flexDirection: 'column',
83
         flexDirection: 'column',
154
     },
85
     },
155
 
86
 
156
     /**
87
     /**
157
-     * The style of the root/top-level {@link Container} of {@link Toolbox}
158
-     * which contains {@link Toolbar}s. This is wide layout version which spans
159
-     * from the top to the bottom of the screen and is located to the right of
160
-     * the filmstrip which is displayed as a column on the left side of the
161
-     * screen.
88
+     * The style of the root/top-level {@link Container} of {@link Toolbox}.
89
+     * This is the wide layout version which locates the toolbar at the bottom
90
+     * of the screen.
162
      */
91
      */
163
     toolboxWide: {
92
     toolboxWide: {
164
         bottom: 0,
93
         bottom: 0,
169
     },
98
     },
170
 
99
 
171
     /**
100
     /**
172
-     * The style of toolbar buttons in {@link #primaryToolbar} which display
173
-     * white icons.
101
+     * The style of toolbar buttons which display white icons.
174
      */
102
      */
175
-    whitePrimaryToolbarButton: {
176
-        ...primaryToolbarButton,
103
+    whiteToolbarButton: {
104
+        ...toolbarButton,
177
         backgroundColor: ColorPalette.buttonUnderlay
105
         backgroundColor: ColorPalette.buttonUnderlay
178
     },
106
     },
179
 
107
 
180
     /**
108
     /**
181
-     * The icon style of toolbar buttons in {@link #primaryToolbar} which
182
-     * display white icons.
109
+     * The icon style of toolbar buttons which display white icons.
183
      */
110
      */
184
-    whitePrimaryToolbarButtonIcon: {
185
-        ...primaryToolbarButtonIcon,
111
+    whiteToolbarButtonIcon: {
112
+        ...toolbarButtonIcon,
186
         color: ColorPalette.white
113
         color: ColorPalette.white
187
     }
114
     }
188
 });
115
 });
116
+
117
+export default styles;
118
+
119
+/**
120
+ * Styles for the hangup button.
121
+ */
122
+export const hangupButtonStyles = {
123
+    iconStyle: styles.whiteToolbarButtonIcon,
124
+    style: styles.hangupButton,
125
+    underlayColor: ColorPalette.buttonUnderlay
126
+};
127
+
128
+/**
129
+ * Styles for buttons in the toolbar.
130
+ */
131
+export const toolbarButtonStyles = {
132
+    iconStyle: styles.toolbarButtonIcon,
133
+    style: styles.toolbarButton
134
+};
135
+
136
+/**
137
+ * Styles for toggled buttons in the toolbar.
138
+ */
139
+export const toolbarToggledButtonStyles = {
140
+    iconStyle: styles.whiteToolbarButtonIcon,
141
+    style: styles.whiteToolbarButton
142
+};
143
+
144
+/**
145
+ * Styles for the {@code OverflowMenu} items.
146
+ *
147
+ * These have been implemented as per the Material Design guidelines:
148
+ * {@link https://material.io/guidelines/components/bottom-sheets.html}.
149
+ */
150
+const overflowMenuStyles = createStyleSheet({
151
+    /**
152
+     * Container style for a {@code ToolboxItem} rendered in the
153
+     * {@code OverflowMenu}.
154
+     */
155
+    container: {
156
+        alignItems: 'center',
157
+        flexDirection: 'row',
158
+        height: 48
159
+    },
160
+
161
+    /**
162
+     * Style for the {@code Icon} element in a {@code ToolboxItem} rendered in
163
+     * the {@code OverflowMenu}.
164
+     */
165
+    icon: {
166
+        fontSize: 24
167
+    },
168
+
169
+    /**
170
+     * Style for the label in a {@code ToolboxItem} rendered in the
171
+     * {@code OverflowMenu}.
172
+     */
173
+    label: {
174
+        flex: 1,
175
+        fontSize: 16,
176
+        marginLeft: 32,
177
+        opacity: 0.87
178
+    }
179
+});
180
+
181
+export const overflowMenuItemStyles = {
182
+    iconStyle: overflowMenuStyles.icon,
183
+    labelStyle: overflowMenuStyles.label,
184
+    style: overflowMenuStyles.container,
185
+    underlayColor: '#eee'
186
+};

Loading…
Cancel
Save