mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 10:46:53 -04:00
Fixed: Extra top margin in KiwixAppBar
when opening KiwixSearchView
.
* The issue occurred because our application already has `Edge-To-Edge` mode enabled, but Compose's `TopAppBar` automatically adds a top margin when insets change. This resulted in double padding in the toolbar. * To fix this, we now apply only the side insets to the toolbar, as the top insets are already handled.
This commit is contained in:
parent
852849389e
commit
630446c2e2
@ -22,8 +22,12 @@ import androidx.annotation.StringRes
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.WindowInsets
|
||||
import androidx.compose.foundation.layout.WindowInsetsSides
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.only
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.statusBars
|
||||
import androidx.compose.foundation.lazy.LazyListState
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
@ -78,7 +82,11 @@ fun KiwixAppBar(
|
||||
colors = TopAppBarDefaults.topAppBarColors(
|
||||
containerColor = Black,
|
||||
scrolledContainerColor = Black
|
||||
)
|
||||
),
|
||||
// Edge-to-Edge mode is already enabled in our application,
|
||||
// so we don't need to apply additional top insets.
|
||||
// This prevents unwanted extra margin at the top.
|
||||
windowInsets = WindowInsets.statusBars.only(WindowInsetsSides.Horizontal)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user