@applicaster/zapp-react-native-ui-components 12.0.0-rc.99 → 13.0.0-alpha.2322412833
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/Components/Cell/Cell.tsx +33 -18
- package/Components/Cell/CellWithFocusable.tsx +1 -1
- package/Components/Cell/TvOSCellComponent.tsx +3 -4
- package/Components/Focusable/__tests__/index.android.test.tsx +72 -0
- package/Components/Focusable/index.android.tsx +15 -9
- package/Components/FocusableList/FocusableChild.ts +2 -2
- package/Components/FocusableList/index.tsx +11 -12
- package/Components/FocusableScrollView/index.tsx +1 -1
- package/Components/FreezeWithCallback/Freeze.tsx +31 -0
- package/Components/FreezeWithCallback/LICENSE +21 -0
- package/Components/FreezeWithCallback/Suspender.tsx +17 -0
- package/Components/FreezeWithCallback/__tests__/index.test.tsx +170 -0
- package/Components/FreezeWithCallback/index.tsx +3 -0
- package/Components/Image/Image.android.tsx +1 -1
- package/Components/MasterCell/DefaultComponents/ActionButton.tsx +11 -7
- package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +1 -7
- package/Components/MasterCell/DefaultComponents/CellBadge/index.tsx +6 -1
- package/Components/MasterCell/DefaultComponents/FocusableView/index.tsx +12 -0
- package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +6 -5
- package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +2 -2
- package/Components/MasterCell/DefaultComponents/ImageBorderContainer/index.ts +71 -0
- package/Components/MasterCell/DefaultComponents/__tests__/image.test.js +1 -1
- package/Components/MasterCell/DefaultComponents/index.ts +2 -0
- package/Components/MasterCell/SharedUI/ProgressBar/hooks/useFillInPercent.ts +7 -1
- package/Components/MasterCell/dataAdapter.ts +21 -7
- package/Components/MasterCell/index.tsx +5 -3
- package/Components/MasterCell/utils/index.ts +3 -4
- package/Components/NativeFocusables/{index.js → index.ts} +4 -2
- package/Components/PlayerContainer/PlayerContainer.tsx +14 -8
- package/Components/Screen/TV/hooks/index.ts +0 -2
- package/Components/Screen/TV/index.web.tsx +32 -19
- package/Components/Screen/__tests__/Screen.test.tsx +0 -49
- package/Components/Screen/index.tsx +2 -20
- package/Components/Screen/navigationHandler.ts +1 -3
- package/Components/Screen/orientationHandler.ts +18 -7
- package/Components/Screen/utils.ts +16 -0
- package/Components/ScreenResolver/index.tsx +6 -11
- package/Components/Transitioner/Scene.tsx +9 -2
- package/Components/Transitioner/Transitioner.tsx +38 -23
- package/Components/Transitioner/__tests__/Scene.test.js +7 -0
- package/Components/Transitioner/__tests__/__snapshots__/transitioner.test.js.snap +1 -0
- package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +5 -0
- package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +3 -9
- package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +87 -41
- package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +20 -9
- package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +41 -22
- package/Components/VideoModal/PlayerDetails.tsx +16 -2
- package/Components/VideoModal/PlayerWrapper.tsx +101 -67
- package/Components/VideoModal/VideoModal.tsx +33 -27
- package/Components/VideoModal/__tests__/PlayerDetails.test.tsx +7 -0
- package/Components/VideoModal/__tests__/__snapshots__/PlayerDetails.test.tsx.snap +2 -0
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +78 -16
- package/Components/ZappFrameworkComponents/BarView/BarView.tsx +7 -3
- package/Components/ZappFrameworkComponents/BarView/Buttons/BackButton.tsx +7 -2
- package/Components/ZappFrameworkComponents/BarView/Buttons/CloseButton.tsx +7 -2
- package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +87 -0
- package/Components/ZappFrameworkComponents/Buttons/ActionButton.tsx +9 -4
- package/Components/default-cell-renderer/__tests__/__snapshots__/defaultCellRenderer.test.tsx.snap +4 -4
- package/Contexts/CachedDimensionsContext/index.ts +13 -9
- package/Contexts/ConfirmDialogState/index.ts +1 -1
- package/Contexts/ScreenContext/index.tsx +6 -1
- package/Decorators/Analytics/{index.js → index.tsx} +11 -11
- package/README.md +1 -13
- package/const.ts +6 -0
- package/index.js +3 -0
- package/package.json +5 -5
- package/Components/Screen/TV/hooks/useRestoreFocus.ts +0 -22
|
@@ -60,9 +60,14 @@ export const AnimationView = ({
|
|
|
60
60
|
const {
|
|
61
61
|
width: screenWidth,
|
|
62
62
|
deviceInfo: { isTablet, isTabletLandscape },
|
|
63
|
-
} = useDimensions("window", {
|
|
63
|
+
} = useDimensions("window", {
|
|
64
|
+
deviceInfo: true,
|
|
65
|
+
updateForInactiveScreens: true,
|
|
66
|
+
});
|
|
64
67
|
|
|
65
68
|
const { videoModalState } = useNavigation();
|
|
69
|
+
const { mode: videoModalMode, item: videoModalItem } = videoModalState;
|
|
70
|
+
|
|
66
71
|
const insets = useSafeAreaInsets();
|
|
67
72
|
const bottomTabBarHeight = useGetBottomTabBarHeight() + (insets.bottom || 0);
|
|
68
73
|
const minimisedWidth = defaultAspectRatioWidth(minimisedHeight);
|
|
@@ -85,9 +90,9 @@ export const AnimationView = ({
|
|
|
85
90
|
|
|
86
91
|
const isAudioItem = React.useMemo(
|
|
87
92
|
() =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
[
|
|
93
|
+
videoModalItem?.content?.type?.includes?.("audio") ||
|
|
94
|
+
videoModalItem?.type?.value === "audio",
|
|
95
|
+
[videoModalItem]
|
|
91
96
|
);
|
|
92
97
|
|
|
93
98
|
const inlineAudioPlayer = additionalData.inlineAudioPlayer;
|
|
@@ -226,10 +231,8 @@ export const AnimationView = ({
|
|
|
226
231
|
);
|
|
227
232
|
|
|
228
233
|
const getInitialValue = React.useCallback(() => {
|
|
229
|
-
const mode =
|
|
230
|
-
|
|
231
|
-
? videoModalState.previousMode
|
|
232
|
-
: videoModalState.mode;
|
|
234
|
+
const { mode: videoModalMode, previousMode } = videoModalState;
|
|
235
|
+
const mode = videoModalMode === "PIP" ? previousMode : videoModalMode;
|
|
233
236
|
|
|
234
237
|
switch (mode) {
|
|
235
238
|
case "MINIMIZED":
|
|
@@ -263,7 +266,7 @@ export const AnimationView = ({
|
|
|
263
266
|
isTablet,
|
|
264
267
|
isTabletLandscape,
|
|
265
268
|
isRTL,
|
|
266
|
-
fromMiniPlayer:
|
|
269
|
+
fromMiniPlayer: videoModalMode === "MINIMIZED",
|
|
267
270
|
inlineAudioPlayer,
|
|
268
271
|
}),
|
|
269
272
|
[
|
|
@@ -273,7 +276,7 @@ export const AnimationView = ({
|
|
|
273
276
|
defaultValue,
|
|
274
277
|
moveUpValue,
|
|
275
278
|
moveComponentHorizontalValue,
|
|
276
|
-
|
|
279
|
+
videoModalMode,
|
|
277
280
|
]
|
|
278
281
|
);
|
|
279
282
|
|
|
@@ -301,19 +304,40 @@ export const AnimationView = ({
|
|
|
301
304
|
typeof additionalData.height === "number" && additionalData.height;
|
|
302
305
|
}
|
|
303
306
|
|
|
304
|
-
if (
|
|
307
|
+
if (
|
|
308
|
+
videoModalMode === "MAXIMIZED" &&
|
|
309
|
+
defaultValue.x !== screenWidth &&
|
|
310
|
+
width &&
|
|
311
|
+
height
|
|
312
|
+
) {
|
|
305
313
|
const value = { x: width, y: height };
|
|
306
314
|
setDefaultValue(value);
|
|
307
315
|
animatedValue.setValue(value);
|
|
308
316
|
}
|
|
309
317
|
}
|
|
310
|
-
}, [
|
|
318
|
+
}, [screenWidth]);
|
|
319
|
+
|
|
320
|
+
React.useEffect(() => {
|
|
321
|
+
const { mode, previousMode } = videoModalState;
|
|
322
|
+
|
|
323
|
+
if (mode === "MINIMIZED" && previousMode === "MAXIMIZED") {
|
|
324
|
+
// set animation to the minimize values if moving from the player to another screen
|
|
325
|
+
if (playerAnimationState === null) {
|
|
326
|
+
const value = getAnimationValue(
|
|
327
|
+
animationType,
|
|
328
|
+
PlayerAnimationStateEnum.minimize
|
|
329
|
+
).toValue;
|
|
330
|
+
|
|
331
|
+
animatedValue.setValue(value);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}, [videoModalState]);
|
|
311
335
|
|
|
312
336
|
React.useEffect(() => {
|
|
313
337
|
if (
|
|
314
338
|
playerAnimationState === PlayerAnimationStateEnum.minimize &&
|
|
315
339
|
startComponentsAnimation &&
|
|
316
|
-
|
|
340
|
+
videoModalMode === "MAXIMIZED"
|
|
317
341
|
) {
|
|
318
342
|
Animated.timing(
|
|
319
343
|
animatedValue,
|
|
@@ -322,12 +346,7 @@ export const AnimationView = ({
|
|
|
322
346
|
} else if (playerAnimationState === PlayerAnimationStateEnum.maximaze) {
|
|
323
347
|
animatedValue.setValue(defaultValue);
|
|
324
348
|
}
|
|
325
|
-
}, [
|
|
326
|
-
playerAnimationState,
|
|
327
|
-
startComponentsAnimation,
|
|
328
|
-
videoModalState.mode,
|
|
329
|
-
defaultValue,
|
|
330
|
-
]);
|
|
349
|
+
}, [playerAnimationState, startComponentsAnimation, defaultValue]);
|
|
331
350
|
|
|
332
351
|
React.useEffect(() => {
|
|
333
352
|
const dragVideoPlayerYListenerId = dragVideoPlayerY.addListener(
|
|
@@ -389,9 +408,9 @@ export const AnimationView = ({
|
|
|
389
408
|
ref={animationComponentRef}
|
|
390
409
|
style={[
|
|
391
410
|
...preparedStyles,
|
|
392
|
-
(
|
|
393
|
-
|
|
394
|
-
(
|
|
411
|
+
(videoModalMode === "MAXIMIZED" ||
|
|
412
|
+
videoModalMode === "MINIMIZED" ||
|
|
413
|
+
(videoModalMode === "PIP" && isAppActive)) &&
|
|
395
414
|
getAnimationStyle(animationType, animatedValue),
|
|
396
415
|
]}
|
|
397
416
|
>
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyleProp,
|
|
4
|
+
ViewStyle,
|
|
5
|
+
Animated,
|
|
6
|
+
Easing,
|
|
7
|
+
Dimensions,
|
|
8
|
+
} from "react-native";
|
|
3
9
|
import { useTargetScreenData } from "@applicaster/zapp-react-native-utils/reactHooks/screen";
|
|
4
10
|
import { ComponentsMap } from "@applicaster/zapp-react-native-ui-components/Components/River/ComponentsMap";
|
|
5
11
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
12
|
|
|
13
|
+
const { width: SCREEN_WIDTH } = Dimensions.get("screen");
|
|
14
|
+
|
|
7
15
|
type Configuration = {
|
|
8
16
|
[key: string]: any;
|
|
9
17
|
modal_background_color?: string;
|
|
@@ -15,6 +23,7 @@ type Props = {
|
|
|
15
23
|
configuration: Configuration;
|
|
16
24
|
isTabletLandscape: boolean;
|
|
17
25
|
isAudioPlayer?: boolean;
|
|
26
|
+
isTablet: boolean;
|
|
18
27
|
};
|
|
19
28
|
|
|
20
29
|
const containerStyle = ({
|
|
@@ -31,6 +40,7 @@ export const PlayerDetails = ({
|
|
|
31
40
|
configuration,
|
|
32
41
|
isTabletLandscape,
|
|
33
42
|
isAudioPlayer,
|
|
43
|
+
isTablet,
|
|
34
44
|
}: Props) => {
|
|
35
45
|
const screenData = useTargetScreenData(entry);
|
|
36
46
|
const insets = useSafeAreaInsets();
|
|
@@ -77,7 +87,11 @@ export const PlayerDetails = ({
|
|
|
77
87
|
transform: [{ translateY }],
|
|
78
88
|
opacity,
|
|
79
89
|
},
|
|
80
|
-
|
|
90
|
+
{
|
|
91
|
+
// workaround for avoid wrong text-height after going back to portrait rotation
|
|
92
|
+
// we don't see this view in landscape mode, so we are able to use fixed width from portrait mode
|
|
93
|
+
width: isTablet ? undefined : SCREEN_WIDTH,
|
|
94
|
+
},
|
|
81
95
|
]}
|
|
82
96
|
>
|
|
83
97
|
{screenData && (
|
|
@@ -7,14 +7,10 @@ import {
|
|
|
7
7
|
ViewStyle,
|
|
8
8
|
} from "react-native";
|
|
9
9
|
import { Edge, SafeAreaView } from "react-native-safe-area-context";
|
|
10
|
-
|
|
11
10
|
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
12
11
|
import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
13
12
|
import { PlayerDetails } from "./PlayerDetails";
|
|
14
13
|
import { playerDimesionsHack } from "./utils";
|
|
15
|
-
import { PathnameContext } from "../../Contexts/PathnameContext";
|
|
16
|
-
import { ScreenContextProvider } from "../../Contexts/ScreenContext";
|
|
17
|
-
import { ROUTE_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/routeTypes";
|
|
18
14
|
|
|
19
15
|
import {
|
|
20
16
|
AnimatedScrollModal,
|
|
@@ -23,6 +19,8 @@ import {
|
|
|
23
19
|
ComponentAnimationType,
|
|
24
20
|
} from "@applicaster/zapp-react-native-ui-components/Components/VideoModal/ModalAnimation";
|
|
25
21
|
|
|
22
|
+
const { width: SCREEN_WIDTH, height: SCREEN_HEIGHT } = Dimensions.get("screen");
|
|
23
|
+
|
|
26
24
|
type DimensionsT = {
|
|
27
25
|
width: number | string;
|
|
28
26
|
height: number | string | undefined;
|
|
@@ -69,10 +67,8 @@ const directionStyles = (isTabletLandscape: boolean): ViewStyle => {
|
|
|
69
67
|
};
|
|
70
68
|
|
|
71
69
|
const getScreenAspectRatio = () => {
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const longEdge = Math.max(width, height);
|
|
75
|
-
const shortEdge = Math.min(width, height);
|
|
70
|
+
const longEdge = Math.max(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
71
|
+
const shortEdge = Math.min(SCREEN_WIDTH, SCREEN_HEIGHT);
|
|
76
72
|
|
|
77
73
|
return longEdge / shortEdge;
|
|
78
74
|
};
|
|
@@ -125,10 +121,54 @@ const getTabletWidth = (
|
|
|
125
121
|
return Number(width) - sidebarWidth;
|
|
126
122
|
};
|
|
127
123
|
|
|
128
|
-
|
|
124
|
+
const getStyles = (baseStyle, isMobile, isPortrait, pip) => {
|
|
125
|
+
if (pip) {
|
|
126
|
+
return baseStyle;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
if (isMobile && isPortrait) {
|
|
130
|
+
return { width: SCREEN_WIDTH, height: SCREEN_HEIGHT };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
if (isMobile && !isPortrait) {
|
|
134
|
+
return { width: SCREEN_HEIGHT, height: SCREEN_WIDTH };
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return baseStyle;
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const showDetails = (
|
|
141
|
+
isMobile: boolean,
|
|
142
|
+
docked: boolean,
|
|
143
|
+
isInlineModal,
|
|
144
|
+
pip
|
|
145
|
+
): boolean => {
|
|
146
|
+
if (pip) {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (!isInlineModal) {
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// for mobile we always show details. Mounting of it very heavy operation.
|
|
155
|
+
if (isMobile) {
|
|
156
|
+
return true;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// workaround for tablets we need to mount/unmount in order to avoid PlayerDetails content dissappearing
|
|
160
|
+
// FIXME - find out the reason of dissapearing of content
|
|
161
|
+
if (docked) {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return true;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const PlayerWrapperComponent = (props: Props) => {
|
|
129
169
|
const {
|
|
130
170
|
entry,
|
|
131
|
-
style,
|
|
171
|
+
style: baseStyle,
|
|
132
172
|
containerStyle,
|
|
133
173
|
inline,
|
|
134
174
|
docked,
|
|
@@ -143,6 +183,8 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
143
183
|
|
|
144
184
|
const isInlineModal = inline && isModal;
|
|
145
185
|
|
|
186
|
+
const style = getStyles(baseStyle, !isTablet, isInlineModal, pip);
|
|
187
|
+
|
|
146
188
|
const isTabletLandscape = !isTV() && isTablet && !isTabletPortrait;
|
|
147
189
|
|
|
148
190
|
const tabletWidth = getTabletWidth(configuration, style);
|
|
@@ -181,71 +223,63 @@ export const PlayerWrapper = (props: Props) => {
|
|
|
181
223
|
[containerDimensions, playerDimesionsHack]
|
|
182
224
|
);
|
|
183
225
|
|
|
184
|
-
const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${entry?.id}`;
|
|
185
|
-
|
|
186
226
|
return (
|
|
187
|
-
<
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
227
|
+
<WrapperView
|
|
228
|
+
edges={getEdges(isTablet, isInlineModal) as readonly Edge[]}
|
|
229
|
+
style={[
|
|
230
|
+
safeAreaStyles(configuration, isTablet),
|
|
231
|
+
style,
|
|
232
|
+
playerDimesionsHack,
|
|
233
|
+
]}
|
|
234
|
+
>
|
|
235
|
+
<AnimationComponent
|
|
236
|
+
animationType={ComponentAnimationType.moveUpComponent}
|
|
237
|
+
additionalData={{ saveArea: true }}
|
|
238
|
+
style={[directionStyles(isTabletLandscape), defaultStyles.flex]}
|
|
239
|
+
>
|
|
240
|
+
<View
|
|
241
|
+
testID={`${entry?.id}-player-container`}
|
|
191
242
|
style={[
|
|
192
|
-
|
|
193
|
-
|
|
243
|
+
defaultStyles.playerContainer,
|
|
244
|
+
containerDimensions,
|
|
245
|
+
containerStyle,
|
|
194
246
|
playerDimesionsHack,
|
|
195
247
|
]}
|
|
196
248
|
>
|
|
197
249
|
<AnimationComponent
|
|
198
250
|
animationType={ComponentAnimationType.moveUpComponent}
|
|
199
|
-
|
|
200
|
-
|
|
251
|
+
style={isTabletLandscape ? defaultStyles.flex : undefined}
|
|
252
|
+
additionalData={{
|
|
253
|
+
useLayoutMeasure: isTabletLandscape,
|
|
254
|
+
disableAnimatedComponent: !isTabletLandscape,
|
|
255
|
+
resetAnimationValue: isTabletLandscape && docked,
|
|
256
|
+
}}
|
|
201
257
|
>
|
|
202
|
-
<
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
testID={`${entry?.id}-player-container`}
|
|
206
|
-
style={[
|
|
207
|
-
defaultStyles.playerContainer,
|
|
208
|
-
containerDimensions,
|
|
209
|
-
containerStyle,
|
|
210
|
-
playerDimesionsHack,
|
|
211
|
-
]}
|
|
212
|
-
>
|
|
213
|
-
<AnimationComponent
|
|
214
|
-
animationType={ComponentAnimationType.moveUpComponent}
|
|
215
|
-
style={isTabletLandscape ? defaultStyles.flex : undefined}
|
|
216
|
-
additionalData={{
|
|
217
|
-
useLayoutMeasure: isTabletLandscape,
|
|
218
|
-
disableAnimatedComponent: !isTabletLandscape,
|
|
219
|
-
resetAnimationValue: isTabletLandscape && docked,
|
|
220
|
-
}}
|
|
221
|
-
>
|
|
222
|
-
<AnimatedVideoPlayerComponent>
|
|
223
|
-
{children(childrenStyles)}
|
|
224
|
-
</AnimatedVideoPlayerComponent>
|
|
225
|
-
</AnimationComponent>
|
|
226
|
-
</View>
|
|
227
|
-
<AnimatedScrollModal>
|
|
228
|
-
{isInlineModal && !docked ? (
|
|
229
|
-
<AnimationComponent
|
|
230
|
-
animationType={ComponentAnimationType.componentFade}
|
|
231
|
-
style={defaultStyles.flex}
|
|
232
|
-
>
|
|
233
|
-
<PlayerDetails
|
|
234
|
-
configuration={configuration}
|
|
235
|
-
style={defaultStyles.playerDetails}
|
|
236
|
-
entry={entry}
|
|
237
|
-
isTabletLandscape={isTabletLandscape}
|
|
238
|
-
/>
|
|
239
|
-
</AnimationComponent>
|
|
240
|
-
) : (
|
|
241
|
-
<View style={defaultStyles.playerDetails} />
|
|
242
|
-
)}
|
|
243
|
-
</AnimatedScrollModal>
|
|
244
|
-
</ScreenContextProvider>
|
|
245
|
-
</PathnameContext.Provider>
|
|
258
|
+
<AnimatedVideoPlayerComponent>
|
|
259
|
+
{children(childrenStyles)}
|
|
260
|
+
</AnimatedVideoPlayerComponent>
|
|
246
261
|
</AnimationComponent>
|
|
247
|
-
</
|
|
248
|
-
|
|
249
|
-
|
|
262
|
+
</View>
|
|
263
|
+
|
|
264
|
+
<AnimatedScrollModal>
|
|
265
|
+
{showDetails(!isTablet, docked, isInlineModal, pip) && (
|
|
266
|
+
<AnimationComponent
|
|
267
|
+
animationType={ComponentAnimationType.componentFade}
|
|
268
|
+
style={defaultStyles.flex}
|
|
269
|
+
>
|
|
270
|
+
<PlayerDetails
|
|
271
|
+
configuration={configuration}
|
|
272
|
+
style={defaultStyles.playerDetails}
|
|
273
|
+
entry={entry}
|
|
274
|
+
isTabletLandscape={isTabletLandscape}
|
|
275
|
+
isTablet={isTablet}
|
|
276
|
+
/>
|
|
277
|
+
</AnimationComponent>
|
|
278
|
+
)}
|
|
279
|
+
</AnimatedScrollModal>
|
|
280
|
+
</AnimationComponent>
|
|
281
|
+
</WrapperView>
|
|
250
282
|
);
|
|
251
283
|
};
|
|
284
|
+
|
|
285
|
+
export const PlayerWrapper = PlayerWrapperComponent;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import * as R from "ramda";
|
|
3
|
-
import { StyleSheet, View } from "react-native";
|
|
3
|
+
import { StyleSheet, View, StatusBar } from "react-native";
|
|
4
4
|
|
|
5
5
|
import { HandlePlayable } from "@applicaster/zapp-react-native-ui-components/Components/HandlePlayable";
|
|
6
6
|
import {
|
|
@@ -129,32 +129,38 @@ const VideoModalComponent = () => {
|
|
|
129
129
|
const pathname = `${ROUTE_TYPES.VIDEO_MODAL}/${item?.id}`;
|
|
130
130
|
|
|
131
131
|
return (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
132
|
+
<>
|
|
133
|
+
{/* TODO: Workaround to avoid unnecessary UI effect when switching from portrait to fullscreen */}
|
|
134
|
+
<StatusBar hidden={false} />
|
|
135
|
+
{/* TODO: Workaround to avoid unnecessary UI effect when switching from portrait to fullscreen */}
|
|
136
|
+
|
|
137
|
+
<PathnameContext.Provider value={pathname}>
|
|
138
|
+
<ScreenContextProvider pathname={pathname}>
|
|
139
|
+
{itemIdHooksFinished === item?.id ? (
|
|
140
|
+
<AnimatedPlayerModalWrapper
|
|
141
|
+
style={[
|
|
142
|
+
styles.container,
|
|
143
|
+
{
|
|
144
|
+
backgroundColor,
|
|
145
|
+
},
|
|
146
|
+
]}
|
|
147
|
+
>
|
|
148
|
+
<HandlePlayable
|
|
149
|
+
item={item}
|
|
150
|
+
isModal={mode !== "PIP"}
|
|
151
|
+
modalHeight={modalSize.height}
|
|
152
|
+
modalWidth={modalSize.width}
|
|
153
|
+
mode={mode}
|
|
154
|
+
/>
|
|
155
|
+
</AnimatedPlayerModalWrapper>
|
|
156
|
+
) : (
|
|
157
|
+
<View style={styles.loaderContainer}>
|
|
158
|
+
<Spinner />
|
|
159
|
+
</View>
|
|
160
|
+
)}
|
|
161
|
+
</ScreenContextProvider>
|
|
162
|
+
</PathnameContext.Provider>
|
|
163
|
+
</>
|
|
158
164
|
);
|
|
159
165
|
};
|
|
160
166
|
|
|
@@ -8,6 +8,13 @@ const props = {
|
|
|
8
8
|
configuration: { modal_background_color: "transparent" },
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
+
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/layout", () => ({
|
|
12
|
+
useDimensions: jest.fn(() => ({
|
|
13
|
+
width: 20,
|
|
14
|
+
height: 30,
|
|
15
|
+
})),
|
|
16
|
+
}));
|
|
17
|
+
|
|
11
18
|
jest.mock("react-native-safe-area-context", () => ({
|
|
12
19
|
useSafeAreaInsets: jest.fn(() => ({
|
|
13
20
|
top: 20,
|
|
@@ -9,6 +9,7 @@ exports[`PlayerDetails renders properly 1`] = `
|
|
|
9
9
|
"flex": 1,
|
|
10
10
|
"marginTop": -8,
|
|
11
11
|
"paddingTop": -8,
|
|
12
|
+
"width": 750,
|
|
12
13
|
}
|
|
13
14
|
}
|
|
14
15
|
>
|
|
@@ -29,6 +30,7 @@ exports[`PlayerDetails renders properly on tablet in landscape orientation 1`] =
|
|
|
29
30
|
"flex": 1,
|
|
30
31
|
"marginTop": -20,
|
|
31
32
|
"paddingTop": 40,
|
|
33
|
+
"width": 750,
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
>
|
|
@@ -27,8 +27,8 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
27
27
|
"backgroundColor": "transparent",
|
|
28
28
|
},
|
|
29
29
|
Object {
|
|
30
|
-
"height":
|
|
31
|
-
"width":
|
|
30
|
+
"height": 1334,
|
|
31
|
+
"width": 750,
|
|
32
32
|
},
|
|
33
33
|
Object {},
|
|
34
34
|
]
|
|
@@ -72,12 +72,35 @@ exports[`PlayerWrapper renders inline 1`] = `
|
|
|
72
72
|
testID="test-player-container"
|
|
73
73
|
/>
|
|
74
74
|
<View
|
|
75
|
+
animationType="componentFade"
|
|
75
76
|
style={
|
|
76
77
|
Object {
|
|
77
78
|
"flex": 1,
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
|
|
81
|
+
>
|
|
82
|
+
<View
|
|
83
|
+
configuration={
|
|
84
|
+
Object {
|
|
85
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
86
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
entry={
|
|
90
|
+
Object {
|
|
91
|
+
"id": "test",
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
isTablet={false}
|
|
95
|
+
isTabletLandscape={false}
|
|
96
|
+
style={
|
|
97
|
+
Object {
|
|
98
|
+
"flex": 1,
|
|
99
|
+
"paddingTop": 20,
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/>
|
|
103
|
+
</View>
|
|
81
104
|
</View>
|
|
82
105
|
</RNCSafeAreaView>
|
|
83
106
|
</RNCSafeAreaProvider>
|
|
@@ -110,8 +133,8 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
110
133
|
"backgroundColor": "transparent",
|
|
111
134
|
},
|
|
112
135
|
Object {
|
|
113
|
-
"height":
|
|
114
|
-
"width":
|
|
136
|
+
"height": 1334,
|
|
137
|
+
"width": 750,
|
|
115
138
|
},
|
|
116
139
|
Object {},
|
|
117
140
|
]
|
|
@@ -155,12 +178,35 @@ exports[`PlayerWrapper renders inline and docked 1`] = `
|
|
|
155
178
|
testID="test-player-container"
|
|
156
179
|
/>
|
|
157
180
|
<View
|
|
181
|
+
animationType="componentFade"
|
|
158
182
|
style={
|
|
159
183
|
Object {
|
|
160
184
|
"flex": 1,
|
|
161
185
|
}
|
|
162
186
|
}
|
|
163
|
-
|
|
187
|
+
>
|
|
188
|
+
<View
|
|
189
|
+
configuration={
|
|
190
|
+
Object {
|
|
191
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
192
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
entry={
|
|
196
|
+
Object {
|
|
197
|
+
"id": "test",
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
isTablet={false}
|
|
201
|
+
isTabletLandscape={false}
|
|
202
|
+
style={
|
|
203
|
+
Object {
|
|
204
|
+
"flex": 1,
|
|
205
|
+
"paddingTop": 20,
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/>
|
|
209
|
+
</View>
|
|
164
210
|
</View>
|
|
165
211
|
</RNCSafeAreaView>
|
|
166
212
|
</RNCSafeAreaProvider>
|
|
@@ -254,12 +300,35 @@ exports[`PlayerWrapper renders inline on tablet in landscape orientation 1`] = `
|
|
|
254
300
|
/>
|
|
255
301
|
</View>
|
|
256
302
|
<View
|
|
303
|
+
animationType="componentFade"
|
|
257
304
|
style={
|
|
258
305
|
Object {
|
|
259
306
|
"flex": 1,
|
|
260
307
|
}
|
|
261
308
|
}
|
|
262
|
-
|
|
309
|
+
>
|
|
310
|
+
<View
|
|
311
|
+
configuration={
|
|
312
|
+
Object {
|
|
313
|
+
"tablet_landscape_player_container_background_color": "red",
|
|
314
|
+
"tablet_landscape_sidebar_width": "35%",
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
entry={
|
|
318
|
+
Object {
|
|
319
|
+
"id": "test",
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
isTablet={true}
|
|
323
|
+
isTabletLandscape={true}
|
|
324
|
+
style={
|
|
325
|
+
Object {
|
|
326
|
+
"flex": 1,
|
|
327
|
+
"paddingTop": 20,
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
/>
|
|
331
|
+
</View>
|
|
263
332
|
</View>
|
|
264
333
|
</RNCSafeAreaView>
|
|
265
334
|
</RNCSafeAreaProvider>
|
|
@@ -292,8 +361,8 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
292
361
|
"backgroundColor": "transparent",
|
|
293
362
|
},
|
|
294
363
|
Object {
|
|
295
|
-
"height":
|
|
296
|
-
"width":
|
|
364
|
+
"height": 750,
|
|
365
|
+
"width": 1334,
|
|
297
366
|
},
|
|
298
367
|
Object {},
|
|
299
368
|
]
|
|
@@ -336,13 +405,6 @@ exports[`PlayerWrapper renders properly 1`] = `
|
|
|
336
405
|
}
|
|
337
406
|
testID="test-player-container"
|
|
338
407
|
/>
|
|
339
|
-
<View
|
|
340
|
-
style={
|
|
341
|
-
Object {
|
|
342
|
-
"flex": 1,
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
/>
|
|
346
408
|
</View>
|
|
347
409
|
</RNCSafeAreaView>
|
|
348
410
|
</RNCSafeAreaProvider>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import { SafeAreaView } from "react-native-safe-area-context";
|
|
3
4
|
|
|
4
5
|
import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
|
|
5
6
|
import CloseButton from "./Buttons/CloseButton";
|
|
@@ -44,11 +45,14 @@ const BarView = ({ screenStyles, barState = defaultState }: Props) => {
|
|
|
44
45
|
);
|
|
45
46
|
|
|
46
47
|
return (
|
|
47
|
-
<
|
|
48
|
+
<SafeAreaView
|
|
49
|
+
style={[style.view, isRTL ? style.rtlStyle : {}]}
|
|
50
|
+
testID="BarView-safeAreaView"
|
|
51
|
+
>
|
|
48
52
|
{backButton}
|
|
49
53
|
<BarTitle title={barState.title} screenStyles={screenStyles} />
|
|
50
54
|
{closeButton}
|
|
51
|
-
</
|
|
55
|
+
</SafeAreaView>
|
|
52
56
|
);
|
|
53
57
|
};
|
|
54
58
|
|