mirror of
https://github.com/Myzel394/Alibi.git
synced 2025-06-19 07:15:25 +02:00
fix: Fix modal bottom sheet
This commit is contained in:
parent
9bc6908bb9
commit
eeaeef07a8
@ -101,7 +101,7 @@ dependencies {
|
|||||||
implementation 'androidx.compose.ui:ui'
|
implementation 'androidx.compose.ui:ui'
|
||||||
implementation 'androidx.compose.ui:ui-graphics'
|
implementation 'androidx.compose.ui:ui-graphics'
|
||||||
implementation 'androidx.compose.ui:ui-tooling-preview'
|
implementation 'androidx.compose.ui:ui-tooling-preview'
|
||||||
implementation 'androidx.compose.material3:material3'
|
implementation 'androidx.compose.material3:material3:1.1.2'
|
||||||
implementation "androidx.compose.material:material-icons-extended:1.5.4"
|
implementation "androidx.compose.material:material-icons-extended:1.5.4"
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
implementation 'androidx.appcompat:appcompat:1.6.1'
|
||||||
implementation 'androidx.documentfile:documentfile:1.0.1'
|
implementation 'androidx.documentfile:documentfile:1.0.1'
|
||||||
|
@ -5,7 +5,7 @@ import androidx.compose.ui.unit.dp
|
|||||||
|
|
||||||
val BIG_PRIMARY_BUTTON_SIZE = 64.dp
|
val BIG_PRIMARY_BUTTON_SIZE = 64.dp
|
||||||
|
|
||||||
val SHEET_BOTTOM_OFFSET = 56.dp
|
val SHEET_BOTTOM_OFFSET = 24.dp
|
||||||
val MAX_AMPLITUDE = 20000
|
val MAX_AMPLITUDE = 20000
|
||||||
val SUPPORTS_DARK_MODE_NATIVELY = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|
val SUPPORTS_DARK_MODE_NATIVELY = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q
|
||||||
|
|
||||||
|
@ -112,6 +112,7 @@ fun Navigation(
|
|||||||
SettingsScreen(
|
SettingsScreen(
|
||||||
navController = navController,
|
navController = navController,
|
||||||
audioRecorder = audioRecorder,
|
audioRecorder = audioRecorder,
|
||||||
|
videoRecorder = videoRecorder,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
composable(
|
composable(
|
||||||
|
@ -48,13 +48,14 @@ fun QuickMaxDurationSelector(
|
|||||||
) {
|
) {
|
||||||
Column(
|
Column(
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
modifier = Modifier.fillMaxWidth()
|
modifier = Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(bottom = SHEET_BOTTOM_OFFSET)
|
||||||
) {
|
) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.widthIn(max = 400.dp)
|
.widthIn(max = 400.dp)
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp, vertical = 24.dp),
|
||||||
.padding(bottom = SHEET_BOTTOM_OFFSET),
|
|
||||||
) {
|
) {
|
||||||
Text(
|
Text(
|
||||||
stringResource(R.string.ui_recorder_action_changeMaxDuration_title),
|
stringResource(R.string.ui_recorder_action_changeMaxDuration_title),
|
||||||
@ -88,8 +89,6 @@ fun QuickMaxDurationSelector(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer(modifier = Modifier.height(32.dp))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -111,7 +111,7 @@ fun VideoRecorderPreparationSheet(
|
|||||||
.fillMaxSize(),
|
.fillMaxSize(),
|
||||||
cameraSelector = videoSettings.cameraSelector,
|
cameraSelector = videoSettings.cameraSelector,
|
||||||
)
|
)
|
||||||
} else
|
} else {
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(horizontal = 16.dp)
|
.padding(horizontal = 16.dp)
|
||||||
@ -220,4 +220,5 @@ fun VideoRecorderPreparationSheet(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -60,6 +60,7 @@ import app.myzel394.alibi.ui.components.atoms.MessageBox
|
|||||||
import app.myzel394.alibi.ui.components.atoms.MessageType
|
import app.myzel394.alibi.ui.components.atoms.MessageType
|
||||||
import app.myzel394.alibi.ui.effects.rememberSettings
|
import app.myzel394.alibi.ui.effects.rememberSettings
|
||||||
import app.myzel394.alibi.ui.models.AudioRecorderModel
|
import app.myzel394.alibi.ui.models.AudioRecorderModel
|
||||||
|
import app.myzel394.alibi.ui.models.VideoRecorderModel
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
@ -67,6 +68,7 @@ import kotlinx.coroutines.launch
|
|||||||
fun SettingsScreen(
|
fun SettingsScreen(
|
||||||
navController: NavController,
|
navController: NavController,
|
||||||
audioRecorder: AudioRecorderModel,
|
audioRecorder: AudioRecorderModel,
|
||||||
|
videoRecorder: VideoRecorderModel,
|
||||||
) {
|
) {
|
||||||
val snackbarHostState = remember { SnackbarHostState() }
|
val snackbarHostState = remember { SnackbarHostState() }
|
||||||
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(
|
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(
|
||||||
@ -120,7 +122,7 @@ fun SettingsScreen(
|
|||||||
val settings = rememberSettings()
|
val settings = rememberSettings()
|
||||||
|
|
||||||
// Show alert
|
// Show alert
|
||||||
if (audioRecorder.isInRecording)
|
if (audioRecorder.isInRecording || videoRecorder.isInRecording) {
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.padding(16.dp)
|
.padding(16.dp)
|
||||||
@ -131,6 +133,7 @@ fun SettingsScreen(
|
|||||||
message = stringResource(R.string.ui_settings_hint_recordingActive_message),
|
message = stringResource(R.string.ui_settings_hint_recordingActive_message),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!SUPPORTS_DARK_MODE_NATIVELY) {
|
if (!SUPPORTS_DARK_MODE_NATIVELY) {
|
||||||
ThemeSelector()
|
ThemeSelector()
|
||||||
}
|
}
|
||||||
@ -140,6 +143,10 @@ fun SettingsScreen(
|
|||||||
DeleteRecordingsImmediatelyTile(settings = settings)
|
DeleteRecordingsImmediatelyTile(settings = settings)
|
||||||
CustomNotificationTile(navController = navController, settings = settings)
|
CustomNotificationTile(navController = navController, settings = settings)
|
||||||
EnableAppLockTile(settings = settings)
|
EnableAppLockTile(settings = settings)
|
||||||
|
SaveFolderTile(
|
||||||
|
settings = settings,
|
||||||
|
snackbarHostState = snackbarHostState,
|
||||||
|
)
|
||||||
GlobalSwitch(
|
GlobalSwitch(
|
||||||
label = stringResource(R.string.ui_settings_advancedSettings_label),
|
label = stringResource(R.string.ui_settings_advancedSettings_label),
|
||||||
checked = settings.showAdvancedSettings,
|
checked = settings.showAdvancedSettings,
|
||||||
@ -157,11 +164,6 @@ fun SettingsScreen(
|
|||||||
verticalArrangement = Arrangement.spacedBy(32.dp),
|
verticalArrangement = Arrangement.spacedBy(32.dp),
|
||||||
) {
|
) {
|
||||||
Column {
|
Column {
|
||||||
SaveFolderTile(
|
|
||||||
settings = settings,
|
|
||||||
snackbarHostState = snackbarHostState,
|
|
||||||
)
|
|
||||||
|
|
||||||
DividerTitle(
|
DividerTitle(
|
||||||
title = stringResource(R.string.ui_settings_sections_audio_title),
|
title = stringResource(R.string.ui_settings_sections_audio_title),
|
||||||
description = stringResource(R.string.ui_settings_sections_audio_description),
|
description = stringResource(R.string.ui_settings_sections_audio_description),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user