mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-05-02 21:56:24 +00:00
Fixed global layout listener never removed if binding is not available
This commit is contained in:
parent
2ed862426e
commit
fcd0779507
1 changed files with 4 additions and 3 deletions
|
|
@ -746,10 +746,11 @@ class DetailChatRoomFragment : MasterFragment<ChatRoomDetailFragmentBinding, Cha
|
||||||
.addOnGlobalLayoutListener(
|
.addOnGlobalLayoutListener(
|
||||||
object : OnGlobalLayoutListener {
|
object : OnGlobalLayoutListener {
|
||||||
override fun onGlobalLayout() {
|
override fun onGlobalLayout() {
|
||||||
|
binding.chatMessagesList
|
||||||
|
.viewTreeObserver
|
||||||
|
.removeOnGlobalLayoutListener(this)
|
||||||
|
|
||||||
if (isBindingAvailable()) {
|
if (isBindingAvailable()) {
|
||||||
binding.chatMessagesList
|
|
||||||
.viewTreeObserver
|
|
||||||
.removeOnGlobalLayoutListener(this)
|
|
||||||
if (::chatScrollListener.isInitialized) {
|
if (::chatScrollListener.isInitialized) {
|
||||||
binding.chatMessagesList.addOnScrollListener(chatScrollListener)
|
binding.chatMessagesList.addOnScrollListener(chatScrollListener)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue