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

Commit e9bc72ba authored by Zoey Chen's avatar Zoey Chen
Browse files

[Settings] To set visibility to menu button, add new set/get in OrderMenuPreference

Test: manual
Bug: 422043318
Flag: EXEMPT refactor
Change-Id: Ic1efa15db557081e2c94d476451778911c6567c8
parent d44d0d12
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -49,6 +49,14 @@ class OrderMenuPreference @JvmOverloads constructor(
            }
        }

    var isMenuButtonVisible: Boolean = true
        set(value) {
            if (field != value) {
                field = value
                notifyChanged()
            }
        }

    init {
        layoutResource = R.layout.settingslib_expressive_preference_ordermenu
        widgetLayoutResource = R.layout.settingslib_expressive_button_menu
@@ -66,6 +74,7 @@ class OrderMenuPreference @JvmOverloads constructor(
        holder.isDividerAllowedAbove = false

        menuButton = holder.findViewById(R.id.settingslib_menu_button) as? MaterialButton
        (menuButton as android.view.View).visibility = if (isMenuButtonVisible) VISIBLE else GONE

        // setup the onClickListener
        setupMenuButton(context)