decrease width of search bar on large tablets

#133
This commit is contained in:
johan12345
2021-10-11 18:00:55 +02:00
committed by Johan von Forstner
parent af0fb6762d
commit 3151d74d1a
4 changed files with 17 additions and 4 deletions

View File

@@ -194,7 +194,11 @@ class MapFragment : Fragment(), OnMapReadyCallback, MapsActivity.FragmentCallbac
val density = resources.displayMetrics.density
// status bar height + toolbar height + margin
val margin =
insets.systemWindowInsetTop + (48 * density).toInt() + (28 * density).toInt()
if (binding.toolbarContainer.layoutParams.width == ViewGroup.LayoutParams.MATCH_PARENT) {
insets.systemWindowInsetTop + (48 * density).toInt() + (28 * density).toInt()
} else {
insets.systemWindowInsetTop + (12 * density).toInt()
}
binding.fabLayers.updateLayoutParams<ViewGroup.MarginLayoutParams> {
topMargin = margin
}