From b316c6f29e82fca780710c965f47381df435c06a Mon Sep 17 00:00:00 2001 From: Alex Hart Date: Mon, 17 Nov 2025 12:23:36 -0400 Subject: [PATCH] Fix bottom bar. --- .../securesms/components/menu/SignalBottomActionBar.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/menu/SignalBottomActionBar.kt b/app/src/main/java/org/thoughtcrime/securesms/components/menu/SignalBottomActionBar.kt index 1f93912e20..9c71bf5671 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/menu/SignalBottomActionBar.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/components/menu/SignalBottomActionBar.kt @@ -41,6 +41,7 @@ import org.thoughtcrime.securesms.util.ViewUtil class SignalBottomActionBar(context: Context, attributeSet: AttributeSet?) : LinearLayout(context, attributeSet) { val items: MutableList = mutableListOf() + private var defaultBottomMargin: Int = 0 val enterAnimation: Animation by lazy { AnimationUtils.loadAnimation(context, R.anim.slide_fade_from_bottom).apply { @@ -62,6 +63,12 @@ class SignalBottomActionBar(context: Context, attributeSet: AttributeSet?) : Lin elevation = 20f } + override fun onAttachedToWindow() { + super.onAttachedToWindow() + + defaultBottomMargin = (layoutParams as? MarginLayoutParams)?.bottomMargin ?: 0 + } + fun setItems(items: List) { this.items.clear() this.items.addAll(items) @@ -80,7 +87,7 @@ class SignalBottomActionBar(context: Context, attributeSet: AttributeSet?) : Lin if (insets != null) { val navigationBarInset = insets.systemWindowInsetBottom val layoutParams = layoutParams as? MarginLayoutParams - layoutParams?.bottomMargin = navigationBarInset + layoutParams?.bottomMargin = defaultBottomMargin + navigationBarInset } return super.onApplyWindowInsets(insets) }