mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-28 13:48:12 +00:00
Apply window insets to bottom action bar if they're not already consumed.
This commit is contained in:
@@ -5,6 +5,7 @@ import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowInsets
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.AnimationUtils
|
||||
import android.widget.ImageView
|
||||
@@ -75,6 +76,15 @@ class SignalBottomActionBar(context: Context, attributeSet: AttributeSet?) : Lin
|
||||
}
|
||||
}
|
||||
|
||||
override fun onApplyWindowInsets(insets: WindowInsets?): WindowInsets? {
|
||||
if (insets != null) {
|
||||
val navigationBarInset = insets.systemWindowInsetBottom
|
||||
val layoutParams = layoutParams as? MarginLayoutParams
|
||||
layoutParams?.bottomMargin = navigationBarInset
|
||||
}
|
||||
return super.onApplyWindowInsets(insets)
|
||||
}
|
||||
|
||||
private fun present(items: List<ActionItem>) {
|
||||
if (width == 0) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user