@applicaster/zapp-react-native-ui-components 15.0.0-rc.5 → 15.0.0-rc.50

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.
Files changed (72) hide show
  1. package/Components/AnimatedInOut/index.tsx +69 -26
  2. package/Components/Cell/Cell.tsx +8 -3
  3. package/Components/Cell/FocusableWrapper.tsx +44 -0
  4. package/Components/Cell/TvOSCellComponent.tsx +101 -19
  5. package/Components/HandlePlayable/HandlePlayable.tsx +17 -65
  6. package/Components/HandlePlayable/const.ts +3 -0
  7. package/Components/HandlePlayable/utils.ts +74 -0
  8. package/Components/Layout/TV/LayoutBackground.tsx +5 -2
  9. package/Components/Layout/TV/ScreenContainer.tsx +2 -6
  10. package/Components/Layout/TV/index.tsx +3 -4
  11. package/Components/Layout/TV/index.web.tsx +3 -4
  12. package/Components/LinkHandler/LinkHandler.tsx +2 -2
  13. package/Components/MasterCell/DefaultComponents/BorderContainerView/__tests__/index.test.tsx +16 -1
  14. package/Components/MasterCell/DefaultComponents/BorderContainerView/index.tsx +30 -2
  15. package/Components/MasterCell/DefaultComponents/Image/Image.android.tsx +5 -1
  16. package/Components/MasterCell/DefaultComponents/Image/Image.ios.tsx +11 -3
  17. package/Components/MasterCell/DefaultComponents/Image/Image.web.tsx +9 -1
  18. package/Components/MasterCell/DefaultComponents/Image/hooks/useImage.ts +15 -14
  19. package/Components/MasterCell/DefaultComponents/LiveImage/index.tsx +10 -6
  20. package/Components/MasterCell/DefaultComponents/Text/index.tsx +8 -8
  21. package/Components/MasterCell/index.tsx +2 -0
  22. package/Components/MasterCell/utils/__tests__/resolveColor.test.js +82 -3
  23. package/Components/MasterCell/utils/index.ts +61 -31
  24. package/Components/MeasurmentsPortal/MeasurementsPortal.tsx +102 -87
  25. package/Components/MeasurmentsPortal/__tests__/MeasurementsPortal.test.tsx +355 -0
  26. package/Components/OfflineHandler/NotificationView/NotificationView.tsx +2 -2
  27. package/Components/OfflineHandler/NotificationView/__tests__/index.test.tsx +17 -18
  28. package/Components/OfflineHandler/__tests__/index.test.tsx +27 -18
  29. package/Components/PlayerContainer/PlayerContainer.tsx +5 -19
  30. package/Components/PlayerImageBackground/index.tsx +3 -22
  31. package/Components/Screen/TV/hooks/useInitialFocus.ts +14 -4
  32. package/Components/Screen/TV/index.web.tsx +4 -2
  33. package/Components/Screen/__tests__/Screen.test.tsx +65 -42
  34. package/Components/Screen/__tests__/__snapshots__/Screen.test.tsx.snap +68 -42
  35. package/Components/Screen/hooks.ts +2 -3
  36. package/Components/Screen/index.tsx +24 -8
  37. package/Components/Screen/navigationHandler.ts +49 -24
  38. package/Components/Screen/orientationHandler.ts +3 -3
  39. package/Components/ScreenResolver/index.tsx +13 -7
  40. package/Components/ScreenRevealManager/ScreenRevealManager.ts +40 -8
  41. package/Components/ScreenRevealManager/__tests__/ScreenRevealManager.test.ts +86 -69
  42. package/Components/ScreenRevealManager/utils/index.ts +23 -0
  43. package/Components/ScreenRevealManager/withScreenRevealManager.tsx +54 -24
  44. package/Components/Tabs/TV/Tabs.tsx +20 -3
  45. package/Components/Transitioner/Scene.tsx +15 -2
  46. package/Components/Transitioner/index.js +3 -3
  47. package/Components/VideoLive/__tests__/__snapshots__/PlayerLiveImageComponent.test.tsx.snap +1 -0
  48. package/Components/VideoModal/ModalAnimation/ModalAnimationContext.tsx +118 -171
  49. package/Components/VideoModal/ModalAnimation/index.ts +2 -13
  50. package/Components/VideoModal/ModalAnimation/utils.ts +1 -327
  51. package/Components/VideoModal/PlayerWrapper.tsx +14 -88
  52. package/Components/VideoModal/VideoModal.tsx +1 -5
  53. package/Components/VideoModal/__tests__/PlayerWrapper.test.tsx +1 -0
  54. package/Components/VideoModal/hooks/useModalSize.ts +10 -5
  55. package/Components/VideoModal/playerWrapperStyle.ts +70 -0
  56. package/Components/VideoModal/playerWrapperUtils.ts +91 -0
  57. package/Components/VideoModal/utils.ts +19 -9
  58. package/Decorators/Analytics/index.tsx +6 -5
  59. package/Decorators/ZappPipesDataConnector/index.tsx +2 -2
  60. package/Decorators/ZappPipesDataConnector/resolvers/StaticFeedResolver.tsx +1 -1
  61. package/Helpers/DataSourceHelper/__tests__/itemLimitForData.test.ts +80 -0
  62. package/Helpers/DataSourceHelper/index.ts +19 -0
  63. package/index.d.ts +7 -0
  64. package/package.json +6 -5
  65. package/Components/VideoModal/ModalAnimation/AnimatedPlayerModalWrapper.tsx +0 -60
  66. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.tsx +0 -417
  67. package/Components/VideoModal/ModalAnimation/AnimatedScrollModal.web.tsx +0 -294
  68. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.tsx +0 -176
  69. package/Components/VideoModal/ModalAnimation/AnimatedVideoPlayerComponent.web.tsx +0 -93
  70. package/Components/VideoModal/ModalAnimation/AnimationComponent.tsx +0 -500
  71. package/Components/VideoModal/ModalAnimation/__tests__/getMoveUpValue.test.ts +0 -108
  72. package/Helpers/DataSourceHelper/index.js +0 -19
@@ -7,7 +7,7 @@ import {
7
7
  useGetScreenOrientation,
8
8
  } from "@applicaster/zapp-react-native-utils/appUtils/orientationHelper";
9
9
  import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
10
- import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
10
+ import { usePlugins, useAppData } from "@applicaster/zapp-react-native-redux";
11
11
  import { findPluginByType } from "@applicaster/zapp-react-native-utils/pluginUtils";
12
12
  import { useIsTablet } from "@applicaster/zapp-react-native-utils/reactHooks";
13
13
 
@@ -65,8 +65,8 @@ export function useNewOrientationForScreenData({
65
65
  }: OrientationHookArgs) {
66
66
  const isTablet = useIsTablet();
67
67
 
68
- const { appData, plugins } = usePickFromState(["appData", "plugins"]);
69
- const isTabletPortrait = appData?.isTabletPortrait;
68
+ const plugins = usePlugins();
69
+ const { isTabletPortrait } = useAppData();
70
70
  const isLandscapeTablet = isTablet && !isTabletPortrait;
71
71
 
72
72
  const screenOrientation = useGetScreenOrientation(screenData);
@@ -11,12 +11,19 @@ import { LinkHandler } from "../LinkHandler";
11
11
  import { Favorites } from "../Favorites";
12
12
  import { ZappPipesScreenContext } from "../../Contexts";
13
13
  import { componentsLogger } from "../../Helpers/logger";
14
- import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
15
- import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
14
+ import {
15
+ useAppSelector,
16
+ usePlugins,
17
+ } from "@applicaster/zapp-react-native-redux/hooks";
18
+ import {
19
+ useNavigation,
20
+ useRivers,
21
+ } from "@applicaster/zapp-react-native-utils/reactHooks";
16
22
  import { useScreenAnalytics } from "@applicaster/zapp-react-native-utils/analyticsUtils/helpers/hooks";
17
23
 
18
24
  import { useCallbackActions } from "@applicaster/zapp-react-native-utils/zappFrameworkUtils/HookCallback/useCallbackActions";
19
25
  import { ScreenResultCallback } from "@applicaster/zapp-react-native-utils/zappFrameworkUtils/HookCallback/callbackNavigationAction";
26
+ import { selectComponents } from "@applicaster/zapp-react-native-redux";
20
27
 
21
28
  const logger = componentsLogger.addSubsystem("ScreenResolver");
22
29
 
@@ -49,11 +56,10 @@ export function ScreenResolverComponent(props: Props) {
49
56
 
50
57
  const { hookPlugin } = screenData || {};
51
58
 
52
- const { components, plugins, rivers } = usePickFromState([
53
- "components",
54
- "plugins",
55
- "rivers",
56
- ]);
59
+ const plugins = usePlugins();
60
+ const rivers = useRivers();
61
+
62
+ const components = useAppSelector(selectComponents);
57
63
 
58
64
  const {
59
65
  videoModalState: { mode },
@@ -1,6 +1,11 @@
1
1
  import { makeListOf } from "@applicaster/zapp-react-native-utils/arrayUtils";
2
2
  import { isFirstComponentGallery } from "@applicaster/zapp-react-native-utils/componentsUtils";
3
- import { once } from "ramda";
3
+ import { race, Subject, Subscription } from "rxjs";
4
+ import { first } from "rxjs/operators";
5
+
6
+ import { withTimeout$ } from "@applicaster/zapp-react-native-utils/idleUtils";
7
+
8
+ const MAX_TIMEOUT_TO_WAIT_COMPONENTS_TO_LOAD = 2000; // 2 seconds
4
9
 
5
10
  const INITIAL_NUMBER_TO_LOAD = 3;
6
11
 
@@ -34,7 +39,8 @@ const getNumberOfComponentsWaitToLoadBeforePresent = (
34
39
  export class ScreenRevealManager {
35
40
  public numberOfComponentsWaitToLoadBeforePresent: number;
36
41
  private renderingState: Array<ComponentLoadingState>;
37
- private callback: Callback;
42
+ private subject$ = new Subject<void>();
43
+ private subscription: Subscription;
38
44
 
39
45
  constructor(componentsToRender: ZappUIComponent[], callback: Callback) {
40
46
  this.numberOfComponentsWaitToLoadBeforePresent =
@@ -45,32 +51,58 @@ export class ScreenRevealManager {
45
51
  this.numberOfComponentsWaitToLoadBeforePresent
46
52
  );
47
53
 
48
- this.callback = once(callback);
54
+ this.subscription = race(
55
+ withTimeout$(MAX_TIMEOUT_TO_WAIT_COMPONENTS_TO_LOAD),
56
+ this.subject$
57
+ )
58
+ .pipe(first())
59
+ .subscribe(callback);
49
60
  }
50
61
 
51
62
  onLoadFinished = (index: number): void => {
63
+ const currentState = this.renderingState[index];
64
+
65
+ if (
66
+ COMPONENT_LOADING_STATE.LOADED_WITH_SUCCESS === currentState ||
67
+ COMPONENT_LOADING_STATE.LOADED_WITH_FAILURE === currentState
68
+ ) {
69
+ return;
70
+ }
71
+
52
72
  this.renderingState[index] = COMPONENT_LOADING_STATE.LOADED_WITH_SUCCESS;
53
73
 
54
74
  if (
55
75
  getNumberOfLoaded(this.renderingState) >=
56
76
  this.numberOfComponentsWaitToLoadBeforePresent
57
77
  ) {
58
- this.setIsReadyToShow();
78
+ this.subject$.next();
79
+ this.subject$.complete();
59
80
  }
60
81
  };
61
82
 
62
83
  onLoadFailed = (index: number): void => {
84
+ const currentState = this.renderingState[index];
85
+
86
+ if (
87
+ COMPONENT_LOADING_STATE.LOADED_WITH_SUCCESS === currentState ||
88
+ COMPONENT_LOADING_STATE.LOADED_WITH_FAILURE === currentState
89
+ ) {
90
+ return;
91
+ }
92
+
63
93
  this.renderingState[index] = COMPONENT_LOADING_STATE.LOADED_WITH_FAILURE;
64
94
 
65
95
  if (
66
96
  getNumberOfLoaded(this.renderingState) >=
67
97
  this.numberOfComponentsWaitToLoadBeforePresent
68
98
  ) {
69
- this.setIsReadyToShow();
99
+ this.subject$.next();
100
+ this.subject$.complete();
70
101
  }
71
102
  };
72
103
 
73
- setIsReadyToShow = (): void => {
74
- this.callback();
75
- };
104
+ dispose(): void {
105
+ this.subscription?.unsubscribe();
106
+ this.subject$.complete();
107
+ }
76
108
  }
@@ -2,106 +2,123 @@ import {
2
2
  ScreenRevealManager,
3
3
  COMPONENT_LOADING_STATE,
4
4
  } from "../ScreenRevealManager";
5
+ import { Subject } from "rxjs";
6
+
7
+ jest.mock("@applicaster/zapp-react-native-utils/arrayUtils", () => ({
8
+ makeListOf: jest.fn((value: any, length: number) =>
9
+ Array(length).fill(value)
10
+ ),
11
+ }));
12
+
13
+ jest.mock("@applicaster/zapp-react-native-utils/componentsUtils", () => ({
14
+ isFirstComponentGallery: jest.fn(),
15
+ }));
16
+
17
+ jest.mock("@applicaster/zapp-react-native-utils/idleUtils", () => ({
18
+ withTimeout$: jest.fn(),
19
+ }));
20
+
21
+ import { makeListOf } from "@applicaster/zapp-react-native-utils/arrayUtils";
22
+ import { isFirstComponentGallery } from "@applicaster/zapp-react-native-utils/componentsUtils";
23
+ import { withTimeout$ } from "@applicaster/zapp-react-native-utils/idleUtils";
5
24
 
6
25
  describe("ScreenRevealManager", () => {
7
- const mockCallback = jest.fn();
26
+ let mockCallback: jest.Mock;
27
+ let timeout$: Subject<void>;
8
28
 
9
29
  beforeEach(() => {
10
- jest.clearAllMocks();
11
- });
12
-
13
- it("should initialize with the correct number of components to wait for", () => {
14
- const componentsToRender: ZappUIComponent[] = [
15
- { component_type: "component1" },
16
- { component_type: "component2" },
17
- { component_type: "component3" },
18
- ];
30
+ jest.useFakeTimers();
31
+ mockCallback = jest.fn();
32
+ timeout$ = new Subject();
19
33
 
20
- const manager = new ScreenRevealManager(componentsToRender, mockCallback);
34
+ (withTimeout$ as jest.Mock).mockReturnValue(timeout$);
35
+ (isFirstComponentGallery as jest.Mock).mockReturnValue(false);
21
36
 
22
- expect(manager.numberOfComponentsWaitToLoadBeforePresent).toBe(3);
37
+ (makeListOf as jest.Mock).mockImplementation((value, length) =>
38
+ Array(length).fill(value)
39
+ );
40
+ });
23
41
 
24
- expect(manager.renderingState).toEqual([
25
- COMPONENT_LOADING_STATE.UNKNOWN,
26
- COMPONENT_LOADING_STATE.UNKNOWN,
27
- COMPONENT_LOADING_STATE.UNKNOWN,
28
- ]);
42
+ afterEach(() => {
43
+ jest.clearAllTimers();
44
+ jest.useRealTimers();
45
+ jest.resetAllMocks();
29
46
  });
30
47
 
31
- it("should call the callback when the required number of components are loaded successfully", () => {
32
- const componentsToRender: ZappUIComponent[] = [
33
- { component_type: "component1" },
34
- { component_type: "component2" },
35
- { component_type: "component3" },
36
- ];
48
+ // ────────────────────────────────────────────────
49
+ it("should initialize with correct number of components and UNKNOWN state", () => {
50
+ const components = new Array(5).fill({});
51
+ const mgr = new ScreenRevealManager(components, mockCallback);
37
52
 
38
- const manager = new ScreenRevealManager(componentsToRender, mockCallback);
53
+ expect(mgr.numberOfComponentsWaitToLoadBeforePresent).toBe(3);
54
+ expect(makeListOf).toHaveBeenCalledWith(COMPONENT_LOADING_STATE.UNKNOWN, 3);
55
+ });
39
56
 
40
- manager.onLoadFinished(0);
41
- manager.onLoadFinished(1);
42
- manager.onLoadFinished(2);
57
+ // ────────────────────────────────────────────────
58
+ it("should set numberOfComponentsWaitToLoadBeforePresent to 1 if first component is gallery", () => {
59
+ (isFirstComponentGallery as jest.Mock).mockReturnValue(true);
43
60
 
44
- expect(mockCallback).toHaveBeenCalledTimes(1);
61
+ const components = new Array(5).fill({});
62
+ const mgr = new ScreenRevealManager(components, mockCallback);
63
+
64
+ expect(mgr.numberOfComponentsWaitToLoadBeforePresent).toBe(1);
45
65
  });
46
66
 
47
- it("should call the callback when the required number of components fail to load", () => {
48
- const componentsToRender: ZappUIComponent[] = [
49
- { component_type: "component1" },
50
- { component_type: "component2" },
51
- { component_type: "component3" },
52
- ];
67
+ // ────────────────────────────────────────────────
68
+ it("should trigger callback after all components load successfully", () => {
69
+ const components = new Array(3).fill({});
70
+ const mgr = new ScreenRevealManager(components, mockCallback);
53
71
 
54
- const manager = new ScreenRevealManager(componentsToRender, mockCallback);
72
+ mgr.onLoadFinished(0);
73
+ expect(mockCallback).not.toHaveBeenCalled();
55
74
 
56
- manager.onLoadFailed(0);
57
- manager.onLoadFailed(1);
58
- manager.onLoadFailed(2);
75
+ mgr.onLoadFinished(1);
76
+ expect(mockCallback).not.toHaveBeenCalled();
59
77
 
78
+ mgr.onLoadFinished(2);
60
79
  expect(mockCallback).toHaveBeenCalledTimes(1);
61
80
  });
62
81
 
63
- it("should call the callback when a mix of successful and failed loads meet the required number", () => {
64
- const componentsToRender: ZappUIComponent[] = [
65
- { component_type: "component1" },
66
- { component_type: "component2" },
67
- { component_type: "component3" },
68
- ];
69
-
70
- const manager = new ScreenRevealManager(componentsToRender, mockCallback);
82
+ // ────────────────────────────────────────────────
83
+ it("should trigger callback after some components fail to load but all finished", () => {
84
+ const components = new Array(3).fill({});
85
+ const mgr = new ScreenRevealManager(components, mockCallback);
71
86
 
72
- manager.onLoadFinished(0);
73
- manager.onLoadFailed(1);
74
- manager.onLoadFinished(2);
87
+ mgr.onLoadFinished(0);
88
+ mgr.onLoadFailed(1);
89
+ mgr.onLoadFailed(2);
75
90
 
76
91
  expect(mockCallback).toHaveBeenCalledTimes(1);
77
92
  });
78
93
 
79
- it("should not call the callback if the required number of components are not loaded", () => {
80
- const componentsToRender: ZappUIComponent[] = [
81
- { component_type: "component1" },
82
- { component_type: "component2" },
83
- { component_type: "component3" },
84
- ];
85
-
86
- const manager = new ScreenRevealManager(componentsToRender, mockCallback);
94
+ // ────────────────────────────────────────────────
95
+ it("should not trigger callback twice when same component finishes twice", () => {
96
+ const components = new Array(3).fill({});
97
+ const mgr = new ScreenRevealManager(components, mockCallback);
87
98
 
88
- manager.onLoadFinished(0);
89
- manager.onLoadFailed(1);
99
+ mgr.onLoadFinished(0);
100
+ mgr.onLoadFinished(0); // duplicate
101
+ mgr.onLoadFinished(1);
102
+ mgr.onLoadFinished(2);
90
103
 
91
- expect(mockCallback).not.toHaveBeenCalled();
104
+ expect(mockCallback).toHaveBeenCalledTimes(1);
92
105
  });
93
106
 
94
- it("should call the callback when the when first component is gallery and it was loaded successfully", () => {
95
- const componentsToRender: ZappUIComponent[] = [
96
- { component_type: "gallery-qb" },
97
- { component_type: "component2" },
98
- { component_type: "component3" },
99
- ];
107
+ // ────────────────────────────────────────────────
108
+ it("should trigger callback when timeout$ emits before all loaded", () => {
109
+ const components = new Array(3).fill({});
110
+ new ScreenRevealManager(components, mockCallback);
100
111
 
101
- const manager = new ScreenRevealManager(componentsToRender, mockCallback);
102
-
103
- manager.onLoadFinished(0);
112
+ timeout$.next(); // simulate timeout event from withTimeout$
104
113
 
105
114
  expect(mockCallback).toHaveBeenCalledTimes(1);
106
115
  });
116
+
117
+ // ────────────────────────────────────────────────
118
+ it("should not call callback if nothing loads and no timeout emitted", () => {
119
+ const components = new Array(3).fill({});
120
+ new ScreenRevealManager(components, mockCallback);
121
+
122
+ expect(mockCallback).not.toHaveBeenCalled();
123
+ });
107
124
  });
@@ -0,0 +1,23 @@
1
+ import { ReplaySubject } from "rxjs";
2
+ import { pairwise, filter, first } from "rxjs/operators";
3
+
4
+ // we are interested in last 2 events, because we wait transition from <false> to <true>
5
+ const screenRevealManagerSubject$ = new ReplaySubject<boolean>(2);
6
+
7
+ export const emitScreenRevealManagerIsReadyToShow = () => {
8
+ screenRevealManagerSubject$.next(true);
9
+ };
10
+
11
+ export const emitScreenRevealManagerIsNotReadyToShow = () => {
12
+ screenRevealManagerSubject$.next(false);
13
+ };
14
+
15
+ export const waitUntilScreenRevealManagerIsReady = () => {
16
+ return screenRevealManagerSubject$.pipe(
17
+ pairwise(), // emit consecutive pairs: [prev, curr]
18
+ filter(
19
+ ([previousIsReady, currentIsReady]) => !previousIsReady && currentIsReady
20
+ ), // detect transition from not_ready to ready
21
+ first()
22
+ );
23
+ };
@@ -1,21 +1,23 @@
1
1
  import * as React from "react";
2
- import { Animated } from "react-native";
2
+ import { Animated, StyleSheet } from "react-native";
3
3
  import { isFirstComponentScreenPicker } from "@applicaster/zapp-react-native-utils/componentsUtils";
4
- import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
5
4
  import { useRefWithInitialValue } from "@applicaster/zapp-react-native-utils/reactHooks/state/useRefWithInitialValue";
5
+ import { useTheme } from "@applicaster/zapp-react-native-utils/theme";
6
6
 
7
7
  import { ScreenRevealManager } from "./ScreenRevealManager";
8
+ import {
9
+ emitScreenRevealManagerIsReadyToShow,
10
+ emitScreenRevealManagerIsNotReadyToShow,
11
+ } from "./utils";
8
12
 
9
- const flex = platformSelect({
10
- tvos: 1,
11
- android_tv: 1,
12
- web: undefined,
13
- samsung_tv: undefined,
14
- lg_tv: undefined,
15
- default: undefined,
13
+ const styles = StyleSheet.create({
14
+ container: {
15
+ ...StyleSheet.absoluteFillObject,
16
+ position: "absolute",
17
+ },
16
18
  });
17
19
 
18
- export const TIMEOUT = 500; // 500 ms
20
+ export const TIMEOUT = 300; // 300 ms
19
21
 
20
22
  const HIDDEN = 0; // opacity = 0
21
23
 
@@ -29,29 +31,48 @@ export const withScreenRevealManager = (Component) => {
29
31
  return function WithScreenRevealManager(props: Props) {
30
32
  const { componentsToRender } = props;
31
33
 
32
- const [isReadyToShow, setIsReadyToShow] = React.useState(false);
34
+ const [isContentReadyToBeShown, setIsContentReadyToBeShown] =
35
+ React.useState(false);
33
36
 
34
- const handleSetIsReadyToShow = React.useCallback(() => {
35
- setIsReadyToShow(true);
37
+ const [isShowOverlay, setIsShowOverlay] = React.useState(true);
38
+
39
+ const theme = useTheme<BaseThemePropertiesTV>();
40
+
41
+ const handleSetIsContentReadyToBeShown = React.useCallback(() => {
42
+ setIsContentReadyToBeShown(true);
36
43
  }, []);
37
44
 
38
45
  const managerRef = useRefWithInitialValue<ScreenRevealManager>(
39
- () => new ScreenRevealManager(componentsToRender, handleSetIsReadyToShow)
46
+ () =>
47
+ new ScreenRevealManager(
48
+ componentsToRender,
49
+ handleSetIsContentReadyToBeShown
50
+ )
40
51
  );
41
52
 
42
53
  const opacityRef = useRefWithInitialValue<Animated.Value>(
43
- () => new Animated.Value(HIDDEN)
54
+ () => new Animated.Value(SHOWN)
44
55
  );
45
56
 
46
57
  React.useEffect(() => {
47
- if (isReadyToShow) {
58
+ if (!isContentReadyToBeShown) {
59
+ emitScreenRevealManagerIsNotReadyToShow();
60
+ } else {
61
+ emitScreenRevealManagerIsReadyToShow();
62
+ }
63
+ }, [isContentReadyToBeShown]);
64
+
65
+ React.useEffect(() => {
66
+ if (isContentReadyToBeShown) {
48
67
  Animated.timing(opacityRef.current, {
49
- toValue: SHOWN,
68
+ toValue: HIDDEN,
50
69
  duration: TIMEOUT,
51
70
  useNativeDriver: true,
52
- }).start();
71
+ }).start(() => {
72
+ setIsShowOverlay(false);
73
+ });
53
74
  }
54
- }, [isReadyToShow]);
75
+ }, [isContentReadyToBeShown]);
55
76
 
56
77
  if (isFirstComponentScreenPicker(componentsToRender)) {
57
78
  // for screen-picker with have additional internal ComponentsMap, no need to add this wrapper
@@ -59,10 +80,7 @@ export const withScreenRevealManager = (Component) => {
59
80
  }
60
81
 
61
82
  return (
62
- <Animated.View
63
- style={{ opacity: opacityRef.current, flex }}
64
- testID="animated-component"
65
- >
83
+ <>
66
84
  <Component
67
85
  {...props}
68
86
  initialNumberToLoad={
@@ -73,7 +91,19 @@ export const withScreenRevealManager = (Component) => {
73
91
  }
74
92
  onLoadFailedFromScreenRevealManager={managerRef.current.onLoadFailed}
75
93
  />
76
- </Animated.View>
94
+ {isShowOverlay ? (
95
+ <Animated.View
96
+ style={[
97
+ styles.container,
98
+ {
99
+ opacity: opacityRef.current,
100
+ backgroundColor: theme.app_background_color,
101
+ },
102
+ ]}
103
+ testID="animated-component"
104
+ />
105
+ ) : null}
106
+ </>
77
107
  );
78
108
  };
79
109
  };
@@ -8,6 +8,7 @@ import { isEmptyOrNil } from "@applicaster/zapp-react-native-utils/cellUtils";
8
8
  import { focusManager } from "@applicaster/zapp-react-native-utils/appUtils/focusManager";
9
9
  import { FocusableGroup } from "@applicaster/zapp-react-native-ui-components/Components/FocusableGroup";
10
10
  import { Focusable } from "@applicaster/zapp-react-native-ui-components/Components/Focusable";
11
+ import { useAccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager/hooks";
11
12
  import { Gutter } from "../Gutter";
12
13
  import Tab from "./Tab";
13
14
  import { getStyles } from "./styles";
@@ -28,11 +29,14 @@ const TabsComponent = ({
28
29
  style,
29
30
  selectedEntryIndex,
30
31
  setSelectedEntry,
32
+ accessibility,
31
33
  }: TabsProps & Partial<TabsSelectionContextType>) => {
32
34
  const configuration = useConfiguration();
33
35
  const config = applyFontConfig(configuration);
34
36
  const styles = useMemo(() => getStyles(config), [config]);
35
37
 
38
+ const accessibilityManager = useAccessibilityManager({});
39
+
36
40
  const {
37
41
  tab_bar_gutter: horizontalGutter,
38
42
  tab_bar_background_image: bgImage,
@@ -60,10 +64,20 @@ const TabsComponent = ({
60
64
  );
61
65
 
62
66
  const onListElementFocus = useCallback(
63
- (index) => {
67
+ (index, isSelected: boolean, item: ZappEntry) => {
68
+ if (isSelected) {
69
+ accessibilityManager.readText({
70
+ text: `${accessibility?.selectedHint} ${item.title}`,
71
+ });
72
+ } else {
73
+ accessibilityManager.readText({
74
+ text: `${accessibility?.hint} ${item.title}`,
75
+ });
76
+ }
77
+
64
78
  scrollToSelectedIndex(index, VIEW_POSITION);
65
79
  },
66
- [scrollToSelectedIndex]
80
+ [scrollToSelectedIndex, accessibility]
67
81
  );
68
82
 
69
83
  const renderItem = useCallback(
@@ -94,7 +108,7 @@ const TabsComponent = ({
94
108
  id={itemId}
95
109
  testID={itemId}
96
110
  preferredFocus={isSelected}
97
- onFocus={() => onListElementFocus(index)}
111
+ onFocus={() => onListElementFocus(index, isSelected, item)}
98
112
  onPress={() => setSelectedEntry && setSelectedEntry(item)}
99
113
  style={style}
100
114
  >
@@ -149,6 +163,9 @@ const TabsComponent = ({
149
163
  shouldUsePreferredFocus
150
164
  isWithMemory={false}
151
165
  nextFocusDown={parentFocus?.nextFocusDown}
166
+ onFocus={() => {
167
+ accessibilityManager.addHeading(accessibility?.announcement);
168
+ }}
152
169
  >
153
170
  <View style={tabs}>
154
171
  <ImageBackground
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { useEffect } from "react";
2
2
  import { equals } from "ramda";
3
3
  import { Animated, ViewProps, ViewStyle } from "react-native";
4
4
  import { useSafeAreaFrame } from "react-native-safe-area-context";
@@ -95,9 +95,22 @@ function SceneComponent({
95
95
  });
96
96
 
97
97
  const frame = useSafeAreaFrame();
98
+
99
+ const [memoFrame, setMemoFrame] = React.useState(frame);
100
+
101
+ useEffect(() => {
102
+ if (isActive) {
103
+ setMemoFrame((oldFrame) =>
104
+ oldFrame.width === frame.width && oldFrame.height === frame.height
105
+ ? oldFrame
106
+ : frame
107
+ );
108
+ }
109
+ }, [isActive, frame.width, frame.height]);
110
+
98
111
  const isAnimating = animating && overlayStyle;
99
112
 
100
- const dimensions = isAnimating ? fullWidthDimensions : frame;
113
+ const dimensions = isAnimating ? fullWidthDimensions : memoFrame;
101
114
 
102
115
  return (
103
116
  <Animated.View
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
3
3
  import { useDimensions } from "@applicaster/zapp-react-native-utils/reactHooks/layout";
4
- import { usePickFromState } from "@applicaster/zapp-react-native-redux/hooks";
4
+ import { useAppData } from "@applicaster/zapp-react-native-redux";
5
+
5
6
  import { TransitionerComponent } from "./Transitioner";
6
7
 
7
8
  export const Transitioner = (props) => {
@@ -16,8 +17,7 @@ export const Transitioner = (props) => {
16
17
  deviceInfo: true,
17
18
  });
18
19
 
19
- const { appData } = usePickFromState(["appData"]);
20
- const isTabletPortrait = appData?.isTabletPortrait;
20
+ const { isTabletPortrait } = useAppData();
21
21
 
22
22
  return (
23
23
  <TransitionerComponent
@@ -9,6 +9,7 @@ exports[`PlayerLiveImageComponent should render correctly with default props 1`]
9
9
  <View>
10
10
  <View
11
11
  collapsable={false}
12
+ renderToHardwareTextureAndroid={false}
12
13
  style={
13
14
  {
14
15
  "opacity": 1,