You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iceraven-browser/app/src/main/java/org/mozilla/fenix/tabstray/ext/BrowserMenu.kt

26 lines
815 B
Kotlin

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package org.mozilla.fenix.tabstray.ext
import android.view.View
import androidx.cardview.widget.CardView
import androidx.core.content.ContextCompat
import mozilla.components.browser.menu.BrowserMenu
import org.mozilla.fenix.R
/**
* Invokes [BrowserMenu.show] and applies the default theme color background.
*/
fun BrowserMenu.showWithTheme(view: View) {
show(view).also { popupMenu ->
(popupMenu.contentView as? CardView)?.setCardBackgroundColor(
ContextCompat.getColor(
view.context,
R.color.fx_mobile_layer_color_1
)
)
}
}