mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
feat: Add import export to settings
This commit is contained in:
parent
eceaba78be
commit
d9420ddff5
@ -0,0 +1,53 @@
|
|||||||
|
package app.myzel394.alibi.ui.components.SettingsScreen.atoms
|
||||||
|
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Download
|
||||||
|
import androidx.compose.material.icons.filled.Upload
|
||||||
|
import androidx.compose.material3.Button
|
||||||
|
import androidx.compose.material3.ButtonDefaults
|
||||||
|
import androidx.compose.material3.Icon
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Alignment
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.res.stringResource
|
||||||
|
import app.myzel394.alibi.R
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun ImportExport() {
|
||||||
|
Row(
|
||||||
|
horizontalArrangement = Arrangement.SpaceEvenly,
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
modifier = Modifier.fillMaxWidth(),
|
||||||
|
) {
|
||||||
|
Button(
|
||||||
|
onClick = { /*TODO*/ },
|
||||||
|
colors = ButtonDefaults.filledTonalButtonColors(),
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
Icons.Default.Download,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(ButtonDefaults.IconSize),
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.size(ButtonDefaults.IconSpacing))
|
||||||
|
Text(stringResource(R.string.ui_settings_option_import_label))
|
||||||
|
}
|
||||||
|
Button(
|
||||||
|
onClick = { /*TODO*/ },
|
||||||
|
colors = ButtonDefaults.filledTonalButtonColors(),
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
Icons.Default.Upload,
|
||||||
|
contentDescription = null,
|
||||||
|
modifier = Modifier.size(ButtonDefaults.IconSize),
|
||||||
|
)
|
||||||
|
Spacer(modifier = Modifier.size(ButtonDefaults.IconSpacing))
|
||||||
|
Text(stringResource(R.string.ui_settings_option_export_label))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
package app.myzel394.alibi.ui.screens
|
package app.myzel394.alibi.ui.screens
|
||||||
|
|
||||||
import androidx.compose.animation.AnimatedVisibility
|
import androidx.compose.animation.AnimatedVisibility
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
@ -39,6 +40,7 @@ import app.myzel394.alibi.ui.SUPPORTS_DARK_MODE_NATIVELY
|
|||||||
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.BitrateTile
|
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.BitrateTile
|
||||||
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.EncoderTile
|
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.EncoderTile
|
||||||
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.ForceExactMaxDurationTile
|
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.ForceExactMaxDurationTile
|
||||||
|
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.ImportExport
|
||||||
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.InAppLanguagePicker
|
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.InAppLanguagePicker
|
||||||
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.IntervalDurationTile
|
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.IntervalDurationTile
|
||||||
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.MaxDurationTile
|
import app.myzel394.alibi.ui.components.SettingsScreen.atoms.MaxDurationTile
|
||||||
@ -128,6 +130,10 @@ fun SettingsScreen(
|
|||||||
ForceExactMaxDurationTile()
|
ForceExactMaxDurationTile()
|
||||||
InAppLanguagePicker()
|
InAppLanguagePicker()
|
||||||
AnimatedVisibility(visible = settings.showAdvancedSettings) {
|
AnimatedVisibility(visible = settings.showAdvancedSettings) {
|
||||||
|
Column(
|
||||||
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
verticalArrangement = Arrangement.spacedBy(32.dp),
|
||||||
|
) {
|
||||||
Column {
|
Column {
|
||||||
Divider(
|
Divider(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@ -139,6 +145,12 @@ fun SettingsScreen(
|
|||||||
EncoderTile(snackbarHostState = snackbarHostState)
|
EncoderTile(snackbarHostState = snackbarHostState)
|
||||||
OutputFormatTile()
|
OutputFormatTile()
|
||||||
}
|
}
|
||||||
|
Divider(
|
||||||
|
modifier = Modifier
|
||||||
|
.fillMaxWidth(0.5f)
|
||||||
|
)
|
||||||
|
ImportExport()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<resources xmlns:android="http://schemas.android.com/apk/res/android"
|
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||||
xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
|
||||||
<string name="app_name">Alibi</string>
|
<string name="app_name">Alibi</string>
|
||||||
|
|
||||||
<string name="dialog_close_cancel_label">Cancel</string>
|
<string name="dialog_close_cancel_label">Cancel</string>
|
||||||
@ -64,4 +63,6 @@
|
|||||||
<string name="ui_audioRecorder_error_recording_description">Alibi encountered an error during recording. Would you like to try saving the recording?</string>
|
<string name="ui_audioRecorder_error_recording_description">Alibi encountered an error during recording. Would you like to try saving the recording?</string>
|
||||||
<string name="ui_settings_language_title">Language</string>
|
<string name="ui_settings_language_title">Language</string>
|
||||||
<string name="ui_settings_language_update_label">Change</string>
|
<string name="ui_settings_language_update_label">Change</string>
|
||||||
|
<string name="ui_settings_option_import_label">Import Settings</string>
|
||||||
|
<string name="ui_settings_option_export_label">Export Settings</string>
|
||||||
</resources>
|
</resources>
|
Loading…
x
Reference in New Issue
Block a user