Remove all menu icons which can be imported from AC
Some of the icons were also used in the old implementation of browser menu,
implementation which is not used anymore, so I decided to delete the implementation
This commit is contained in:
Ionut Cristian Bedregeanu 2021-08-19 08:42:14 +03:00 committed by mergify[bot]
parent d1a9ae198a
commit 14745227de
35 changed files with 31 additions and 948 deletions

View file

@ -1,39 +0,0 @@
/* 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.focus.browser
import android.view.View
import android.widget.PopupWindow
import mozilla.components.concept.menu.MenuController
import mozilla.components.concept.menu.Orientation
import mozilla.components.concept.menu.candidate.MenuCandidate
import mozilla.components.support.base.observer.Observable
import mozilla.components.support.base.observer.ObserverRegistry
import org.mozilla.focus.ext.ifCustomTab
import org.mozilla.focus.fragment.BrowserFragment
import org.mozilla.focus.menu.browser.BrowserMenu
/**
* This adapter bridges between `browser-toolbar` and the custom, legacy [BrowserMenu] in Focus.
* It allows launching [BrowserMenu] from `BrowserToolbar`.
*/
class BrowserMenuControllerAdapter(
private val fragment: BrowserFragment
) : MenuController, Observable<MenuController.Observer> by ObserverRegistry() {
override fun dismiss() {
// Not used.
}
override fun show(anchor: View, orientation: Orientation?): PopupWindow {
val menu = BrowserMenu(fragment.requireContext(), fragment, fragment.tab.ifCustomTab()?.config)
menu.show(anchor)
return menu
}
override fun submitList(list: List<MenuCandidate>) {
// Not used.
}
}

View file

@ -34,7 +34,7 @@ class NavigationButtonsIntegration(
init {
toolbar.addNavigationAction(
NavigationButton(
image = ContextCompat.getDrawable(context, R.drawable.ic_back)!!,
image = ContextCompat.getDrawable(context, R.drawable.mozac_ic_back)!!,
contentDescription = context.getString(R.string.content_description_back),
isEnabled = { store.state.findCustomTabOrSelectedTab(customTabId)?.content?.canGoBack ?: false },
listener = { sessionUseCases.goBack(store.state.findCustomTabOrSelectedTab(customTabId)?.id) }
@ -43,7 +43,7 @@ class NavigationButtonsIntegration(
toolbar.addNavigationAction(
NavigationButton(
image = ContextCompat.getDrawable(context, R.drawable.ic_forward)!!,
image = ContextCompat.getDrawable(context, R.drawable.mozac_ic_forward)!!,
contentDescription = context.getString(R.string.content_description_forward),
isEnabled = { store.state.findCustomTabOrSelectedTab(customTabId)?.content?.canGoForward ?: false },
listener = { sessionUseCases.goForward(store.state.findCustomTabOrSelectedTab(customTabId)?.id) }
@ -52,8 +52,8 @@ class NavigationButtonsIntegration(
toolbar.addNavigationAction(
RefreshStopButton(
refreshImage = ContextCompat.getDrawable(context, R.drawable.ic_refresh)!!,
stopImage = ContextCompat.getDrawable(context, R.drawable.ic_stop)!!,
refreshImage = ContextCompat.getDrawable(context, R.drawable.mozac_ic_refresh)!!,
stopImage = ContextCompat.getDrawable(context, R.drawable.mozac_ic_stop)!!,
refreshContentDescription = context.getString(R.string.content_description_reload),
stopContentDescription = context.getString(R.string.content_description_stop),
isLoading = { store.state.findCustomTabOrSelectedTab(customTabId)?.content?.loading ?: false },

View file

@ -1,103 +0,0 @@
/* 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.focus.menu.browser
import android.view.View
import android.widget.CompoundButton
import android.widget.Switch
import android.widget.TextView
import androidx.lifecycle.coroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import mozilla.components.browser.state.selector.findTabOrCustomTabOrSelectedTab
import mozilla.components.support.ktx.kotlin.tryGetHostFromUrl
import mozilla.components.support.utils.ThreadUtils
import org.mozilla.focus.R
import org.mozilla.focus.exceptions.ExceptionDomains
import org.mozilla.focus.ext.components
import org.mozilla.focus.fragment.BrowserFragment
import org.mozilla.focus.telemetry.TelemetryWrapper
private const val THUMB_ANIMATION_DURATION = 250L
internal class BlockingItemViewHolder(
itemView: View,
private val fragment: BrowserFragment
) : BrowserMenuViewHolder(itemView), CompoundButton.OnCheckedChangeListener {
private val trackerCounter: TextView
init {
val switchView = itemView.findViewById<Switch>(R.id.blocking_switch)
switchView.isChecked = fragment.requireContext().components.store.state.findTabOrCustomTabOrSelectedTab(
fragment.tab.id
)!!.trackingProtection.ignoredOnTrackingProtection.not()
switchView.setOnCheckedChangeListener(this)
val helpView = itemView.findViewById<View>(R.id.help_trackers)
helpView.setOnClickListener(this)
trackerCounter = itemView.findViewById(R.id.trackers_count)
updateTrackers(fragment.tab.trackingProtection.blockedTrackers.size)
}
fun updateTrackers(trackers: Int) {
if (!fragment.tab.trackingProtection.ignoredOnTrackingProtection) {
updateTrackingCount(trackerCounter, trackers)
} else {
disableTrackingCount(trackerCounter)
}
}
private fun updateTrackingCount(view: TextView, count: Int) {
ThreadUtils.postToMainThread(Runnable { view.text = count.toString() })
}
private fun disableTrackingCount(view: TextView) {
ThreadUtils.postToMainThread(Runnable { view.setText(R.string.content_blocking_disabled) })
}
override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
TelemetryWrapper.blockingSwitchEvent(isChecked)
// Delay closing the menu and reloading the website a bit so that the user can actually see
// the switch change its state.
ThreadUtils.postToMainThreadDelayed(
Runnable {
menu.dismiss()
buttonView.context.components.apply {
if (isChecked) {
trackingProtectionUseCases.removeException(fragment.tab.id)
} else {
trackingProtectionUseCases.addException(fragment.tab.id)
}
updateExceptionsLocalList(isChecked)
sessionUseCases.reload(fragment.tab.id)
}
},
THUMB_ANIMATION_DURATION
)
}
private fun updateExceptionsLocalList(isChecked: Boolean) {
fragment.lifecycle.coroutineScope.launch(Dispatchers.IO) {
val domain = fragment.tab.content.url.tryGetHostFromUrl()
fragment.context?.let {
if (isChecked) {
ExceptionDomains.remove(it, listOf(domain))
} else {
ExceptionDomains.add(it, domain)
}
}
}
}
companion object {
const val LAYOUT_ID = R.layout.menu_blocking_switch
}
}

View file

@ -1,73 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* 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.focus.menu.browser
import android.annotation.SuppressLint
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.PopupWindow
import android.widget.TextView
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import mozilla.components.browser.state.state.CustomTabConfig
import org.mozilla.focus.R
import org.mozilla.focus.fragment.BrowserFragment
import org.mozilla.focus.utils.ViewUtils.isRTL
/**
* The overflow menu shown in the BrowserFragment containing page actions like "Refresh", "Share" etc.
*/
class BrowserMenu(
context: Context,
fragment: BrowserFragment,
customTabConfig: CustomTabConfig?
) : PopupWindow() {
private val adapter: BrowserMenuAdapter
init {
@SuppressLint("InflateParams") // This View will have it's params ignored anyway:
val view = LayoutInflater.from(context).inflate(R.layout.menu, null)
contentView = view
adapter = BrowserMenuAdapter(context, this, fragment, customTabConfig)
val menuList: RecyclerView = view.findViewById(R.id.list)
menuList.layoutManager = LinearLayoutManager(context, RecyclerView.VERTICAL, false)
menuList.adapter = adapter
if (customTabConfig != null) {
val brandingView = view.findViewById<TextView>(R.id.branding)
brandingView.text = context.getString(
R.string.menu_custom_tab_branding,
context.getString(R.string.app_name)
)
brandingView.visibility = View.VISIBLE
}
setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
isFocusable = true
height = ViewGroup.LayoutParams.WRAP_CONTENT
width = ViewGroup.LayoutParams.WRAP_CONTENT
elevation = context.resources.getDimension(R.dimen.menu_elevation)
}
fun updateTrackers(trackers: Int) {
adapter.updateTrackers(trackers)
}
fun updateLoading(loading: Boolean) {
adapter.updateLoading(loading)
}
fun show(anchor: View) {
val xOffset = if (isRTL(anchor)) -anchor.width else 0
super.showAsDropDown(anchor, xOffset, -(anchor.height + anchor.paddingBottom))
}
}

View file

@ -1,226 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* 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.focus.menu.browser
import android.app.PendingIntent
import android.content.Context
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import mozilla.components.browser.state.state.CustomTabConfig
import org.mozilla.focus.R
import org.mozilla.focus.fragment.BrowserFragment
import org.mozilla.focus.utils.Browsers
import org.mozilla.focus.utils.HardwareUtils
import java.lang.ref.WeakReference
class BrowserMenuAdapter(
private val context: Context,
private val menu: BrowserMenu,
private val fragment: BrowserFragment,
customTabConfig: CustomTabConfig?
) : RecyclerView.Adapter<BrowserMenuViewHolder>() {
sealed class MenuItem {
open val viewType = 0
open class Default(val id: Int, val label: String, val drawableResId: Int) : MenuItem() {
override val viewType = MenuItemViewHolder.LAYOUT_ID
}
class Custom(
id: Int,
label: String,
drawableResId: Int,
val pendingIntent: PendingIntent
) : Default(id, label, drawableResId) {
override val viewType = CustomTabMenuItemViewHolder.LAYOUT_ID
}
object Navigation : MenuItem() {
override val viewType = NavigationItemViewHolder.LAYOUT_ID
}
object BlockingSwitch : MenuItem() {
override val viewType = BlockingItemViewHolder.LAYOUT_ID
}
object RequestDesktopCheck : MenuItem() {
override val viewType = RequestDesktopCheckItemViewHolder.LAYOUT_ID
}
}
private var items = mutableListOf<MenuItem>()
private var navigationItemViewHolderReference = WeakReference<NavigationItemViewHolder>(null)
private var blockingItemViewHolderReference = WeakReference<BlockingItemViewHolder>(null)
init {
initializeMenu(fragment.tab.content.url, customTabConfig)
}
private fun initializeMenu(url: String, customTabConfig: CustomTabConfig?) {
val resources = context.resources
val browsers = Browsers(context, url)
if (shouldShowButtonToolbar()) {
items.add(MenuItem.Navigation)
}
items.add(MenuItem.BlockingSwitch)
if (customTabConfig == null || customTabConfig.showShareMenuItem) {
items.add(
MenuItem.Default(
R.id.share, resources.getString(R.string.menu_share),
R.drawable.ic_share
)
)
}
items.add(
MenuItem.Default(
R.id.add_to_homescreen,
resources.getString(R.string.menu_add_to_home_screen),
R.drawable.ic_home
)
)
items.add(
MenuItem.Default(
R.id.find_in_page,
resources.getString(R.string.find_in_page),
R.drawable.ic_search
)
)
if (browsers.hasMultipleThirdPartyBrowsers(context)) {
items.add(
MenuItem.Default(
R.id.open_select_browser,
resources.getString(
R.string.menu_open_with_a_browser2
),
R.drawable.ic_open_in
)
)
}
if (customTabConfig != null) {
// "Open in Firefox Focus" to switch from a custom tab to the full-featured browser
val appName = resources.getString(R.string.app_name)
val label = resources.getString(R.string.menu_open_with_default_browser2, appName)
val menuItem = MenuItem.Default(R.id.open_in_firefox_focus, label, 0)
items.add(menuItem)
}
if (browsers.hasThirdPartyDefaultBrowser(context)) {
items.add(
MenuItem.Default(
R.id.open_default,
resources.getString(
R.string.menu_open_with_default_browser2,
browsers.defaultBrowser!!.loadLabel(
context.packageManager
)
),
0
)
)
}
items.add(MenuItem.RequestDesktopCheck)
if (customTabConfig == null) {
// Theres no need for Settings in a custom tab.
// The user can go to the browser app itself in order to do this.
items.add(
MenuItem.Default(
R.id.settings, resources.getString(R.string.menu_settings),
R.drawable.ic_settings2
)
)
}
// "Report Site Issue" is available for builds using GeckoView only
items.add(
MenuItem.Default(
R.id.report_site_issue,
resources.getString(R.string.menu_report_site_issue),
0
)
)
if (customTabConfig != null) {
val customTabItems = customTabConfig.menuItems
.map { MenuItem.Custom(R.id.custom_tab_menu_item, it.name, 0, it.pendingIntent) }
items.addAll(customTabItems)
}
}
fun updateTrackers(trackers: Int) {
val navigationItemViewHolder = blockingItemViewHolderReference.get() ?: return
navigationItemViewHolder.updateTrackers(trackers)
}
fun updateLoading(loading: Boolean) {
val navigationItemViewHolder = navigationItemViewHolderReference.get() ?: return
navigationItemViewHolder.updateLoading(loading)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BrowserMenuViewHolder {
val inflater = LayoutInflater.from(parent.context)
return when (viewType) {
NavigationItemViewHolder.LAYOUT_ID -> {
val navigationItemViewHolder = NavigationItemViewHolder(
inflater.inflate(R.layout.menu_navigation, parent, false), fragment
)
navigationItemViewHolderReference = WeakReference(navigationItemViewHolder)
navigationItemViewHolder
}
BlockingItemViewHolder.LAYOUT_ID -> {
val blockingItemViewHolder = BlockingItemViewHolder(
inflater.inflate(R.layout.menu_blocking_switch, parent, false), fragment
)
blockingItemViewHolderReference = WeakReference(blockingItemViewHolder)
blockingItemViewHolder
}
RequestDesktopCheckItemViewHolder.LAYOUT_ID -> {
RequestDesktopCheckItemViewHolder(
inflater.inflate(R.layout.request_desktop_check_menu_item, parent, false),
fragment
)
}
MenuItemViewHolder.LAYOUT_ID -> MenuItemViewHolder(
inflater.inflate(
R.layout.menu_item,
parent,
false
)
)
CustomTabMenuItemViewHolder.LAYOUT_ID -> CustomTabMenuItemViewHolder(
inflater.inflate(R.layout.custom_tab_menu_item, parent, false)
)
else -> throw IllegalArgumentException("Unknown view type: $viewType")
}
}
override fun onBindViewHolder(holder: BrowserMenuViewHolder, position: Int) {
holder.menu = menu
holder.setOnClickListener(fragment)
val item = items[position]
when (item) {
is MenuItem.Custom -> (holder as CustomTabMenuItemViewHolder).bind(item)
is MenuItem.Default -> (holder as MenuItemViewHolder).bind(item)
}
}
override fun getItemViewType(position: Int): Int = items[position].viewType
override fun getItemCount(): Int = items.size
// On phones we show an extra row with toolbar items (forward/refresh)
private fun shouldShowButtonToolbar(): Boolean = !HardwareUtils.isTablet(context)
}

View file

@ -1,43 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* 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.focus.menu.browser;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import org.mozilla.focus.fragment.BrowserFragment;
public abstract class BrowserMenuViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private BrowserMenu menu;
protected BrowserFragment browserFragment;
public BrowserMenuViewHolder(View itemView) {
super(itemView);
}
public void setMenu(BrowserMenu menu) {
this.menu = menu;
}
public BrowserMenu getMenu() {
return menu;
}
public void setOnClickListener(BrowserFragment browserFragment) {
this.browserFragment = browserFragment;
}
@Override
public void onClick(View view) {
if (menu != null) {
menu.dismiss();
}
if (browserFragment != null) {
browserFragment.onClick(view);
}
}
}

View file

@ -40,7 +40,7 @@ class CustomTabMenu(
override val menuToolbar by lazy {
val back = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = R.drawable.ic_back,
primaryImageResource = R.drawable.mozac_ic_back,
primaryContentDescription = context.getString(R.string.content_description_back),
primaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
isInPrimaryState = {
@ -54,7 +54,7 @@ class CustomTabMenu(
}
val forward = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = R.drawable.ic_forward,
primaryImageResource = R.drawable.mozac_ic_forward,
primaryContentDescription = context.getString(R.string.content_description_forward),
primaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
isInPrimaryState = {
@ -68,13 +68,13 @@ class CustomTabMenu(
}
val refresh = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = R.drawable.ic_refresh,
primaryImageResource = R.drawable.mozac_ic_refresh,
primaryContentDescription = context.getString(R.string.content_description_reload),
primaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
isInPrimaryState = {
selectedSession?.content?.loading == false
},
secondaryImageResource = R.drawable.ic_stop,
secondaryImageResource = R.drawable.mozac_ic_stop,
secondaryContentDescription = context.getString(R.string.content_description_stop),
secondaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
disableInSecondaryState = false,
@ -92,13 +92,13 @@ class CustomTabMenu(
private val menuItems by lazy {
val findInPage = BrowserMenuImageText(
label = context.getString(R.string.find_in_page),
imageResource = R.drawable.ic_search
imageResource = R.drawable.mozac_ic_search
) {
onItemTapped.invoke(ToolbarMenu.Item.FindInPage)
}
val desktopMode = BrowserMenuImageSwitch(
imageResource = R.drawable.ic_device_desktop,
imageResource = R.drawable.mozac_ic_device_desktop,
label = context.getString(R.string.preference_performance_request_desktop_site2),
initialState = {
selectedSession?.content?.desktopMode ?: true
@ -114,7 +114,7 @@ class CustomTabMenu(
val addToHomescreen = BrowserMenuImageText(
label = context.getString(R.string.menu_add_to_home_screen),
imageResource = R.drawable.ic_add_to_home_screen
imageResource = R.drawable.mozac_ic_add_to_home_screen
) {
onItemTapped.invoke(ToolbarMenu.Item.AddToHomeScreen)
}

View file

@ -1,61 +0,0 @@
package org.mozilla.focus.menu.browser;
import android.app.PendingIntent;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import org.mozilla.focus.R;
import org.mozilla.focus.telemetry.TelemetryWrapper;
/**
* Custom tab menu items look just the same as any other menu items. The primary difference
* is that they each have a custom pending intent (which we need to execute), as opposed to
* simply redirecting to the BrowserFragment menu item handling (which is performed via the MenuItem
* id).
*/
/* package-private */ class CustomTabMenuItemViewHolder extends MenuItemViewHolder {
/* package-private */ static final int LAYOUT_ID = R.layout.custom_tab_menu_item;
private BrowserMenu menu;
private PendingIntent pendingIntent;
/* package-private */ CustomTabMenuItemViewHolder(View itemView) {
super(itemView);
}
@Override
public void setMenu(BrowserMenu menu) {
this.menu = menu;
}
@Override
public void onClick(View view) {
// Usually this is done in BrowserMenuViewHolder.onClick(), but that also tries to submit
// the click up to the fragment, which we explicitly don't want here:
if (menu != null) {
menu.dismiss();
}
if (pendingIntent == null) {
throw new IllegalStateException("No PendingIntent set for CustomTabMenuItemViewHolder");
}
try {
final Intent intent = new Intent();
intent.setData(Uri.parse(browserFragment.getTab().getContent().getUrl()));
pendingIntent.send(view.getContext(), 0, intent);
} catch (PendingIntent.CanceledException e) {
// There's really nothing we can do here...
}
TelemetryWrapper.customTabMenuEvent();
}
/* package-private */ void bind(BrowserMenuAdapter.MenuItem.Custom menuItem) {
super.bind(menuItem);
pendingIntent = menuItem.getPendingIntent();
}
}

View file

@ -42,7 +42,7 @@ class DefaultBrowserMenu(
override val menuToolbar by lazy {
val back = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = R.drawable.ic_back,
primaryImageResource = R.drawable.mozac_ic_back,
primaryContentDescription = context.getString(R.string.content_description_back),
primaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
isInPrimaryState = {
@ -56,7 +56,7 @@ class DefaultBrowserMenu(
}
val forward = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = R.drawable.ic_forward,
primaryImageResource = R.drawable.mozac_ic_forward,
primaryContentDescription = context.getString(R.string.content_description_forward),
primaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
isInPrimaryState = {
@ -70,13 +70,13 @@ class DefaultBrowserMenu(
}
val refresh = BrowserMenuItemToolbar.TwoStateButton(
primaryImageResource = R.drawable.ic_refresh,
primaryImageResource = R.drawable.mozac_ic_refresh,
primaryContentDescription = context.getString(R.string.content_description_reload),
primaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
isInPrimaryState = {
selectedSession?.content?.loading == false
},
secondaryImageResource = R.drawable.ic_stop,
secondaryImageResource = R.drawable.mozac_ic_stop,
secondaryContentDescription = context.getString(R.string.content_description_stop),
secondaryImageTintResource = context.theme.resolveAttribute(R.attr.primaryText),
disableInSecondaryState = false,
@ -89,7 +89,7 @@ class DefaultBrowserMenu(
}
}
val share = BrowserMenuItemToolbar.Button(
imageResource = R.drawable.ic_share2,
imageResource = R.drawable.mozac_ic_share,
contentDescription = context.getString(R.string.menu_share),
listener = {
onItemTapped.invoke(ToolbarMenu.Item.Share)
@ -120,13 +120,13 @@ class DefaultBrowserMenu(
val findInPage = BrowserMenuImageText(
label = context.getString(R.string.find_in_page),
imageResource = R.drawable.ic_search
imageResource = R.drawable.mozac_ic_search
) {
onItemTapped.invoke(ToolbarMenu.Item.FindInPage)
}
val desktopMode = BrowserMenuImageSwitch(
imageResource = R.drawable.ic_device_desktop,
imageResource = R.drawable.mozac_ic_device_desktop,
label = context.getString(R.string.preference_performance_request_desktop_site2),
initialState = {
selectedSession?.content?.desktopMode ?: false
@ -142,14 +142,14 @@ class DefaultBrowserMenu(
val addToHomescreen = BrowserMenuImageText(
label = context.getString(R.string.menu_add_to_home_screen),
imageResource = R.drawable.ic_add_to_home_screen
imageResource = R.drawable.mozac_ic_add_to_home_screen
) {
onItemTapped.invoke(ToolbarMenu.Item.AddToHomeScreen)
}
val openInApp = BrowserMenuImageText(
label = context.getString(R.string.menu_open_with_a_browser2),
imageResource = R.drawable.ic_open_in,
imageResource = R.drawable.mozac_ic_open_in,
textColorResource = context.theme.resolveAttribute(R.attr.primaryText)
) {
onItemTapped.invoke(ToolbarMenu.Item.OpenInApp)
@ -157,7 +157,7 @@ class DefaultBrowserMenu(
val settings = BrowserMenuImageText(
label = context.getString(R.string.menu_settings),
imageResource = R.drawable.ic_settings2,
imageResource = R.drawable.mozac_ic_settings,
textColorResource = context.theme.resolveAttribute(R.attr.primaryText)
) {
onItemTapped.invoke(ToolbarMenu.Item.Settings)

View file

@ -1,50 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* 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.focus.menu.browser;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.widget.TextView;
import org.mozilla.focus.R;
/* package-private */ class MenuItemViewHolder extends BrowserMenuViewHolder {
/* package-private */ static final int LAYOUT_ID = R.layout.menu_item;
private final TextView menuItemView;
/* package-private */ MenuItemViewHolder(View itemView) {
super(itemView);
menuItemView = (TextView) itemView;
}
/* package-private */ void bind(BrowserMenuAdapter.MenuItem.Default menuItem) {
menuItemView.setId(menuItem.getId());
menuItemView.setText(menuItem.getLabel());
if (menuItem.getDrawableResId() != 0) {
final Drawable drawable = menuItemView.getContext().getDrawable(menuItem.getDrawableResId());
if (drawable != null) {
drawable.setTint(menuItemView.getContext().getResources().getColor(R.color.colorSettingsTint));
menuItemView.setCompoundDrawablesRelativeWithIntrinsicBounds(
drawable,
null,
null,
null
);
}
}
final boolean isLoading = browserFragment.getTab().getContent().getLoading();
if ((menuItem.getId() == R.id.add_to_homescreen || menuItem.getId() == R.id.find_in_page) && isLoading) {
menuItemView.setTextColor(browserFragment.getResources().getColor(R.color.colorTextInactive));
menuItemView.setClickable(false);
} else {
menuItemView.setOnClickListener(this);
}
}
}

View file

@ -1,43 +0,0 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
* 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.focus.menu.browser;
import android.view.View;
import org.mozilla.focus.R;
import org.mozilla.focus.fragment.BrowserFragment;
public class NavigationItemViewHolder extends BrowserMenuViewHolder {
public static final int LAYOUT_ID = R.layout.menu_navigation;
final View refreshButton;
final View stopButton;
public NavigationItemViewHolder(View itemView, BrowserFragment fragment) {
super(itemView);
refreshButton = itemView.findViewById(R.id.refresh);
refreshButton.setOnClickListener(this);
stopButton = itemView.findViewById(R.id.stop);
stopButton.setOnClickListener(this);
updateLoading(fragment.getTab().getContent().getLoading());
final View forwardView = itemView.findViewById(R.id.forward);
if (!fragment.getTab().getContent().getCanGoForward()) {
forwardView.setEnabled(false);
forwardView.setAlpha(0.5f);
} else {
forwardView.setOnClickListener(this);
}
}
public void updateLoading(boolean loading) {
refreshButton.setVisibility(loading ? View.GONE : View.VISIBLE);
stopButton.setVisibility(loading ? View.VISIBLE : View.GONE);
}
}

View file

@ -1,51 +0,0 @@
/* 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.focus.menu.browser
import android.view.View
import android.widget.CheckBox
import android.widget.CompoundButton
import mozilla.components.support.utils.ThreadUtils
import org.mozilla.focus.R
import org.mozilla.focus.ext.requireComponents
import org.mozilla.focus.fragment.BrowserFragment
import org.mozilla.focus.utils.UrlUtils
internal class RequestDesktopCheckItemViewHolder/* package */(
itemView: View,
private val fragment: BrowserFragment
) : BrowserMenuViewHolder(itemView), CompoundButton.OnCheckedChangeListener {
private val checkbox: CheckBox = itemView.findViewById(R.id.check_menu_item_checkbox)
init {
checkbox.isChecked = fragment.tab.content.desktopMode
checkbox.setOnCheckedChangeListener(this)
}
override fun onCheckedChanged(buttonView: CompoundButton, isChecked: Boolean) {
fragment.setShouldRequestDesktop(isChecked)
// Delay closing the menu and reloading the website a bit so that the user can actually see
// the switch change its state.
ThreadUtils.postToMainThreadDelayed(
Runnable {
menu.dismiss()
val url = UrlUtils.stripSchemeAndSubDomain(fragment.tab.content.url)
fragment.requireComponents.sessionUseCases.loadUrl(url)
},
ANIMATION_DURATION
)
}
companion object {
const val LAYOUT_ID = R.layout.request_desktop_check_menu_item
/**
* Switch.THUMB_ANIMATION_DURATION
*/
const val ANIMATION_DURATION = 250L
}
}

View file

@ -66,9 +66,9 @@ private class MenuItemViewHolder(
fun bind(item: MenuItem) {
val iconResourceId = if (item.id == R.id.help) {
R.drawable.ic_help
R.drawable.mozac_ic_help
} else {
R.drawable.ic_settings2
R.drawable.mozac_ic_settings
}
containerView.apply {
id = item.id

View file

@ -145,7 +145,7 @@ private fun SearchSuggestions(
val components = components
val query = viewModel.searchQuery.observeAsState()
val icon = ContextCompat.getDrawable(LocalContext.current, R.drawable.ic_search)
val icon = ContextCompat.getDrawable(LocalContext.current, R.drawable.mozac_ic_search)
?.toBitmap()
val provider = remember(context) {

View file

@ -62,7 +62,7 @@ class IconGenerator {
val options = BitmapFactory.Options()
options.inMutable = true
val shape = BitmapFactory.decodeResource(context.resources, R.drawable.ic_search_engine_shape, options)
return drawVectorOnBitmap(context, R.drawable.ic_search, shape, SEARCH_ICON_FRAME)
return drawVectorOnBitmap(context, R.drawable.mozac_ic_search, shape, SEARCH_ICON_FRAME)
}
private fun drawVectorOnBitmap(context: Context, vectorId: Int, bitmap: Bitmap, frame: Double): Bitmap {

View file

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M15.535,10.526L17.135,12.126C17.449,12.44 17.228,12.977 16.784,12.98L12.551,13L12,12.449L12.021,8.217C12.023,7.773 12.56,7.552 12.875,7.866L14.471,9.462L19.72,4.22C20.013,3.927 20.488,3.927 20.781,4.22C21.074,4.513 21.074,4.988 20.781,5.281L15.535,10.526Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M7.6,14H6.4L6,14.4V15.6L6.4,16H7.6L8,15.6V14.4L7.6,14Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M10.6,14H9.4L9,14.4V15.6L9.4,16H10.6L11,15.6V14.4L10.6,14Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M13.6,14H12.4L12,14.4V15.6L12.4,16H13.6L14,15.6V14.4L13.6,14Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M10.6,11H9.4L9,11.4V12.6L9.4,13H10.6L11,12.6V11.4L10.6,11Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M14.5,2H5.5C4.119,2 3,3.119 3,4.5V19.5C3,20.881 4.119,22 5.5,22H14.5C15.881,22 17,20.881 17,19.5V15.225C17,14.811 16.664,14.475 16.25,14.475C15.836,14.475 15.5,14.811 15.5,15.225V17H4.5V4.3L5.3,3.5H14.7L15.5,4.3V5C15.5,5.414 15.836,5.75 16.25,5.75C16.664,5.75 17,5.414 17,5V4.5C17,3.119 15.881,2 14.5,2ZM8.75,19H11.25C11.664,19 12,19.336 12,19.75C12,20.164 11.664,20.5 11.25,20.5H8.75C8.336,20.5 8,20.164 8,19.75C8,19.336 8.336,19 8.75,19Z"
android:fillColor="@color/primary_text"/>
</vector>

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:autoMirrored="true">
<path
android:fillColor="#ffffff"
android:pathData="M21,11H5.914l5.793,-5.793a1,1 0,0 0,-1.414 -1.414l-7.5,7.5a1,1 0,0 0,0 1.414l7.5,7.5a1,1 0,0 0,1.414 -1.414L5.914,13H21a1,1 0,0 0,0 -2Z"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="16dp"
android:height="16dp"
android:viewportHeight="16.0"
android:viewportWidth="16.0">
<path
android:fillColor="#ffffff"
android:pathData="M8,0a8,8 0,1 0,8 8A8,8 0,0 0,8 0ZM12.243,10.828a1,1 0,0 1,-1.414 1.414L8,9.414 5.172,12.243a1,1 0,0 1,-1.414 -1.414L6.586,8 3.757,5.172A1,1 0,0 1,5.172 3.757L8,6.586l2.828,-2.828a1,1 0,0 1,1.414 1.414L9.414,8Z" />
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M13.326,12l4.337,-4.337a0.938,0.938 0,0 0,-1.326 -1.326L12,10.674 7.663,6.337A0.938,0.938 0,0 0,6.337 7.663L10.674,12 6.337,16.337a0.938,0.938 0,0 0,1.326 1.326L12,13.326l4.337,4.337a0.938,0.938 0,0 0,1.326 -1.326Z"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="m4,6c0,-0.5523 0.4477,-1 1,-1h14c0.5523,0 1,0.4477 1,1v11h2v1c0,0.5523 -0.4477,1 -1,1h-18c-0.5523,0 -1,-0.4477 -1,-1v-1h2zM10,17v1h4v-1zM6,7v9h12v-9z"
android:fillColor="@color/primary_text"/>
</vector>

View file

@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0"
android:autoMirrored="true">
<path
android:fillColor="#ffffff"
android:pathData="M21.207,11.293l-7.5,-7.5a1,1 0,0 0,-1.414 1.414L18.086,11H3a1,1 0,0 0,0 2H18.086l-5.793,5.793a1,1 0,1 0,1.414 1.414l7.5,-7.5A1,1 0,0 0,21.207 11.293Z"/>
</vector>

View file

@ -1,19 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M11.75,14C11.336,14 11,13.664 11,13.25V12.291C11,11.646 11.452,11.085 12.074,10.955C12.81,10.803 13.344,10.146 13.344,9.394C13.344,8.515 12.629,7.8 11.75,7.8C11.07,7.8 10.465,8.231 10.243,8.8721C10.107,9.264 9.682,9.474 9.289,9.3361C8.897,9.201 8.69,8.774 8.825,8.382C9.256,7.1371 10.432,6.3 11.75,6.3C13.456,6.3 14.844,7.688 14.844,9.394C14.844,10.812 13.865,12.055 12.5,12.396V13.25C12.5,13.664 12.164,14 11.75,14Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M12.2,17H11.3L11,16.7V15.8L11.3,15.5H12.2L12.5,15.8V16.7L12.2,17Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M11.75,4C16.161,4 19.75,7.589 19.75,12C19.75,16.411 16.161,20 11.75,20C7.339,20 3.75,16.411 3.75,12C3.75,7.589 7.339,4 11.75,4ZM11.75,2.5C6.503,2.5 2.25,6.753 2.25,12C2.25,17.247 6.503,21.5 11.75,21.5C16.997,21.5 21.25,17.247 21.25,12C21.25,6.753 16.997,2.5 11.75,2.5Z"
android:fillColor="@color/primary_text"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
<path
android:fillColor="@color/primary_text"
android:pathData="m11.2929,2.2929c0.3905,-0.3905 1.0237,-0.3905 1.4142,0l9,9c0.3905,0.3905 0.3905,1.0237 0,1.4142s-1.0237,0.3905 -1.4142,0l-1.2929,-1.2929v7.5858c0,1.6569 -1.3431,3 -3,3h-8c-1.6569,0 -3,-1.3431 -3,-3v-7.5858l-1.2929,1.2929c-0.3905,0.3905 -1.0237,0.3905 -1.4142,0 -0.3905,-0.3905 -0.3905,-1.0237 0,-1.4142zM12,4.4142 L7,9.4142v9.5858c0,0.5523 0.4477,1 1,1h1v-6c0,-1.1046 0.8954,-2 2,-2h2c1.1046,0 2,0.8954 2,2v6h1c0.5523,0 1,-0.4477 1,-1v-9.5858zM14,16.5c0,-0.2761 -0.2239,-0.5 -0.5,-0.5 -0.2762,0 -0.5,0.2239 -0.5,0.5s0.2238,0.5 0.5,0.5c0.2761,0 0.5,-0.2239 0.5,-0.5z" />
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM13,17h-2v-6h2v6zM13,9h-2L11,7h2v2z" />
</vector>

View file

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@color/primary_text" android:pathData="M7 5C5.895 5 5 5.895 5 7v10c0 1.105 0.895 2 2 2h10c1.105 0 2-0.895 2-2v-1c0-0.552 0.448-1 1-1s1 0.448 1 1v1c0 2.21-1.79 4-4 4H7c-2.21 0-4-1.79-4-4V7c0-2.21 1.79-4 4-4h1c0.552 0 1 0.448 1 1S8.552 5 8 5H7zm6 0c-0.552 0-1-0.448-1-1s0.448-1 1-1h7c0.552 0 1 0.448 1 1v7c0 0.552-0.448 1-1 1s-1-0.448-1-1V6.414l-6.293 6.293c-0.39 0.39-1.024 0.39-1.414 0-0.39-0.39-0.39-1.024 0-1.414L17.586 5H13z"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M21,4.04a0.96,0.96 0,0 0,-0.96 0.96V8a8.981,8.981 0,1 0,-1.676 10.361A1,1 0,0 0,16.95 16.95a7.031,7.031 0,1 1,1.72 -6.91H15a0.96,0.96 0,0 0,0 1.92h6a0.96,0.96 0,0 0,0.96 -0.96V5A0.96,0.96 0,0 0,21 4.04Z"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M4,9.5C4,6.4624 6.4624,4 9.5,4C12.5376,4 15,6.4624 15,9.5C15,12.5376 12.5376,15 9.5,15C6.4624,15 4,12.5376 4,9.5ZM9.5,2C5.3579,2 2,5.3579 2,9.5C2,13.6421 5.3579,17 9.5,17C11.2105,17 12.7873,16.4274 14.0491,15.4633L20.2929,21.7071C20.6834,22.0976 21.3166,22.0976 21.7071,21.7071C22.0976,21.3166 22.0976,20.6834 21.7071,20.2929L15.4633,14.0491C16.4274,12.7873 17,11.2105 17,9.5C17,5.3579 13.6421,2 9.5,2Z"
android:fillColor="@color/primary_text"/>
</vector>

View file

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12.7911,22H11.2171C10.3301,22 9.5392,21.404 9.2951,20.552L8.7851,18.775C8.4291,18.604 8.0822,18.402 7.7481,18.171L5.9472,18.619C5.0872,18.833 4.1761,18.447 3.7322,17.679L2.9451,16.315C2.5052,15.553 2.6212,14.576 3.2262,13.938L4.5251,12.568C4.5092,12.381 4.5002,12.192 4.5002,12C4.5002,11.798 4.5111,11.598 4.5282,11.4L3.2411,10.067C2.6251,9.429 2.5041,8.447 2.9481,7.678L3.7352,6.315C4.1741,5.553 5.0771,5.164 5.9342,5.37L7.7741,5.812C8.1002,5.587 8.4382,5.392 8.7842,5.226L9.2942,3.449C9.5401,2.596 10.3301,2 11.2171,2H12.7911C13.6701,2 14.4591,2.589 14.7091,3.432L15.2441,5.237C15.5781,5.399 15.9071,5.591 16.2251,5.811L18.0651,5.369C18.9191,5.167 19.8251,5.554 20.2641,6.314L21.0511,7.677C21.4951,8.445 21.3741,9.427 20.7581,10.066L19.4721,11.4C19.4901,11.598 19.5001,11.797 19.5001,12C19.5001,12.192 19.4911,12.381 19.4751,12.568L20.7741,13.938C21.3791,14.575 21.4951,15.553 21.0551,16.314L20.2681,17.677C19.8241,18.446 18.9141,18.833 18.0531,18.617L16.2521,18.169C15.9261,18.396 15.5881,18.594 15.2431,18.762L14.7081,20.567C14.4591,21.411 13.6701,22 12.7911,22ZM7.7252,16.63L8.3622,16.762C8.7851,17.085 9.2341,17.347 9.6981,17.54L10.1301,18.025L10.7361,20.137C10.7981,20.35 10.9951,20.499 11.2171,20.499H12.7911C13.0111,20.499 13.2081,20.352 13.2701,20.141L13.9021,18.007L14.3301,17.529C14.7801,17.339 15.2201,17.081 15.6371,16.761L16.2741,16.629L18.4151,17.162C18.6281,17.215 18.8571,17.119 18.9691,16.926L19.7561,15.563C19.8661,15.373 19.8371,15.128 19.6861,14.969L18.1491,13.348L17.9481,12.74C17.9791,12.499 18.0001,12.252 18.0001,12C18.0001,11.738 17.9771,11.482 17.9441,11.229L18.1481,10.612L19.6791,9.025C19.8331,8.866 19.8631,8.62 19.7521,8.429L18.9651,7.065C18.8561,6.875 18.6301,6.778 18.4151,6.829L16.2401,7.351L15.6131,7.22C15.2001,6.908 14.7681,6.655 14.3301,6.47L13.9031,5.992L13.2711,3.859C13.2081,3.647 13.0111,3.5 12.7911,3.5H11.2171C10.9951,3.5 10.7981,3.649 10.7361,3.862L10.1301,5.974L9.6971,6.459C9.2441,6.647 8.8032,6.903 8.3871,7.218L7.7592,7.351L5.5841,6.829C5.3702,6.778 5.1441,6.875 5.0342,7.065L4.2471,8.428C4.1361,8.62 4.1672,8.866 4.3201,9.025L5.8512,10.612L6.0552,11.229C6.0231,11.482 6.0002,11.738 6.0002,12C6.0002,12.252 6.0212,12.499 6.0511,12.742L5.8512,13.35L4.3141,14.971C4.1631,15.131 4.1342,15.375 4.2442,15.565L5.0311,16.928C5.1421,17.12 5.3721,17.217 5.5851,17.163L7.7252,16.63Z"
android:fillColor="@color/primary_text"/>
<path
android:pathData="M12,15.5C10.07,15.5 8.5,13.93 8.5,12C8.5,10.07 10.07,8.5 12,8.5C13.93,8.5 15.5,10.07 15.5,12C15.5,13.93 13.93,15.5 12,15.5ZM12,10C10.897,10 10,10.897 10,12C10,13.103 10.897,14 12,14C13.103,14 14,13.103 14,12C14,10.897 13.103,10 12,10Z"
android:fillColor="@color/primary_text"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18,9C19.6569,9 21,7.6569 21,6C21,4.3431 19.6569,3 18,3C16.3431,3 15,4.3431 15,6C15,6.1255 15.0077,6.2492 15.0227,6.3706L8.0826,9.8406C7.543,9.3201 6.8089,9 6,9C4.3432,9 3,10.3431 3,12C3,13.6569 4.3432,15 6,15C6.8089,15 7.543,14.6799 8.0826,14.1594L15.0227,17.6294C15.0077,17.7508 15,17.8745 15,18C15,19.6569 16.3431,21 18,21C19.6569,21 21,19.6569 21,18C21,16.3431 19.6569,15 18,15C17.1911,15 16.457,15.3202 15.9174,15.8407L8.9773,12.3706C8.9923,12.2492 9,12.1255 9,12C9,11.8745 8.9923,11.7508 8.9773,11.6294L15.9174,8.1593C16.457,8.6798 17.1911,9 18,9Z"
android:fillColor="@color/primary_text"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M18.406,14.12C17.501,13.878 16.559,14.003 15.75,14.469C15.372,14.687 15.05,14.973 14.783,15.303L9.879,12.852C10.014,12.299 10.02,11.719 9.884,11.164L14.788,8.702C15.45,9.519 16.445,10 17.496,10C17.797,10 18.103,9.961 18.405,9.88C20.269,9.381 21.379,7.458 20.88,5.594C20.638,4.692 20.059,3.937 19.249,3.469C18.44,3.003 17.498,2.878 16.593,3.12C14.745,3.615 13.643,5.509 14.111,7.362L9.215,9.821C9.135,9.722 9.066,9.617 8.974,9.525C7.609,8.16 5.389,8.16 4.023,9.525C2.66,10.889 2.66,13.11 4.023,14.474C4.706,15.157 5.602,15.497 6.498,15.497C7.395,15.497 8.291,15.156 8.974,14.474C9.062,14.386 9.118,14.28 9.194,14.185L14.111,16.642C13.645,18.49 14.747,20.383 16.594,20.878C16.896,20.96 17.202,21 17.506,21C18.113,21 18.711,20.841 19.249,20.53C20.059,20.062 20.638,19.307 20.88,18.405C21.38,16.542 20.269,14.619 18.406,14.12ZM16.982,4.57C17.155,4.523 17.33,4.501 17.504,4.501C17.85,4.501 18.192,4.592 18.5,4.77C18.962,5.037 19.293,5.467 19.431,5.984C19.716,7.048 19.082,8.147 18.017,8.432C17.084,8.685 16.109,8.233 15.693,7.36C15.641,7.251 15.599,7.135 15.568,7.019C15.283,5.954 15.917,4.855 16.982,4.57ZM7.913,13.414C7.134,14.192 5.863,14.194 5.083,13.414C4.304,12.635 4.304,11.365 5.083,10.586C5.473,10.196 5.985,10.001 6.497,10.001C7.01,10.001 7.523,10.196 7.912,10.586C8.692,11.365 8.692,12.635 7.913,13.414ZM19.431,18.017C19.293,18.534 18.962,18.964 18.5,19.231C18.037,19.499 17.498,19.572 16.982,19.43C15.916,19.145 15.283,18.046 15.568,16.982C15.807,16.09 16.617,15.501 17.499,15.501C17.671,15.501 17.844,15.522 18.017,15.569C19.082,15.854 19.716,16.953 19.431,18.017Z"
android:fillColor="@color/primary_text"/>
</vector>

View file

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 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/. -->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#ffffff"
android:pathData="M13.768,12l6.616,-6.616a1.25,1.25 0,0 0,-1.768 -1.768L12,10.232 5.384,3.616A1.25,1.25 0,0 0,3.616 5.384L10.232,12 3.616,18.616a1.25,1.25 0,1 0,1.768 1.768L12,13.768l6.616,6.616a1.25,1.25 0,0 0,1.768 -1.768Z"/>
</vector>

View file

@ -21,7 +21,7 @@
android:scaleType="center"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:srcCompat="@drawable/ic_back" />
app:srcCompat="@drawable/mozac_ic_back" />
<ImageView
android:id="@+id/site_favicon"

View file

@ -16,7 +16,7 @@
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/content_description_forward"
android:src="@drawable/ic_forward"/>
android:src="@drawable/mozac_ic_forward"/>
<ImageButton
android:id="@+id/refresh"
@ -25,14 +25,14 @@
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/content_description_reload"
android:src="@drawable/ic_refresh"/>
android:src="@drawable/mozac_ic_refresh"/>
<ImageButton
android:id="@+id/stop"
android:layout_width="0dp"
android:layout_height="48dp"
android:layout_weight="1"
android:src="@drawable/ic_stop"
android:src="@drawable/mozac_ic_stop"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/content_description_stop" />
</LinearLayout>

View file

@ -10,7 +10,7 @@
android:background="?android:attr/selectableItemBackground"
android:button="@null"
android:clickable="true"
android:drawableStart="@drawable/ic_device_desktop"
android:drawableStart="@drawable/mozac_ic_device_desktop"
android:drawableEnd="?android:attr/listChoiceIndicatorMultiple"
android:drawablePadding="16dp"
android:ellipsize="end"

View file

@ -9,7 +9,7 @@
<!-- We modify the Setting's theme's actionButtonStyle in order to change the padding between
these two items - not great, but it works. Details in @style/SettingsActionButtonStyle. -->
<item android:id="@+id/learn_more"
android:icon="@drawable/ic_menu_info"
android:icon="@drawable/mozac_ic_info"
android:title="@string/preference_autocomplete_learn_more"
app:showAsAction="ifRoom"/>