remove huge gap in non-edge-to-edge devices with bottom bar in cards and cards manage screen

This commit is contained in:
2026-06-13 18:05:10 +05:00
parent 98990544fc
commit 5b5f776715
@@ -155,12 +155,11 @@ class CardsFragment : Fragment() {
} }
}) })
ViewCompat.setOnApplyWindowInsetsListener(binding.contentLayout) { v, insets -> ViewCompat.setOnApplyWindowInsetsListener(binding.contentLayout) { v, insets ->
val isBottomNav = requireContext().getSharedPreferences("prefs", Context.MODE_PRIVATE) val bottomNav = activity?.findViewById<View>(R.id.bottomNavigation)
.getBoolean("bottom_nav", false) val navBarBottom = if (bottomNav?.visibility == View.VISIBLE) 0
val navBar = insets.getInsets(WindowInsetsCompat.Type.systemBars()) else insets.getInsets(WindowInsetsCompat.Type.systemBars()).bottom
val extraBottom = if (isBottomNav) 0 else navBar.bottom v.setPadding(0, 0, 0, (16 * resources.displayMetrics.density).toInt() + navBarBottom)
v.setPadding(0, 0, 0, (16 * resources.displayMetrics.density).toInt() + extraBottom)
insets insets
} }