mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-18 23:05:26 +02:00
feat: Add explanation to internal storage
Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com>
This commit is contained in:
parent
880a81f919
commit
1fe99b2aa6
@ -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
|
||||
@ -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
|
||||
@ -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,
|
||||
)
|
||||
},
|
||||
@ -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 = {
|
||||
@ -258,12 +284,9 @@ fun SaveFolderTile(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun MediaFoldersExplanationDialog(
|
||||
fun DCIMFolderExplanationDialog(
|
||||
onDismiss: () -> Unit,
|
||||
) {
|
||||
val context = LocalContext.current
|
||||
val openFolder = rememberOpenUri()
|
||||
|
||||
AlertDialog(
|
||||
onDismissRequest = onDismiss,
|
||||
icon = {
|
||||
@ -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(
|
||||
|
@ -188,4 +188,5 @@
|
||||
<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…
x
Reference in New Issue
Block a user