Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
Fix ime padding
Browse files Browse the repository at this point in the history
  • Loading branch information
M3DZIK committed Oct 22, 2023
1 parent bd453c3 commit 2aef21d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import android.util.Log
import androidx.activity.compose.setContent
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.core.view.WindowCompat
import androidx.fragment.app.FragmentActivity
import androidx.navigation.NavController
import dev.medzik.android.components.navigate
Expand All @@ -24,6 +25,8 @@ class MainActivity : FragmentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

WindowCompat.setDecorFitsSystemWindows(window, false)

// handle uncaught exceptions
Thread.setDefaultUncaughtExceptionHandler { _, e ->
Log.e("LibrePass", "Uncaught exception", e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package dev.medzik.librepass.android.ui
import android.app.Activity
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.imePadding
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Add
Expand Down Expand Up @@ -273,6 +274,7 @@ fun LibrePassNavigation() {
NavHost(
navController,
startDestination = getStartRoute(),
modifier = Modifier.imePadding()
) {
for (screen in Screen.values()) {
composable(screen.getRoute()) {
Expand All @@ -281,7 +283,7 @@ fun LibrePassNavigation() {
} else {
Scaffold(
topBar = { screen.topBar(navController) },
floatingActionButton = { screen.floatingActionButton(navController) },
floatingActionButton = { screen.floatingActionButton(navController) }
) { innerPadding ->
Column(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.medzik.librepass.android.ui.theme

import android.os.Build
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.imePadding
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.darkColorScheme
Expand Down Expand Up @@ -131,9 +130,7 @@ fun LibrePassTheme(
) {
Surface(
color = MaterialTheme.colorScheme.surface,
modifier = Modifier
.fillMaxSize()
.imePadding(),
modifier = Modifier.fillMaxSize(),
content = content
)
}
Expand Down

0 comments on commit 2aef21d

Please sign in to comment.