livevoice-sdk-react-native 1.0.2 → 2.0.0

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 (188) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -5
  3. package/android/{generated/java/io/livevoice/react → app/build/generated/source/codegen/java/com/facebook/fbreact/specs}/NativeLiveVoiceSdkSpec.java +2 -2
  4. package/android/{generated → app/build/generated/source/codegen}/jni/CMakeLists.txt +1 -9
  5. package/android/{generated → app/build/generated/source/codegen}/jni/RNLiveVoiceSpec-generated.cpp +3 -3
  6. package/android/app/build/generated/source/codegen/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +341 -0
  7. package/android/build.gradle +41 -84
  8. package/android/gradle.properties +10 -6
  9. package/android/src/main/java/io/livevoice/react/LiveVoiceModule.kt +17 -16
  10. package/android/src/main/java/io/livevoice/react/LiveVoiceSdkReactNativePackage.kt +12 -13
  11. package/android/src/main/java/io/livevoice/react/Mappings.kt +36 -5
  12. package/android/src/main/java/io/livevoice/react/NativeModels.kt +2 -0
  13. package/android/src/main/java/io/livevoice/react/__SDK.kt +1 -1
  14. package/ios/LiveVoiceSdkReactNative.h +5 -5
  15. package/ios/{LivevoiceSdkReactNative.mm → LiveVoiceSdkReactNative.mm} +59 -74
  16. package/ios/__SDK.h +1 -1
  17. package/lib/module/components/AudioOutputSwitchView.js +5 -1
  18. package/lib/module/components/AudioOutputSwitchView.js.map +1 -1
  19. package/lib/module/components/ChannelView.js +14 -38
  20. package/lib/module/components/ChannelView.js.map +1 -1
  21. package/lib/module/components/LiveVoiceView.js +61 -26
  22. package/lib/module/components/LiveVoiceView.js.map +1 -1
  23. package/lib/module/components/PlayButtonView.js +243 -84
  24. package/lib/module/components/PlayButtonView.js.map +1 -1
  25. package/lib/module/icons/captions@1x.png +0 -0
  26. package/lib/module/icons/captions@2x.png +0 -0
  27. package/lib/module/icons/pause@1x.png +0 -0
  28. package/lib/module/icons/pause@2x.png +0 -0
  29. package/lib/module/icons/play@1x.png +0 -0
  30. package/lib/module/icons/play@2x.png +0 -0
  31. package/lib/module/index.js +27 -21
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/module/specs/NativeLiveVoiceSdk.js +4 -0
  34. package/lib/module/specs/NativeLiveVoiceSdk.js.map +1 -1
  35. package/lib/module/util/Colors.js +2 -1
  36. package/lib/module/util/Colors.js.map +1 -1
  37. package/lib/typescript/package.json +1 -0
  38. package/lib/typescript/src/components/AudioOutputSwitchView.d.ts.map +1 -0
  39. package/lib/typescript/src/components/BrandingView.d.ts.map +1 -0
  40. package/lib/typescript/{commonjs/src → src}/components/ChannelView.d.ts +4 -2
  41. package/lib/typescript/src/components/ChannelView.d.ts.map +1 -0
  42. package/lib/typescript/src/components/ErrorView.d.ts.map +1 -0
  43. package/lib/typescript/src/components/LiveVoiceView.d.ts.map +1 -0
  44. package/lib/typescript/src/components/PlayButtonView.d.ts +341 -0
  45. package/lib/typescript/src/components/PlayButtonView.d.ts.map +1 -0
  46. package/lib/typescript/src/components/ReconnectingView.d.ts.map +1 -0
  47. package/lib/typescript/src/components/WarningView.d.ts.map +1 -0
  48. package/lib/typescript/src/components/index.d.ts.map +1 -0
  49. package/lib/typescript/{commonjs/src → src}/index.d.ts +30 -18
  50. package/lib/typescript/src/index.d.ts.map +1 -0
  51. package/lib/typescript/{commonjs/src → src}/specs/NativeLiveVoiceSdk.d.ts +3 -3
  52. package/lib/typescript/src/specs/NativeLiveVoiceSdk.d.ts.map +1 -0
  53. package/lib/typescript/{commonjs/src → src}/util/Colors.d.ts +2 -1
  54. package/lib/typescript/src/util/Colors.d.ts.map +1 -0
  55. package/lib/typescript/src/util/ForegroundServiceConfig.d.ts.map +1 -0
  56. package/lib/typescript/src/util/PlayingState.d.ts.map +1 -0
  57. package/lib/typescript/src/util/Translations.d.ts.map +1 -0
  58. package/lib/typescript/{module/src → src}/util/UIState.d.ts +22 -1
  59. package/lib/typescript/src/util/UIState.d.ts.map +1 -0
  60. package/livevoice-sdk-react-native.podspec +6 -27
  61. package/package.json +33 -123
  62. package/src/components/AudioOutputSwitchView.tsx +10 -9
  63. package/src/components/ChannelView.tsx +18 -25
  64. package/src/components/LiveVoiceView.tsx +143 -83
  65. package/src/components/PlayButtonView.tsx +280 -87
  66. package/src/icons/captions@1x.png +0 -0
  67. package/src/icons/captions@2x.png +0 -0
  68. package/src/icons/pause@1x.png +0 -0
  69. package/src/icons/pause@2x.png +0 -0
  70. package/src/icons/play@1x.png +0 -0
  71. package/src/icons/play@2x.png +0 -0
  72. package/src/index.tsx +99 -75
  73. package/src/specs/NativeLiveVoiceSdk.ts +7 -5
  74. package/src/util/Colors.ts +3 -1
  75. package/src/util/UIState.ts +25 -1
  76. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI-generated.cpp +0 -245
  77. package/android/generated/jni/react/renderer/components/RNLiveVoiceSpec/RNLiveVoiceSpecJSI.h +0 -398
  78. package/android/src/main/AndroidManifest.xml +0 -3
  79. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec-generated.mm +0 -292
  80. package/ios/generated/RNLiveVoiceSpec/RNLiveVoiceSpec.h +0 -101
  81. package/ios/generated/RNLiveVoiceSpecJSI-generated.cpp +0 -245
  82. package/ios/generated/RNLiveVoiceSpecJSI.h +0 -398
  83. package/lib/commonjs/components/AudioOutputSwitchView.js +0 -140
  84. package/lib/commonjs/components/AudioOutputSwitchView.js.map +0 -1
  85. package/lib/commonjs/components/BrandingView.js +0 -78
  86. package/lib/commonjs/components/BrandingView.js.map +0 -1
  87. package/lib/commonjs/components/ChannelView.js +0 -117
  88. package/lib/commonjs/components/ChannelView.js.map +0 -1
  89. package/lib/commonjs/components/ErrorView.js +0 -88
  90. package/lib/commonjs/components/ErrorView.js.map +0 -1
  91. package/lib/commonjs/components/LiveVoiceView.js +0 -95
  92. package/lib/commonjs/components/LiveVoiceView.js.map +0 -1
  93. package/lib/commonjs/components/PlayButtonView.js +0 -161
  94. package/lib/commonjs/components/PlayButtonView.js.map +0 -1
  95. package/lib/commonjs/components/ReconnectingView.js +0 -109
  96. package/lib/commonjs/components/ReconnectingView.js.map +0 -1
  97. package/lib/commonjs/components/WarningView.js +0 -58
  98. package/lib/commonjs/components/WarningView.js.map +0 -1
  99. package/lib/commonjs/components/index.js +0 -94
  100. package/lib/commonjs/components/index.js.map +0 -1
  101. package/lib/commonjs/icons/branding.png +0 -0
  102. package/lib/commonjs/icons/cpu.png +0 -0
  103. package/lib/commonjs/icons/headphones.png +0 -0
  104. package/lib/commonjs/icons/mic.png +0 -0
  105. package/lib/commonjs/icons/pause.png +0 -0
  106. package/lib/commonjs/icons/play.png +0 -0
  107. package/lib/commonjs/icons/speaker.png +0 -0
  108. package/lib/commonjs/index.js +0 -319
  109. package/lib/commonjs/index.js.map +0 -1
  110. package/lib/commonjs/specs/NativeLiveVoiceSdk.js +0 -19
  111. package/lib/commonjs/specs/NativeLiveVoiceSdk.js.map +0 -1
  112. package/lib/commonjs/util/Colors.js +0 -30
  113. package/lib/commonjs/util/Colors.js.map +0 -1
  114. package/lib/commonjs/util/ForegroundServiceConfig.js +0 -33
  115. package/lib/commonjs/util/ForegroundServiceConfig.js.map +0 -1
  116. package/lib/commonjs/util/PlayingState.js +0 -24
  117. package/lib/commonjs/util/PlayingState.js.map +0 -1
  118. package/lib/commonjs/util/Translations.js +0 -47
  119. package/lib/commonjs/util/Translations.js.map +0 -1
  120. package/lib/commonjs/util/UIState.js +0 -6
  121. package/lib/commonjs/util/UIState.js.map +0 -1
  122. package/lib/module/icons/pause.png +0 -0
  123. package/lib/module/icons/play.png +0 -0
  124. package/lib/typescript/commonjs/package.json +0 -1
  125. package/lib/typescript/commonjs/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  126. package/lib/typescript/commonjs/src/components/BrandingView.d.ts.map +0 -1
  127. package/lib/typescript/commonjs/src/components/ChannelView.d.ts.map +0 -1
  128. package/lib/typescript/commonjs/src/components/ErrorView.d.ts.map +0 -1
  129. package/lib/typescript/commonjs/src/components/LiveVoiceView.d.ts.map +0 -1
  130. package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts +0 -146
  131. package/lib/typescript/commonjs/src/components/PlayButtonView.d.ts.map +0 -1
  132. package/lib/typescript/commonjs/src/components/ReconnectingView.d.ts.map +0 -1
  133. package/lib/typescript/commonjs/src/components/WarningView.d.ts.map +0 -1
  134. package/lib/typescript/commonjs/src/components/index.d.ts.map +0 -1
  135. package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
  136. package/lib/typescript/commonjs/src/specs/NativeLiveVoiceSdk.d.ts.map +0 -1
  137. package/lib/typescript/commonjs/src/util/Colors.d.ts.map +0 -1
  138. package/lib/typescript/commonjs/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  139. package/lib/typescript/commonjs/src/util/PlayingState.d.ts.map +0 -1
  140. package/lib/typescript/commonjs/src/util/Translations.d.ts.map +0 -1
  141. package/lib/typescript/commonjs/src/util/UIState.d.ts +0 -45
  142. package/lib/typescript/commonjs/src/util/UIState.d.ts.map +0 -1
  143. package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts +0 -6
  144. package/lib/typescript/module/src/components/AudioOutputSwitchView.d.ts.map +0 -1
  145. package/lib/typescript/module/src/components/BrandingView.d.ts +0 -6
  146. package/lib/typescript/module/src/components/BrandingView.d.ts.map +0 -1
  147. package/lib/typescript/module/src/components/ChannelView.d.ts +0 -13
  148. package/lib/typescript/module/src/components/ChannelView.d.ts.map +0 -1
  149. package/lib/typescript/module/src/components/ErrorView.d.ts +0 -9
  150. package/lib/typescript/module/src/components/ErrorView.d.ts.map +0 -1
  151. package/lib/typescript/module/src/components/LiveVoiceView.d.ts +0 -6
  152. package/lib/typescript/module/src/components/LiveVoiceView.d.ts.map +0 -1
  153. package/lib/typescript/module/src/components/PlayButtonView.d.ts +0 -146
  154. package/lib/typescript/module/src/components/PlayButtonView.d.ts.map +0 -1
  155. package/lib/typescript/module/src/components/ReconnectingView.d.ts +0 -9
  156. package/lib/typescript/module/src/components/ReconnectingView.d.ts.map +0 -1
  157. package/lib/typescript/module/src/components/WarningView.d.ts +0 -8
  158. package/lib/typescript/module/src/components/WarningView.d.ts.map +0 -1
  159. package/lib/typescript/module/src/components/index.d.ts +0 -9
  160. package/lib/typescript/module/src/components/index.d.ts.map +0 -1
  161. package/lib/typescript/module/src/index.d.ts +0 -133
  162. package/lib/typescript/module/src/index.d.ts.map +0 -1
  163. package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts +0 -48
  164. package/lib/typescript/module/src/specs/NativeLiveVoiceSdk.d.ts.map +0 -1
  165. package/lib/typescript/module/src/util/Colors.d.ts +0 -13
  166. package/lib/typescript/module/src/util/Colors.d.ts.map +0 -1
  167. package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts +0 -12
  168. package/lib/typescript/module/src/util/ForegroundServiceConfig.d.ts.map +0 -1
  169. package/lib/typescript/module/src/util/PlayingState.d.ts +0 -7
  170. package/lib/typescript/module/src/util/PlayingState.d.ts.map +0 -1
  171. package/lib/typescript/module/src/util/Translations.d.ts +0 -22
  172. package/lib/typescript/module/src/util/Translations.d.ts.map +0 -1
  173. package/lib/typescript/module/src/util/UIState.d.ts.map +0 -1
  174. package/react-native.config.js +0 -12
  175. package/src/icons/pause.png +0 -0
  176. package/src/icons/play.png +0 -0
  177. /package/android/{generated → app/build/generated/source/codegen}/jni/RNLiveVoiceSpec.h +0 -0
  178. /package/lib/{typescript/module → module}/package.json +0 -0
  179. /package/lib/typescript/{commonjs/src → src}/components/AudioOutputSwitchView.d.ts +0 -0
  180. /package/lib/typescript/{commonjs/src → src}/components/BrandingView.d.ts +0 -0
  181. /package/lib/typescript/{commonjs/src → src}/components/ErrorView.d.ts +0 -0
  182. /package/lib/typescript/{commonjs/src → src}/components/LiveVoiceView.d.ts +0 -0
  183. /package/lib/typescript/{commonjs/src → src}/components/ReconnectingView.d.ts +0 -0
  184. /package/lib/typescript/{commonjs/src → src}/components/WarningView.d.ts +0 -0
  185. /package/lib/typescript/{commonjs/src → src}/components/index.d.ts +0 -0
  186. /package/lib/typescript/{commonjs/src → src}/util/ForegroundServiceConfig.d.ts +0 -0
  187. /package/lib/typescript/{commonjs/src → src}/util/PlayingState.d.ts +0 -0
  188. /package/lib/typescript/{commonjs/src → src}/util/Translations.d.ts +0 -0
@@ -9,171 +9,364 @@
9
9
  * SPDX-License-Identifier: MIT
10
10
  */
11
11
 
12
- import { COLORS } from '../util/Colors';
13
- import { ActivityIndicator, Image, TouchableOpacity, useColorScheme } from 'react-native'
14
- import { PlayingState } from '../util/PlayingState';
12
+ import { COLORS } from "../util/Colors";
13
+ import {
14
+ ActivityIndicator,
15
+ Image,
16
+ TouchableOpacity,
17
+ useColorScheme,
18
+ View,
19
+ } from "react-native";
20
+ import { PlayingState } from "../util/PlayingState";
15
21
 
16
22
  export interface PlayButtonProps {
17
23
  playingState: PlayingState;
18
24
  isChannelOnline: boolean;
25
+ hasAudio?: boolean;
26
+ hasSubtitles?: boolean;
19
27
  isDarkMode?: boolean;
20
- onPress: () => void;
28
+ onAudioPress?: () => void;
29
+ onSubtitlesPress?: () => void;
30
+ onPress?: () => void;
21
31
  }
22
32
 
23
33
  const PlayButtonView: React.FC<PlayButtonProps> = ({
24
34
  playingState,
25
35
  isChannelOnline,
26
- isDarkMode = useColorScheme() === 'dark',
36
+ hasAudio = true,
37
+ hasSubtitles = false,
38
+ isDarkMode = useColorScheme() === "dark",
39
+ onAudioPress,
40
+ onSubtitlesPress,
27
41
  onPress,
28
-
29
42
  }) => {
30
43
  const isPlaying = playingState === PlayingState.PLAYING;
31
44
  const isTransitioning = playingState === PlayingState.TRANSITIONING;
32
45
 
33
- const iconColor = !isChannelOnline
34
- ? (isDarkMode ? '#585858' : '#dee2e6')
35
- : isPlaying
36
- ? COLORS.primary
37
- : COLORS.white;
46
+ const getAudioIconColor = () => {
47
+ if (!isChannelOnline) {
48
+ return isDarkMode ? "#5a5a60" : "#d1d1d6";
49
+ }
50
+ return COLORS.white;
51
+ };
38
52
 
39
- const opacity = isChannelOnline ? 1 : 0.8;
53
+ const getSubtitlesIconColor = () => {
54
+ if (!isChannelOnline) {
55
+ return isDarkMode ? "#ffffff" : "#000000";
56
+ }
57
+ return COLORS.white;
58
+ };
59
+
60
+ const audioIconColor = getAudioIconColor();
61
+ const subtitlesIconColor = getSubtitlesIconColor();
40
62
 
41
- const getButtonIcon = () => {
63
+ const getAudioIcon = () => {
42
64
  if (isTransitioning) {
43
- return <ActivityIndicator size={20} color={iconColor} style={{ opacity }} />;
65
+ return <ActivityIndicator size={20} color={audioIconColor} style={{}} />;
44
66
  }
45
67
  return isPlaying ? (
46
68
  <Image
47
- source={require('../icons/pause.png')}
48
- style={[{tintColor: iconColor, width: 20, height: 20}]}
49
- />) : (
69
+ source={require("../icons/pause.png")}
70
+ style={[{ tintColor: audioIconColor, width: 30, height: 26 }]}
71
+ />
72
+ ) : (
73
+ <Image
74
+ source={require("../icons/play.png")}
75
+ style={[{ tintColor: audioIconColor, width: 30, height: 26 }]}
76
+ />
77
+ );
78
+ };
79
+
80
+ const getSubtitlesIcon = () => {
81
+ return (
50
82
  <Image
51
- source={require('../icons/play.png')}
52
- style={[{tintColor: iconColor, width: 20, height: 20}]}
83
+ source={require("../icons/captions.png")}
84
+ style={[{ tintColor: subtitlesIconColor, width: 30, height: 26 }]}
53
85
  />
54
86
  );
55
87
  };
56
88
 
57
89
  const getStyleType = () => {
58
- if (!isChannelOnline) return 'offline';
59
- if (isPlaying) return 'playing';
60
- return 'paused';
90
+ if (!isChannelOnline) return "offline";
91
+ if (isPlaying) return "playing";
92
+ return "paused";
61
93
  };
62
94
 
95
+ // If no audio and no subtitles, render disabled button with dashed border
96
+ if (!hasAudio && !hasSubtitles) {
97
+ const noContentStyle = {
98
+ ...baseButtonStyleNoContent,
99
+ backgroundColor: isDarkMode ? "#1c1c1e00" : "#ffffff",
100
+ borderColor: isDarkMode
101
+ ? COLORS_SCHEME.borderGrayDark
102
+ : COLORS_SCHEME.borderGrayLight,
103
+ borderStyle: "dashed" as const,
104
+ };
105
+ return (
106
+ <TouchableOpacity
107
+ style={noContentStyle}
108
+ disabled={true}
109
+ activeOpacity={0.8}
110
+ >
111
+ <View />
112
+ </TouchableOpacity>
113
+ );
114
+ }
115
+
116
+ // If only audio, render simple button
117
+ if (hasAudio && !hasSubtitles) {
118
+ return (
119
+ <TouchableOpacity
120
+ style={getButtonStyle(getStyleType(), isDarkMode, false)}
121
+ onPress={onAudioPress || onPress}
122
+ activeOpacity={0.8}
123
+ >
124
+ {getAudioIcon()}
125
+ </TouchableOpacity>
126
+ );
127
+ }
128
+
129
+ // If only subtitles, render subtitles button
130
+ if (!hasAudio && hasSubtitles) {
131
+ return (
132
+ <TouchableOpacity
133
+ style={getButtonStyle(getStyleType(), isDarkMode, false)}
134
+ onPress={onSubtitlesPress || onPress}
135
+ activeOpacity={0.8}
136
+ >
137
+ {getSubtitlesIcon()}
138
+ </TouchableOpacity>
139
+ );
140
+ }
141
+
142
+ // If both audio and subtitles, render split button
63
143
  return (
64
- <TouchableOpacity
65
- style={[getButtonStyle(getStyleType(), isDarkMode), { opacity }]}
66
- onPress={onPress}
67
- activeOpacity={0.8}
68
- >
69
- {getButtonIcon()}
70
- </TouchableOpacity>
144
+ <View style={getSplitButtonContainerStyle(getStyleType(), isDarkMode)}>
145
+ <TouchableOpacity
146
+ style={getSplitButtonAudioStyle(getStyleType(), isDarkMode)}
147
+ onPress={onAudioPress || onPress}
148
+ activeOpacity={0.8}
149
+ >
150
+ {getAudioIcon()}
151
+ </TouchableOpacity>
152
+ <View style={getDividerStyle(getStyleType(), isDarkMode)} />
153
+ <TouchableOpacity
154
+ style={getSplitButtonSubtitlesStyle(getStyleType(), isDarkMode)}
155
+ onPress={onSubtitlesPress || onPress}
156
+ activeOpacity={0.8}
157
+ >
158
+ {getSubtitlesIcon()}
159
+ </TouchableOpacity>
160
+ </View>
71
161
  );
72
162
  };
73
163
 
74
- type ButtonStyleType = 'paused' | 'playing' | 'offline';
164
+ type ButtonStyleType = "paused" | "playing" | "offline";
75
165
 
76
166
  export const getButtonStyle = (
77
167
  type: ButtonStyleType,
78
- isDarkMode: boolean
168
+ isDarkMode: boolean,
169
+ isSplit: boolean = false,
79
170
  ) => {
80
- return ButtonStyles[type][isDarkMode ? 'dark' : 'light'];
171
+ if (isSplit) {
172
+ return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].container;
173
+ }
174
+ return ButtonStyles[type][isDarkMode ? "dark" : "light"];
81
175
  };
82
176
 
83
- const baseButtonStyle = {
84
- paddingVertical: 8,
85
- paddingHorizontal: 18,
86
- borderRadius: 10,
87
- borderWidth: 2,
88
- outlineStyle: 'solid' as const,
89
- outlineWidth: 3,
177
+ export const getSplitButtonContainerStyle = (
178
+ type: ButtonStyleType,
179
+ isDarkMode: boolean,
180
+ ) => {
181
+ return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].container;
90
182
  };
91
183
 
92
- const ButtonColorLight = {
93
- orange: '#f56230',
94
- orange_light: '#f67b51',
95
- orange_dark: '#b93305',
184
+ export const getSplitButtonAudioStyle = (
185
+ type: ButtonStyleType,
186
+ isDarkMode: boolean,
187
+ ) => {
188
+ return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].audio;
189
+ };
96
190
 
97
- errorBackground: '#f1f1f1',
191
+ export const getSplitButtonSubtitlesStyle = (
192
+ type: ButtonStyleType,
193
+ isDarkMode: boolean,
194
+ ) => {
195
+ return SplitButtonStyles[type][isDarkMode ? "dark" : "light"].subtitles;
196
+ };
98
197
 
99
- playButtonBorderThinOffline: '#d1d1d6',
100
- playButtonBorderThickOffline: '#f2f2f7',
101
- playButtonIconOffline: '#dee2e6',
198
+ export const getDividerStyle = (type: ButtonStyleType, isDarkMode: boolean) => {
199
+ // When button is online (orange background), divider is light orange
200
+ if (type === "paused" || type === "playing") {
201
+ return {
202
+ width: 1,
203
+ height: 24,
204
+ backgroundColor: COLORS_SCHEME.dividerOnOrange,
205
+ };
206
+ }
102
207
 
103
- playButtonBorderThickOnline: '#f5623021',
104
- playButtonIconOnline: '#ffffff',
105
- playButtonFillOnline: '#f56230',
208
+ // When button is offline, divider is gray (same as border)
209
+ return {
210
+ width: 1,
211
+ height: 24,
212
+ backgroundColor: isDarkMode
213
+ ? COLORS_SCHEME.borderGrayDark
214
+ : COLORS_SCHEME.borderGrayLight,
215
+ };
216
+ };
106
217
 
107
- playButtonGlowPlaying: '#f56230b3',
108
- playButtonBorderThickPlaying: '#f56230',
109
- playButtonIconPlaying: '#f56230',
110
- playButtonFillPlaying: '#ffffff',
218
+ const baseButtonStyle = {
219
+ width: 96,
220
+ height: 44,
221
+ borderRadius: 22,
222
+ borderWidth: 1,
223
+ alignItems: "center" as const,
224
+ justifyContent: "center" as const,
111
225
  };
112
226
 
113
- const ButtonColorDark = {
114
- orange: '#f56230',
115
- orange_light: '#f67b51',
116
- orange_dark: '#b93305',
227
+ const baseButtonStyleNoContent = {
228
+ width: 96,
229
+ height: 44,
230
+ borderRadius: 22,
231
+ borderWidth: 1,
232
+ alignItems: "center" as const,
233
+ justifyContent: "center" as const,
234
+ };
117
235
 
118
- errorBackground: '#111111',
236
+ const baseSplitButtonStyle = {
237
+ width: 96,
238
+ height: 44,
239
+ borderRadius: 22,
240
+ borderWidth: 1,
241
+ flexDirection: "row" as const,
242
+ alignItems: "center" as const,
243
+ justifyContent: "center" as const,
244
+ overflow: "hidden" as const,
245
+ };
119
246
 
120
- playButtonBorderThinOffline: '#212121',
121
- playButtonBorderThickOffline: '#585858',
122
- playButtonIconOffline: '#585858',
247
+ const baseSplitAudioStyle = {
248
+ flex: 1,
249
+ height: 44,
250
+ alignItems: "center" as const,
251
+ justifyContent: "center" as const,
252
+ };
123
253
 
124
- playButtonBorderThickOnline: '#77392421',
125
- playButtonIconOnline: '#ffffff',
126
- playButtonFillOnline: '#f56230',
254
+ const baseSplitSubtitlesStyle = {
255
+ flex: 1,
256
+ height: 44,
257
+ alignItems: "center" as const,
258
+ justifyContent: "center" as const,
259
+ };
127
260
 
128
- playButtonGlowPlaying: '#f56230',
129
- playButtonBorderThickPlaying: '#ff7433',
130
- playButtonIconPlaying: '#f56230',
131
- playButtonFillPlaying: '#ffffff',
261
+ const COLORS_SCHEME = {
262
+ orange: "#f56230",
263
+ dividerOnOrange: "#ffffff80",
264
+ borderGrayLight: "#d1d1d6",
265
+ borderGrayDark: "#5a5a60",
132
266
  };
133
267
 
134
268
  export const ButtonStyles = {
135
269
  paused: {
136
270
  light: {
137
271
  ...baseButtonStyle,
138
- backgroundColor: ButtonColorLight.playButtonFillOnline,
139
- borderColor: 'transparent',
140
- outlineColor: ButtonColorLight.playButtonBorderThickOnline,
272
+ backgroundColor: COLORS_SCHEME.orange,
273
+ borderColor: "transparent",
141
274
  },
142
275
  dark: {
143
276
  ...baseButtonStyle,
144
- backgroundColor: ButtonColorDark.playButtonFillOnline,
145
- borderColor: 'transparent',
146
- outlineColor: ButtonColorDark.playButtonBorderThickOnline,
277
+ backgroundColor: COLORS_SCHEME.orange,
278
+ borderColor: "transparent",
147
279
  },
148
280
  },
149
281
 
150
282
  playing: {
151
283
  light: {
152
284
  ...baseButtonStyle,
153
- backgroundColor: ButtonColorLight.playButtonFillPlaying,
154
- borderColor: ButtonColorLight.playButtonFillPlaying,
155
- outlineColor: ButtonColorLight.playButtonBorderThickPlaying,
285
+ backgroundColor: COLORS_SCHEME.orange,
286
+ borderColor: "transparent",
156
287
  },
157
288
  dark: {
158
289
  ...baseButtonStyle,
159
- backgroundColor: ButtonColorDark.playButtonFillPlaying,
160
- borderColor: ButtonColorDark.playButtonFillPlaying,
161
- outlineColor: ButtonColorDark.playButtonBorderThickPlaying,
290
+ backgroundColor: COLORS_SCHEME.orange,
291
+ borderColor: "transparent",
162
292
  },
163
293
  },
164
294
 
165
295
  offline: {
166
296
  light: {
167
297
  ...baseButtonStyle,
168
- backgroundColor: 'transparent',
169
- borderColor: ButtonColorLight.playButtonBorderThinOffline,
170
- outlineColor: ButtonColorLight.playButtonBorderThickOffline,
298
+ backgroundColor: "#ffffff",
299
+ borderColor: COLORS_SCHEME.borderGrayLight,
171
300
  },
172
301
  dark: {
173
302
  ...baseButtonStyle,
174
- backgroundColor: 'transparent',
175
- borderColor: ButtonColorDark.playButtonBorderThinOffline,
176
- outlineColor: ButtonColorDark.playButtonBorderThickOffline,
303
+ backgroundColor: "#212429",
304
+ borderColor: COLORS_SCHEME.borderGrayDark,
305
+ },
306
+ },
307
+ };
308
+
309
+ export const SplitButtonStyles = {
310
+ paused: {
311
+ light: {
312
+ container: {
313
+ ...baseSplitButtonStyle,
314
+ backgroundColor: COLORS_SCHEME.orange,
315
+ borderColor: "transparent",
316
+ },
317
+ audio: baseSplitAudioStyle,
318
+ subtitles: baseSplitSubtitlesStyle,
319
+ },
320
+ dark: {
321
+ container: {
322
+ ...baseSplitButtonStyle,
323
+ backgroundColor: COLORS_SCHEME.orange,
324
+ borderColor: "transparent",
325
+ },
326
+ audio: baseSplitAudioStyle,
327
+ subtitles: baseSplitSubtitlesStyle,
328
+ },
329
+ },
330
+
331
+ playing: {
332
+ light: {
333
+ container: {
334
+ ...baseSplitButtonStyle,
335
+ backgroundColor: COLORS_SCHEME.orange,
336
+ borderColor: "transparent",
337
+ },
338
+ audio: baseSplitAudioStyle,
339
+ subtitles: baseSplitSubtitlesStyle,
340
+ },
341
+ dark: {
342
+ container: {
343
+ ...baseSplitButtonStyle,
344
+ backgroundColor: COLORS_SCHEME.orange,
345
+ borderColor: "transparent",
346
+ },
347
+ audio: baseSplitAudioStyle,
348
+ subtitles: baseSplitSubtitlesStyle,
349
+ },
350
+ },
351
+
352
+ offline: {
353
+ light: {
354
+ container: {
355
+ ...baseSplitButtonStyle,
356
+ backgroundColor: "#ffffff",
357
+ borderColor: COLORS_SCHEME.borderGrayLight,
358
+ },
359
+ audio: baseSplitAudioStyle,
360
+ subtitles: baseSplitSubtitlesStyle,
361
+ },
362
+ dark: {
363
+ container: {
364
+ ...baseSplitButtonStyle,
365
+ backgroundColor: "#212429",
366
+ borderColor: COLORS_SCHEME.borderGrayDark,
367
+ },
368
+ audio: baseSplitAudioStyle,
369
+ subtitles: baseSplitSubtitlesStyle,
177
370
  },
178
371
  },
179
372
  };
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file