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

Commit 1c471757 authored by Wes Okuhara's avatar Wes Okuhara
Browse files

SettingsLib: Hide StatusBannerPreference button dynamically

Views that use StatusBannerPreference can call
setButtonOnClickListener() to add or remove a click listener. When the
listener exists, the button will be visible, else the button will be
hidden dynamically.

Bug: 398843113
Test: Manually test in reference app
Flag: EXEMPT bugfix
Change-Id: Iba804fbed1cc84d030cd3641849726b63735bc7a
parent 084f4f2e
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -167,9 +167,10 @@ class StatusBannerPreference @JvmOverloads constructor(
    }

    /**
     * Register a callback to be invoked when positive button is clicked.
     * Register a callback to be invoked when positive button is clicked. If null is passed as the
     * callback, the button will be hidden.
     */
    fun setButtonOnClickListener(listener: View.OnClickListener) {
    fun setButtonOnClickListener(listener: View.OnClickListener?) {
        this.listener = listener
        notifyChanged()
    }