-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: prompt to use Ktor downloader on Android DownloadManager failure
- Loading branch information
1 parent
ad7fc35
commit 3662b67
Showing
6 changed files
with
89 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...src/main/kotlin/com/aliucord/manager/ui/components/dialogs/AlternativeDownloaderDialog.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.aliucord.manager.ui.components.dialogs | ||
|
||
import androidx.compose.material3.* | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.res.painterResource | ||
import androidx.compose.ui.res.stringResource | ||
import com.aliucord.manager.R | ||
|
||
@Composable | ||
fun AlternativeDownloaderDialog( | ||
onConfirm: () -> Unit, | ||
onDismiss: () -> Unit, | ||
) { | ||
AlertDialog( | ||
onDismissRequest = onDismiss, | ||
confirmButton = { | ||
FilledTonalButton( | ||
onClick = onConfirm, | ||
colors = ButtonDefaults.filledTonalButtonColors( | ||
containerColor = MaterialTheme.colorScheme.primary, | ||
contentColor = MaterialTheme.colorScheme.onPrimary, | ||
), | ||
) { | ||
Text(stringResource(R.string.action_retry)) | ||
} | ||
}, | ||
dismissButton = { | ||
TextButton( | ||
onClick = onDismiss, | ||
colors = ButtonDefaults.textButtonColors( | ||
contentColor = MaterialTheme.colorScheme.error, | ||
), | ||
) { | ||
Text(stringResource(R.string.action_cancel)) | ||
} | ||
}, | ||
title = { Text(stringResource(R.string.alt_downloader_dialog_title)) }, | ||
text = { Text(stringResource(R.string.alt_downloader_dialog_desc)) }, | ||
icon = { Icon(painterResource(R.drawable.ic_download), contentDescription = null) }, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters