Fix post loop when View is GONE.

This commit is contained in:
Rashad Sookram 2021-12-06 15:54:40 -05:00 committed by GitHub
parent c93457402c
commit 738c5db7c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@ import android.view.animation.AnimationUtils
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.view.isGone
import androidx.interpolator.view.animation.FastOutSlowInInterpolator
import org.thoughtcrime.securesms.R
import org.thoughtcrime.securesms.util.ViewUtil
@ -54,7 +55,19 @@ class SignalBottomActionBar(context: Context, attributeSet: AttributeSet) : Line
present(this.items)
}
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
super.onSizeChanged(w, h, oldw, oldh)
if (w != oldw) {
present(items)
}
}
private fun present(items: List<ActionItem>) {
if (isGone) {
return
}
if (width == 0) {
post { present(items) }
return