瀏覽代碼

[RN] "The View is never the target of touch events"

In preparation for "pinch to zoom" support in desktop streams on mobile, make
certain Views not intervene in touch event handling. While the modification is
necessary for "pinch to zoom" which is coming later, it really makes sense for
the modified Views to not be involved in touching because they're used to aid
layout and/or animations and are to behave to the user as if they're not there.
master
Zoltan Bettenbuk 7 年之前
父節點
當前提交
cb70c084b3

+ 3
- 1
react/features/base/media/components/native/VideoTrack.js 查看文件

58
         return (
58
         return (
59
             <View style = { styles.video } >
59
             <View style = { styles.video } >
60
                 { super.render() }
60
                 { super.render() }
61
-                <Animated.View style = { animatedStyles } />
61
+                <Animated.View
62
+                    pointerEvents = 'none'
63
+                    style = { animatedStyles } />
62
             </View>
64
             </View>
63
         );
65
         );
64
     }
66
     }

+ 4
- 2
react/features/base/participants/components/ParticipantView.native.js 查看文件

158
         };
158
         };
159
 
159
 
160
         return (
160
         return (
161
-            <View style = { containerStyle } >
162
-                <Text style = { styles.connectionInfoText } >
161
+            <View
162
+                pointerEvents = 'box-none'
163
+                style = { containerStyle }>
164
+                <Text style = { styles.connectionInfoText }>
163
                     { t(messageKey, { displayName }) }
165
                     { t(messageKey, { displayName }) }
164
                 </Text>
166
                 </Text>
165
             </View>
167
             </View>

+ 9
- 2
react/features/base/react/components/native/Container.js 查看文件

43
             return null;
43
             return null;
44
         }
44
         }
45
 
45
 
46
-        let element = super._render(View, props);
46
+        const onClickOrTouchFeedback = onClick || touchFeedback;
47
+        let element
48
+            = super._render(
49
+                View,
50
+                {
51
+                    pointerEvents: onClickOrTouchFeedback ? 'auto' : 'box-none',
52
+                    ...props
53
+                });
47
 
54
 
48
         // onClick & touchFeedback
55
         // onClick & touchFeedback
49
-        if (element && (onClick || touchFeedback)) {
56
+        if (element && onClickOrTouchFeedback) {
50
             element
57
             element
51
                 = React.createElement(
58
                 = React.createElement(
52
                     touchFeedback
59
                     touchFeedback

+ 9
- 3
react/features/base/react/components/native/TintedView.js 查看文件

135
     render() {
135
     render() {
136
         // XXX Don't tint the children, tint the background only.
136
         // XXX Don't tint the children, tint the background only.
137
         return (
137
         return (
138
-            <View style = { BASE_STYLE }>
139
-                <View style = { this.state.style } />
140
-                <View style = { BASE_STYLE }>
138
+            <View
139
+                pointerEvents = 'box-none'
140
+                style = { BASE_STYLE }>
141
+                <View
142
+                    pointerEvents = 'none'
143
+                    style = { this.state.style } />
144
+                <View
145
+                    pointerEvents = 'box-none'
146
+                    style = { BASE_STYLE }>
141
                     { this.props.children }
147
                     { this.props.children }
142
                 </View>
148
                 </View>
143
             </View>
149
             </View>

+ 3
- 1
react/features/conference/components/Conference.native.js 查看文件

218
                         </TintedView>
218
                         </TintedView>
219
                 }
219
                 }
220
 
220
 
221
-                <View style = { styles.toolboxAndFilmstripContainer } >
221
+                <View
222
+                    pointerEvents = 'box-none'
223
+                    style = { styles.toolboxAndFilmstripContainer }>
222
                     {/*
224
                     {/*
223
                       * The Toolbox is in a stacking layer bellow the Filmstrip.
225
                       * The Toolbox is in a stacking layer bellow the Filmstrip.
224
                       */}
226
                       */}

+ 2
- 0
react/features/toolbox/components/Toolbox.native.js 查看文件

188
         return (
188
         return (
189
             <View
189
             <View
190
                 key = 'primaryToolbar'
190
                 key = 'primaryToolbar'
191
+                pointerEvents = 'box-none'
191
                 style = { styles.primaryToolbar }>
192
                 style = { styles.primaryToolbar }>
192
                 <AudioMuteButton buttonStyles = { audioButtonStyles } />
193
                 <AudioMuteButton buttonStyles = { audioButtonStyles } />
193
                 <HangupButton />
194
                 <HangupButton />
219
         return (
220
         return (
220
             <View
221
             <View
221
                 key = 'secondaryToolbar'
222
                 key = 'secondaryToolbar'
223
+                pointerEvents = 'box-none'
222
                 style = { styles.secondaryToolbar }>
224
                 style = { styles.secondaryToolbar }>
223
                 {
225
                 {
224
                     AudioRouteButton
226
                     AudioRouteButton

Loading…
取消
儲存