Commit 73c4ab97 authored by MozLando's avatar MozLando
Browse files

Merge #7936



7936: Closes #7840: Menu is only long clickable if listener is set r=pocmo a=NotWoods



Co-authored-by: default avatarTiger Oakes <toakes@mozilla.com>
parents 61ad2215 84aaed38
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -54,10 +54,11 @@ class BrowserMenuItemToolbar(
                menu.dismiss()
            }
            button.setOnLongClickListener {
                item.longClickListener()
                item.longClickListener?.invoke()
                menu.dismiss()
                true
            }
            button.isLongClickable = item.longClickListener != null

            layout.addView(button, LinearLayout.LayoutParams(0, MATCH_PARENT, 1f))
        }
@@ -91,7 +92,7 @@ class BrowserMenuItemToolbar(
        val contentDescription: String,
        @ColorRes val iconTintColorResource: Int = NO_ID,
        val isEnabled: () -> Boolean = { true },
        val longClickListener: () -> Unit = {},
        val longClickListener: (() -> Unit)? = null,
        val listener: () -> Unit
    ) {

@@ -152,7 +153,7 @@ class BrowserMenuItemToolbar(
        @ColorRes val secondaryImageTintResource: Int = primaryImageTintResource,
        val isInPrimaryState: () -> Boolean = { true },
        val disableInSecondaryState: Boolean = false,
        longClickListener: () -> Unit = {},
        longClickListener: (() -> Unit)? = null,
        listener: () -> Unit
    ) : Button(
        primaryImageResource,
+5 −2
Original line number Diff line number Diff line
@@ -25,6 +25,9 @@ permalink: /changelog/
  * ⚠️ **This is a breaking change**: Renamed `queuedDownloads` from `BrowserState` to `downloads` .
  * Removed automatic deletion of `downloads` upon a completed download.

* **browser-menu**
  * ⚠️ **This is a breaking change**: `BrowserMenuItemToolbar.Button.longClickListener` is now nullable and defaults to null.

# 52.0.0

* [Commits](https://github.com/mozilla-mobile/android-components/compare/v51.0.0...v52.0.0)