mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-05-19 16:31:44 +00:00
Added tip for error message
This commit is contained in:
parent
7d60a0c43f
commit
703d9b09d2
9 changed files with 1547 additions and 3 deletions
3
.idea/.gitignore
vendored
Normal file
3
.idea/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
9
.idea/NuvioMobile.iml
Normal file
9
.idea/NuvioMobile.iml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="JAVA_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||||
|
<exclude-output />
|
||||||
|
<content url="file://$MODULE_DIR$" />
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
1490
.idea/caches/deviceStreaming.xml
Normal file
1490
.idea/caches/deviceStreaming.xml
Normal file
File diff suppressed because it is too large
Load diff
6
.idea/misc.xml
Normal file
6
.idea/misc.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectRootManager">
|
||||||
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/NuvioMobile.iml" filepath="$PROJECT_DIR$/.idea/NuvioMobile.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
Normal file
6
.idea/vcs.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
|
|
@ -21,6 +21,7 @@ interface CustomAlertProps {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
title: string;
|
title: string;
|
||||||
message: string;
|
message: string;
|
||||||
|
subtitle?: string;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
actions?: Array<{
|
actions?: Array<{
|
||||||
label: string;
|
label: string;
|
||||||
|
|
@ -33,6 +34,7 @@ export const CustomAlert = ({
|
||||||
visible,
|
visible,
|
||||||
title,
|
title,
|
||||||
message,
|
message,
|
||||||
|
subtitle,
|
||||||
onClose,
|
onClose,
|
||||||
actions = [
|
actions = [
|
||||||
{ label: 'OK', onPress: onClose }
|
{ label: 'OK', onPress: onClose }
|
||||||
|
|
@ -110,6 +112,13 @@ export const CustomAlert = ({
|
||||||
{message}
|
{message}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
|
{/* Subtitle / tooltip */}
|
||||||
|
{subtitle ? (
|
||||||
|
<Text style={styles.subtitle}>
|
||||||
|
{subtitle}
|
||||||
|
</Text>
|
||||||
|
) : null}
|
||||||
|
|
||||||
{/* Actions */}
|
{/* Actions */}
|
||||||
<View style={[
|
<View style={[
|
||||||
styles.actionsRow,
|
styles.actionsRow,
|
||||||
|
|
@ -200,11 +209,19 @@ const styles = StyleSheet.create({
|
||||||
message: {
|
message: {
|
||||||
color: '#AAAAAA',
|
color: '#AAAAAA',
|
||||||
fontSize: 15,
|
fontSize: 15,
|
||||||
marginBottom: 24,
|
marginBottom: 8,
|
||||||
textAlign: 'center',
|
textAlign: 'center',
|
||||||
lineHeight: 22,
|
lineHeight: 22,
|
||||||
letterSpacing: 0.1,
|
letterSpacing: 0.1,
|
||||||
},
|
},
|
||||||
|
subtitle: {
|
||||||
|
color: '#666666',
|
||||||
|
fontSize: 12,
|
||||||
|
marginBottom: 24,
|
||||||
|
textAlign: 'center',
|
||||||
|
lineHeight: 18,
|
||||||
|
letterSpacing: 0.1,
|
||||||
|
},
|
||||||
actionsRow: {
|
actionsRow: {
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
justifyContent: 'flex-end',
|
justifyContent: 'flex-end',
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ export const StreamsScreen = () => {
|
||||||
alertVisible,
|
alertVisible,
|
||||||
alertTitle,
|
alertTitle,
|
||||||
alertMessage,
|
alertMessage,
|
||||||
|
alertSubtitle,
|
||||||
alertActions,
|
alertActions,
|
||||||
openAlert,
|
openAlert,
|
||||||
closeAlert,
|
closeAlert,
|
||||||
|
|
@ -206,6 +207,7 @@ export const StreamsScreen = () => {
|
||||||
visible={alertVisible}
|
visible={alertVisible}
|
||||||
title={alertTitle}
|
title={alertTitle}
|
||||||
message={alertMessage}
|
message={alertMessage}
|
||||||
|
subtitle={alertSubtitle}
|
||||||
actions={alertActions}
|
actions={alertActions}
|
||||||
onClose={closeAlert}
|
onClose={closeAlert}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ export const useStreamsScreen = () => {
|
||||||
const [alertVisible, setAlertVisible] = useState(false);
|
const [alertVisible, setAlertVisible] = useState(false);
|
||||||
const [alertTitle, setAlertTitle] = useState('');
|
const [alertTitle, setAlertTitle] = useState('');
|
||||||
const [alertMessage, setAlertMessage] = useState('');
|
const [alertMessage, setAlertMessage] = useState('');
|
||||||
|
const [alertSubtitle, setAlertSubtitle] = useState('');
|
||||||
const [alertActions, setAlertActions] = useState<AlertAction[]>([]);
|
const [alertActions, setAlertActions] = useState<AlertAction[]>([]);
|
||||||
|
|
||||||
// Loading and provider state
|
// Loading and provider state
|
||||||
|
|
@ -174,12 +175,13 @@ export const useStreamsScreen = () => {
|
||||||
|
|
||||||
// Open alert helper
|
// Open alert helper
|
||||||
const openAlert = useCallback(
|
const openAlert = useCallback(
|
||||||
(title: string, message: string, actions?: AlertAction[]) => {
|
(title: string, message: string, actions?: AlertAction[], subtitle?: string) => {
|
||||||
if (!isMounted.current) return;
|
if (!isMounted.current) return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
setAlertTitle(title);
|
setAlertTitle(title);
|
||||||
setAlertMessage(message);
|
setAlertMessage(message);
|
||||||
|
setAlertSubtitle(subtitle ?? '');
|
||||||
setAlertActions(actions && actions.length > 0 ? actions : [{ label: 'OK', onPress: () => { } }]);
|
setAlertActions(actions && actions.length > 0 ? actions : [{ label: 'OK', onPress: () => { } }]);
|
||||||
setAlertVisible(true);
|
setAlertVisible(true);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
@ -463,7 +465,7 @@ export const useStreamsScreen = () => {
|
||||||
|
|
||||||
// Block magnet links
|
// Block magnet links
|
||||||
if (typeof stream.url === 'string' && stream.url.startsWith('magnet:')) {
|
if (typeof stream.url === 'string' && stream.url.startsWith('magnet:')) {
|
||||||
openAlert('Not supported', 'Torrent streaming is not supported yet.');
|
openAlert('Not supported', 'Torrent streaming is not supported yet.', undefined, 'You need a Debrid provider.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1144,6 +1146,7 @@ export const useStreamsScreen = () => {
|
||||||
alertVisible,
|
alertVisible,
|
||||||
alertTitle,
|
alertTitle,
|
||||||
alertMessage,
|
alertMessage,
|
||||||
|
alertSubtitle,
|
||||||
alertActions,
|
alertActions,
|
||||||
openAlert,
|
openAlert,
|
||||||
closeAlert,
|
closeAlert,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue