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

Prevent drawing behind status bar #303

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
@@ -1,7 +1,11 @@
package org.scottishtecharmy.soundscape.screens.home

import android.util.Log
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand Down Expand Up @@ -80,7 +84,8 @@ fun HomeScreen(
val uiState = settingsViewModel.state.collectAsStateWithLifecycle()
Settings(
onNavigateUp = { navController.navigateUp() },
uiState = uiState.value
uiState = uiState.value,
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing),
)
}

Expand All @@ -105,6 +110,7 @@ fun HomeScreen(
latitude = location.value?.latitude,
longitude = location.value?.longitude,
heading = heading.value,
modifier = Modifier.windowInsetsPadding(WindowInsets.safeDrawing),
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ fun LocationDetailsScreen(
heading : Float,
onNavigateUp: () -> Unit,
viewModel: LocationDetailsViewModel = hiltViewModel(),
modifier: Modifier = Modifier
) {
LocationDetails(
onNavigateUp = onNavigateUp,
Expand All @@ -58,7 +59,8 @@ fun LocationDetailsScreen(
},
latitude = latitude,
longitude = longitude,
heading = heading
heading = heading,
modifier = modifier
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ fun SettingsPreview() {
@Composable
fun Settings(
onNavigateUp: () -> Unit,
uiState : SettingsViewModel.SettingsUiState)
uiState: SettingsViewModel.SettingsUiState,
modifier: Modifier = Modifier,
)
{
ProvidePreferenceLocals {
LazyColumn {

LazyColumn (modifier = modifier){
stickyHeader {
Surface {
CustomAppBar(stringResource(R.string.general_alert_settings),
Expand Down
Loading