Skip to content

Commit

Permalink
feat: Do not show a warning for custom folders anymore
Browse files Browse the repository at this point in the history
Signed-off-by: Myzel394 <[email protected]>
  • Loading branch information
Myzel394 committed Mar 22, 2024
1 parent f8c1db4 commit e0dce7d
Showing 1 changed file with 1 addition and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import androidx.compose.material.icons.filled.Folder
import androidx.compose.material.icons.filled.Lock
import androidx.compose.material.icons.filled.Mic
import androidx.compose.material.icons.filled.PermMedia
import androidx.compose.material.icons.filled.Warning
import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
Expand Down Expand Up @@ -435,8 +434,6 @@ fun SelectionSheet(
) {
val context = LocalContext.current

var showCustomFolderWarning by remember { mutableStateOf(false) }

val selectFolder = rememberFolderSelectorDialog { folder ->
if (folder == null) {
return@rememberFolderSelectorDialog
Expand All @@ -445,18 +442,6 @@ fun SelectionSheet(
updateValue(folder.toString())
}

if (showCustomFolderWarning) {
CustomFolderWarningDialog(
onDismiss = {
showCustomFolderWarning = false
},
onConfirm = {
showCustomFolderWarning = false
selectFolder()
},
)
}

var showExternalPermissionRequired by remember { mutableStateOf(false) }

if (showExternalPermissionRequired) {
Expand Down Expand Up @@ -523,9 +508,7 @@ fun SelectionSheet(
SelectionButton(
label = stringResource(R.string.ui_settings_option_saveFolder_action_custom_label),
icon = Icons.Default.Folder,
onClick = {
showCustomFolderWarning = true
},
onClick = selectFolder,
)
if (!SUPPORTS_SAVING_VIDEOS_IN_CUSTOM_FOLDERS) {
Column(
Expand Down Expand Up @@ -581,52 +564,6 @@ fun SelectionButton(
}
}

@Composable
fun CustomFolderWarningDialog(
onDismiss: () -> Unit,
onConfirm: () -> Unit,
) {
val title = stringResource(R.string.ui_settings_option_saveFolder_warning_title)
val text = stringResource(R.string.ui_settings_option_saveFolder_warning_text)

AlertDialog(
icon = {
Icon(
Icons.Default.Warning,
contentDescription = null,
)
},
onDismissRequest = onDismiss,
title = {
Text(text = title)
},
text = {
Text(text = text)
},
confirmButton = {
Button(onClick = onConfirm) {
Text(
text = stringResource(R.string.ui_settings_option_saveFolder_warning_action_confirm),
)
}
},
dismissButton = {
TextButton(
onClick = onDismiss,
contentPadding = ButtonDefaults.TextButtonWithIconContentPadding,
) {
Icon(
Icons.Default.Cancel,
contentDescription = null,
modifier = Modifier.size(ButtonDefaults.IconSize),
)
Spacer(modifier = Modifier.width(ButtonDefaults.IconSpacing))
Text(stringResource(R.string.dialog_close_cancel_label))
}
}
)
}

@Composable
fun ExternalPermissionRequiredDialog(
onDismiss: () -> Unit,
Expand Down

0 comments on commit e0dce7d

Please sign in to comment.