Skip to content

Commit

Permalink
Fix edge-to-edge (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
fornewid authored Dec 30, 2024
1 parent 150dc65 commit ea071d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
package soup.movie.feature.search.impl

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
Expand All @@ -32,6 +34,7 @@ import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.material3.TextField
import androidx.compose.material3.TextFieldDefaults
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState
Expand Down Expand Up @@ -68,7 +71,6 @@ fun SearchScreen(
val uiModel by viewModel.uiModel.collectAsState()

Scaffold(
modifier = Modifier.systemBarsPadding(),
topBar = {
SearchTopBar(
upPress = upPress,
Expand Down Expand Up @@ -108,15 +110,17 @@ fun SearchScreen(
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
private fun SearchTopBar(
upPress: () -> Unit,
query: String,
onQueryChanged: (String) -> Unit,
modifier: Modifier = Modifier,
windowInsets: WindowInsets = TopAppBarDefaults.windowInsets,
) {
Surface(
modifier = modifier
modifier = modifier.windowInsetsPadding(windowInsets)
.fillMaxWidth()
.height(56.dp),
color = MovieTheme.colorScheme.primary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
*/
package soup.movie.feature.settings.impl

import androidx.compose.foundation.layout.systemBarsPadding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
Expand Down Expand Up @@ -49,7 +47,6 @@ fun SettingsNavGraph() {
exitTransition = { materialSharedAxisZOut(forward = true) },
popEnterTransition = { materialSharedAxisZIn(forward = false) },
popExitTransition = { materialSharedAxisZOut(forward = false) },
modifier = Modifier.systemBarsPadding(),
) {
composable<SettingsScreen.Home> {
val viewModel = hiltViewModel<SettingsViewModel>()
Expand Down

0 comments on commit ea071d3

Please sign in to comment.