Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve help description #79

Merged
merged 2 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import android.Manifest
import android.content.Intent
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
Expand All @@ -21,10 +19,10 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.InsertDriveFile
import androidx.compose.material.icons.filled.CameraAlt
import androidx.compose.material.icons.filled.Cancel
import androidx.compose.material.icons.filled.Folder
import androidx.compose.material.icons.filled.InsertDriveFile
import androidx.compose.material.icons.filled.Lock
import androidx.compose.material.icons.filled.Mic
import androidx.compose.material.icons.filled.PermMedia
Expand Down Expand Up @@ -147,19 +145,29 @@ fun SaveFolderTile(
var showDCIMFolderHelpSheet by remember { mutableStateOf(false) }

if (showDCIMFolderHelpSheet) {
MediaFoldersExplanationDialog(
DCIMFolderExplanationDialog(
onDismiss = {
showDCIMFolderHelpSheet = false
}
)
}

var showExplanationDialog by remember { mutableStateOf(false) }

if (showExplanationDialog) {
InternalFolderExplanationDialog(
onDismiss = {
showExplanationDialog = false
}
)
}

SettingsTile(
title = stringResource(R.string.ui_settings_option_saveFolder_title),
description = stringResource(R.string.ui_settings_option_saveFolder_explanation),
leading = {
Icon(
Icons.Default.InsertDriveFile,
Icons.AutoMirrored.Filled.InsertDriveFile,
contentDescription = null,
)
},
Expand Down Expand Up @@ -205,7 +213,25 @@ fun SaveFolderTile(
val openFolder = rememberOpenUri()

when (settings.saveFolder) {
null -> {}
null -> {
Button(
onClick = {
showExplanationDialog = true
},
shape = MaterialTheme.shapes.small,
contentPadding = ButtonDefaults.TextButtonContentPadding,
colors = ButtonDefaults.filledTonalButtonColors(
contentColor = MaterialTheme.colorScheme.onTertiaryContainer,
containerColor = MaterialTheme.colorScheme.tertiaryContainer,
),
) {
Text(
stringResource(R.string.ui_settings_option_saveFolder_explainMediaFolder_label),
fontSize = MaterialTheme.typography.bodySmall.fontSize,
)
}
}

RECORDER_MEDIA_SELECTED_VALUE -> {
Button(
onClick = {
Expand Down Expand Up @@ -258,12 +284,9 @@ fun SaveFolderTile(
}

@Composable
fun MediaFoldersExplanationDialog(
fun DCIMFolderExplanationDialog(
onDismiss: () -> Unit,
) {
val context = LocalContext.current
val openFolder = rememberOpenUri()

AlertDialog(
onDismissRequest = onDismiss,
icon = {
Expand Down Expand Up @@ -363,6 +386,42 @@ fun MediaFoldersExplanationDialog(
)
}

@Composable
fun InternalFolderExplanationDialog(
onDismiss: () -> Unit,
) {
AlertDialog(
onDismissRequest = onDismiss,
icon = {
Icon(
Icons.Default.Lock,
contentDescription = null,
)
},
title = {
Text(stringResource(R.string.ui_settings_option_saveFolder_explainMediaFolder_label))
},
confirmButton = {
Button(onClick = onDismiss) {
Text(stringResource(R.string.dialog_close_neutral_label))
}
},
text = {
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(32.dp),
) {
Text(
stringResource(R.string.ui_settings_option_saveFolder_explainInternalFolder_explanation),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.onSurface,
)
}
}
)
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SelectionSheet(
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,11 @@
<string name="ui_severeError_fileSaverUnavailable_title">File Manager app not found</string>
<string name="ui_severeError_fileSaverUnavailable_text">Alibi couldn\'t find a file manager app on your phone. Please install a file manager app and try again. If this message still appears, you can try using a custom batches folder in the advanced settings section. Alibi may not fully work on your device.</string>
<string name="ui_videoRecorder_state_recording_title">Recording Video</string>
<string name="ui_settings_option_saveFolder_openFolder_label">Open Folder in Files</string>
<string name="ui_settings_option_saveFolder_openFolder_label">Open selected folder in file manager</string>
<string name="ui_settings_option_saveFolder_explainMediaFolder_label">Where are my batches stored?</string>
<string name="ui_settings_option_saveFolder_explainMediaFolder_generalExplanation">To view your batches, open the Files app, go to the internal storage and then you will find your batches in following folders:</string>
<string name="ui_settings_option_saveFolder_explainMediaFolder_subfoldersExplanation">The final merged recordings will be saved in those folders. Each recording creates a subfolder to store the short batches in (\"%s\" for audio recordings, \"%s\" for video recordings). To view the individual batches, you may need to enable hidden files in the Files app.</string>
<string name="ui_settings_option_saveFolder_explainMediaFolder_openFolderExplanation">Tap on a folder to open it in the Files app</string>
<string name="ui_videoRecorder_action_start_settings_cameraLens_unknown_label">Unknown</string>
<string name="ui_settings_option_saveFolder_explainInternalFolder_explanation">To protect your privacy, Alibi stores its batches into its own private, encrypted storage. This storage is only accessible by Alibi and can\'t be accessed by other apps or by a possible intruder. Once you save the recording, you will be asked where you want to save the recording to.</string>
</resources>
Loading