Skip to content

Commit

Permalink
Added Window Insets Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
LA Colinares committed Aug 22, 2021
1 parent a3b95ad commit 41d55d8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ dependencies {
implementation "com.google.accompanist:accompanist-pager:$accompanist"
implementation "com.google.accompanist:accompanist-placeholder-material:$accompanist"
implementation "com.google.accompanist:accompanist-navigation-animation:$accompanist"
implementation "com.google.accompanist:accompanist-insets:$accompanist"

//ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.compose.material.ExperimentalMaterialApi
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Surface
import androidx.compose.ui.Modifier
import com.google.accompanist.insets.ProvideWindowInsets
import com.lacolinares.jetpicexpress.presentation.ui.theme.JetPicExpressTheme
import com.lacolinares.jetpicexpress.util.FileHelper
import com.lacolinares.jetpicexpress.util.extensions.setTransparentStatusBar
Expand All @@ -31,14 +32,16 @@ class MainActivity : ComponentActivity() {
setTransparentStatusBar()
setContent {
JetPicExpressTheme {
Surface(
color = MaterialTheme.colors.background,
modifier = Modifier.fillMaxSize()
) {
Navigation(
activity = this,
fileHelper = fileHelper
)
ProvideWindowInsets {
Surface(
color = MaterialTheme.colors.background,
modifier = Modifier.fillMaxSize()
) {
Navigation(
activity = this,
fileHelper = fileHelper
)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.google.accompanist.insets.navigationBarsPadding
import com.google.accompanist.pager.ExperimentalPagerApi
import com.lacolinares.jetpicexpress.R
import com.lacolinares.jetpicexpress.presentation.ui.home.components.HomeButtonMenu
Expand All @@ -26,7 +27,9 @@ fun HomeScreen(
navigator: AppNavigator
) {
navigator.activity.setTransparentStatusBar()
Box {
Box(
modifier = Modifier.navigationBarsPadding()
) {
MainContent()
TopContent(navigator)
BottomContent(this, navigator)
Expand Down

0 comments on commit 41d55d8

Please sign in to comment.