@applicaster/zapp-react-native-ui-components 14.0.0-alpha.5521273514 → 14.0.0-alpha.5533663133
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/AudioPlayer/index.tsx +15 -0
- package/Components/AudioPlayer/mobile/Layout.tsx +66 -0
- package/Components/AudioPlayer/{__tests__/__snapshots__/audioPlayer.test.js.snap → mobile/__tests__/__snapshots__/audioPlayerMobileLayout.test.js.snap} +2 -2
- package/Components/AudioPlayer/mobile/__tests__/audioPlayerMobileLayout.test.js +18 -0
- package/Components/AudioPlayer/mobile/index.tsx +18 -0
- package/Components/AudioPlayer/tv/Artwork.tsx +41 -0
- package/Components/AudioPlayer/{Channel.tsx → tv/Channel.tsx} +7 -7
- package/Components/AudioPlayer/tv/Layout.tsx +168 -0
- package/Components/AudioPlayer/{Runtime.tsx → tv/Runtime.tsx} +9 -2
- package/Components/AudioPlayer/{Summary.tsx → tv/Summary.tsx} +17 -10
- package/Components/AudioPlayer/tv/Title.tsx +46 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/Runtime.test.js.snap +4 -4
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/artWork.test.js.snap +9 -4
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/audioPlayer.test.js.snap +164 -0
- package/Components/AudioPlayer/tv/__tests__/__snapshots__/channel.test.js.snap +19 -0
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap +2 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/title.test.js.snap +2 -3
- package/Components/AudioPlayer/{__tests__ → tv/__tests__}/audioPlayer.test.js +7 -3
- package/Components/AudioPlayer/{helpers.tsx → tv/helpers.tsx} +3 -4
- package/Components/AudioPlayer/{AudioPlayer.tsx → tv/index.tsx} +18 -57
- package/Components/AudioPlayer/types.ts +40 -0
- package/Components/GeneralContentScreen/GeneralContentScreen.tsx +0 -2
- package/Components/MasterCell/DefaultComponents/Text/index.tsx +1 -0
- package/Components/MasterCell/index.tsx +1 -1
- package/Components/PlayerContainer/PlayerContainer.tsx +2 -2
- package/Components/PlayerImageBackground/index.tsx +1 -1
- package/Components/River/ComponentsMap/ComponentsMap.tsx +1 -5
- package/Components/River/RiverItem.tsx +8 -8
- package/Components/River/TV/River.tsx +0 -3
- package/Components/River/__tests__/__snapshots__/componentsMap.test.js.snap +0 -6
- package/Components/TopMarginApplicator/TopMarginApplicator.tsx +16 -15
- package/Components/VideoModal/__tests__/__snapshots__/PlayerWrapper.test.tsx.snap +60 -0
- package/Components/VideoModal/hooks/__tests__/useDelayedPlayerDetails.test.ts +17 -55
- package/Components/VideoModal/hooks/useDelayedPlayerDetails.ts +15 -26
- package/index.d.ts +0 -1
- package/package.json +5 -5
- package/Components/AudioPlayer/Artwork.tsx +0 -35
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +0 -202
- package/Components/AudioPlayer/Title.tsx +0 -39
- package/Components/AudioPlayer/__tests__/__snapshots__/audioPlayerLayout.test.js.snap +0 -66
- package/Components/AudioPlayer/__tests__/__snapshots__/channel.test.js.snap +0 -28
- package/Components/AudioPlayer/__tests__/audioPlayerLayout.test.js +0 -26
- package/Components/AudioPlayer/index.ts +0 -1
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/Runtime.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/artWork.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/channel.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/summary.test.js +0 -0
- /package/Components/AudioPlayer/{__tests__ → tv/__tests__}/title.test.js +0 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<AudioPlayerTV /> renders correctly 1`] = `
|
|
4
|
+
<View
|
|
5
|
+
accessibilityIgnoresInvertColors={true}
|
|
6
|
+
>
|
|
7
|
+
<Image
|
|
8
|
+
resizeMode="cover"
|
|
9
|
+
source={
|
|
10
|
+
{
|
|
11
|
+
"uri": "https://example.com",
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
style={
|
|
15
|
+
[
|
|
16
|
+
{
|
|
17
|
+
"bottom": 0,
|
|
18
|
+
"left": 0,
|
|
19
|
+
"position": "absolute",
|
|
20
|
+
"right": 0,
|
|
21
|
+
"top": 0,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"height": undefined,
|
|
25
|
+
"width": undefined,
|
|
26
|
+
},
|
|
27
|
+
undefined,
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
/>
|
|
31
|
+
<View
|
|
32
|
+
style={
|
|
33
|
+
[
|
|
34
|
+
{
|
|
35
|
+
"backgroundColor": "transparent",
|
|
36
|
+
"overflow": "hidden",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"backgroundColor": undefined,
|
|
40
|
+
},
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
>
|
|
44
|
+
<View
|
|
45
|
+
style={
|
|
46
|
+
{
|
|
47
|
+
"marginHorizontal": 24,
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
>
|
|
51
|
+
<Image
|
|
52
|
+
fadeDuration={0}
|
|
53
|
+
resizeMode="cover"
|
|
54
|
+
source={
|
|
55
|
+
{
|
|
56
|
+
"uri": "artwork_url",
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
style={
|
|
60
|
+
[
|
|
61
|
+
{
|
|
62
|
+
"height": 400,
|
|
63
|
+
"width": 400,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"borderRadius": 0,
|
|
67
|
+
},
|
|
68
|
+
]
|
|
69
|
+
}
|
|
70
|
+
/>
|
|
71
|
+
</View>
|
|
72
|
+
<View>
|
|
73
|
+
<Image
|
|
74
|
+
fadeDuration={0}
|
|
75
|
+
source={
|
|
76
|
+
{
|
|
77
|
+
"uri": "https://example.com",
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
style={
|
|
81
|
+
{
|
|
82
|
+
"height": 72,
|
|
83
|
+
"marginBottom": 30,
|
|
84
|
+
"width": 128,
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/>
|
|
88
|
+
<View
|
|
89
|
+
style={
|
|
90
|
+
{
|
|
91
|
+
"marginBottom": 12,
|
|
92
|
+
"width": 600,
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
>
|
|
96
|
+
<Text
|
|
97
|
+
numberOfLines={3}
|
|
98
|
+
style={
|
|
99
|
+
{
|
|
100
|
+
"color": "white",
|
|
101
|
+
"fontFamily": null,
|
|
102
|
+
"fontSize": 38,
|
|
103
|
+
"fontWeight": "600",
|
|
104
|
+
"textAlign": "right",
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
>
|
|
108
|
+
tittle
|
|
109
|
+
</Text>
|
|
110
|
+
</View>
|
|
111
|
+
<View
|
|
112
|
+
style={
|
|
113
|
+
{
|
|
114
|
+
"marginBottom": 30,
|
|
115
|
+
"width": 600,
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
>
|
|
119
|
+
<Text
|
|
120
|
+
numberOfLines={3}
|
|
121
|
+
style={
|
|
122
|
+
{
|
|
123
|
+
"color": "white",
|
|
124
|
+
"fontFamily": null,
|
|
125
|
+
"fontSize": 20,
|
|
126
|
+
"fontWeight": "600",
|
|
127
|
+
"opacity": 0.8,
|
|
128
|
+
"textAlign": "right",
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
>
|
|
132
|
+
Summary
|
|
133
|
+
</Text>
|
|
134
|
+
</View>
|
|
135
|
+
<View
|
|
136
|
+
style={
|
|
137
|
+
{
|
|
138
|
+
"justifyContent": "flex-end",
|
|
139
|
+
"width": 600,
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
>
|
|
143
|
+
<Text
|
|
144
|
+
numberOfLines={1}
|
|
145
|
+
style={
|
|
146
|
+
{
|
|
147
|
+
"alignItems": "flex-start",
|
|
148
|
+
"color": "white",
|
|
149
|
+
"flexDirection": "row-reverse",
|
|
150
|
+
"fontFamily": null,
|
|
151
|
+
"fontSize": 20,
|
|
152
|
+
"justifyContent": "flex-end",
|
|
153
|
+
"opacity": 0.8,
|
|
154
|
+
"textAlign": "right",
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
>
|
|
158
|
+
10:10 - 11:11
|
|
159
|
+
</Text>
|
|
160
|
+
</View>
|
|
161
|
+
</View>
|
|
162
|
+
</View>
|
|
163
|
+
</View>
|
|
164
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`<Channel /> renders correctly 1`] = `
|
|
4
|
+
<Image
|
|
5
|
+
fadeDuration={0}
|
|
6
|
+
source={
|
|
7
|
+
{
|
|
8
|
+
"uri": "https://example.com",
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
style={
|
|
12
|
+
{
|
|
13
|
+
"height": 72,
|
|
14
|
+
"marginBottom": 30,
|
|
15
|
+
"width": 128,
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/>
|
|
19
|
+
`;
|
package/Components/AudioPlayer/{__tests__ → tv/__tests__}/__snapshots__/summary.test.js.snap
RENAMED
|
@@ -4,14 +4,13 @@ exports[`<Summary /> renders correctly 1`] = `
|
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
6
|
{
|
|
7
|
-
"height": 80,
|
|
8
7
|
"marginBottom": 30,
|
|
9
8
|
"width": 600,
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
11
|
>
|
|
13
12
|
<Text
|
|
14
|
-
numberOfLines={
|
|
13
|
+
numberOfLines={3}
|
|
15
14
|
style={
|
|
16
15
|
{
|
|
17
16
|
"color": "white",
|
|
@@ -19,7 +18,7 @@ exports[`<Summary /> renders correctly 1`] = `
|
|
|
19
18
|
"fontSize": 20,
|
|
20
19
|
"fontWeight": "600",
|
|
21
20
|
"opacity": 0.8,
|
|
22
|
-
"textAlign": "
|
|
21
|
+
"textAlign": "right",
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
>
|
|
@@ -4,21 +4,20 @@ exports[`<Title /> renders correctly 1`] = `
|
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
6
|
{
|
|
7
|
-
"height": 100,
|
|
8
7
|
"marginBottom": 12,
|
|
9
8
|
"width": 600,
|
|
10
9
|
}
|
|
11
10
|
}
|
|
12
11
|
>
|
|
13
12
|
<Text
|
|
14
|
-
numberOfLines={
|
|
13
|
+
numberOfLines={3}
|
|
15
14
|
style={
|
|
16
15
|
{
|
|
17
16
|
"color": "white",
|
|
18
17
|
"fontFamily": null,
|
|
19
18
|
"fontSize": 38,
|
|
20
19
|
"fontWeight": "600",
|
|
21
|
-
"textAlign": "
|
|
20
|
+
"textAlign": "right",
|
|
22
21
|
}
|
|
23
22
|
}
|
|
24
23
|
>
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { render } from "@testing-library/react-native";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { AudioPlayerTV } from "..";
|
|
5
|
+
|
|
6
|
+
jest.mock("@applicaster/zapp-react-native-utils/audioPlayerUtils", () => ({
|
|
7
|
+
useArtworkImage: jest.fn(() => "artwork_url"),
|
|
8
|
+
}));
|
|
5
9
|
|
|
6
10
|
const audioPlayerProps = {
|
|
7
11
|
audio_item: {
|
|
@@ -45,9 +49,9 @@ const audioPlayerProps = {
|
|
|
45
49
|
styles: {},
|
|
46
50
|
};
|
|
47
51
|
|
|
48
|
-
describe("<
|
|
52
|
+
describe("<AudioPlayerTV />", () => {
|
|
49
53
|
it("renders correctly", () => {
|
|
50
|
-
const { toJSON } = render(<
|
|
54
|
+
const { toJSON } = render(<AudioPlayerTV {...audioPlayerProps} />);
|
|
51
55
|
expect(toJSON()).toMatchSnapshot();
|
|
52
56
|
});
|
|
53
57
|
});
|
|
@@ -2,9 +2,8 @@ const defaults = {
|
|
|
2
2
|
audio_player_title_color: "white",
|
|
3
3
|
audio_player_summary_color: "white",
|
|
4
4
|
audio_player_background_color: "black",
|
|
5
|
-
|
|
5
|
+
audio_player_background_image: undefined,
|
|
6
6
|
audio_player_rtl: false,
|
|
7
|
-
audio_player_background_image_default_color: "",
|
|
8
7
|
};
|
|
9
8
|
|
|
10
9
|
export function getPropertyFromEntryOrConfig({ entry, plugin_configuration }) {
|
|
@@ -26,14 +25,14 @@ export function getPropertyFromEntryOrConfig({ entry, plugin_configuration }) {
|
|
|
26
25
|
const LTR = {
|
|
27
26
|
flexDirection: "row",
|
|
28
27
|
justifyContent: "flex-start",
|
|
29
|
-
textAlign: "
|
|
28
|
+
textAlign: "left",
|
|
30
29
|
alignItems: "flex-end",
|
|
31
30
|
};
|
|
32
31
|
|
|
33
32
|
const RTL = {
|
|
34
33
|
flexDirection: "row-reverse",
|
|
35
34
|
justifyContent: "flex-end",
|
|
36
|
-
textAlign: "
|
|
35
|
+
textAlign: "right",
|
|
37
36
|
alignItems: "flex-start",
|
|
38
37
|
};
|
|
39
38
|
|
|
@@ -1,60 +1,24 @@
|
|
|
1
1
|
import React, { useCallback, useMemo } from "react";
|
|
2
2
|
|
|
3
3
|
import { platformSelect } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
4
|
+
import { useArtworkImage } from "@applicaster/zapp-react-native-utils/audioPlayerUtils";
|
|
4
5
|
|
|
5
|
-
import {
|
|
6
|
+
import { AudioPlayerTVLayout } from "./Layout";
|
|
6
7
|
|
|
7
|
-
import { AudioPlayerLayout } from "./AudioPlayerLayout";
|
|
8
8
|
import { Channel } from "./Channel";
|
|
9
9
|
import { Title } from "./Title";
|
|
10
10
|
import { Summary } from "./Summary";
|
|
11
11
|
import { Runtime } from "./Runtime";
|
|
12
12
|
import { getPropertyFromEntryOrConfig } from "./helpers";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
audio_player_artwork_aspect_ratio?: string;
|
|
19
|
-
audio_player_background_image?: string;
|
|
20
|
-
audio_player_background_color?: string;
|
|
21
|
-
audio_player_channel_icon?: string;
|
|
22
|
-
audio_player_title_color?: string;
|
|
23
|
-
audio_player_summary_color?: string;
|
|
24
|
-
audio_player_rtl?: boolean;
|
|
25
|
-
audio_player_background_image_default_color?: string;
|
|
26
|
-
start_time?: string;
|
|
27
|
-
end_time?: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
plugin_configuration: {
|
|
31
|
-
audio_player_background_color?: string;
|
|
32
|
-
audio_player_title_color?: string;
|
|
33
|
-
audio_player_summary_color?: string;
|
|
34
|
-
audio_player_rtl?: string;
|
|
35
|
-
audio_player_background_image_default_color?: string;
|
|
36
|
-
audio_player_background_image?: string;
|
|
37
|
-
audio_player_artwork_aspect_ratio?: string;
|
|
38
|
-
lg_tv_audio_player_title_font_family?: string;
|
|
39
|
-
lg_tv_audio_player_title_font_size?: number;
|
|
40
|
-
lg_tv_audio_player_summary_font_family?: string;
|
|
41
|
-
lg_tv_audio_player_summary_font_size?: number;
|
|
42
|
-
samsung_tv_audio_player_title_font_family?: string;
|
|
43
|
-
samsung_tv_audio_player_title_font_size?: number;
|
|
44
|
-
samsung_tv_audio_player_summary_font_family?: string;
|
|
45
|
-
samsung_tv_audio_player_summary_font_size?: number;
|
|
46
|
-
tv_os_audio_player_title_font_family?: string;
|
|
47
|
-
tv_os_audio_player_title_font_size?: number;
|
|
48
|
-
tv_os_audio_player_summary_font_family?: string;
|
|
49
|
-
tv_os_audio_player_summary_font_size?: number;
|
|
50
|
-
};
|
|
51
|
-
style?: ViewStyle;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export function AudioPlayer(props: Props) {
|
|
55
|
-
const { audio_item, plugin_configuration, style } = props;
|
|
13
|
+
|
|
14
|
+
import { Props } from "../types";
|
|
15
|
+
|
|
16
|
+
export function AudioPlayerTV(props: Props) {
|
|
17
|
+
const { audio_item, plugin_configuration, style = {} } = props;
|
|
56
18
|
const { extensions, title, summary } = audio_item;
|
|
57
19
|
|
|
20
|
+
const artwork = useArtworkImage(audio_item);
|
|
21
|
+
|
|
58
22
|
const getProp = useCallback(
|
|
59
23
|
getPropertyFromEntryOrConfig({
|
|
60
24
|
entry: audio_item,
|
|
@@ -64,19 +28,20 @@ export function AudioPlayer(props: Props) {
|
|
|
64
28
|
);
|
|
65
29
|
|
|
66
30
|
const config = useMemo(() => {
|
|
67
|
-
// Checking if we are
|
|
31
|
+
// Checking if we are receiving items from the DSP
|
|
68
32
|
const titleColor = getProp("audio_player_title_color");
|
|
69
33
|
const summaryColor = getProp("audio_player_summary_color");
|
|
70
34
|
const backgroundColor = getProp("audio_player_background_color");
|
|
71
35
|
const backgroundImage = getProp("audio_player_background_image");
|
|
72
|
-
const artworkAspectRatio = getProp("audio_player_artwork_aspect_ratio");
|
|
73
36
|
const channelIcon = getProp("audio_player_channel_icon");
|
|
74
37
|
const rtlFlag = getProp("audio_player_rtl");
|
|
75
38
|
|
|
76
|
-
const
|
|
77
|
-
"
|
|
39
|
+
const backgroundImageOverlay = getProp(
|
|
40
|
+
"audio_player_background_image_overlay"
|
|
78
41
|
);
|
|
79
42
|
|
|
43
|
+
const artworkBorderRadius = getProp("audio_player_artwork_border_radius");
|
|
44
|
+
|
|
80
45
|
const isRTL = rtlFlag === "1" || rtlFlag === "true" || rtlFlag === true;
|
|
81
46
|
|
|
82
47
|
const titleFontFamily = getProp(
|
|
@@ -151,22 +116,18 @@ export function AudioPlayer(props: Props) {
|
|
|
151
116
|
summaryFontSize,
|
|
152
117
|
runTimeFontFamily,
|
|
153
118
|
runTimeFontSize,
|
|
154
|
-
artworkAspectRatio,
|
|
155
119
|
channelIcon,
|
|
156
|
-
|
|
120
|
+
artworkBorderRadius,
|
|
121
|
+
backgroundImageOverlay,
|
|
157
122
|
};
|
|
158
123
|
}, [getProp]);
|
|
159
124
|
|
|
160
|
-
const artwork = imageSrcFromMediaItem(audio_item, [
|
|
161
|
-
config?.artworkAspectRatio,
|
|
162
|
-
]);
|
|
163
|
-
|
|
164
125
|
return (
|
|
165
|
-
<
|
|
126
|
+
<AudioPlayerTVLayout artwork={artwork} config={config} style={style}>
|
|
166
127
|
<Channel srcImage={config?.channelIcon} config={config} />
|
|
167
128
|
<Title title={title} config={config} />
|
|
168
129
|
<Summary summary={summary} config={config} />
|
|
169
130
|
<Runtime {...extensions} config={config} />
|
|
170
|
-
</
|
|
131
|
+
</AudioPlayerTVLayout>
|
|
171
132
|
);
|
|
172
133
|
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ViewStyle } from "react-native";
|
|
2
|
+
|
|
3
|
+
export type Props = {
|
|
4
|
+
audio_item: ZappEntry & {
|
|
5
|
+
extensions?: {
|
|
6
|
+
audio_player_artwork_aspect_ratio?: string;
|
|
7
|
+
audio_player_background_image?: string;
|
|
8
|
+
audio_player_background_color?: string;
|
|
9
|
+
audio_player_channel_icon?: string;
|
|
10
|
+
audio_player_title_color?: string;
|
|
11
|
+
audio_player_summary_color?: string;
|
|
12
|
+
audio_player_rtl?: boolean;
|
|
13
|
+
audio_player_background_image_default_color?: string;
|
|
14
|
+
start_time?: string;
|
|
15
|
+
end_time?: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
plugin_configuration: {
|
|
19
|
+
audio_player_background_color?: string;
|
|
20
|
+
audio_player_title_color?: string;
|
|
21
|
+
audio_player_summary_color?: string;
|
|
22
|
+
audio_player_rtl?: string;
|
|
23
|
+
audio_player_background_image_default_color?: string;
|
|
24
|
+
audio_player_background_image?: string;
|
|
25
|
+
audio_player_artwork_aspect_ratio?: string;
|
|
26
|
+
lg_tv_audio_player_title_font_family?: string;
|
|
27
|
+
lg_tv_audio_player_title_font_size?: number;
|
|
28
|
+
lg_tv_audio_player_summary_font_family?: string;
|
|
29
|
+
lg_tv_audio_player_summary_font_size?: number;
|
|
30
|
+
samsung_tv_audio_player_title_font_family?: string;
|
|
31
|
+
samsung_tv_audio_player_title_font_size?: number;
|
|
32
|
+
samsung_tv_audio_player_summary_font_family?: string;
|
|
33
|
+
samsung_tv_audio_player_summary_font_size?: number;
|
|
34
|
+
tv_os_audio_player_title_font_family?: string;
|
|
35
|
+
tv_os_audio_player_title_font_size?: number;
|
|
36
|
+
tv_os_audio_player_summary_font_family?: string;
|
|
37
|
+
tv_os_audio_player_summary_font_size?: number;
|
|
38
|
+
};
|
|
39
|
+
style?: ViewStyle;
|
|
40
|
+
};
|
|
@@ -30,7 +30,6 @@ export const GeneralContentScreen = ({
|
|
|
30
30
|
isScreenWrappedInContainer,
|
|
31
31
|
componentsMapExtraProps = {},
|
|
32
32
|
focused,
|
|
33
|
-
extraOffset,
|
|
34
33
|
parentFocus,
|
|
35
34
|
containerHeight,
|
|
36
35
|
preferredFocus = false,
|
|
@@ -122,7 +121,6 @@ export const GeneralContentScreen = ({
|
|
|
122
121
|
isScreenWrappedInContainer={isScreenWrappedInContainer}
|
|
123
122
|
parentFocus={parentFocus}
|
|
124
123
|
focused={focused}
|
|
125
|
-
extraOffset={extraOffset}
|
|
126
124
|
containerHeight={containerHeight}
|
|
127
125
|
preferredFocus={preferredFocus}
|
|
128
126
|
{...componentsMapExtraProps}
|
|
@@ -86,7 +86,7 @@ export function masterCellBuilder({
|
|
|
86
86
|
entry: item,
|
|
87
87
|
state: getEntryState(state, entryIsSelected),
|
|
88
88
|
}),
|
|
89
|
-
[state, item
|
|
89
|
+
[state, item, entryIsSelected] // Assuming that item won't mutate
|
|
90
90
|
);
|
|
91
91
|
|
|
92
92
|
const wrapperRef = React.useRef(null);
|
|
@@ -716,11 +716,11 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
716
716
|
key={item.id}
|
|
717
717
|
groupId={FocusableGroupMainContainerId}
|
|
718
718
|
cellTapAction={onCellTap}
|
|
719
|
-
extraAnchorPointYOffset={
|
|
719
|
+
extraAnchorPointYOffset={0}
|
|
720
720
|
isScreenWrappedInContainer={true}
|
|
721
721
|
containerHeight={styles.inlineRiver.height}
|
|
722
722
|
componentsMapExtraProps={{
|
|
723
|
-
isNestedComponentsMap:
|
|
723
|
+
isNestedComponentsMap: true,
|
|
724
724
|
}}
|
|
725
725
|
/>
|
|
726
726
|
)}
|
|
@@ -28,7 +28,7 @@ const PlayerImageBackgroundComponent = ({
|
|
|
28
28
|
defaultImageDimensions,
|
|
29
29
|
}: Props) => {
|
|
30
30
|
const source = React.useMemo(
|
|
31
|
-
() => ({ uri: imageSrcFromMediaItem(entry, imageKey) }),
|
|
31
|
+
() => ({ uri: imageSrcFromMediaItem(entry, [imageKey]) }),
|
|
32
32
|
[imageKey, entry]
|
|
33
33
|
);
|
|
34
34
|
|
|
@@ -281,8 +281,8 @@ function ComponentsMapComponent(props: Props) {
|
|
|
281
281
|
scrollIndicatorInsets={scrollIndicatorInsets}
|
|
282
282
|
extraData={feed}
|
|
283
283
|
stickyHeaderIndices={stickyHeaderIndices}
|
|
284
|
-
onLayout={handleOnLayout}
|
|
285
284
|
removeClippedSubviews={isAndroid}
|
|
285
|
+
onLayout={handleOnLayout}
|
|
286
286
|
initialNumToRender={3}
|
|
287
287
|
maxToRenderPerBatch={10}
|
|
288
288
|
windowSize={12}
|
|
@@ -303,10 +303,6 @@ function ComponentsMapComponent(props: Props) {
|
|
|
303
303
|
onMomentumScrollEnd={_onMomentumScrollEnd}
|
|
304
304
|
onScrollEndDrag={_onScrollEndDrag}
|
|
305
305
|
scrollEventThrottle={16}
|
|
306
|
-
maintainVisibleContentPosition={{
|
|
307
|
-
minIndexForVisible: 0,
|
|
308
|
-
autoscrollToTopThreshold: 10,
|
|
309
|
-
}}
|
|
310
306
|
{...scrollViewExtraProps}
|
|
311
307
|
/>
|
|
312
308
|
</ViewportTracker>
|
|
@@ -39,6 +39,10 @@ function getFeedUrl(feed: ZappFeed, index: number) {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
const isNextIndex = (index, readyIndex) => {
|
|
43
|
+
return readyIndex + 1 >= index;
|
|
44
|
+
};
|
|
45
|
+
|
|
42
46
|
/**
|
|
43
47
|
* useLoadingState for RiverItemComponent
|
|
44
48
|
* takes currentIndex and loadingState as arguments
|
|
@@ -48,24 +52,20 @@ const useLoadingState = (
|
|
|
48
52
|
loadingState: RiverItemType["loadingState"]
|
|
49
53
|
) => {
|
|
50
54
|
const [readyToBeDisplayed, setReadyToBeDisplayed] = React.useState(
|
|
51
|
-
loadingState.getValue().index
|
|
55
|
+
isNextIndex(currentIndex, loadingState.getValue().index)
|
|
52
56
|
);
|
|
53
57
|
|
|
54
58
|
useEffect(() => {
|
|
55
59
|
const subscription = loadingState.subscribe(({ index }) => {
|
|
56
|
-
if (index
|
|
60
|
+
if (isNextIndex(currentIndex, index)) {
|
|
57
61
|
setReadyToBeDisplayed(true);
|
|
58
62
|
}
|
|
59
63
|
});
|
|
60
64
|
|
|
61
|
-
if (loadingState.getValue().index + 1 >= currentIndex) {
|
|
62
|
-
setReadyToBeDisplayed(true);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
65
|
return () => {
|
|
66
66
|
subscription.unsubscribe();
|
|
67
67
|
};
|
|
68
|
-
}, [
|
|
68
|
+
}, [currentIndex]);
|
|
69
69
|
|
|
70
70
|
return readyToBeDisplayed;
|
|
71
71
|
};
|
|
@@ -151,7 +151,7 @@ function RiverItemComponent(props: RiverItemType) {
|
|
|
151
151
|
component={item}
|
|
152
152
|
componentIndex={index}
|
|
153
153
|
onLoadFailed={onLoadFailed}
|
|
154
|
-
onLoadFinished={() => onLoadFinished(index)}
|
|
154
|
+
onLoadFinished={() => onLoadFinished(index)}
|
|
155
155
|
groupId={groupId}
|
|
156
156
|
feedUrl={feedUrl}
|
|
157
157
|
isLast={isLast}
|
|
@@ -26,7 +26,6 @@ type Props = {
|
|
|
26
26
|
componentsMapExtraProps?: any;
|
|
27
27
|
isInsideContainer?: boolean;
|
|
28
28
|
extraAnchorPointYOffset: number;
|
|
29
|
-
extraOffset: number;
|
|
30
29
|
river?: ZappRiver | ZappEntry;
|
|
31
30
|
};
|
|
32
31
|
|
|
@@ -39,7 +38,6 @@ export const River = (props: Props) => {
|
|
|
39
38
|
componentsMapExtraProps,
|
|
40
39
|
isInsideContainer,
|
|
41
40
|
extraAnchorPointYOffset,
|
|
42
|
-
extraOffset,
|
|
43
41
|
} = props;
|
|
44
42
|
|
|
45
43
|
const { title: screenTitle, summary: screenSummary } = useNavbarState();
|
|
@@ -120,7 +118,6 @@ export const River = (props: Props) => {
|
|
|
120
118
|
<GeneralContentScreen
|
|
121
119
|
feed={feedData}
|
|
122
120
|
screenId={screenId}
|
|
123
|
-
extraOffset={extraOffset}
|
|
124
121
|
isScreenWrappedInContainer={isInsideContainer}
|
|
125
122
|
extraAnchorPointYOffset={extraAnchorPointYOffset}
|
|
126
123
|
componentsMapExtraProps={componentsMapExtraProps}
|
|
@@ -135,12 +135,6 @@ exports[`componentsMap renders renders components map correctly 1`] = `
|
|
|
135
135
|
getItemCount={[Function]}
|
|
136
136
|
initialNumToRender={3}
|
|
137
137
|
keyExtractor={[Function]}
|
|
138
|
-
maintainVisibleContentPosition={
|
|
139
|
-
{
|
|
140
|
-
"autoscrollToTopThreshold": 10,
|
|
141
|
-
"minIndexForVisible": 0,
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
138
|
maxToRenderPerBatch={10}
|
|
145
139
|
onContentSizeChange={[Function]}
|
|
146
140
|
onLayout={[Function]}
|