Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd667ed4 authored by Jagrut Desai's avatar Jagrut Desai
Browse files

Clear TaskbarDividerPopupView callback upon closing

- Breakout CL part 4
- This is a breakout cl from ag/24272821 to make it more readable and atomic.
- This cl consist of clearing callbacks after calling close once, so that we don't run into scenario where user is able to close popup multiple times leading to crash.

Test: Manual, Visual
Bug: 265170176
Flag: ENABLE_TASKBAR_PINNING
Change-Id: Ie4cd95c69a559a17b7c19a64a71ccf6ac20542d7
parent df3043aa
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ constructor(
            return taskMenuViewWithArrow.populateForView(view)
        }
    }

    private lateinit var dividerView: View

    private val menuWidth =
@@ -178,13 +179,19 @@ constructor(

    override fun closeComplete() {
        onCloseCallback(didPreferenceChange)
        onCloseCallback = {}
        super.closeComplete()
    }

    private fun onClickAlwaysShowTaskbarSwitchOption() {
        didPreferenceChange = true
        changePreference()
        changePreference = {}
        // Allow switch animation to finish and then close the popup.
        postDelayed(DIVIDER_POPUP_CLOSING_DELAY) { close(true) }
        postDelayed(DIVIDER_POPUP_CLOSING_DELAY) {
            if (isOpen) {
                close(false)
            }
        }
    }
}