Skip to content

Commit

Permalink
fix: debug insets
Browse files Browse the repository at this point in the history
  • Loading branch information
mezhendosina committed Dec 7, 2023
1 parent 38b3147 commit 6c9a6fc
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ dependencies {
kapt "com.google.dagger:hilt-compiler:2.48.1"



// compose
//
// def composeBom = platform('androidx.compose:compose-bom:2023.10.01')
Expand All @@ -233,7 +232,7 @@ dependencies {
// implementation 'androidx.compose.material3:material3-window-size-class'
//
// // Optional - Integration with activities
// implementation 'androidx.activity:activity-compose:1.8.1'
implementation 'androidx.activity:activity-compose:1.8.1'
// // Optional - Integration with ViewModels
// implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1'
// // Optional - Integration with LiveData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package com.mezhendosina.sgo.app.activities
import android.app.DownloadManager
import android.os.Bundle
import androidx.activity.OnBackPressedCallback
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
Expand Down Expand Up @@ -46,6 +47,7 @@ class LoginActivity : AppCompatActivity() {
}

override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)

onBackPressedDispatcher.addCallback(onBackPressedCallback)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.mezhendosina.sgo.app.activities

import android.os.Bundle
import android.view.View
import androidx.activity.enableEdgeToEdge
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.core.os.bundleOf
Expand Down Expand Up @@ -73,6 +74,7 @@ class MainActivity : AppCompatActivity() {
// }

override fun onCreate(savedInstanceState: Bundle?) {
enableEdgeToEdge()
super.onCreate(savedInstanceState)

binding = ContainerMainActivityBinding.inflate(layoutInflater)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ fun AppCompatActivity.setupInsets(fragmentContainer: View) {
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) {
view.updateLayoutParams<MarginLayoutParams> {
topMargin = insets.top
this.bottomMargin = insetsNavigation.bottom
bottomMargin = insetsNavigation.bottom
}
} else {
view.setPadding(
insets.left,
topBarInset.top,
insets.right,
insetsNavigation.bottom
view.paddingBottom
)
}
WindowInsetsCompat.CONSUMED
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-night/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<item name="android:windowTranslucentNavigation">true</item>
<item name="android:statusBarColor">@color/md_theme_dark_background</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:fitsSystemWindows">true</item>


<item name="colorPrimary">@color/md_theme_dark_primary</item>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!-- <item name="android:windowTranslucentStatus">true</item>-->
<item name="android:statusBarColor">@color/md_theme_light_background</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:fitsSystemWindows">true</item>

<item name="colorPrimary">@color/md_theme_light_primary</item>
<item name="colorOnPrimary">@color/md_theme_light_onPrimary</item>
<item name="colorPrimaryContainer">@color/md_theme_light_primaryContainer</item>
Expand Down

0 comments on commit 6c9a6fc

Please sign in to comment.