@stream-io/video-react-native-sdk 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/dist/commonjs/components/Call/CallContent/CallContent.js +2 -2
- package/dist/commonjs/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/commonjs/components/Call/CallControls/CallControls.js +2 -2
- package/dist/commonjs/components/Call/CallControls/CallControls.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js +2 -2
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js +2 -2
- package/dist/commonjs/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +22 -6
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js +23 -11
- package/dist/commonjs/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js +21 -8
- package/dist/commonjs/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js +5 -3
- package/dist/commonjs/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
- package/dist/commonjs/components/Call/RingingCallContent/UserInfo.js +1 -1
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +11 -10
- package/dist/commonjs/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +1 -1
- package/dist/commonjs/constants/index.js +1 -1
- package/dist/commonjs/theme/theme.js +10 -4
- package/dist/commonjs/theme/theme.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallContent/CallContent.js +2 -2
- package/dist/module/components/Call/CallContent/CallContent.js.map +1 -1
- package/dist/module/components/Call/CallControls/CallControls.js +2 -2
- package/dist/module/components/Call/CallControls/CallControls.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js +2 -2
- package/dist/module/components/Call/CallLayout/CallParticipantsGrid.js.map +1 -1
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js +2 -2
- package/dist/module/components/Call/CallLayout/CallParticipantsSpotlight.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js +22 -6
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js +23 -11
- package/dist/module/components/Call/RingingCallContent/IncomingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js +21 -8
- package/dist/module/components/Call/RingingCallContent/OutgoingCall.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/RingingCallContent.js +5 -3
- package/dist/module/components/Call/RingingCallContent/RingingCallContent.js.map +1 -1
- package/dist/module/components/Call/RingingCallContent/UserInfo.js +1 -1
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js +12 -11
- package/dist/module/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.js.map +1 -1
- package/dist/module/constants/index.js +1 -1
- package/dist/module/theme/theme.js +10 -4
- package/dist/module/theme/theme.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts +6 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/IncomingCall.d.ts +15 -6
- package/dist/typescript/components/Call/RingingCallContent/IncomingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts +6 -1
- package/dist/typescript/components/Call/RingingCallContent/OutgoingCall.d.ts.map +1 -1
- package/dist/typescript/components/Call/RingingCallContent/RingingCallContent.d.ts.map +1 -1
- package/dist/typescript/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.d.ts.map +1 -1
- package/dist/typescript/constants/index.d.ts +1 -1
- package/dist/typescript/theme/theme.d.ts +6 -0
- package/dist/typescript/theme/theme.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/expo-config-plugin/dist/common/addNewLinesToAppDelegate.d.ts +1 -0
- package/expo-config-plugin/dist/common/addNewLinesToAppDelegate.js +17 -0
- package/expo-config-plugin/dist/common/types.d.ts +8 -0
- package/expo-config-plugin/dist/common/types.js +2 -0
- package/expo-config-plugin/dist/index.js +4 -0
- package/expo-config-plugin/dist/withAppBuildGradle.d.ts +3 -0
- package/expo-config-plugin/dist/withAppBuildGradle.js +21 -0
- package/expo-config-plugin/dist/withBuildProperties.d.ts +3 -0
- package/expo-config-plugin/dist/withBuildProperties.js +13 -0
- package/package.json +15 -5
- package/src/components/Call/CallContent/CallContent.tsx +2 -2
- package/src/components/Call/CallControls/CallControls.tsx +2 -2
- package/src/components/Call/CallLayout/CallParticipantsGrid.tsx +2 -2
- package/src/components/Call/CallLayout/CallParticipantsSpotlight.tsx +2 -2
- package/src/components/Call/Lobby/Lobby.tsx +32 -11
- package/src/components/Call/RingingCallContent/IncomingCall.tsx +54 -32
- package/src/components/Call/RingingCallContent/OutgoingCall.tsx +40 -24
- package/src/components/Call/RingingCallContent/RingingCallContent.tsx +7 -3
- package/src/components/Call/RingingCallContent/UserInfo.tsx +1 -1
- package/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx +43 -51
- package/src/constants/index.ts +1 -1
- package/src/theme/theme.ts +16 -4
- package/src/version.ts +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const expo_build_properties_1 = require("expo-build-properties");
|
|
4
|
+
const withStreamVideoReactNativeBuildGradle = (configuration) => {
|
|
5
|
+
return (0, expo_build_properties_1.withBuildProperties)(configuration, {
|
|
6
|
+
android: {
|
|
7
|
+
extraProguardRules: `
|
|
8
|
+
-keep class org.webrtc.** { *; }
|
|
9
|
+
`,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
exports.default = withStreamVideoReactNativeBuildGradle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stream-io/video-react-native-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"packageManager": "yarn@3.2.4",
|
|
5
5
|
"main": "dist/commonjs/index.js",
|
|
6
6
|
"module": "dist/module/index.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"postinstall": "yarn copy-version",
|
|
15
15
|
"clean": "rimraf dist && rimraf expo-config-plugin/dist",
|
|
16
16
|
"start": "yarn copy-version && tsc --project tsconfig.json --watch",
|
|
17
|
-
"build:expo-plugin": "rimraf plugin/dist && tsc --project expo-config-plugin/tsconfig.json",
|
|
17
|
+
"build:expo-plugin": "rimraf expo-config-plugin/dist && tsc --project expo-config-plugin/tsconfig.json",
|
|
18
18
|
"build": "yarn clean && yarn copy-version && bob build && yarn build:expo-plugin",
|
|
19
19
|
"test:expo-plugin": "jest expo-config-plugin --coverage",
|
|
20
20
|
"test": "jest --coverage && yarn test:expo-plugin",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"package.json",
|
|
31
31
|
"app.plugin.js",
|
|
32
32
|
"expo-config-plugin/README.md",
|
|
33
|
-
"expo-config-plugin/dist
|
|
33
|
+
"expo-config-plugin/dist/**/*",
|
|
34
34
|
"!expo-config-plugin/src/*",
|
|
35
35
|
"!expo-config-plugin/fixtures/*",
|
|
36
36
|
"!ios/build",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@stream-io/i18n": "^0.1.2",
|
|
49
|
-
"@stream-io/video-client": "^0.3.
|
|
50
|
-
"@stream-io/video-react-bindings": "^0.2.
|
|
49
|
+
"@stream-io/video-client": "^0.3.33",
|
|
50
|
+
"@stream-io/video-react-bindings": "^0.2.34",
|
|
51
51
|
"intl-pluralrules": "2.0.1",
|
|
52
52
|
"lodash.merge": "^4.6.2",
|
|
53
53
|
"react-native-url-polyfill": "1.3.0",
|
|
@@ -60,6 +60,8 @@
|
|
|
60
60
|
"@react-native-firebase/app": ">=17.5.0",
|
|
61
61
|
"@react-native-firebase/messaging": ">=17.5.0",
|
|
62
62
|
"@stream-io/react-native-webrtc": ">=104.0.1",
|
|
63
|
+
"expo": ">=47.0.0",
|
|
64
|
+
"expo-build-properties": "*",
|
|
63
65
|
"expo-notifications": "*",
|
|
64
66
|
"expo-task-manager": "*",
|
|
65
67
|
"react": ">=17.0.0",
|
|
@@ -81,6 +83,12 @@
|
|
|
81
83
|
"@react-native-firebase/messaging": {
|
|
82
84
|
"optional": true
|
|
83
85
|
},
|
|
86
|
+
"expo": {
|
|
87
|
+
"optional": true
|
|
88
|
+
},
|
|
89
|
+
"expo-build-properties": {
|
|
90
|
+
"optional": true
|
|
91
|
+
},
|
|
84
92
|
"expo-notifications": {
|
|
85
93
|
"optional": true
|
|
86
94
|
},
|
|
@@ -119,6 +127,8 @@
|
|
|
119
127
|
"@types/react-native": "^0.70.4",
|
|
120
128
|
"@types/react-native-incall-manager": "^3.2.1",
|
|
121
129
|
"@types/react-test-renderer": "^18",
|
|
130
|
+
"expo": "49.0.13",
|
|
131
|
+
"expo-build-properties": "^0.5.1",
|
|
122
132
|
"expo-modules-core": "1.5.11",
|
|
123
133
|
"expo-notifications": "0.20.1",
|
|
124
134
|
"expo-task-manager": "11.3.0",
|
|
@@ -174,12 +174,12 @@ export const CallContent = ({
|
|
|
174
174
|
supportedReactions,
|
|
175
175
|
};
|
|
176
176
|
|
|
177
|
-
const
|
|
177
|
+
const landscapeStyles: ViewStyle = {
|
|
178
178
|
flexDirection: landscape ? 'row' : 'column',
|
|
179
179
|
};
|
|
180
180
|
|
|
181
181
|
return (
|
|
182
|
-
<View style={[styles.container, callContent.container,
|
|
182
|
+
<View style={[styles.container, callContent.container, landscapeStyles]}>
|
|
183
183
|
<View style={[styles.container, callContent.callParticipantsContainer]}>
|
|
184
184
|
<View
|
|
185
185
|
style={[styles.view, callContent.topContainer]}
|
|
@@ -31,7 +31,7 @@ export const CallControls = ({
|
|
|
31
31
|
const {
|
|
32
32
|
theme: { colors, callControls },
|
|
33
33
|
} = useTheme();
|
|
34
|
-
const
|
|
34
|
+
const landscapeStyles: ViewStyle = {
|
|
35
35
|
flexDirection: landscape ? 'column-reverse' : 'row',
|
|
36
36
|
paddingHorizontal: landscape ? 12 : 0,
|
|
37
37
|
paddingVertical: landscape ? 0 : 12,
|
|
@@ -42,7 +42,7 @@ export const CallControls = ({
|
|
|
42
42
|
styles.container,
|
|
43
43
|
{ backgroundColor: colors.static_grey },
|
|
44
44
|
callControls.container,
|
|
45
|
-
|
|
45
|
+
landscapeStyles,
|
|
46
46
|
style,
|
|
47
47
|
]}
|
|
48
48
|
>
|
|
@@ -54,7 +54,7 @@ export const CallParticipantsGrid = ({
|
|
|
54
54
|
// we debounce the participants arrays to avoid unnecessary rerenders that happen when participant tracks are all subscribed simultaneously
|
|
55
55
|
const remoteParticipants = useDebouncedValue(_remoteParticipants, 300);
|
|
56
56
|
const allParticipants = useDebouncedValue(_allParticipants, 300);
|
|
57
|
-
const
|
|
57
|
+
const landscapeStyles: ViewStyle = {
|
|
58
58
|
flexDirection: landscape ? 'row' : 'column',
|
|
59
59
|
};
|
|
60
60
|
|
|
@@ -80,7 +80,7 @@ export const CallParticipantsGrid = ({
|
|
|
80
80
|
<View
|
|
81
81
|
style={[
|
|
82
82
|
styles.container,
|
|
83
|
-
|
|
83
|
+
landscapeStyles,
|
|
84
84
|
{ backgroundColor: colors.dark_gray },
|
|
85
85
|
callParticipantsGrid.container,
|
|
86
86
|
]}
|
|
@@ -75,7 +75,7 @@ export const CallParticipantsSpotlight = ({
|
|
|
75
75
|
ParticipantView,
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
const
|
|
78
|
+
const landscapeStyles: ViewStyle = {
|
|
79
79
|
flexDirection: landscape ? 'row' : 'column',
|
|
80
80
|
};
|
|
81
81
|
|
|
@@ -88,7 +88,7 @@ export const CallParticipantsSpotlight = ({
|
|
|
88
88
|
testID={ComponentTestIds.CALL_PARTICIPANTS_SPOTLIGHT}
|
|
89
89
|
style={[
|
|
90
90
|
styles.container,
|
|
91
|
-
|
|
91
|
+
landscapeStyles,
|
|
92
92
|
{
|
|
93
93
|
backgroundColor: colors.dark_gray,
|
|
94
94
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ComponentType } from 'react';
|
|
2
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
import { StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
3
3
|
import { MicOff } from '../../../icons';
|
|
4
4
|
import {
|
|
5
5
|
useCall,
|
|
@@ -40,6 +40,11 @@ export type LobbyProps = {
|
|
|
40
40
|
* Component to customize the Join Call Button in the Lobby component.
|
|
41
41
|
*/
|
|
42
42
|
JoinCallButton?: ComponentType<JoinCallButtonProps> | null;
|
|
43
|
+
/**
|
|
44
|
+
* Check if device is in landscape mode.
|
|
45
|
+
* This will apply the landscape mode styles to the component.
|
|
46
|
+
*/
|
|
47
|
+
landscape?: boolean;
|
|
43
48
|
/**
|
|
44
49
|
* Component to customize the Lobby Footer in the Lobby component.
|
|
45
50
|
*/
|
|
@@ -53,6 +58,7 @@ export const Lobby = ({
|
|
|
53
58
|
onJoinCallHandler,
|
|
54
59
|
LobbyControls = DefaultLobbyControls,
|
|
55
60
|
JoinCallButton = DefaultJoinCallButton,
|
|
61
|
+
landscape = false,
|
|
56
62
|
LobbyFooter = DefaultLobbyFooter,
|
|
57
63
|
}: LobbyProps) => {
|
|
58
64
|
const {
|
|
@@ -75,16 +81,21 @@ export const Lobby = ({
|
|
|
75
81
|
name: connectedUser?.name,
|
|
76
82
|
} as StreamVideoParticipant;
|
|
77
83
|
|
|
84
|
+
const landscapeStyles: ViewStyle = {
|
|
85
|
+
flexDirection: landscape ? 'row' : 'column',
|
|
86
|
+
};
|
|
87
|
+
|
|
78
88
|
return (
|
|
79
89
|
<View
|
|
80
90
|
style={[
|
|
81
91
|
styles.container,
|
|
92
|
+
landscapeStyles,
|
|
82
93
|
{ backgroundColor: colors.static_grey },
|
|
83
94
|
lobby.container,
|
|
84
95
|
]}
|
|
85
96
|
>
|
|
86
97
|
{connectedUser && (
|
|
87
|
-
|
|
98
|
+
<View style={[styles.topContainer, lobby.topContainer]}>
|
|
88
99
|
<Text
|
|
89
100
|
style={[
|
|
90
101
|
styles.heading,
|
|
@@ -126,15 +137,17 @@ export const Lobby = ({
|
|
|
126
137
|
)}
|
|
127
138
|
<ParticipantStatus />
|
|
128
139
|
</View>
|
|
129
|
-
|
|
130
|
-
</>
|
|
131
|
-
)}
|
|
132
|
-
{LobbyFooter && (
|
|
133
|
-
<LobbyFooter
|
|
134
|
-
JoinCallButton={JoinCallButton}
|
|
135
|
-
onJoinCallHandler={onJoinCallHandler}
|
|
136
|
-
/>
|
|
140
|
+
</View>
|
|
137
141
|
)}
|
|
142
|
+
<View style={[styles.bottomContainer, lobby.bottomContainer]}>
|
|
143
|
+
{LobbyControls && <LobbyControls />}
|
|
144
|
+
{LobbyFooter && (
|
|
145
|
+
<LobbyFooter
|
|
146
|
+
JoinCallButton={JoinCallButton}
|
|
147
|
+
onJoinCallHandler={onJoinCallHandler}
|
|
148
|
+
/>
|
|
149
|
+
)}
|
|
150
|
+
</View>
|
|
138
151
|
</View>
|
|
139
152
|
);
|
|
140
153
|
};
|
|
@@ -195,13 +208,16 @@ const styles = StyleSheet.create({
|
|
|
195
208
|
container: {
|
|
196
209
|
flex: 1,
|
|
197
210
|
justifyContent: 'center',
|
|
211
|
+
},
|
|
212
|
+
topContainer: {
|
|
213
|
+
flex: 2,
|
|
214
|
+
justifyContent: 'space-evenly',
|
|
198
215
|
paddingHorizontal: 12,
|
|
199
216
|
},
|
|
200
217
|
heading: {
|
|
201
218
|
textAlign: 'center',
|
|
202
219
|
},
|
|
203
220
|
subHeading: {
|
|
204
|
-
marginBottom: 16,
|
|
205
221
|
textAlign: 'center',
|
|
206
222
|
},
|
|
207
223
|
videoContainer: {
|
|
@@ -213,6 +229,11 @@ const styles = StyleSheet.create({
|
|
|
213
229
|
padding: 8,
|
|
214
230
|
},
|
|
215
231
|
topView: {},
|
|
232
|
+
bottomContainer: {
|
|
233
|
+
flex: 1,
|
|
234
|
+
justifyContent: 'space-evenly',
|
|
235
|
+
paddingHorizontal: 12,
|
|
236
|
+
},
|
|
216
237
|
participantStatusContainer: {
|
|
217
238
|
alignSelf: 'flex-start',
|
|
218
239
|
flexDirection: 'row',
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
ImageBackground,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
Text,
|
|
6
|
+
View,
|
|
7
|
+
ViewStyle,
|
|
8
|
+
} from 'react-native';
|
|
3
9
|
import {
|
|
4
10
|
useCallStateHooks,
|
|
5
11
|
useConnectedUser,
|
|
@@ -28,6 +34,11 @@ export type IncomingCallProps = IncomingCallControlsProps & {
|
|
|
28
34
|
* Prop to customize the IncomingCall controls.
|
|
29
35
|
*/
|
|
30
36
|
IncomingCallControls?: React.ComponentType<IncomingCallControlsProps> | null;
|
|
37
|
+
/**
|
|
38
|
+
* Check if device is in landscape mode.
|
|
39
|
+
* This will apply the landscape mode styles to the component.
|
|
40
|
+
*/
|
|
41
|
+
landscape?: boolean;
|
|
31
42
|
};
|
|
32
43
|
|
|
33
44
|
/**
|
|
@@ -39,45 +50,59 @@ export const IncomingCall = ({
|
|
|
39
50
|
onRejectCallHandler,
|
|
40
51
|
CallTopView = DefaultCallTopView,
|
|
41
52
|
IncomingCallControls = DefaultIncomingCallControls,
|
|
53
|
+
landscape,
|
|
42
54
|
}: IncomingCallProps) => {
|
|
43
55
|
const { t } = useI18n();
|
|
44
56
|
const {
|
|
45
57
|
theme: { colors, incomingCall, typefaces },
|
|
46
58
|
} = useTheme();
|
|
47
59
|
|
|
60
|
+
const landscapeContentStyles: ViewStyle = {
|
|
61
|
+
flexDirection: landscape ? 'row' : 'column',
|
|
62
|
+
};
|
|
63
|
+
|
|
48
64
|
return (
|
|
49
65
|
<Background>
|
|
50
66
|
{CallTopView && <CallTopView />}
|
|
51
|
-
<View style={[styles.content, incomingCall.content]}>
|
|
52
|
-
<UserInfo />
|
|
53
|
-
<Text
|
|
54
|
-
style={[
|
|
55
|
-
styles.incomingCallText,
|
|
56
|
-
{ color: colors.static_white },
|
|
57
|
-
typefaces.heading6,
|
|
58
|
-
incomingCall.incomingCallText,
|
|
59
|
-
]}
|
|
60
|
-
>
|
|
61
|
-
{t('Incoming Call...')}
|
|
62
|
-
</Text>
|
|
63
|
-
</View>
|
|
64
67
|
<View
|
|
65
|
-
style={[styles.
|
|
68
|
+
style={[styles.content, landscapeContentStyles, incomingCall.content]}
|
|
66
69
|
>
|
|
67
|
-
{
|
|
68
|
-
<
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
<View style={[styles.topContainer, incomingCall.topContainer]}>
|
|
71
|
+
<UserInfo />
|
|
72
|
+
<Text
|
|
73
|
+
style={[
|
|
74
|
+
styles.incomingCallText,
|
|
75
|
+
{ color: colors.static_white },
|
|
76
|
+
typefaces.heading6,
|
|
77
|
+
incomingCall.incomingCallText,
|
|
78
|
+
]}
|
|
79
|
+
>
|
|
80
|
+
{t('Incoming Call...')}
|
|
81
|
+
</Text>
|
|
82
|
+
</View>
|
|
83
|
+
<View style={[styles.bottomContainer, incomingCall.bottomContainer]}>
|
|
84
|
+
<View
|
|
85
|
+
style={[
|
|
86
|
+
styles.incomingCallControls,
|
|
87
|
+
incomingCall.incomingCallControls,
|
|
88
|
+
]}
|
|
89
|
+
>
|
|
90
|
+
{IncomingCallControls && (
|
|
91
|
+
<IncomingCallControls
|
|
92
|
+
onAcceptCallHandler={onAcceptCallHandler}
|
|
93
|
+
onRejectCallHandler={onRejectCallHandler}
|
|
94
|
+
/>
|
|
95
|
+
)}
|
|
96
|
+
</View>
|
|
97
|
+
</View>
|
|
73
98
|
</View>
|
|
74
99
|
</Background>
|
|
75
100
|
);
|
|
76
101
|
};
|
|
77
102
|
|
|
78
|
-
const Background: React.FunctionComponent<{
|
|
79
|
-
children
|
|
80
|
-
}) => {
|
|
103
|
+
const Background: React.FunctionComponent<{
|
|
104
|
+
children: React.ReactNode;
|
|
105
|
+
}> = ({ children }) => {
|
|
81
106
|
const {
|
|
82
107
|
theme: { colors, incomingCall },
|
|
83
108
|
} = useTheme();
|
|
@@ -99,7 +124,6 @@ const Background: React.FunctionComponent<{ children: React.ReactNode }> = ({
|
|
|
99
124
|
uri: avatarsToShow[0],
|
|
100
125
|
}}
|
|
101
126
|
style={[
|
|
102
|
-
StyleSheet.absoluteFill,
|
|
103
127
|
styles.background,
|
|
104
128
|
{ backgroundColor: colors.static_grey },
|
|
105
129
|
incomingCall.background,
|
|
@@ -112,7 +136,6 @@ const Background: React.FunctionComponent<{ children: React.ReactNode }> = ({
|
|
|
112
136
|
return (
|
|
113
137
|
<View
|
|
114
138
|
style={[
|
|
115
|
-
StyleSheet.absoluteFill,
|
|
116
139
|
styles.background,
|
|
117
140
|
{ backgroundColor: colors.static_grey },
|
|
118
141
|
incomingCall.background,
|
|
@@ -128,16 +151,15 @@ export const styles = StyleSheet.create({
|
|
|
128
151
|
flex: 1,
|
|
129
152
|
},
|
|
130
153
|
content: {
|
|
131
|
-
|
|
154
|
+
flex: 1,
|
|
132
155
|
},
|
|
156
|
+
topContainer: { flex: 1 },
|
|
133
157
|
incomingCallText: {
|
|
134
|
-
marginTop:
|
|
158
|
+
marginTop: 8,
|
|
135
159
|
textAlign: 'center',
|
|
136
160
|
},
|
|
161
|
+
bottomContainer: { flex: 1, justifyContent: 'center' },
|
|
137
162
|
incomingCallControls: {
|
|
138
|
-
|
|
139
|
-
bottom: 64,
|
|
140
|
-
left: 0,
|
|
141
|
-
right: 0,
|
|
163
|
+
justifyContent: 'center',
|
|
142
164
|
},
|
|
143
165
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
import { StyleSheet, Text, View, ViewStyle } from 'react-native';
|
|
3
3
|
import { UserInfo } from './UserInfo';
|
|
4
4
|
import { Z_INDEX } from '../../../constants';
|
|
5
5
|
import {
|
|
@@ -31,6 +31,11 @@ export type OutgoingCallProps = OutgoingCallControlsProps & {
|
|
|
31
31
|
* Prop to customize the OutgoingCall controls.
|
|
32
32
|
*/
|
|
33
33
|
OutgoingCallControls?: React.ComponentType<OutgoingCallControlsProps> | null;
|
|
34
|
+
/**
|
|
35
|
+
* Check if device is in landscape mode.
|
|
36
|
+
* This will apply the landscape mode styles to the component.
|
|
37
|
+
*/
|
|
38
|
+
landscape?: boolean;
|
|
34
39
|
};
|
|
35
40
|
|
|
36
41
|
/**
|
|
@@ -40,12 +45,17 @@ export type OutgoingCallProps = OutgoingCallControlsProps & {
|
|
|
40
45
|
export const OutgoingCall = ({
|
|
41
46
|
CallTopView = DefaultCallTopView,
|
|
42
47
|
OutgoingCallControls = DefaultOutgoingCallControls,
|
|
48
|
+
landscape,
|
|
43
49
|
}: OutgoingCallProps) => {
|
|
44
50
|
const {
|
|
45
51
|
theme: { colors, typefaces, outgoingCall },
|
|
46
52
|
} = useTheme();
|
|
47
53
|
const { t } = useI18n();
|
|
48
54
|
|
|
55
|
+
const landscapeContentStyles: ViewStyle = {
|
|
56
|
+
flexDirection: landscape ? 'row' : 'column',
|
|
57
|
+
};
|
|
58
|
+
|
|
49
59
|
return (
|
|
50
60
|
<>
|
|
51
61
|
<View
|
|
@@ -56,28 +66,35 @@ export const OutgoingCall = ({
|
|
|
56
66
|
]}
|
|
57
67
|
>
|
|
58
68
|
{CallTopView && <CallTopView />}
|
|
59
|
-
<View style={[styles.content, outgoingCall.content]}>
|
|
60
|
-
<UserInfo />
|
|
61
|
-
<Text
|
|
62
|
-
style={[
|
|
63
|
-
styles.callingText,
|
|
64
|
-
{ color: colors.static_white },
|
|
65
|
-
typefaces.heading6,
|
|
66
|
-
outgoingCall.callingText,
|
|
67
|
-
]}
|
|
68
|
-
>
|
|
69
|
-
{t('Calling...')}
|
|
70
|
-
</Text>
|
|
71
|
-
</View>
|
|
72
69
|
<View
|
|
73
|
-
style={[
|
|
74
|
-
styles.outgoingCallControls,
|
|
75
|
-
outgoingCall.outgoingCallControls,
|
|
76
|
-
]}
|
|
70
|
+
style={[styles.content, landscapeContentStyles, outgoingCall.content]}
|
|
77
71
|
>
|
|
78
|
-
{
|
|
72
|
+
<View style={[styles.topContainer, outgoingCall.topContainer]}>
|
|
73
|
+
<UserInfo />
|
|
74
|
+
<Text
|
|
75
|
+
style={[
|
|
76
|
+
styles.callingText,
|
|
77
|
+
{ color: colors.static_white },
|
|
78
|
+
typefaces.heading6,
|
|
79
|
+
outgoingCall.callingText,
|
|
80
|
+
]}
|
|
81
|
+
>
|
|
82
|
+
{t('Calling...')}
|
|
83
|
+
</Text>
|
|
84
|
+
</View>
|
|
85
|
+
<View style={[styles.bottomContainer, outgoingCall.bottomContainer]}>
|
|
86
|
+
<View
|
|
87
|
+
style={[
|
|
88
|
+
styles.outgoingCallControls,
|
|
89
|
+
outgoingCall.outgoingCallControls,
|
|
90
|
+
]}
|
|
91
|
+
>
|
|
92
|
+
{OutgoingCallControls && <OutgoingCallControls />}
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
79
95
|
</View>
|
|
80
96
|
</View>
|
|
97
|
+
|
|
81
98
|
<Background />
|
|
82
99
|
</>
|
|
83
100
|
);
|
|
@@ -133,17 +150,16 @@ const styles = StyleSheet.create({
|
|
|
133
150
|
container: {
|
|
134
151
|
zIndex: Z_INDEX.IN_MIDDLE,
|
|
135
152
|
},
|
|
153
|
+
topContainer: { flex: 1 },
|
|
136
154
|
content: {
|
|
137
|
-
|
|
155
|
+
flex: 1,
|
|
138
156
|
},
|
|
139
157
|
callingText: {
|
|
140
158
|
marginTop: 16,
|
|
141
159
|
textAlign: 'center',
|
|
142
160
|
},
|
|
161
|
+
bottomContainer: { flex: 1, alignSelf: 'center', justifyContent: 'center' },
|
|
143
162
|
outgoingCallControls: {
|
|
144
|
-
|
|
145
|
-
bottom: 64,
|
|
146
|
-
left: 0,
|
|
147
|
-
right: 0,
|
|
163
|
+
justifyContent: 'center',
|
|
148
164
|
},
|
|
149
165
|
});
|
|
@@ -55,7 +55,7 @@ const RingingCallPanel = ({
|
|
|
55
55
|
CallContent = DefaultCallContent,
|
|
56
56
|
JoiningCallIndicator = DefaultJoiningCallIndicator,
|
|
57
57
|
CallTopView,
|
|
58
|
-
landscape,
|
|
58
|
+
landscape = false,
|
|
59
59
|
}: RingingCallContentProps) => {
|
|
60
60
|
const call = useCall();
|
|
61
61
|
const isCallCreatedByMe = call?.isCreatedByMe;
|
|
@@ -66,8 +66,12 @@ const RingingCallPanel = ({
|
|
|
66
66
|
switch (callingState) {
|
|
67
67
|
case CallingState.RINGING:
|
|
68
68
|
return isCallCreatedByMe
|
|
69
|
-
? OutgoingCall &&
|
|
70
|
-
|
|
69
|
+
? OutgoingCall && (
|
|
70
|
+
<OutgoingCall CallTopView={CallTopView} landscape={landscape} />
|
|
71
|
+
)
|
|
72
|
+
: IncomingCall && (
|
|
73
|
+
<IncomingCall CallTopView={CallTopView} landscape={landscape} />
|
|
74
|
+
);
|
|
71
75
|
case CallingState.JOINED:
|
|
72
76
|
return (
|
|
73
77
|
CallContent && (
|
package/src/components/Participant/FloatingParticipantView/FloatingView/ReanimatedFloatingView.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useMemo, useEffect
|
|
1
|
+
import React, { useMemo, useEffect } from 'react';
|
|
2
2
|
import { LayoutRectangle, View } from 'react-native';
|
|
3
3
|
import {
|
|
4
4
|
FloatingViewAlignment,
|
|
@@ -46,13 +46,8 @@ try {
|
|
|
46
46
|
children,
|
|
47
47
|
}: FloatingViewProps) => {
|
|
48
48
|
// to store the starting position of the gesture
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
y: number;
|
|
52
|
-
}>({
|
|
53
|
-
x: 0,
|
|
54
|
-
y: 0,
|
|
55
|
-
});
|
|
49
|
+
// NOTE: note be used for deriving styling
|
|
50
|
+
const start = useSharedValue({ x: 0, y: 0 });
|
|
56
51
|
// to store the necessary translate x, y position
|
|
57
52
|
const translationX = useSharedValue(0);
|
|
58
53
|
const translationY = useSharedValue(0);
|
|
@@ -82,55 +77,51 @@ try {
|
|
|
82
77
|
});
|
|
83
78
|
}, [rectangle, containerWidth, containerHeight]);
|
|
84
79
|
|
|
85
|
-
const dragGesture =
|
|
86
|
-
() =>
|
|
87
|
-
|
|
88
|
-
.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
translationX.value
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
translationY.value
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
translationX.value = withTiming(closestAlignment.x);
|
|
123
|
-
translationY.value = withTiming(closestAlignment.y);
|
|
124
|
-
}),
|
|
125
|
-
[snapAlignments, translationX, translationY],
|
|
126
|
-
);
|
|
80
|
+
const dragGesture = Gesture.Pan()
|
|
81
|
+
.onStart((_e) => {
|
|
82
|
+
start.value = {
|
|
83
|
+
x: translationX.value,
|
|
84
|
+
y: translationY.value,
|
|
85
|
+
};
|
|
86
|
+
})
|
|
87
|
+
.onUpdate((e) => {
|
|
88
|
+
// update the translation with the distance of the gesture + starting position
|
|
89
|
+
translationX.value = Math.max(
|
|
90
|
+
0,
|
|
91
|
+
Math.min(
|
|
92
|
+
e.translationX + (start.value.x ?? 0),
|
|
93
|
+
snapAlignments[FloatingViewAlignment.bottomRight].x,
|
|
94
|
+
),
|
|
95
|
+
);
|
|
96
|
+
translationY.value = Math.max(
|
|
97
|
+
0,
|
|
98
|
+
Math.min(
|
|
99
|
+
e.translationY + (start.value.y ?? 0),
|
|
100
|
+
snapAlignments[FloatingViewAlignment.bottomRight].y,
|
|
101
|
+
),
|
|
102
|
+
);
|
|
103
|
+
})
|
|
104
|
+
.onEnd(() => {
|
|
105
|
+
// snap to the closest alignment with a spring animation
|
|
106
|
+
const position = {
|
|
107
|
+
x: translationX.value,
|
|
108
|
+
y: translationY.value,
|
|
109
|
+
};
|
|
110
|
+
const closestAlignment = getClosestSnapAlignment({
|
|
111
|
+
position,
|
|
112
|
+
snapAlignments,
|
|
113
|
+
});
|
|
114
|
+
translationX.value = withTiming(closestAlignment.x);
|
|
115
|
+
translationY.value = withTiming(closestAlignment.y);
|
|
116
|
+
});
|
|
127
117
|
|
|
118
|
+
/* Move to the initial position */
|
|
128
119
|
useEffect(() => {
|
|
129
120
|
if (!rectangle) {
|
|
130
121
|
return;
|
|
131
122
|
}
|
|
132
123
|
const alignment = snapAlignments[initialAlignment];
|
|
133
|
-
|
|
124
|
+
start.value = alignment;
|
|
134
125
|
|
|
135
126
|
translationX.value = alignment.x;
|
|
136
127
|
translationY.value = alignment.y;
|
|
@@ -145,6 +136,7 @@ try {
|
|
|
145
136
|
opacity,
|
|
146
137
|
translationX,
|
|
147
138
|
translationY,
|
|
139
|
+
start,
|
|
148
140
|
]);
|
|
149
141
|
|
|
150
142
|
const animatedStyle = useAnimatedStyle(() => {
|
package/src/constants/index.ts
CHANGED