diff options
Diffstat (limited to 'mobile/android/android-components/components/browser/toolbar')
152 files changed, 8109 insertions, 0 deletions
diff --git a/mobile/android/android-components/components/browser/toolbar/README.md b/mobile/android/android-components/components/browser/toolbar/README.md new file mode 100644 index 0000000000..1dcd5a115b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/README.md @@ -0,0 +1,37 @@ +# [Android Components](../../../README.md) > Browser > Toolbar + +A customizable toolbar for browsers. + +## Usage + +### Setting up the dependency + +Use Gradle to download the library from [maven.mozilla.org](https://maven.mozilla.org/) ([Setup repository](../../../README.md#maven-repository)): + +```Groovy +implementation "org.mozilla.components:browser-toolbar:{latest-version}" +``` + +## Facts + +This component emits the following [Facts](../../support/base/README.md#Facts): + +| Action | Item | Extras | Description | +|--------|---------|----------------|------------------------------------| +| CLICK | menu | `menuExtras` | The user opened the overflow menu. | +| COMMIT | toolbar | `commitExtras` | The user has edited the URL. | + +`menuExtras` are additional extras set on the `BrowserMenuBuilder` passed to the `BrowserToolbar` (see [browser-menu](../menu/README.md)). + +#### `commitExtras` + +| Key | Type | Value | +|--------------|---------|-----------------------------------| +| autocomplete | Boolean | Whether the URL was autocompleted | +| source | String? | Which autocomplete list was used | + +## License + + 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/ diff --git a/mobile/android/android-components/components/browser/toolbar/build.gradle b/mobile/android/android-components/components/browser/toolbar/build.gradle new file mode 100644 index 0000000000..d18b1ebd48 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/build.gradle @@ -0,0 +1,56 @@ +/* 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/. */ + +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' + +android { + defaultConfig { + minSdkVersion config.minSdkVersion + compileSdk config.compileSdkVersion + targetSdkVersion config.targetSdkVersion + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + + namespace 'mozilla.components.browser.toolbar' +} + +dependencies { + api project(':concept-toolbar') + api project(':ui-autocomplete') + api project(':support-base') + + implementation project(':concept-engine') + implementation project(':concept-menu') + implementation project(':browser-menu') + implementation project(':browser-menu2') + implementation project(':ui-icons') + implementation project(':ui-colors') + implementation project(':ui-widgets') + implementation project(':support-ktx') + + implementation ComponentsDependencies.androidx_appcompat + implementation ComponentsDependencies.androidx_constraintlayout + implementation ComponentsDependencies.androidx_core_ktx + implementation ComponentsDependencies.google_material + + implementation ComponentsDependencies.kotlin_coroutines + + testImplementation project(':support-test') + + testImplementation ComponentsDependencies.androidx_test_core + testImplementation ComponentsDependencies.androidx_test_junit + testImplementation ComponentsDependencies.testing_robolectric + testImplementation ComponentsDependencies.testing_coroutines +} + +apply from: '../../../android-lint.gradle' +apply from: '../../../publish.gradle' +ext.configurePublish(config.componentsGroupId, archivesBaseName, project.ext.description) diff --git a/mobile/android/android-components/components/browser/toolbar/proguard-rules.pro b/mobile/android/android-components/components/browser/toolbar/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/AndroidManifest.xml b/mobile/android/android-components/components/browser/toolbar/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..e16cda1d34 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ +<!-- 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/. --> +<manifest /> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/BrowserToolbar.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/BrowserToolbar.kt new file mode 100644 index 0000000000..9251a5752c --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/BrowserToolbar.kt @@ -0,0 +1,691 @@ +/* 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 mozilla.components.browser.toolbar + +import android.content.Context +import android.graphics.drawable.Drawable +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import android.view.View.NO_ID +import android.view.ViewGroup +import android.widget.ImageButton +import android.widget.ImageView +import androidx.annotation.ColorRes +import androidx.annotation.DrawableRes +import androidx.annotation.VisibleForTesting +import androidx.annotation.VisibleForTesting.Companion.PRIVATE +import androidx.coordinatorlayout.widget.CoordinatorLayout +import androidx.core.content.ContextCompat +import androidx.core.view.forEach +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.cancelChildren +import kotlinx.coroutines.isActive +import kotlinx.coroutines.launch +import mozilla.components.browser.toolbar.display.DisplayToolbar +import mozilla.components.browser.toolbar.edit.EditToolbar +import mozilla.components.concept.toolbar.AutocompleteDelegate +import mozilla.components.concept.toolbar.AutocompleteResult +import mozilla.components.concept.toolbar.Toolbar +import mozilla.components.concept.toolbar.Toolbar.Highlight +import mozilla.components.support.base.android.Padding +import mozilla.components.support.base.log.logger.Logger +import mozilla.components.support.ktx.kotlin.trimmed +import mozilla.components.ui.autocomplete.AutocompleteView +import mozilla.components.ui.autocomplete.InlineAutocompleteEditText +import mozilla.components.ui.autocomplete.OnFilterListener +import mozilla.components.ui.widgets.behavior.EngineViewScrollingBehavior +import kotlin.coroutines.CoroutineContext + +internal fun ImageView.setTintResource(@ColorRes tintColorResource: Int) { + if (tintColorResource != NO_ID) { + imageTintList = ContextCompat.getColorStateList(context, tintColorResource) + } +} + +/** + * A customizable toolbar for browsers. + * + * The toolbar can switch between two modes: display and edit. The display mode displays the current + * URL and controls for navigation. In edit mode the current URL can be edited. Those two modes are + * implemented by the DisplayToolbar and EditToolbar classes. + * + * ``` + * +----------------+ + * | BrowserToolbar | + * +--------+-------+ + * + + * +-------+-------+ + * | | + * +---------v------+ +-------v--------+ + * | DisplayToolbar | | EditToolbar | + * +----------------+ +----------------+ + * ``` + */ +@Suppress("TooManyFunctions") +class BrowserToolbar @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : ViewGroup(context, attrs, defStyleAttr), Toolbar { + private var state: State = State.DISPLAY + + @VisibleForTesting + internal var searchTerms: String = "" + private var urlCommitListener: ((String) -> Boolean)? = null + var isNavBarEnabled: Boolean = false + + /** + * Toolbar in "display mode". + */ + var display = DisplayToolbar( + context, + this, + LayoutInflater.from(context).inflate( + R.layout.mozac_browser_toolbar_displaytoolbar, + this, + false, + ), + ) + @VisibleForTesting(otherwise = PRIVATE) + internal set + + /** + * Toolbar in "edit mode". + */ + var edit = EditToolbar( + context, + this, + LayoutInflater.from(context).inflate( + R.layout.mozac_browser_toolbar_edittoolbar, + this, + false, + ), + ) + @VisibleForTesting(otherwise = PRIVATE) + internal set + + override var title: String + get() = display.title + set(value) { display.title = value } + + override var url: CharSequence + get() = display.url.toString() + set(value) { + // We update the display toolbar immediately. We do not do that for the edit toolbar to not + // mess with what the user is entering. Instead we will remember the value and update the + // edit toolbar whenever we switch to it. + display.url = (value as String).trimmed() + } + + override var siteSecure: Toolbar.SiteSecurity + get() = display.siteSecurity + set(value) { display.siteSecurity = value } + + override var highlight: Highlight = Highlight.NONE + set(value) { + if (field != value) { + display.setHighlight(value) + field = value + } + } + + override var siteTrackingProtection: Toolbar.SiteTrackingProtection = + Toolbar.SiteTrackingProtection.OFF_GLOBALLY + set(value) { + if (field != value) { + display.setTrackingProtectionState(value) + field = value + } + } + + override var private: Boolean + get() = edit.private + set(value) { edit.private = value } + + /** + * Registers the given listener to be invoked when the user edits the URL. + */ + override fun setOnEditListener(listener: Toolbar.OnEditListener) { + edit.editListener = listener + } + + /** + * Registers the given function to be invoked when users changes text in the toolbar. + * + * @param filter A function which will perform autocompletion and send results to [AutocompleteDelegate]. + */ + override fun setAutocompleteListener(filter: suspend (String, AutocompleteDelegate) -> Unit) { + // Our 'filter' knows how to autocomplete, and the 'urlView' knows how to apply results of + // autocompletion. Which gives us a lovely delegate chain! + // urlView decides when it's appropriate to ask for autocompletion, and in turn we invoke + // our 'filter' and send results back to 'urlView'. + edit.setAutocompleteListener(filter) + } + + override fun refreshAutocomplete() { + edit.refreshAutocompleteSuggestion() + } + + init { + addView(display.rootView) + addView(edit.rootView) + + updateState(State.DISPLAY) + } + + // We layout the toolbar ourselves to avoid the overhead from using complex ViewGroup implementations + override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) { + forEach { child -> + child.layout( + 0 + paddingLeft, + 0 + paddingTop, + paddingLeft + child.measuredWidth, + paddingTop + child.measuredHeight, + ) + } + } + + // We measure the views manually to avoid overhead by using complex ViewGroup implementations + override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { + // Our toolbar will always use the full width and a fixed height (default) or the provided + // height if it's an exact value. + val width = MeasureSpec.getSize(widthMeasureSpec) + val height = if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY) { + MeasureSpec.getSize(heightMeasureSpec) + } else { + resources.getDimensionPixelSize(R.dimen.mozac_browser_toolbar_default_toolbar_height) + } + + setMeasuredDimension(width, height) + + // Let the children measure themselves using our fixed size (with padding subtracted) + val childWidth = width - paddingLeft - paddingRight + val childHeight = height - paddingTop - paddingBottom + + val childWidthSpec = MeasureSpec.makeMeasureSpec(childWidth, MeasureSpec.EXACTLY) + val childHeightSpec = MeasureSpec.makeMeasureSpec(childHeight, MeasureSpec.EXACTLY) + + forEach { child -> child.measure(childWidthSpec, childHeightSpec) } + } + + override fun onBackPressed(): Boolean { + if (state == State.EDIT) { + displayMode() + return true + } + return false + } + + override fun onStop() { + display.onStop() + } + + override fun setSearchTerms(searchTerms: String) { + this.searchTerms = searchTerms.trimmed() + + if (state == State.EDIT) { + edit.editSuggestion(this.searchTerms) + } + } + + override fun displayProgress(progress: Int) { + display.updateProgress(progress) + } + + override fun setOnUrlCommitListener(listener: (String) -> Boolean) { + this.urlCommitListener = listener + } + + /** + * Declare that the actions (navigation actions, browser actions, page actions) have changed and + * should be updated if needed. + * + * The toolbar will call the <code>visible</code> lambda of every action to determine whether a + * view for this action should be added or removed. Additionally <code>bind</code> will be + * called on every visible action to update its view. + */ + override fun invalidateActions() { + display.invalidateActions() + edit.invalidateActions() + } + + /** + * Adds an action to be displayed on the right side of the toolbar (outside of the URL bounding + * box) in display mode. + * + * If there is not enough room to show all icons then some icons may be moved to an overflow + * menu. + * + * Related: + * https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Browser_action + */ + override fun addBrowserAction(action: Toolbar.Action) { + display.addBrowserAction(action) + } + + /** + * Removes a previously added browser action (see [addBrowserAction]). If the provided + * action was never added, this method has no effect. + * + * @param action the action to remove. + */ + override fun removeBrowserAction(action: Toolbar.Action) { + display.removeBrowserAction(action) + } + + /** + * Removes a previously added page action (see [addPageAction]). If the provided + * action was never added, this method has no effect. + * + * @param action the action to remove. + */ + override fun removePageAction(action: Toolbar.Action) { + display.removePageAction(action) + } + + /** + * Adds an action to be displayed on the right side of the URL in display mode. + * + * Related: + * https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Page_actions + */ + override fun addPageAction(action: Toolbar.Action) { + display.addPageAction(action) + } + + /** + * Adds an action to be display on the far left side of the toolbar. This area is usually used + * on larger devices for navigation actions like "back" and "forward". + */ + override fun addNavigationAction(action: Toolbar.Action) { + display.addNavigationAction(action) + } + + /** + * Removes a previously added navigation action (see [addNavigationAction]). If the provided + * action was never added, this method has no effect. + * + * @param action the action to remove. + */ + override fun removeNavigationAction(action: Toolbar.Action) { + display.removeNavigationAction(action) + } + + /** + * Adds an action to be displayed at the start of the URL in edit mode. + */ + override fun addEditActionStart(action: Toolbar.Action) { + edit.addEditActionStart(action) + } + + /** + * Adds an action to be displayed at the end of the URL in edit mode. + */ + override fun addEditActionEnd(action: Toolbar.Action) { + edit.addEditActionEnd(action) + } + + /** + * Removes an action end of the URL in edit mode. + */ + override fun removeEditActionEnd(action: Toolbar.Action) { + edit.removeEditActionEnd(action) + } + + /** + * Hides the menu button in display mode. + */ + override fun hideMenuButton() { + display.hideMenuButton() + } + + /** + * Shows the menu button in display mode. + */ + override fun showMenuButton() { + display.showMenuButton() + } + + /** + * Sets the horizontal padding in display mode. + */ + override fun setDisplayHorizontalPadding(horizontalPadding: Int) { + display.setHorizontalPadding(horizontalPadding) + } + + /** + * Hides the page action separator in display/edit mode. + */ + override fun hidePageActionSeparator() { + display.hidePageActionSeparator() + edit.hidePageActionSeparator() + } + + /** + * Shows the page action separator in display/edit mode. + */ + override fun showPageActionSeparator() { + display.showPageActionSeparator() + edit.showPageActionSeparator() + } + + /** + * Switches to URL editing mode. + * + * @param cursorPlacement Where the cursor should be placed after focusing on the URL input field. + */ + override fun editMode(cursorPlacement: Toolbar.CursorPlacement) { + val urlValue = if (searchTerms.isEmpty()) url else searchTerms + edit.updateUrl(urlValue.toString(), false) + updateState(State.EDIT) + edit.focus() + + when (cursorPlacement) { + Toolbar.CursorPlacement.ALL -> { + edit.selectAll() + } + Toolbar.CursorPlacement.END -> { + edit.selectEnd() + } + } + } + + /** + * Switches to URL displaying mode. + */ + override fun displayMode() { + updateState(State.DISPLAY) + } + + /** + * Dismisses the display toolbar popup menu. + */ + override fun dismissMenu() { + display.views.menu.dismissMenu() + } + + override fun enableScrolling() { + // Behavior can be changed without us knowing. Not safe to use a memoized value. + (layoutParams as? CoordinatorLayout.LayoutParams)?.apply { + (behavior as? EngineViewScrollingBehavior)?.enableScrolling() + } + } + + override fun disableScrolling() { + // Behavior can be changed without us knowing. Not safe to use a memoized value. + (layoutParams as? CoordinatorLayout.LayoutParams)?.apply { + (behavior as? EngineViewScrollingBehavior)?.disableScrolling() + } + } + + override fun expand() { + (layoutParams as? CoordinatorLayout.LayoutParams)?.apply { + (behavior as? EngineViewScrollingBehavior)?.forceExpand(this@BrowserToolbar) + } + } + + override fun collapse() { + (layoutParams as? CoordinatorLayout.LayoutParams)?.apply { + (behavior as? EngineViewScrollingBehavior)?.forceCollapse(this@BrowserToolbar) + } + } + + internal fun onUrlEntered(url: String) { + if (urlCommitListener?.invoke(url) != false) { + // Return to display mode if there's no urlCommitListener or if it returned true. This lets + // the app control whether we should switch to display mode automatically. + displayMode() + } + } + + private fun updateState(state: State) { + this.state = state + + val (show, hide) = when (state) { + State.DISPLAY -> { + edit.stopEditing() + Pair(display.rootView, edit.rootView) + } + State.EDIT -> { + edit.startEditing() + Pair(edit.rootView, display.rootView) + } + } + + show.visibility = View.VISIBLE + hide.visibility = View.GONE + } + + private enum class State { + DISPLAY, + EDIT, + } + + /** + * An action button to be added to the toolbar. + * + * @param imageDrawable The drawable to be shown. + * @param contentDescription The content description to use. + * @param visible Lambda that returns true or false to indicate whether this button should be shown. + * @param autoHide Lambda that returns true or false to indicate whether this button should auto hide. + * @param weight Lambda that returns an integer to indicate weight of an action. The lesser the weight, + * the closer it is to the url. A default weight -1 indicates, the position is not cared for + * and action will be appended at the end. + * @param background A custom (stateful) background drawable resource to be used. + * @param padding a custom [Padding] for this Button. + * @param iconTintColorResource Optional ID of color resource to tint the icon. + * @param longClickListener Callback that will be invoked whenever the button is long-pressed. + * @param listener Callback that will be invoked whenever the button is pressed + */ + open class Button( + imageDrawable: Drawable, + contentDescription: String, + visible: () -> Boolean = { true }, + autoHide: () -> Boolean = { false }, + weight: () -> Int = { -1 }, + @DrawableRes background: Int = 0, + val padding: Padding = DEFAULT_PADDING, + @ColorRes iconTintColorResource: Int = NO_ID, + longClickListener: (() -> Unit)? = null, + listener: () -> Unit, + ) : Toolbar.ActionButton( + imageDrawable, + contentDescription, + visible, + autoHide, + weight, + background, + padding, + iconTintColorResource, + longClickListener, + listener, + ) + + /** + * An action button with two states, selected and unselected. When the button is pressed, the + * state changes automatically. + * + * @param image The drawable to be shown if the button is in unselected state. + * @param imageSelected The drawable to be shown if the button is in selected state. + * @param contentDescription The content description to use if the button is in unselected state. + * @param contentDescriptionSelected The content description to use if the button is in selected state. + * @param visible Lambda that returns true or false to indicate whether this button should be shown. + * @param weight Lambda that returns an integer to indicate weight of an action. The lesser the weight, + * the closer it is to the url. A default weight -1 indicates, the position is not cared for + * and action will be appended at the end. + * @param selected Sets whether this button should be selected initially. + * @param background A custom (stateful) background drawable resource to be used. + * @param padding a custom [Padding] for this Button. + * @param listener Callback that will be invoked whenever the checked state changes. + */ + open class ToggleButton( + image: Drawable, + imageSelected: Drawable, + contentDescription: String, + contentDescriptionSelected: String, + visible: () -> Boolean = { true }, + weight: () -> Int = { -1 }, + selected: Boolean = false, + @DrawableRes background: Int = 0, + val padding: Padding = DEFAULT_PADDING, + listener: (Boolean) -> Unit, + ) : Toolbar.ActionToggleButton( + image, + imageSelected, + contentDescription, + contentDescriptionSelected, + visible, + weight, + selected, + background, + padding, + listener, + ) + + /** + * An action that either shows an active button or an inactive button based on the provided + * <code>isInPrimaryState</code> lambda. All secondary characteristics default to their + * corresponding primary. + * + * @param primaryImage: The drawable to be shown if the button is in the primary/enabled state + * @param primaryContentDescription: The content description to use if the button is in the primary state. + * @param secondaryImage: The drawable to be shown if the button is in the secondary/disabled state. + * @param secondaryContentDescription: The content description to use if the button is in the secondary state. + * @param isInPrimaryState: Lambda that returns whether this button should be in the primary or secondary state. + * @param primaryImageTintResource: Optional ID of color resource to tint the icon in the primary state. + * @param secondaryImageTintResource: ID of color resource to tint the icon in the secondary state. + * @param disableInSecondaryState: Disable the button entirely when in the secondary state? + * @param weight Lambda that returns an integer to indicate weight of an action. The lesser the weight, + * the closer it is to the url. A default weight -1 indicates, the position is not cared for + * and action will be appended at the end. + * @param background A custom (stateful) background drawable resource to be used. + * @param longClickListener Callback that will be invoked whenever the button is long-pressed. + * @param listener Callback that will be invoked whenever the button is pressed. + */ + open class TwoStateButton( + val primaryImage: Drawable, + val primaryContentDescription: String, + val secondaryImage: Drawable = primaryImage, + val secondaryContentDescription: String = primaryContentDescription, + val isInPrimaryState: () -> Boolean = { true }, + @ColorRes val primaryImageTintResource: Int = NO_ID, + @ColorRes val secondaryImageTintResource: Int = primaryImageTintResource, + val disableInSecondaryState: Boolean = true, + override val weight: () -> Int = { -1 }, + background: Int = 0, + longClickListener: (() -> Unit)? = null, + listener: () -> Unit, + ) : Button( + primaryImage, + primaryContentDescription, + weight = weight, + background = background, + longClickListener = longClickListener, + listener = listener, + ) { + var enabled: Boolean = false + private set + + override fun bind(view: View) { + enabled = isInPrimaryState.invoke() + + val button = view as ImageButton + if (enabled) { + button.setImageDrawable(primaryImage) + button.contentDescription = primaryContentDescription + button.setTintResource(primaryImageTintResource) + button.isEnabled = true + } else { + button.setImageDrawable(secondaryImage) + button.contentDescription = secondaryContentDescription + button.setTintResource(secondaryImageTintResource) + button.isEnabled = !disableInSecondaryState + } + } + } + + companion object { + internal const val ACTION_PADDING_DP = 16 + internal val DEFAULT_PADDING = + Padding(ACTION_PADDING_DP, ACTION_PADDING_DP, ACTION_PADDING_DP, ACTION_PADDING_DP) + } +} + +/** + * Wraps [filter] execution in a coroutine context, cancelling prior executions on every invocation. + * [coroutineContext] must be of type that doesn't propagate cancellation of its children upwards. + */ +class AsyncFilterListener( + private val urlView: AutocompleteView, + override val coroutineContext: CoroutineContext, + private val filter: suspend (String, AutocompleteDelegate) -> Unit, + private val uiContext: CoroutineContext = Dispatchers.Main, +) : OnFilterListener, CoroutineScope { + override fun invoke(text: String) { + // We got a new input, so whatever past autocomplete queries we still have running are + // irrelevant. We cancel them, but do not depend on cancellation to take place. + coroutineContext.cancelChildren() + + CoroutineScope(coroutineContext).launch { + filter(text, AsyncAutocompleteDelegate(urlView, this, uiContext)) + } + } +} + +/** + * An autocomplete delegate which is aware of its parent scope (to check for cancellations). + * Responsible for processing autocompletion results and discarding stale results when [urlView] moved on. + */ +private class AsyncAutocompleteDelegate( + private val urlView: AutocompleteView, + private val parentScope: CoroutineScope, + override val coroutineContext: CoroutineContext, + private val logger: Logger = Logger("AsyncAutocompleteDelegate"), +) : AutocompleteDelegate, CoroutineScope { + override fun applyAutocompleteResult(result: AutocompleteResult, onApplied: () -> Unit) { + // Bail out if we were cancelled already. + if (!parentScope.isActive) { + logger.debug("Autocomplete request cancelled. Discarding results.") + return + } + + // Process results on the UI dispatcher. + CoroutineScope(coroutineContext).launch { + // Ignore this result if the query is stale. + if (result.input == urlView.originalText.lowercase()) { + urlView.applyAutocompleteResult( + InlineAutocompleteEditText.AutocompleteResult( + text = result.text, + source = result.source, + totalItems = result.totalItems, + ), + ) + onApplied() + } else { + logger.debug("Discarding stale autocomplete result.") + } + } + } + + override fun noAutocompleteResult(input: String) { + // Bail out if we were cancelled already. + if (!parentScope.isActive) { + logger.debug("Autocomplete request cancelled. Discarding 'noAutocompleteResult'.") + return + } + + // Process results on the UI thread. + CoroutineScope(coroutineContext).launch { + // Ignore this result if the query is stale. + if (input == urlView.originalText) { + urlView.noAutocompleteResult() + } else { + logger.debug("Discarding stale lack of autocomplete results.") + } + } + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbar.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbar.kt new file mode 100644 index 0000000000..2ad177a67f --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbar.kt @@ -0,0 +1,711 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.content.Context +import android.graphics.Color +import android.graphics.Typeface +import android.graphics.drawable.Drawable +import android.os.Build +import android.util.TypedValue +import android.view.View +import android.view.accessibility.AccessibilityEvent +import android.widget.ImageView +import android.widget.ProgressBar +import androidx.annotation.ColorInt +import androidx.appcompat.content.res.AppCompatResources.getDrawable +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.constraintlayout.widget.ConstraintSet +import androidx.core.content.ContextCompat +import androidx.core.view.isVisible +import mozilla.components.browser.menu.BrowserMenuBuilder +import mozilla.components.browser.toolbar.BrowserToolbar +import mozilla.components.browser.toolbar.R +import mozilla.components.browser.toolbar.internal.ActionContainer +import mozilla.components.concept.menu.MenuController +import mozilla.components.concept.toolbar.Toolbar +import mozilla.components.support.ktx.android.content.isScreenReaderEnabled +import mozilla.components.ui.colors.R.color as photonColors + +/** + * Sub-component of the browser toolbar responsible for displaying the URL and related controls ("display mode"). + * + * Structure: + * ``` + * +-------------+------------+-----------------------+----------+------+ + * | navigation | indicators | url [ page ] | browser | menu | + * | actions | | [ actions ] | actions | | + * +-------------+------------+-----------------------+----------+------+ + * +------------------------progress------------------------------------+ + * ``` + * + * Navigation actions (optional): + * A dynamic list of clickable icons usually used for navigation on larger devices + * (e.g. “back”/”forward” buttons.) + * + * Indicators (optional): + * Tracking protection indicator icon (e.g. “shield” icon) that may show a doorhanger when clicked. + * Separator icon: a vertical line that separate the above and below icons. + * Site security indicator icon (e.g. “Lock” icon) that may show a doorhanger when clicked. + * Empty indicator: Icon that will be displayed if the URL is empty. + * + * URL: + * Section that displays the current URL (read-only) + * + * Page actions (optional): + * A dynamic list of clickable icons inside the URL section (e.g. “reader mode” icon) + * + * Browser actions (optional): + * A list of dynamic clickable icons on the toolbar (e.g. tabs tray button) + * + * Menu (optional): + * A button that shows an overflow menu when clicked (constructed using the browser-menu + * component) + * + * Progress (optional): + * A horizontal progress bar showing the loading progress (at the top or bottom of the toolbar). + */ +@Suppress("LargeClass") +class DisplayToolbar internal constructor( + private val context: Context, + private val toolbar: BrowserToolbar, + internal val rootView: View, +) { + /** + * Enum of indicators that can be displayed in the toolbar. + */ + enum class Indicators { + SECURITY, + TRACKING_PROTECTION, + EMPTY, + HIGHLIGHT, + } + + /** + * Data class holding the customizable colors in "display mode". + * + * @property securityIconSecure Color tint for the "secure connection" icon (lock). + * @property securityIconInsecure Color tint for the "insecure connection" icon (broken lock). + * @property emptyIcon Color tint for the icon shown when the URL is empty. + * @property menu Color tint for the menu icon. + * @property hint Text color of the hint shown when the URL is empty. + * @property title Text color of the website title. + * @property text Text color of the URL. + * @property trackingProtection Color tint for the tracking protection icons. + * @property separator Color tint for the separator shown between indicators. + * @property pageActionSeparator Color tint of separator dividing url and page actions. + * @property highlight Color tint for the highlight icon. + * + * Set/Get the site security icon colours. It uses a pair of color integers which represent the + * insecure and secure colours respectively. + */ + data class Colors( + @ColorInt val securityIconSecure: Int, + @ColorInt val securityIconInsecure: Int, + @ColorInt val emptyIcon: Int, + @ColorInt val menu: Int, + @ColorInt val hint: Int, + @ColorInt val title: Int, + @ColorInt val text: Int, + @ColorInt val trackingProtection: Int?, + @ColorInt val separator: Int, + @ColorInt val pageActionSeparator: Int, + @ColorInt val highlight: Int?, + ) + + /** + * Data class holding the customizable icons in "display mode". + * + * @property emptyIcon An icon that is shown in front of the URL if the URL is empty. + * @property trackingProtectionTrackersBlocked An icon that is shown if tracking protection is + * enabled and trackers have been blocked. + * @property trackingProtectionNothingBlocked An icon that is shown if tracking protection is + * enabled and no trackers have been blocked. + * @property trackingProtectionException An icon that is shown if tracking protection is enabled + * but the current page is in the "exception list". + * @property highlight An icon that is shown if any event needs to be brought + * to the user's attention. Like the autoplay permission been blocked. + */ + data class Icons( + val emptyIcon: Drawable?, + val trackingProtectionTrackersBlocked: Drawable, + val trackingProtectionNothingBlocked: Drawable, + val trackingProtectionException: Drawable, + val highlight: Drawable, + ) + + /** + * Gravity enum for positioning the progress bar. + */ + enum class Gravity { + TOP, + BOTTOM, + } + + internal val views = DisplayToolbarViews( + browserActions = rootView.findViewById(R.id.mozac_browser_toolbar_browser_actions), + pageActions = rootView.findViewById(R.id.mozac_browser_toolbar_page_actions), + navigationActions = rootView.findViewById(R.id.mozac_browser_toolbar_navigation_actions), + background = rootView.findViewById(R.id.mozac_browser_toolbar_background), + separator = rootView.findViewById(R.id.mozac_browser_toolbar_separator), + pageActionSeparator = rootView.findViewById(R.id.mozac_browser_toolbar_action_separator), + emptyIndicator = rootView.findViewById(R.id.mozac_browser_toolbar_empty_indicator), + menu = MenuButton(rootView.findViewById(R.id.mozac_browser_toolbar_menu)), + securityIndicator = rootView.findViewById(R.id.mozac_browser_toolbar_security_indicator), + trackingProtectionIndicator = rootView.findViewById( + R.id.mozac_browser_toolbar_tracking_protection_indicator, + ), + origin = rootView.findViewById<OriginView>(R.id.mozac_browser_toolbar_origin_view).also { + it.toolbar = toolbar + }, + progress = rootView.findViewById<ProgressBar>(R.id.mozac_browser_toolbar_progress), + highlight = rootView.findViewById(R.id.mozac_browser_toolbar_permission_indicator), + ) + + /** + * Customizable colors in "display mode". + */ + var colors: Colors = Colors( + securityIconSecure = ContextCompat.getColor(context, photonColors.photonWhite), + securityIconInsecure = ContextCompat.getColor(context, photonColors.photonWhite), + emptyIcon = ContextCompat.getColor(context, photonColors.photonWhite), + menu = ContextCompat.getColor(context, photonColors.photonWhite), + hint = views.origin.hintColor, + title = views.origin.titleColor, + text = views.origin.textColor, + trackingProtection = null, + separator = ContextCompat.getColor(context, photonColors.photonGrey80), + pageActionSeparator = ContextCompat.getColor(context, photonColors.photonGrey80), + highlight = null, + ) + set(value) { + field = value + + updateSiteSecurityIcon() + views.emptyIndicator.setColorFilter(value.emptyIcon) + views.menu.setColorFilter(value.menu) + views.origin.hintColor = value.hint + views.origin.titleColor = value.title + views.origin.textColor = value.text + views.separator.setColorFilter(value.separator) + views.pageActionSeparator.setBackgroundColor(value.pageActionSeparator) + + if (value.trackingProtection != null) { + views.trackingProtectionIndicator.setTint(value.trackingProtection) + views.trackingProtectionIndicator.setColorFilter(value.trackingProtection) + } + + if (value.highlight != null) { + views.highlight.setTint(value.highlight) + } + } + + /** + * Customizable icons in "edit mode". + */ + var icons: Icons = Icons( + emptyIcon = null, + trackingProtectionTrackersBlocked = requireNotNull( + getDrawable(context, TrackingProtectionIconView.DEFAULT_ICON_ON_TRACKERS_BLOCKED), + ), + trackingProtectionNothingBlocked = requireNotNull( + getDrawable(context, TrackingProtectionIconView.DEFAULT_ICON_ON_NO_TRACKERS_BLOCKED), + ), + trackingProtectionException = requireNotNull( + getDrawable(context, TrackingProtectionIconView.DEFAULT_ICON_OFF_FOR_A_SITE), + ), + highlight = requireNotNull( + getDrawable(context, R.drawable.mozac_dot_notification), + ), + ) + set(value) { + field = value + + views.emptyIndicator.setImageDrawable(value.emptyIcon) + + views.trackingProtectionIndicator.setIcons( + value.trackingProtectionNothingBlocked, + value.trackingProtectionTrackersBlocked, + value.trackingProtectionException, + ) + views.highlight.setIcon(value.highlight) + } + + /** + * Allows customization of URL for display purposes. + */ + var urlFormatter: ((CharSequence) -> CharSequence)? = null + + /** + * Sets a listener to be invoked when the site security indicator icon is clicked. + */ + fun setOnSiteSecurityClickedListener(listener: (() -> Unit)?) { + if (listener == null) { + views.securityIndicator.setOnClickListener(null) + views.securityIndicator.background = null + } else { + views.securityIndicator.setOnClickListener { + listener.invoke() + } + + val outValue = TypedValue() + context.theme.resolveAttribute( + android.R.attr.selectableItemBackgroundBorderless, + outValue, + true, + ) + + views.securityIndicator.setBackgroundResource(outValue.resourceId) + } + } + + /** + * Sets a listener to be invoked when the site tracking protection indicator icon is clicked. + */ + fun setOnTrackingProtectionClickedListener(listener: (() -> Unit)?) { + if (listener == null) { + views.trackingProtectionIndicator.setOnClickListener(null) + views.trackingProtectionIndicator.background = null + } else { + views.trackingProtectionIndicator.setOnClickListener { + listener.invoke() + } + + val outValue = TypedValue() + context.theme.resolveAttribute( + android.R.attr.selectableItemBackgroundBorderless, + outValue, + true, + ) + + views.trackingProtectionIndicator.setBackgroundResource(outValue.resourceId) + } + } + + /** + * Sets a lambda to be invoked when the menu is dismissed + */ + fun setMenuDismissAction(onDismiss: () -> Unit) { + views.menu.setMenuDismissAction(onDismiss) + } + + /** + * List of indicators that should be displayed next to the URL. + */ + var indicators: List<Indicators> = listOf(Indicators.SECURITY) + set(value) { + field = value + + updateIndicatorVisibility() + } + + var displayIndicatorSeparator: Boolean = true + set(value) { + field = value + updateIndicatorVisibility() + } + + /** + * Sets the background that should be drawn behind the URL, page actions an indicators. + */ + fun setUrlBackground(background: Drawable?) { + views.background.setImageDrawable(background) + } + + /** + * Whether the progress bar should be drawn at the top or bottom of the toolbar. + */ + var progressGravity: Gravity = Gravity.BOTTOM + set(value) { + field = value + + val layout = rootView as ConstraintLayout + layout.hashCode() + + val constraintSet = ConstraintSet() + constraintSet.clone(layout) + constraintSet.clear(views.progress.id, ConstraintSet.TOP) + constraintSet.clear(views.progress.id, ConstraintSet.BOTTOM) + constraintSet.connect( + views.progress.id, + if (value == Gravity.TOP) ConstraintSet.TOP else ConstraintSet.BOTTOM, + ConstraintSet.PARENT_ID, + if (value == Gravity.TOP) ConstraintSet.TOP else ConstraintSet.BOTTOM, + ) + constraintSet.applyTo(layout) + } + + /** + * Sets a lambda that will be invoked whenever the URL in display mode was clicked. Only if this + * lambda returns <code>true</code> the toolbar will switch to editing mode. Return + * <code>false</code> to not switch to editing mode and handle the click manually. + */ + var onUrlClicked: () -> Boolean + get() = views.origin.onUrlClicked + set(value) { + views.origin.onUrlClicked = value + } + + /** + * Sets the text to be displayed when the URL of the toolbar is empty. + */ + var hint: String + get() = views.origin.hint + set(value) { + views.origin.hint = value + } + + /** + * Sets the size of the text for the title displayed in the toolbar. + */ + var titleTextSize: Float + get() = views.origin.titleTextSize + set(value) { + views.origin.titleTextSize = value + } + + /** + * Sets the size of the text for the URL/search term displayed in the toolbar. + */ + var textSize: Float + get() = views.origin.textSize + set(value) { + views.origin.textSize = value + } + + /** + * Sets the typeface of the text for the URL/search term displayed in the toolbar. + */ + var typeface: Typeface + get() = views.origin.typeface + set(value) { + views.origin.typeface = value + } + + /** + * Sets a [BrowserMenuBuilder] that will be used to create a menu when the menu button is clicked. + * The menu button will only be visible if a builder or controller has been set. + */ + var menuBuilder: BrowserMenuBuilder? + get() = views.menu.menuBuilder + set(value) { + views.menu.menuBuilder = value + } + + /** + * Sets a [MenuController] that will be used to create a menu when the menu button is clicked. + * The menu button will only be visible if a builder or controller has been set. + * If both a [menuBuilder] and controller are present, only the controller will be used. + */ + var menuController: MenuController? + get() = views.menu.menuController + set(value) { + views.menu.menuController = value + } + + /** + * Set a LongClickListener to the urlView of the toolbar. + */ + fun setOnUrlLongClickListener(handler: ((View) -> Boolean)?) = views.origin.setOnUrlLongClickListener(handler) + + private fun updateIndicatorVisibility() { + val urlEmpty = url.isEmpty() + + views.securityIndicator.visibility = if (!urlEmpty && indicators.contains(Indicators.SECURITY)) { + View.VISIBLE + } else { + View.GONE + } + + views.trackingProtectionIndicator.visibility = if ( + !urlEmpty && indicators.contains(Indicators.TRACKING_PROTECTION) + ) { + View.VISIBLE + } else { + View.GONE + } + + views.emptyIndicator.visibility = if (urlEmpty && indicators.contains(Indicators.EMPTY)) { + View.VISIBLE + } else { + View.GONE + } + + views.highlight.visibility = if (!urlEmpty && indicators.contains(Indicators.HIGHLIGHT)) { + setHighlight(toolbar.highlight) + } else { + View.GONE + } + + updateSeparatorVisibility() + } + + private fun updateSeparatorVisibility() { + views.separator.visibility = if ( + displayIndicatorSeparator && + views.trackingProtectionIndicator.isVisible && + views.securityIndicator.isVisible + ) { + View.VISIBLE + } else { + View.GONE + } + + // In Fenix (which is using a beta release of ConstraintLayout) we are seeing issues after + // early visibility changes. Children of the ConstraintLayout are not visible and have a + // size of 0x0 (even though they have a fixed size in the layout XML). Explicitly requesting + // to layout the ConstraintLayout fixes that issue. This may be a bug in the beta of + // ConstraintLayout and in the future we may be able to just remove this call. + rootView.requestLayout() + } + + /** + * Updates the title to be displayed. + */ + internal var title: String + get() = views.origin.title + set(value) { + views.origin.title = value + } + + /** + * Updates the URL to be displayed. + */ + internal var url: CharSequence = "" + set(value) { + field = value + views.origin.url = urlFormatter?.invoke(value) ?: value + updateIndicatorVisibility() + } + + /** + * Sets the site's security icon as secure if true, else the regular globe. + */ + internal var siteSecurity: Toolbar.SiteSecurity = Toolbar.SiteSecurity.INSECURE + set(value) { + field = value + updateSiteSecurityIcon() + } + + private fun updateSiteSecurityIcon() { + @ColorInt val color = when (siteSecurity) { + Toolbar.SiteSecurity.INSECURE -> colors.securityIconInsecure + Toolbar.SiteSecurity.SECURE -> colors.securityIconSecure + } + if (color == Color.TRANSPARENT && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + views.securityIndicator.clearColorFilter() + } else { + views.securityIndicator.setColorFilter(color) + } + + views.securityIndicator.siteSecurity = siteSecurity + } + + internal fun setTrackingProtectionState(state: Toolbar.SiteTrackingProtection) { + views.trackingProtectionIndicator.siteTrackingProtection = state + updateSeparatorVisibility() + } + + internal fun setHighlight(state: Toolbar.Highlight): Int { + if (!indicators.contains(Indicators.HIGHLIGHT)) { + return views.highlight.visibility + } + + views.highlight.state = state + + return views.highlight.visibility + } + + internal fun onStop() { + views.menu.dismissMenu() + } + + /** + * Updates the progress to be displayed. + * + * Accessibility note: + * ProgressBars can be made accessible to TalkBack by setting `android:accessibilityLiveRegion`. + * They will emit TYPE_VIEW_SELECTED events. TalkBack will format those events into percentage + * announcements along with a pitch-change earcon. We are not using that feature here for + * several reasons: + * 1. They are dispatched via a 200ms timeout. Since loading a page can be a short process, + * and since we only update the bar a handful of times, these events often never fire and + * they don't give the user a true sense of the progress. + * 2. The last 100% event is dispatched after the view is hidden. This prevents the event + * from being fired, so the user never gets a "complete" event. + * 3. Live regions in TalkBack have their role announced, so the user will hear + * "Progress bar, 25%". For a common feature like page load this is very chatty and unintuitive. + * 4. We can provide custom strings instead of the less useful percentage utterance, but + * TalkBack will not play an earcon if an event has its own text. + * + * For all those reasons, we are going another route here with a "loading" announcement + * when the progress bar first appears along with scroll events that have the same + * pitch-change earcon in TalkBack (although they are a bit louder). This gives a concise and + * consistent feedback to the user that they can depend on. + * + */ + internal fun updateProgress(progress: Int) { + if (!views.progress.isVisible && progress > 0) { + // Loading has just started, make visible. + views.progress.visibility = View.VISIBLE + + // Announce "loading" for accessibility if it has not been completed + if (progress < views.progress.max) { + views.progress.announceForAccessibility( + context.getString(R.string.mozac_browser_toolbar_progress_loading), + ) + } + } + + views.progress.progress = progress + val event = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + AccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SCROLLED) + } else { + @Suppress("DEPRECATION") + AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED) + }.apply { + scrollY = progress + maxScrollY = views.progress.max + } + + if (context.isScreenReaderEnabled) { + views.progress.parent.requestSendAccessibilityEvent(views.progress, event) + } + + if (progress >= views.progress.max) { + // Loading is done, hide progress bar. + views.progress.visibility = View.GONE + } + } + + /** + * Declare that the actions (navigation actions, browser actions, page actions) have changed and + * should be updated if needed. + */ + internal fun invalidateActions() { + views.menu.invalidateMenu() + + views.browserActions.invalidateActions() + views.pageActions.invalidateActions() + views.navigationActions.invalidateActions() + } + + /** + * Adds an action to be displayed on the right side of the toolbar (outside of the URL bounding + * box) in display mode. + * + * If there is not enough room to show all icons then some icons may be moved to an overflow + * menu. + * + * Related: + * https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Browser_action + */ + internal fun addBrowserAction(action: Toolbar.Action) { + views.browserActions.addAction(action) + } + + /** + * Removes a previously added browser action (see [addBrowserAction]). If the provided + * action was never added, this method has no effect. + * + * @param action the action to remove. + */ + internal fun removeBrowserAction(action: Toolbar.Action) { + views.browserActions.removeAction(action) + } + + /** + * Removes a previously added page action (see [addBrowserAction]). If the provided + * action was never added, this method has no effect. + * + * @param action the action to remove. + */ + internal fun removePageAction(action: Toolbar.Action) { + views.pageActions.removeAction(action) + } + + /** + * Adds an action to be displayed on the right side of the URL in display mode. + * + * Related: + * https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Page_actions + */ + internal fun addPageAction(action: Toolbar.Action) { + views.pageActions.addAction(action) + } + + /** + * Adds an action to be display on the far left side of the toolbar. This area is usually used + * on larger devices for navigation actions like "back" and "forward". + */ + internal fun addNavigationAction(action: Toolbar.Action) { + views.navigationActions.addAction(action) + } + + /** + * Removes a previously added navigation action (see [addNavigationAction]). If the provided + * action was never added, this method has no effect. + * + * @param action the action to remove. + */ + internal fun removeNavigationAction(action: Toolbar.Action) { + views.navigationActions.removeAction(action) + } + + /** + * Hides the menu button in display mode. + */ + fun hideMenuButton() { + views.menu.setShouldBeHidden(true) + } + + /** + * Shows the menu button in display mode. + */ + internal fun showMenuButton() { + views.menu.setShouldBeHidden(false) + } + + /** + * Sets the horizontal padding. + */ + fun setHorizontalPadding(horizontalPadding: Int) { + rootView.setPadding(horizontalPadding, 0, horizontalPadding, 0) + } + + /** + * Hides the page action separator in display mode. + */ + fun hidePageActionSeparator() { + views.pageActionSeparator.isVisible = false + } + + /** + * Shows the page action separator in display mode. + */ + internal fun showPageActionSeparator() { + views.pageActionSeparator.isVisible = true + } +} + +/** + * Internal holder for view references. + */ +@Suppress("LongParameterList") +internal class DisplayToolbarViews( + val browserActions: ActionContainer, + val pageActions: ActionContainer, + val navigationActions: ActionContainer, + val background: ImageView, + val separator: ImageView, + val pageActionSeparator: View, + val emptyIndicator: ImageView, + val menu: MenuButton, + val securityIndicator: SiteSecurityIconView, + val trackingProtectionIndicator: TrackingProtectionIconView, + val origin: OriginView, + val progress: ProgressBar, + val highlight: HighlightView, +) diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbarView.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbarView.kt new file mode 100644 index 0000000000..733684895d --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/DisplayToolbarView.kt @@ -0,0 +1,51 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.content.Context +import android.graphics.Canvas +import android.util.AttributeSet +import android.view.View +import android.widget.ImageView +import androidx.constraintlayout.widget.ConstraintLayout +import mozilla.components.browser.toolbar.R + +/** + * Custom ConstraintLayout for DisplayToolbar that allows us to draw ripple backgrounds on the toolbar + * by setting a background to transparent. + */ +class DisplayToolbarView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : ConstraintLayout(context, attrs, defStyleAttr) { + init { + // Forcing transparent background so that draw methods will get called and ripple effect + // for children will be drawn on this layout. + setBackgroundColor(0x00000000) + } + + lateinit var backgroundView: ImageView + + override fun onFinishInflate() { + backgroundView = findViewById(R.id.mozac_browser_toolbar_background) + backgroundView.visibility = View.INVISIBLE + + super.onFinishInflate() + } + + // Overriding draw instead of onDraw since we want to draw the background before the actual + // (transparent) background (with a ripple effect) is drawn. + override fun draw(canvas: Canvas) { + canvas.save() + canvas.translate(backgroundView.x, backgroundView.y) + + backgroundView.drawable?.draw(canvas) + + canvas.restore() + + super.draw(canvas) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/HighlightView.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/HighlightView.kt new file mode 100644 index 0000000000..1120c3eaea --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/HighlightView.kt @@ -0,0 +1,91 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.content.Context +import android.graphics.drawable.Drawable +import android.util.AttributeSet +import androidx.annotation.VisibleForTesting +import androidx.appcompat.content.res.AppCompatResources +import androidx.appcompat.widget.AppCompatImageView +import androidx.core.view.isVisible +import mozilla.components.browser.toolbar.R +import mozilla.components.concept.toolbar.Toolbar.Highlight +import mozilla.components.concept.toolbar.Toolbar.Highlight.NONE +import mozilla.components.concept.toolbar.Toolbar.Highlight.PERMISSIONS_CHANGED + +/** + * Internal widget to display a dot notification. + */ +internal class HighlightView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : AppCompatImageView(context, attrs, defStyleAttr) { + + init { + visibility = GONE + } + + var state: Highlight = NONE + set(value) { + if (value != field) { + field = value + updateIcon() + } + } + + @VisibleForTesting + internal var highlightTint: Int? = null + + private var highlightIcon: Drawable = + requireNotNull(AppCompatResources.getDrawable(context, DEFAULT_ICON)) + + fun setTint(tint: Int) { + highlightTint = tint + setColorFilter(tint) + } + + fun setIcon(icons: Drawable) { + this.highlightIcon = icons + + updateIcon() + } + + @Synchronized + @VisibleForTesting + internal fun updateIcon() { + val update = state.toUpdate() + + isVisible = update.visible + + contentDescription = if (update.contentDescription != null) { + context.getString(update.contentDescription) + } else { + null + } + + highlightTint?.let { setColorFilter(it) } + setImageDrawable(update.drawable) + } + + companion object { + val DEFAULT_ICON = R.drawable.mozac_dot_notification + } + + private fun Highlight.toUpdate(): Update = when (this) { + PERMISSIONS_CHANGED -> Update( + highlightIcon, + R.string.mozac_browser_toolbar_content_description_autoplay_blocked, + true, + ) + + NONE -> Update( + null, + null, + false, + ) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/MenuButton.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/MenuButton.kt new file mode 100644 index 0000000000..621e20032b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/MenuButton.kt @@ -0,0 +1,106 @@ +/* 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 mozilla.components.browser.toolbar.display + +import androidx.annotation.ColorInt +import androidx.annotation.VisibleForTesting +import androidx.core.view.isVisible +import mozilla.components.browser.menu.BrowserMenuBuilder +import mozilla.components.browser.menu.ext.asCandidateList +import mozilla.components.browser.menu.ext.getHighlight +import mozilla.components.browser.toolbar.facts.emitOpenMenuFact +import mozilla.components.concept.menu.MenuController + +internal class MenuButton( + @get:VisibleForTesting internal val impl: mozilla.components.browser.menu.view.MenuButton, +) { + + init { + impl.isVisible = false + impl.register( + object : mozilla.components.concept.menu.MenuButton.Observer { + override fun onShow() { + emitOpenMenuFact(impl.menuBuilder?.extras) + } + }, + ) + } + + /** + * Reference to the [MenuController]. + * If present, [menuBuilder] will be ignored. + */ + var menuController: MenuController? + get() = impl.menuController + set(value) { + impl.menuController = value + impl.isVisible = shouldBeVisible() + } + + /** + * Legacy [BrowserMenuBuilder] reference. + * Used to build the menu. + */ + var menuBuilder: BrowserMenuBuilder? + get() = impl.menuBuilder + set(value) { + impl.menuBuilder = value + impl.isVisible = shouldBeVisible() + } + + /** + * Declare that the menu items should be updated if needed. + * This should only be used once a [menuBuilder] is set. + * To update items in the [menuController], call [MenuController.submitList] directly. + */ + fun invalidateMenu() { + val menuController = menuController + if (menuController != null) { + // Convert the menu builder items into a menu candidate list, + // if the menu builder is present + menuBuilder?.items?.let { items -> + val list = items.asCandidateList(impl.context) + menuController.submitList(list) + } + } else { + // Invalidate the BrowserMenu + impl.invalidateBrowserMenu() + impl.setHighlight(menuBuilder?.items?.getHighlight()) + } + } + + fun dismissMenu() { + val menuController = menuController + if (menuController != null) { + // Use the controller to dismiss the menu + menuController.dismiss() + } else { + // Use the button to dismiss the legacy menu + impl.dismissMenu() + } + } + + /** + * Sets a lambda to be invoked when the menu is dismissed + */ + @Suppress("Deprecation") + fun setMenuDismissAction(onDismiss: () -> Unit) { + impl.onDismiss = onDismiss + } + + fun setColorFilter(@ColorInt color: Int) = impl.setColorFilter(color) + + /** + * Hides the menu button. + * + * @param shouldBeHidden A [Boolean] that determines the visibility of the menu button. + */ + fun setShouldBeHidden(shouldBeHidden: Boolean) { + impl.isVisible = !shouldBeHidden && shouldBeVisible() + } + + @VisibleForTesting + internal fun shouldBeVisible() = impl.menuBuilder != null || impl.menuController != null +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/OriginView.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/OriginView.kt new file mode 100644 index 0000000000..56cb43cfd2 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/OriginView.kt @@ -0,0 +1,198 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.animation.LayoutTransition +import android.content.Context +import android.graphics.Typeface +import android.util.AttributeSet +import android.util.TypedValue +import android.view.Gravity +import android.view.View +import android.widget.LinearLayout +import android.widget.TextView +import androidx.annotation.VisibleForTesting +import androidx.core.view.isVisible +import mozilla.components.browser.toolbar.BrowserToolbar +import mozilla.components.browser.toolbar.R + +private const val TITLE_VIEW_WEIGHT = 5.7f +private const val URL_VIEW_WEIGHT = 4.3f + +/** + * View displaying the URL and optionally the title of a website. + */ +internal class OriginView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : LinearLayout(context, attrs, defStyleAttr) { + internal lateinit var toolbar: BrowserToolbar + + private val textSizeUrlNormal = context.resources.getDimension( + R.dimen.mozac_browser_toolbar_url_textsize, + ) + private val textSizeUrlWithTitle = context.resources.getDimension( + R.dimen.mozac_browser_toolbar_url_with_title_textsize, + ) + private val textSizeTitle = context.resources.getDimension( + R.dimen.mozac_browser_toolbar_title_textsize, + ) + + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + internal val urlView = TextView(context).apply { + id = R.id.mozac_browser_toolbar_url_view + setTextSize(TypedValue.COMPLEX_UNIT_PX, textSizeUrlNormal) + gravity = Gravity.CENTER_VERTICAL + + setSingleLine() + isClickable = true + isFocusable = true + + setOnClickListener { + if (onUrlClicked()) { + toolbar.editMode() + } + } + + val fadingEdgeSize = resources.getDimensionPixelSize( + R.dimen.mozac_browser_toolbar_url_fading_edge_size, + ) + + setFadingEdgeLength(fadingEdgeSize) + isHorizontalFadingEdgeEnabled = fadingEdgeSize > 0 + } + + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + internal val titleView = TextView(context).apply { + id = R.id.mozac_browser_toolbar_title_view + visibility = View.GONE + + setTextSize( + TypedValue.COMPLEX_UNIT_PX, + textSizeTitle, + ) + gravity = Gravity.CENTER_VERTICAL + + setSingleLine() + + val fadingEdgeSize = resources.getDimensionPixelSize( + R.dimen.mozac_browser_toolbar_url_fading_edge_size, + ) + + setFadingEdgeLength(fadingEdgeSize) + isHorizontalFadingEdgeEnabled = fadingEdgeSize > 0 + } + + init { + orientation = VERTICAL + + addView( + titleView, + LayoutParams( + LayoutParams.MATCH_PARENT, + 0, + TITLE_VIEW_WEIGHT, + ), + ) + + addView( + urlView, + LayoutParams( + LayoutParams.MATCH_PARENT, + 0, + URL_VIEW_WEIGHT, + ), + ) + + layoutTransition = LayoutTransition() + } + + internal var title: String + get() = titleView.text.toString() + set(value) { + titleView.text = value + + titleView.isVisible = value.isNotEmpty() + + urlView.setTextSize( + TypedValue.COMPLEX_UNIT_PX, + if (value.isNotEmpty()) { + textSizeUrlWithTitle + } else { + textSizeUrlNormal + }, + ) + } + + internal var onUrlClicked: () -> Boolean = { true } + + fun setOnUrlLongClickListener(handler: ((View) -> Boolean)?) { + urlView.isLongClickable = true + titleView.isLongClickable = true + + urlView.setOnLongClickListener(handler) + titleView.setOnLongClickListener(handler) + } + + internal var url: CharSequence + get() = urlView.text + set(value) { urlView.text = value } + + /** + * Sets the colour of the text to be displayed when the URL of the toolbar is empty. + */ + var hintColor: Int + get() = urlView.currentHintTextColor + set(value) { + urlView.setHintTextColor(value) + } + + /** + * Sets the text to be displayed when the URL of the toolbar is empty. + */ + var hint: String + get() = urlView.hint.toString() + set(value) { urlView.hint = value } + + /** + * Sets the colour of the text for title displayed in the toolbar. + */ + var titleColor: Int + get() = urlView.currentTextColor + set(value) { titleView.setTextColor(value) } + + /** + * Sets the colour of the text for the URL/search term displayed in the toolbar. + */ + var textColor: Int + get() = urlView.currentTextColor + set(value) { urlView.setTextColor(value) } + + /** + * Sets the size of the text for the title displayed in the toolbar. + */ + var titleTextSize: Float + get() = titleView.textSize + set(value) { titleView.textSize = value } + + /** + * Sets the size of the text for the URL/search term displayed in the toolbar. + */ + var textSize: Float + get() = urlView.textSize + set(value) { + urlView.textSize = value + } + + /** + * Sets the typeface of the text for the URL/search term displayed in the toolbar. + */ + var typeface: Typeface + get() = urlView.typeface + set(value) { + urlView.typeface = value + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/SiteSecurityIconView.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/SiteSecurityIconView.kt new file mode 100644 index 0000000000..879897bc56 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/SiteSecurityIconView.kt @@ -0,0 +1,48 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.content.Context +import android.util.AttributeSet +import android.view.View +import androidx.appcompat.widget.AppCompatImageView +import mozilla.components.browser.toolbar.R +import mozilla.components.concept.toolbar.Toolbar.SiteSecurity + +/** + * Internal widget to display the different icons of site security, relies on the + * [SiteSecurity] state of each page. + */ +internal class SiteSecurityIconView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : AppCompatImageView(context, attrs, defStyleAttr) { + + // We allow null here because in some situations, onCreateDrawableState is getting called from + // the super() constructor on the View class, way before this class properties get + // initialized causing a null pointer exception. + // See for more details: https://github.com/mozilla-mobile/android-components/issues/4058 + var siteSecurity: SiteSecurity? = SiteSecurity.INSECURE + set(value) { + if (value != field) { + field = value + refreshDrawableState() + } + + field = value + } + + override fun onCreateDrawableState(extraSpace: Int): IntArray { + return when (siteSecurity) { + SiteSecurity.INSECURE, null -> super.onCreateDrawableState(extraSpace) + SiteSecurity.SECURE -> { + val drawableState = super.onCreateDrawableState(extraSpace + 1) + View.mergeDrawableStates(drawableState, intArrayOf(R.attr.state_site_secure)) + drawableState + } + } + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/TrackingProtectionIconView.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/TrackingProtectionIconView.kt new file mode 100644 index 0000000000..7dde3dc251 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/display/TrackingProtectionIconView.kt @@ -0,0 +1,135 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.content.Context +import android.graphics.drawable.Animatable +import android.graphics.drawable.Drawable +import android.util.AttributeSet +import androidx.annotation.StringRes +import androidx.annotation.VisibleForTesting +import androidx.appcompat.content.res.AppCompatResources +import androidx.appcompat.widget.AppCompatImageView +import androidx.core.view.isVisible +import mozilla.components.browser.toolbar.R +import mozilla.components.concept.toolbar.Toolbar.SiteTrackingProtection +import mozilla.components.concept.toolbar.Toolbar.SiteTrackingProtection.OFF_FOR_A_SITE +import mozilla.components.concept.toolbar.Toolbar.SiteTrackingProtection.OFF_GLOBALLY +import mozilla.components.concept.toolbar.Toolbar.SiteTrackingProtection.ON_NO_TRACKERS_BLOCKED +import mozilla.components.concept.toolbar.Toolbar.SiteTrackingProtection.ON_TRACKERS_BLOCKED + +/** + * Internal widget to display the different icons of tracking protection, relies on the + * [SiteTrackingProtection] state of each page. + */ +internal class TrackingProtectionIconView @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : AppCompatImageView(context, attrs, defStyleAttr) { + var siteTrackingProtection: SiteTrackingProtection? = null + set(value) { + if (value != field) { + field = value + updateIcon() + } + } + + @VisibleForTesting + internal var trackingProtectionTint: Int? = null + + private var iconOnNoTrackersBlocked: Drawable = + requireNotNull(AppCompatResources.getDrawable(context, DEFAULT_ICON_ON_NO_TRACKERS_BLOCKED)) + private var iconOnTrackersBlocked: Drawable = + requireNotNull(AppCompatResources.getDrawable(context, DEFAULT_ICON_ON_TRACKERS_BLOCKED)) + private var disabledForSite: Drawable = + requireNotNull(AppCompatResources.getDrawable(context, DEFAULT_ICON_OFF_FOR_A_SITE)) + + fun setTint(tint: Int) { + trackingProtectionTint = tint + } + + fun setIcons( + iconOnNoTrackersBlocked: Drawable, + iconOnTrackersBlocked: Drawable, + disabledForSite: Drawable, + ) { + this.iconOnNoTrackersBlocked = iconOnNoTrackersBlocked + this.iconOnTrackersBlocked = iconOnTrackersBlocked + this.disabledForSite = disabledForSite + + updateIcon() + } + + @Synchronized + private fun updateIcon() { + val update = siteTrackingProtection?.toUpdate() ?: return + + isVisible = update.visible + + contentDescription = if (update.contentDescription != null) { + context.getString(update.contentDescription) + } else { + null + } + + setOrClearColorFilter(update.drawable) + setImageDrawable(update.drawable) + + if (update.drawable is Animatable) { + update.drawable.start() + } + } + + @VisibleForTesting + internal fun setOrClearColorFilter(drawable: Drawable?) { + if (drawable is Animatable) { + clearColorFilter() + } else { + trackingProtectionTint?.let { setColorFilter(it) } + } + } + + companion object { + val DEFAULT_ICON_ON_NO_TRACKERS_BLOCKED = + R.drawable.mozac_ic_tracking_protection_on_no_trackers_blocked + val DEFAULT_ICON_ON_TRACKERS_BLOCKED = + R.drawable.mozac_ic_tracking_protection_on_trackers_blocked + val DEFAULT_ICON_OFF_FOR_A_SITE = + R.drawable.mozac_ic_tracking_protection_off_for_a_site + } + + private fun SiteTrackingProtection.toUpdate(): Update = when (this) { + ON_NO_TRACKERS_BLOCKED -> Update( + iconOnNoTrackersBlocked, + R.string.mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked, + true, + ) + + ON_TRACKERS_BLOCKED -> Update( + iconOnTrackersBlocked, + R.string.mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1, + true, + ) + + OFF_FOR_A_SITE -> Update( + disabledForSite, + R.string.mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1, + true, + ) + + OFF_GLOBALLY -> Update( + null, + null, + false, + ) + } +} + +internal class Update( + val drawable: Drawable?, + @StringRes val contentDescription: Int?, + val visible: Boolean, +) diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/edit/EditToolbar.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/edit/EditToolbar.kt new file mode 100644 index 0000000000..ae1be8e844 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/edit/EditToolbar.kt @@ -0,0 +1,415 @@ +/* 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 mozilla.components.browser.toolbar.edit + +import android.content.Context +import android.graphics.Typeface +import android.graphics.drawable.Drawable +import android.os.Build +import android.view.KeyEvent +import android.view.View +import android.widget.ImageView +import androidx.annotation.ColorInt +import androidx.annotation.VisibleForTesting +import androidx.annotation.VisibleForTesting.Companion.PRIVATE +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.constraintlayout.widget.ConstraintSet +import androidx.core.content.ContextCompat +import androidx.core.view.inputmethod.EditorInfoCompat +import androidx.core.view.isVisible +import kotlinx.coroutines.CoroutineExceptionHandler +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.asCoroutineDispatcher +import mozilla.components.browser.toolbar.AsyncFilterListener +import mozilla.components.browser.toolbar.BrowserToolbar +import mozilla.components.browser.toolbar.R +import mozilla.components.browser.toolbar.facts.emitCommitFact +import mozilla.components.browser.toolbar.internal.ActionContainer +import mozilla.components.concept.toolbar.AutocompleteDelegate +import mozilla.components.concept.toolbar.Toolbar +import mozilla.components.support.base.log.logger.Logger +import mozilla.components.support.base.utils.NamedThreadFactory +import mozilla.components.support.ktx.android.view.showKeyboard +import mozilla.components.ui.autocomplete.InlineAutocompleteEditText +import java.util.concurrent.Executors +import mozilla.components.ui.colors.R as colorsR + +private const val AUTOCOMPLETE_QUERY_THREADS = 3 + +/** + * Sub-component of the browser toolbar responsible for allowing the user to edit the URL ("edit mode"). + * + * Structure: + * +------+--------------------+---------------------------+------------------+------+ + * | icon | edit actions start | url | edit actions end | exit | + * +------+--------------------+---------------------------+------------------+------+ + * + * - icon: Optional icon that will be shown in front of the URL. + * - edit actions start: Optional action icons injected by other components in front of the URL + * (e.g. search engines). + * - url: Editable URL of the currently displayed website. + * - edit actions end: Optional action icons injected by other components after the URL + * (e.g. barcode scanner). + * - exit: Button that switches back to display mode or invoke an app-defined callback. + */ +@Suppress("LargeClass") +class EditToolbar internal constructor( + context: Context, + private val toolbar: BrowserToolbar, + internal val rootView: View, +) { + private val logger = Logger("EditToolbar") + + /** + * Data class holding the customizable colors in "edit mode". + * + * @property clear Color tint used for the "cancel" icon to leave "edit mode". + * @property icon Color tint of the icon displayed in front of the URL. + * @property hint Text color of the hint shown when the URL field is empty. + * @property text Text color of the URL. + * @property suggestionBackground The background color used for autocomplete suggestions. + * @property suggestionForeground The foreground color used for autocomplete suggestions. + * @property pageActionSeparator Color tint of separator dividing page actions. + */ + data class Colors( + @ColorInt val clear: Int, + @ColorInt val erase: Int, + @ColorInt val icon: Int?, + @ColorInt val hint: Int, + @ColorInt val text: Int, + @ColorInt val suggestionBackground: Int, + @ColorInt val suggestionForeground: Int?, + @ColorInt val pageActionSeparator: Int, + ) + + private val autocompleteDispatcher = SupervisorJob() + + Executors.newFixedThreadPool( + AUTOCOMPLETE_QUERY_THREADS, + NamedThreadFactory("EditToolbar"), + ).asCoroutineDispatcher() + + CoroutineExceptionHandler { _, throwable -> + logger.error("Error while processing autocomplete input", throwable) + } + + @VisibleForTesting(otherwise = PRIVATE) + internal val views = EditToolbarViews( + background = rootView.findViewById(R.id.mozac_browser_toolbar_background), + icon = rootView.findViewById(R.id.mozac_browser_toolbar_edit_icon), + editActionsStart = rootView.findViewById(R.id.mozac_browser_toolbar_edit_actions_start), + editActionsEnd = rootView.findViewById(R.id.mozac_browser_toolbar_edit_actions_end), + clear = rootView.findViewById<ImageView>(R.id.mozac_browser_toolbar_clear_view).apply { + setOnClickListener { + onClear() + } + }, + erase = rootView.findViewById<ImageView>(R.id.mozac_browser_toolbar_erase_view).apply { + setOnClickListener { + onClear() + } + }, + url = rootView.findViewById<InlineAutocompleteEditText>( + R.id.mozac_browser_toolbar_edit_url_view, + ).apply { + setOnCommitListener { + // We emit the fact before notifying the listener because otherwise the listener may cause a focus + // change which may reset the autocomplete state that we want to report here. + emitCommitFact(autocompleteResult) + + toolbar.onUrlEntered(text.toString()) + } + + setOnTextChangeListener { text, _ -> + onTextChanged(text) + } + + setUrlGoneMargin( + ConstraintSet.END, + context.resources.getDimensionPixelSize(R.dimen.mozac_browser_toolbar_url_gone_margin_end), + ) + + setOnDispatchKeyEventPreImeListener { event -> + if (event?.keyCode == KeyEvent.KEYCODE_BACK && editListener?.onCancelEditing() != false) { + toolbar.displayMode() + } + false + } + }, + pageActionSeparator = rootView.findViewById(R.id.mozac_browser_action_separator), + ) + + /** + * Customizable colors in "edit mode". + */ + var colors: Colors = Colors( + clear = ContextCompat.getColor(context, colorsR.color.photonWhite), + erase = ContextCompat.getColor(context, colorsR.color.photonWhite), + icon = null, + hint = views.url.currentHintTextColor, + text = views.url.currentTextColor, + suggestionBackground = views.url.autoCompleteBackgroundColor, + suggestionForeground = views.url.autoCompleteForegroundColor, + pageActionSeparator = ContextCompat.getColor(context, colorsR.color.photonGrey80), + ) + set(value) { + field = value + + views.clear.setColorFilter(value.clear) + + views.erase.setColorFilter(value.erase) + + if (value.icon != null) { + views.icon.setColorFilter(value.icon) + } + + views.url.setHintTextColor(value.hint) + views.url.setTextColor(value.text) + views.url.autoCompleteBackgroundColor = value.suggestionBackground + views.url.autoCompleteForegroundColor = value.suggestionForeground + views.pageActionSeparator.setBackgroundColor(value.pageActionSeparator) + } + + /** + * Sets the background that will be drawn behind the URL, icon and edit actions. + */ + fun setUrlBackground(background: Drawable?) { + views.background.setImageDrawable(background) + } + + /** + * Sets an icon that will be drawn in front of the URL. + */ + fun setIcon(icon: Drawable, contentDescription: String) { + views.icon.setImageDrawable(icon) + views.icon.contentDescription = contentDescription + views.icon.visibility = View.VISIBLE + } + + /** + * Sets a click listener on the icon view + */ + fun setIconClickListener(listener: ((View) -> Unit)?) { + views.icon.setOnClickListener(listener) + } + + /** + * Sets the text to be displayed when the URL of the toolbar is empty. + */ + var hint: String + get() = views.url.hint.toString() + set(value) { views.url.hint = value } + + /** + * Sets the size of the text for the URL/search term displayed in the toolbar. + */ + var textSize: Float + get() = views.url.textSize + set(value) { + views.url.textSize = value + } + + /** + * Sets the typeface of the text for the URL/search term displayed in the toolbar. + */ + var typeface: Typeface + get() = views.url.typeface + set(value) { views.url.typeface = value } + + /** + * Sets a listener to be invoked when focus of the URL input view (in edit mode) changed. + */ + fun setOnEditFocusChangeListener(listener: (Boolean) -> Unit) { + views.url.onFocusChangeListener = View.OnFocusChangeListener { _, hasFocus -> + listener.invoke(hasFocus) + } + } + + /** + * Focuses the url input field and shows the virtual keyboard if needed. + */ + fun focus() { + views.url.run { + if (!hasFocus()) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + // On Android 14 this needs to be called before requestFocus() in order to receive focus. + isFocusableInTouchMode = true + } + requestFocus() + showKeyboard() + } + } + } + + internal fun stopEditing() { + editListener?.onStopEditing() + } + + internal fun startEditing() { + editListener?.onStartEditing() + } + + internal var editListener: Toolbar.OnEditListener? = null + + internal fun setAutocompleteListener(filter: suspend (String, AutocompleteDelegate) -> Unit) { + views.url.setOnFilterListener( + AsyncFilterListener(views.url, autocompleteDispatcher, filter), + ) + } + + /** + * Attempt to restart the autocomplete functionality with the current user input. + */ + internal fun refreshAutocompleteSuggestion() { + views.url.refreshAutocompleteSuggestions() + } + + internal fun invalidateActions() { + views.editActionsStart.invalidateActions() + views.editActionsEnd.invalidateActions() + } + + internal fun addEditActionStart(action: Toolbar.Action) { + views.editActionsStart.addAction(action) + } + + internal fun addEditActionEnd(action: Toolbar.Action) { + views.editActionsEnd.addAction(action) + } + + internal fun removeEditActionEnd(action: Toolbar.Action) { + views.editActionsEnd.removeAction(action) + } + + /** + * Updates the text of the URL input field. Note: this does *not* affect the value of url itself + * and is only a visual change + */ + fun updateUrl( + url: String, + shouldAutoComplete: Boolean = false, + shouldHighlight: Boolean = false, + shouldAppend: Boolean = false, + ): String { + if (shouldAppend) { + views.url.appendText(url, shouldAutoComplete) + } else { + views.url.setText(url, shouldAutoComplete) + } + views.clear.isVisible = url.isNotBlank() && !toolbar.isNavBarEnabled + views.erase.isVisible = url.isNotBlank() && toolbar.isNavBarEnabled + + if (shouldHighlight) { + views.url.setSelection(views.url.text.length - url.length, views.url.text.length) + } + return views.url.text.toString() + } + + /** + * Select the entire text in the URL input field. + */ + internal fun selectAll() { + views.url.selectAll() + } + + /** + * Places the cursor at the end of the URL input field. + */ + internal fun selectEnd() { + views.url.setSelection(views.url.text.length) + } + + /** + * Applies the given search terms for further editing, requesting new suggestions along the way. + */ + internal fun editSuggestion(searchTerms: String) { + updateUrl(searchTerms) + views.url.setSelection(views.url.text.length) + focus() + + editListener?.onTextChanged(searchTerms) + } + + /** + * Sets/gets private mode. + * + * In private mode the IME should not update any personalized data such as typing history and personalized language + * model based on what the user typed. + */ + internal var private: Boolean + get() = (views.url.imeOptions and EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING) != 0 + set(value) { + views.url.imeOptions = if (value) { + views.url.imeOptions or EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING + } else { + views.url.imeOptions and (EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING.inv()) + } + } + + private fun onClear() { + // We set text to an empty string instead of using clear to avoid #3612. + views.url.setText("") + editListener?.onInputCleared() + } + + private fun setUrlGoneMargin(anchor: Int, dimen: Int) { + val set = ConstraintSet() + val container = rootView.findViewById<ConstraintLayout>( + R.id.mozac_browser_toolbar_container, + ) + set.clone(container) + set.setGoneMargin(R.id.mozac_browser_toolbar_edit_url_view, anchor, dimen) + set.applyTo(container) + } + + private fun onTextChanged(text: String) { + views.clear.isVisible = text.isNotBlank() && !toolbar.isNavBarEnabled + views.erase.isVisible = text.isNotBlank() && toolbar.isNavBarEnabled + views.editActionsEnd.autoHideAction(text.isEmpty()) + + /* + We use margin_gone instead of margin to take into account both the actionContainer(which in + most cases is gone) and the clear button. + */ + if (text.isNotBlank()) { + setUrlGoneMargin(ConstraintSet.END, 0) + } else { + setUrlGoneMargin( + ConstraintSet.END, + rootView.resources.getDimensionPixelSize( + R.dimen.mozac_browser_toolbar_url_gone_margin_end, + ), + ) + } + editListener?.onTextChanged(text) + } + + /** + * Hides the page action separator in edit mode. + */ + fun hidePageActionSeparator() { + views.pageActionSeparator.isVisible = false + } + + /** + * Shows the page action separator in edit mode. + */ + fun showPageActionSeparator() { + views.pageActionSeparator.isVisible = true + } +} + +/** + * Internal holder for view references. + */ +@Suppress("LongParameterList") +internal class EditToolbarViews( + val background: ImageView, + val icon: ImageView, + val editActionsStart: ActionContainer, + val editActionsEnd: ActionContainer, + val clear: ImageView, + val erase: ImageView, + val url: InlineAutocompleteEditText, + val pageActionSeparator: View, +) diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/facts/ToolbarFacts.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/facts/ToolbarFacts.kt new file mode 100644 index 0000000000..dd8ec851f2 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/facts/ToolbarFacts.kt @@ -0,0 +1,60 @@ +/* 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 mozilla.components.browser.toolbar.facts + +import mozilla.components.support.base.Component +import mozilla.components.support.base.facts.Action +import mozilla.components.support.base.facts.Fact +import mozilla.components.support.base.facts.collect +import mozilla.components.ui.autocomplete.InlineAutocompleteEditText + +/** + * Facts emitted for telemetry related to [ToolbarFeature] + */ +class ToolbarFacts { + /** + * Items that specify which portion of the [ToolbarFeature] was interacted with + */ + object Items { + const val TOOLBAR = "toolbar" + const val MENU = "menu" + } +} + +private fun emitToolbarFact( + action: Action, + item: String, + value: String? = null, + metadata: Map<String, Any>? = null, +) { + Fact( + Component.BROWSER_TOOLBAR, + action, + item, + value, + metadata, + ).collect() +} + +internal fun emitOpenMenuFact(extras: Map<String, Any>?) { + emitToolbarFact(Action.CLICK, ToolbarFacts.Items.MENU, metadata = extras) +} + +internal fun emitCommitFact( + autocompleteResult: InlineAutocompleteEditText.AutocompleteResult?, +) { + val metadata = if (autocompleteResult == null) { + mapOf( + "autocomplete" to false, + ) + } else { + mapOf( + "autocomplete" to true, + "source" to autocompleteResult.source, + ) + } + + emitToolbarFact(Action.COMMIT, ToolbarFacts.Items.TOOLBAR, metadata = metadata) +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/internal/ActionContainer.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/internal/ActionContainer.kt new file mode 100644 index 0000000000..ca6e761ba1 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/internal/ActionContainer.kt @@ -0,0 +1,134 @@ +/* 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 mozilla.components.browser.toolbar.internal + +import android.content.Context +import android.transition.TransitionManager +import android.util.AttributeSet +import android.view.Gravity +import android.view.View +import android.widget.LinearLayout +import androidx.annotation.VisibleForTesting +import androidx.core.view.isVisible +import mozilla.components.browser.toolbar.R +import mozilla.components.concept.toolbar.Toolbar + +/** + * A container [View] for displaying [Toolbar.Action] objects. + */ +internal class ActionContainer @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : LinearLayout(context, attrs, defStyleAttr) { + private val actions = mutableListOf<ActionWrapper>() + private var actionSize: Int? = null + + init { + gravity = Gravity.CENTER_VERTICAL + orientation = HORIZONTAL + visibility = View.GONE + + context.obtainStyledAttributes( + attrs, + R.styleable.ActionContainer, + defStyleAttr, + 0, + ).run { + actionSize = attrs?.let { + getDimensionPixelSize(R.styleable.ActionContainer_actionContainerItemSize, 0) + } + + recycle() + } + } + + fun addAction(action: Toolbar.Action) { + val wrapper = ActionWrapper(action) + + if (action.visible()) { + visibility = View.VISIBLE + + action.createView(this).let { + wrapper.view = it + val insertionIndex = calculateInsertionIndex(action) + addActionView(it, insertionIndex) + } + } + + actions.add(wrapper) + } + + /** + * Essentially calculates the index of an action on toolbar based on a + * map [visibleActionIndicesWithWeights] that holds the order + * of visible action indices to their weights sorted by weights. + * An index is now calculated by finding the immediate next larger weight + * compared to the new action's weight. Index of this find becomes the index of the new action. + * If not found, action is appended at the end. + */ + @VisibleForTesting(otherwise = VisibleForTesting.PRIVATE) + internal fun calculateInsertionIndex(newAction: Toolbar.Action): Int { + if (newAction.weight() == -1) { + return -1 + } + val visibleActionIndicesWithWeights = actions.filter { it.actual.visible() } + .mapNotNull { actionWrapper -> + val index = indexOfChild(actionWrapper.view) + if (index != -1) index to actionWrapper.actual.weight() else null + }.sortedBy { it.second } + + val insertionIndex = visibleActionIndicesWithWeights.firstOrNull { it.second > newAction.weight() }?.first + + return insertionIndex ?: childCount + } + + fun removeAction(action: Toolbar.Action) { + actions.find { it.actual == action }?.let { + actions.remove(it) + removeView(it.view) + } + } + + fun invalidateActions() { + TransitionManager.beginDelayedTransition(this) + var updatedVisibility = View.GONE + + for (action in actions) { + val visible = action.actual.visible() + + if (visible) { + updatedVisibility = View.VISIBLE + } + + if (!visible && action.view != null) { + removeView(action.view) + action.view = null + } else if (visible && action.view == null) { + action.actual.createView(this).let { + action.view = it + val insertionIndex = calculateInsertionIndex(action.actual) + addActionView(it, insertionIndex) + } + } + + action.view?.let { action.actual.bind(it) } + } + + visibility = updatedVisibility + } + + fun autoHideAction(isVisible: Boolean) { + for (action in actions) { + if (action.actual.autoHide()) { + action.view?.isVisible = isVisible + } + } + } + + private fun addActionView(view: View, index: Int) { + addView(view, index, LayoutParams(actionSize ?: 0, actionSize ?: 0)) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/internal/ActionWrapper.kt b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/internal/ActionWrapper.kt new file mode 100644 index 0000000000..723cd84e20 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/java/mozilla/components/browser/toolbar/internal/ActionWrapper.kt @@ -0,0 +1,16 @@ +/* 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 mozilla.components.browser.toolbar.internal + +import android.view.View +import mozilla.components.concept.toolbar.Toolbar + +/** + * A wrapper helper to pair a Toolbar.Action with an optional View. + */ +internal class ActionWrapper( + var actual: Toolbar.Action, + var view: View? = null, +) diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_browser_toolbar_icons_vertical_separator.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_browser_toolbar_icons_vertical_separator.xml new file mode 100644 index 0000000000..2e366640df --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_browser_toolbar_icons_vertical_separator.xml @@ -0,0 +1,9 @@ +<?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/. --> +<shape xmlns:android="http://schemas.android.com/apk/res/android"> + <size android:width="@dimen/mozac_browser_toolbar_icons_separator_width" + android:height="@dimen/mozac_browser_toolbar_icons_separator_height" /> + <solid android:color="#aaaaaa" /> +</shape>
\ No newline at end of file diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_dot_notification.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_dot_notification.xml new file mode 100644 index 0000000000..5469b822af --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_dot_notification.xml @@ -0,0 +1,16 @@ +<?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="8dp" + android:height="8dp" + android:viewportWidth="10" + android:viewportHeight="10"> + <path + android:pathData="M1,5a4,4 0 1,0 8,0a4,4 0 1,0 -8,0" + android:strokeWidth="1" + android:strokeAlpha=".2" + android:fillColor="#fff" + android:strokeColor="#000" /> +</vector> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_site_security.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_site_security.xml new file mode 100644 index 0000000000..ab2b8d0e37 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_site_security.xml @@ -0,0 +1,11 @@ +<?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/. --> +<selector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ac="http://schemas.android.com/apk/res-auto"> + <item + android:drawable="@drawable/mozac_ic_lock_24" + ac:state_site_secure="true" /> + <item + android:drawable="@drawable/mozac_ic_broken_lock" /> +</selector> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_off_for_a_site.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_off_for_a_site.xml new file mode 100644 index 0000000000..250bfbfc4c --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_off_for_a_site.xml @@ -0,0 +1,12 @@ +<?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/mozac_ui_icons_fill" + android:pathData="M17.9,10.83c-0.27,2.81 -0.75,4.18 -2,5.86A6.48,6.48 0,0 1,12 19a7,7 0,0 1,-2.32 -0.92l-1.44,1.43A8.44,8.44 0,0 0,11.89 21h0.22a8.36,8.36 0,0 0,5.33 -3.08c1.53,-2 2.14,-3.72 2.45,-6.89C20,10.28 20,9 20,7.76l-2,2c-0.06,0.47 -0.08,0.82 -0.1,1.07zM20.21,3.83a1,1 0,0 0,-1.42 0l-0.3,0.31a1.86,1.86 0,0 0,-0.31 -0.1L12,3 5.82,4A2.14,2.14 0,0 0,4 6.1c0,1.67 0,3.9 0.11,4.9a12.43,12.43 0,0 0,1.69 5.79l-2,2a1,1 0,0 0,0 1.42,1 1,0 0,0 1.42,0l15,-15a1,1 0,0 0,-0.01 -1.42zM12,10.59L12,7l-4,0.7c0,2 0.07,2.74 0.09,3a11.65,11.65 0,0 0,0.63 3.17l-1.46,1.46a11.13,11.13 0,0 1,-1.16 -4.5C6,10.08 6,8.4 6,6.11A0.15,0.15 0,0 1,6.14 6L12,5l4.79,0.79z" /> +</vector> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_on_no_trackers_blocked.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_on_no_trackers_blocked.xml new file mode 100644 index 0000000000..4f81a5602b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_on_no_trackers_blocked.xml @@ -0,0 +1,12 @@ +<?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/mozac_ui_icons_fill" + android:pathData="M20 6c0-1-0.8-1.9-1.8-2L12 3 5.8 4C4.8 4 4 5 4 6l0.1 5c0.3 3.2 1 5 2.5 7a8.4 8.4 0 0 0 5.3 3h0.2c2.1-0.3 4-1.4 5.3-3 1.6-2 2.2-3.8 2.5-7l0.1-5zm-2.1 4.8a10 10 0 0 1-2 6c-1 1.1-2.4 2-3.9 2.3a6.5 6.5 0 0 1-3.9-2.4 9.9 9.9 0 0 1-2-5.9 67.3 67.3 0 0 1 0-4.9L12 5l5.9 1 0.1 0.2-0.1 4.7zM8 7.6v3c0.3 2.7 0.8 3.7 1.7 5 0.6 0.6 1.4 1.2 2.3 1.4V7l-4 0.6z" /> +</vector> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_on_trackers_blocked.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_on_trackers_blocked.xml new file mode 100644 index 0000000000..4f81a5602b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/drawable/mozac_ic_tracking_protection_on_trackers_blocked.xml @@ -0,0 +1,12 @@ +<?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/mozac_ui_icons_fill" + android:pathData="M20 6c0-1-0.8-1.9-1.8-2L12 3 5.8 4C4.8 4 4 5 4 6l0.1 5c0.3 3.2 1 5 2.5 7a8.4 8.4 0 0 0 5.3 3h0.2c2.1-0.3 4-1.4 5.3-3 1.6-2 2.2-3.8 2.5-7l0.1-5zm-2.1 4.8a10 10 0 0 1-2 6c-1 1.1-2.4 2-3.9 2.3a6.5 6.5 0 0 1-3.9-2.4 9.9 9.9 0 0 1-2-5.9 67.3 67.3 0 0 1 0-4.9L12 5l5.9 1 0.1 0.2-0.1 4.7zM8 7.6v3c0.3 2.7 0.8 3.7 1.7 5 0.6 0.6 1.4 1.2 2.3 1.4V7l-4 0.6z" /> +</vector> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/layout/mozac_browser_toolbar_displaytoolbar.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/layout/mozac_browser_toolbar_displaytoolbar.xml new file mode 100644 index 0000000000..c969713fad --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/layout/mozac_browser_toolbar_displaytoolbar.xml @@ -0,0 +1,175 @@ +<?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/. --> +<mozilla.components.browser.toolbar.display.DisplayToolbarView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:mozac="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="56dp" + android:orientation="vertical"> + + <!-- Navigation --> + + <mozilla.components.browser.toolbar.internal.ActionContainer + android:id="@+id/mozac_browser_toolbar_navigation_actions" + android:layout_width="wrap_content" + android:layout_height="48dp" + android:layout_marginTop="4dp" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + mozac:actionContainerItemSize="48dp" + tools:layout_width="48dp" /> + + <!-- URL container --> + + <ImageView + android:id="@+id/mozac_browser_toolbar_background" + android:layout_width="0dp" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:importantForAccessibility="no" + app:layout_constraintEnd_toStartOf="@+id/mozac_browser_toolbar_browser_actions" + app:layout_constraintStart_toEndOf="@+id/mozac_browser_toolbar_navigation_actions" + app:layout_constraintTop_toTopOf="parent" + app:layout_goneMarginEnd="0dp" /> + + <!-- URL indicators (lock, tracking protection, ..) --> + + <ImageView + android:id="@+id/mozac_browser_toolbar_empty_indicator" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:scaleType="center" + android:visibility="gone" + app:layout_constraintStart_toStartOf="@id/mozac_browser_toolbar_background" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/mozac_ic_search_24" + tools:ignore="ContentDescription" /> + + <mozilla.components.browser.toolbar.display.TrackingProtectionIconView + android:id="@+id/mozac_browser_toolbar_tracking_protection_indicator" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:scaleType="center" + android:visibility="gone" + app:layout_constraintStart_toEndOf="@id/mozac_browser_toolbar_empty_indicator" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/mozac_ic_tracking_protection_on_no_trackers_blocked" /> + + <ImageView + android:id="@+id/mozac_browser_toolbar_separator" + android:layout_width="@dimen/mozac_browser_toolbar_icons_separator_width" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:importantForAccessibility="no" + android:scaleType="center" + android:visibility="gone" + app:layout_constraintStart_toEndOf="@+id/mozac_browser_toolbar_tracking_protection_indicator" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/mozac_browser_toolbar_icons_vertical_separator" /> + + <mozilla.components.browser.toolbar.display.SiteSecurityIconView + android:id="@+id/mozac_browser_toolbar_security_indicator" + android:layout_width="40dp" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:contentDescription="@string/mozac_browser_toolbar_content_description_site_info" + android:scaleType="center" + app:layout_constraintStart_toEndOf="@+id/mozac_browser_toolbar_separator" + app:layout_constraintTop_toTopOf="parent" + app:srcCompat="@drawable/mozac_ic_site_security" /> + + <mozilla.components.browser.toolbar.display.HighlightView + android:id="@+id/mozac_browser_toolbar_permission_indicator" + android:layout_width="10dp" + android:layout_height="10dp" + android:importantForAccessibility="no" + app:layout_constraintBottom_toBottomOf="@+id/mozac_browser_toolbar_security_indicator" + app:layout_constraintEnd_toEndOf="@+id/mozac_browser_toolbar_security_indicator" + android:layout_marginEnd="8dp" + android:layout_marginBottom="8dp" + android:visibility="gone" + android:tint="@color/photonBlue40" + app:srcCompat="@drawable/mozac_dot_notification" /> + + <!-- URL & Title --> + + <mozilla.components.browser.toolbar.display.OriginView + android:id="@+id/mozac_browser_toolbar_origin_view" + android:layout_width="0dp" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:paddingEnd="@dimen/mozac_browser_toolbar_origin_padding_end" + app:layout_constraintEnd_toStartOf="@+id/mozac_browser_toolbar_action_separator" + app:layout_constraintStart_toEndOf="@+id/mozac_browser_toolbar_security_indicator" + app:layout_constraintTop_toTopOf="parent" + app:layout_goneMarginStart="8dp" + app:layout_goneMarginTop="8dp" /> + + <View + android:id="@+id/mozac_browser_toolbar_action_separator" + android:layout_width="@dimen/mozac_browser_toolbar_page_action_separator_width" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:layout_marginStart="8dp" + android:visibility="gone" + android:importantForAccessibility="no" + android:scaleType="center" + app:layout_constraintStart_toEndOf="@+id/mozac_browser_toolbar_origin_view" + app:layout_constraintEnd_toStartOf="@id/mozac_browser_toolbar_page_actions" + app:layout_constraintTop_toTopOf="parent" /> + + <!-- Page actions --> + + <mozilla.components.browser.toolbar.internal.ActionContainer + android:id="@+id/mozac_browser_toolbar_page_actions" + android:layout_width="wrap_content" + android:layout_height="48dp" + android:layout_marginTop="4dp" + android:scaleType="center" + app:layout_constraintEnd_toEndOf="@+id/mozac_browser_toolbar_background" + app:layout_constraintTop_toTopOf="parent" + mozac:actionContainerItemSize="48dp" + tools:layout_width="48dp" /> + + <!-- Browser Actions --> + + <mozilla.components.browser.toolbar.internal.ActionContainer + android:id="@+id/mozac_browser_toolbar_browser_actions" + android:layout_width="wrap_content" + android:layout_height="48dp" + android:layout_marginTop="4dp" + app:layout_constraintEnd_toStartOf="@id/mozac_browser_toolbar_menu" + app:layout_constraintTop_toTopOf="parent" + mozac:actionContainerItemSize="48dp" + tools:layout_width="48dp" /> + + <!-- Menu --> + + <mozilla.components.browser.menu.view.MenuButton + android:id="@+id/mozac_browser_toolbar_menu" + android:layout_width="36dp" + android:layout_height="48dp" + android:layout_marginTop="4dp" + android:background="?android:attr/selectableItemBackgroundBorderless" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <!-- Progress Bar --> + + <ProgressBar + android:id="@+id/mozac_browser_toolbar_progress" + style="?android:attr/progressBarStyleHorizontal" + android:layout_width="0dp" + android:layout_height="@dimen/mozac_browser_toolbar_progress_bar_height" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + +</mozilla.components.browser.toolbar.display.DisplayToolbarView> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/layout/mozac_browser_toolbar_edittoolbar.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/layout/mozac_browser_toolbar_edittoolbar.xml new file mode 100644 index 0000000000..a45d0902e3 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/layout/mozac_browser_toolbar_edittoolbar.xml @@ -0,0 +1,116 @@ +<?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/. --> +<androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/mozac_browser_toolbar_container" + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:mozac="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:orientation="vertical" + android:layout_height="56dp"> + + <ImageView + android:id="@+id/mozac_browser_toolbar_background" + android:layout_width="0dp" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:layout_marginStart="8dp" + android:layout_marginEnd="8dp" + android:importantForAccessibility="no" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <ImageView + android:id="@+id/mozac_browser_toolbar_edit_icon" + android:layout_width="40dp" + android:layout_height="40dp" + android:scaleType="center" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toStartOf="@id/mozac_browser_toolbar_background" + app:srcCompat="@drawable/mozac_ic_search_24" + android:visibility="gone" + tools:ignore="ContentDescription" + android:layout_marginTop="8dp" /> + + <mozilla.components.browser.toolbar.internal.ActionContainer + android:id="@+id/mozac_browser_toolbar_edit_actions_start" + android:layout_width="wrap_content" + android:layout_height="40dp" + android:layout_marginTop="8dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintStart_toEndOf="@id/mozac_browser_toolbar_edit_icon" + mozac:actionContainerItemSize="56dp" + tools:layout_width="56dp" /> + + <mozilla.components.ui.autocomplete.InlineAutocompleteEditText + android:id="@+id/mozac_browser_toolbar_edit_url_view" + android:layout_width="0dp" + android:layout_marginTop="8dp" + android:layout_height="40dp" + android:width="100dp" + android:height="100dp" + android:imeOptions="actionGo|flagNoExtractUi|flagNoFullscreen" + android:inputType="textUri|text" + android:lines="1" + android:gravity="center_vertical" + android:background="#00000000" + android:textSize="15sp" + app:layout_goneMarginStart="8dp" + app:layout_constraintStart_toEndOf="@id/mozac_browser_toolbar_edit_actions_start" + app:layout_constraintEnd_toStartOf="@id/mozac_browser_toolbar_erase_view" + app:layout_constraintTop_toTopOf="parent" /> + + <ImageView + android:id="@+id/mozac_browser_toolbar_erase_view" + android:layout_width="44dp" + android:layout_height="44dp" + android:contentDescription="@string/mozac_clear_button_description" + android:scaleType="center" + app:srcCompat="@drawable/mozac_ic_cross_circle_fill_20" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@+id/mozac_browser_toolbar_edit_url_view" + app:layout_constraintEnd_toStartOf="@id/mozac_browser_action_separator" + app:layout_constraintTop_toTopOf="parent" /> + + <View + android:id="@+id/mozac_browser_action_separator" + android:layout_width="@dimen/mozac_browser_toolbar_page_action_separator_width" + android:layout_height="40dp" + android:layout_marginTop="8dp" + android:visibility="gone" + android:importantForAccessibility="no" + android:scaleType="center" + app:layout_constraintStart_toEndOf="@+id/mozac_browser_toolbar_erase_view" + app:layout_constraintEnd_toStartOf="@id/mozac_browser_toolbar_edit_actions_end" + app:layout_constraintTop_toTopOf="parent" /> + + <mozilla.components.browser.toolbar.internal.ActionContainer + android:id="@+id/mozac_browser_toolbar_edit_actions_end" + android:layout_width="wrap_content" + android:layout_height="40dp" + android:layout_marginTop="8dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintEnd_toStartOf="@id/mozac_browser_toolbar_clear_view" + mozac:actionContainerItemSize="40dp" + tools:layout_width="48dp" /> + + <ImageView + android:id="@+id/mozac_browser_toolbar_clear_view" + android:layout_width="40dp" + android:layout_height="40dp" + android:width="100dp" + android:height="100dp" + android:contentDescription="@string/mozac_clear_button_description" + android:scaleType="center" + app:srcCompat="@drawable/mozac_ic_cross_circle_fill_24" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="@+id/mozac_browser_toolbar_background" + app:layout_constraintTop_toTopOf="parent" /> + +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-am/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-am/strings.xml new file mode 100644 index 0000000000..eda99f879b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-am/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">ምናሌ</string> + <string name="mozac_clear_button_description">አጽዳ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">የመከታተያ ጥበቃ በርቷል</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">የክትትል ጥበቃ መከታተያዎችን አግዷል</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">የክትትል ጥበቃ ለዚህ ድረ-ገፅ ጠፍቷል</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">የድረ-ገፅ መረጃ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">በመጫን ላይ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">አንዳንድ ይዘቶች በራስ አጫውት ቅንብር ታግደዋል</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-an/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-an/strings.xml new file mode 100644 index 0000000000..14b40de38e --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-an/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Borrar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protección contra seguimiento ye activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Las protección contra seguimiento ha blocau elementos de seguimiento</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protección de seguimiento ye desactivada en este puesto</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información d’o puesto</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Se ye cargando</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ar/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ar/strings.xml new file mode 100644 index 0000000000..a4a01aa836 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ar/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">القائمة</string> + <string name="mozac_clear_button_description">امسح</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">الحماية من التعقّب مفعّلة</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">حجبت الحماية من التعقّب بعض المتعقّبات</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">عُطّلت الحماية من التعقب في هذا الموقع</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">معلومات الموقع</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">يُحمّل</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">حجب إعداد التشغيل التلقائي بعض المحتوى</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ast/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ast/strings.xml new file mode 100644 index 0000000000..6cb4e96a9a --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ast/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Borrar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La proteición antirrastrexu ta activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La proteición antirrastrexu bloquió rastrexadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La proteición antirrastrexu ta desactivada nesti sitiu</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información del sitiu</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargando</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">La configuración de la reproducción automática bloquió parte del conteníu</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-az/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-az/strings.xml new file mode 100644 index 0000000000..0ccb692a99 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-az/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menyu</string> + <string name="mozac_clear_button_description">Təmizlə</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">İzlənmə Qoruması açıqdır</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">İzlənmə Qoruması izləyiciləri əngəllədi</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">İzlənmə Qoruması bu sayt üçün sönülüdür</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Sayt məlumatları</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Yüklənir</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-azb/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-azb/strings.xml new file mode 100644 index 0000000000..f3d084938f --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-azb/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">منو</string> + <string name="mozac_clear_button_description">تمیزله</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ایزلهمه قورونماسی آچیق</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ایزلهمه قوروماسی ایزلهییجیلری مسدود ائلیب</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">بو سایت اوچون ایزلهمه قورونماسی باغلیدیر.</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">سایت بیلگیلری</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">دولور</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">بعضی موحتوالار اوتوماتیکچال تنظیمی طرفیندن مسدود اولموش</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ban/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ban/strings.xml new file mode 100644 index 0000000000..037114093f --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ban/strings.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Puyung</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Jantosang dumun</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-be/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-be/strings.xml new file mode 100644 index 0000000000..7cdd7f116b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-be/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Меню</string> + <string name="mozac_clear_button_description">Ачысціць</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ахова ад сачэння ўключана</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ахова ад сачэння перапыніла высочвальнікаў</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ахова ад сачэння выключана на гэтым сайце</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Інфармацыя пра сайт</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Загрузка</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Некаторае змесціва было заблакавана наладамі аўтапрайгравання</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bg/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bg/strings.xml new file mode 100644 index 0000000000..e6e6ae23e5 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bg/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Меню</string> + <string name="mozac_clear_button_description">Изчистване</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Защита от проследяване включена</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Защитата от проследяване е спряла проследяване</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Защитата от проследяване е изключена за сайта</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Показване на информация за сайта</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Зареждане</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Част от съдържанието е спряно от настройките за автоматично възпроизвеждане</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bn/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bn/strings.xml new file mode 100644 index 0000000000..8c93a8c6e7 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bn/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">মেনু</string> + <string name="mozac_clear_button_description">পরিষ্কার করুন</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ট্র্যাকিং সুরক্ষা চালু আছে</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ট্র্যাকিং সুরক্ষা ট্র্যাকারদের অবরুদ্ধ করেছে</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">এই সাইটের জন্য ট্র্যাকিং সুরক্ষা বন্ধ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">সাইটের তথ্য</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">লোড হচ্ছে</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">কিছু বিষয়বস্তু অটোপ্লে সেটিং দ্বারা ব্লক করা হয়েছে</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-br/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-br/strings.xml new file mode 100644 index 0000000000..189cb05917 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-br/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Lañser</string> + <string name="mozac_clear_button_description">Skarzhañ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Gweredekaet eo ar gware heuliañ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Stanket ez eus bet heulierien gant ar gwarez heuliañ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Diweredekaet eo bet ar gwarez heuliañ evit al lecʼhienn-mañ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Titouroù al lecʼhienn</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">O kargañ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Elfennoù ’zo a zo bet stanket gant arventenn al lenn emgefreek</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bs/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bs/strings.xml new file mode 100644 index 0000000000..2542f069fc --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-bs/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meni</string> + <string name="mozac_clear_button_description">Očisti</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Zaštita od praćenja uključena</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Zaštita od praćenja je blokirala pratioce</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Zaštita od praćenja je isključena za ovu stranicu</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informacije o stranici</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Učitavanje</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Neki sadržaj je blokiran postavkom automatske reprodukcije</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ca/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ca/strings.xml new file mode 100644 index 0000000000..44f350dcf2 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ca/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Esborra</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protecció contra el seguiment està activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protecció contra el seguiment ha blocat elements de seguiment coneguts</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">S’ha desactivat la protecció contra el seguiment per a aquest lloc</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informació del lloc</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">S’està carregant</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Una part del contingut s’ha blocat per la configuració de la reproducció automàtica</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cak/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cak/strings.xml new file mode 100644 index 0000000000..b3cd42e4f8 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cak/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">K\'utsamaj</string> + <string name="mozac_clear_button_description">Tijosq\'ïx</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Tzijïl ri Chajinïk Chuwäch Ojqanïk</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Eruq\'aton ojqanela\' ri i Chajinïk chuwäch Ojqanïk</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Chupül ri Chajinïk chuwäch Ojqanem pa re ruxaq re\'</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Rutzijol ruxaq</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Nusamajij</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Jun peraj chi re ri rupam xq\'at ruma ri runuk\'ulem ri ruyon nitzij</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ceb/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ceb/strings.xml new file mode 100644 index 0000000000..4a03205a32 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ceb/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Panas</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ang Tracking Protection on</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ang Tracking Protection nibara ug tracker</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Wala\'y Tracking Protection ani nga site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Detalye sa site</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Loading</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Ang uban content gibara sa setting sa autoplay</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ckb/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ckb/strings.xml new file mode 100644 index 0000000000..95e99bea91 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ckb/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">پێڕست</string> + <string name="mozac_clear_button_description">پاککردنەوە</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">پارێزگاری لە چاودێری کارایە</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">پارێزگاری چاودێری توانی چەند چاودێریکەرێک بلۆک بکات</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">پارێزگاری لە چاودێری ناکارایە بۆ ئەم ماڵپەڕە</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">زانیاری ماڵپەڕ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">باردەکرێت</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">هەندێک ناوەڕۆک بلۆک کران لە لایەن ڕێکخستنی خۆپێکردنەوە</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-co/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-co/strings.xml new file mode 100644 index 0000000000..5c1db9a3b0 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-co/strings.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Interfaccia</string> + <!-- Content description: For the clear URL text button. --> + <string name="mozac_clear_button_description">Squassà</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">A prutezzione contr’à u spiunagiu hè attivata</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">A prutezzione contr’à u spiunagiu hà bluccatu perseguitatori</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">A prutezzione contr’à u spiunagiu hè disattivata per stu situ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Infurmazioni nant’à u situ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Caricamentu…</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Certi cuntenuti sò stati bluccati da a preferenza di lettura autumatica</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cs/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cs/strings.xml new file mode 100644 index 0000000000..10675ef8b8 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cs/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Nabídka</string> + <string name="mozac_clear_button_description">Vymazat</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ochrana proti sledování je zapnuta</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ochrana proti sledování zablokovala sledovací prvky</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ochrana proti sledování je pro tento web vypnuta</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informace o stránce</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Načítání</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Část obsahu byla zablokována nastavením automatického přehrávání</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cy/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cy/strings.xml new file mode 100644 index 0000000000..8545de8b42 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-cy/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Dewislen</string> + <string name="mozac_clear_button_description">Clirio</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Mae Diogelwch rhag Tracio ymlaen</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Mae Diogelwch rhag Tracio wedi rhwystro tracwyr</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Mae Diogelwch rhag Tracio wedi ei ddiffodd ar gyfer y wefan hon</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Manylion y wefan</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Llwytho</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Mae rhywfaint o gynnwys wedi’i rwystro gan osodiadau awtochwarae</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-da/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-da/strings.xml new file mode 100644 index 0000000000..fff93d6f89 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-da/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Ryd</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Beskyttelse mod sporing er slået til</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Beskyttelse mod sporing har blokeret sporings-tjenester</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Beskyttelse mod sporing er slået fra for dette websted</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Information om webstedet</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Indlæser</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Noget indhold er blevet blokeret af indstillingen for automatisk afspilning</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-de/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-de/strings.xml new file mode 100644 index 0000000000..51e545591b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-de/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menü</string> + <string name="mozac_clear_button_description">Leeren</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Schutz vor Aktivitätenverfolgung ist an</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Der Tracking-Schutz hat Tracker blockiert</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Der Tracking-Schutz ist für diese Website deaktiviert</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Seiteninformation</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Wird geladen</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Einige Inhalte wurden durch die Einstellung zur automatischen Wiedergabe blockiert</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-dsb/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-dsb/strings.xml new file mode 100644 index 0000000000..3b22b7bcb4 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-dsb/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meni</string> + <string name="mozac_clear_button_description">Wuprozniś</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Slědowański šćit jo zašaltowany</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Slědowański šćit jo blokěrował pśeslědowaki</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Slědowański šćit jo něnto znjemóžnjony za toś to sedło</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Sedłowe informacije</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Zacytujo se</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Někake wopśimjeśe jo se pśez wótgrawańske nastajenje zablokěrował</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-el/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-el/strings.xml new file mode 100644 index 0000000000..69d6e8c949 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-el/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Μενού</string> + <string name="mozac_clear_button_description">Απαλοιφή</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Η προστασία από καταγραφή είναι ενεργή</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Η προστασία από καταγραφή έχει αποκλείσει ιχνηλάτες</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Η προστασία από καταγραφή είναι ανενεργή για τον ιστότοπο</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Πληροφορίες ιστοτόπου</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Φόρτωση</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Ορισμένο περιεχόμενο έχει αποκλειστεί από τη ρύθμιση αυτόματης αναπαραγωγής</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-en-rCA/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-en-rCA/strings.xml new file mode 100644 index 0000000000..63bd4a5769 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-en-rCA/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Clear</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Tracking Protection is on</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Tracking Protection has blocked trackers</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Tracking Protection is off for this site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Site information</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Loading</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Some content has been blocked by the autoplay setting</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-en-rGB/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-en-rGB/strings.xml new file mode 100644 index 0000000000..63bd4a5769 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-en-rGB/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Clear</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Tracking Protection is on</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Tracking Protection has blocked trackers</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Tracking Protection is off for this site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Site information</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Loading</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Some content has been blocked by the autoplay setting</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-eo/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-eo/strings.xml new file mode 100644 index 0000000000..19f08c2553 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-eo/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menuo</string> + <string name="mozac_clear_button_description">Viŝi</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Protekto kontraŭ spurado ŝaltita</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protekto kontraŭ spurado blokis spurilojn</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Protekto kontraŭ spurado malŝaltita por tiu ĉi retejo</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informo pri retejo</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Ŝargado</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Parto de la enhavo estis blokita de la agordo pri aŭtomata ludado</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rAR/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rAR/strings.xml new file mode 100644 index 0000000000..a8002e20c1 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rAR/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Eliminar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protección contra rastreo está habilitada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protección contra rastreo bloqueó los rastreadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protección de rastreo ahora está deshabilitada para este sitio</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información del sitio</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargando</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Se bloquearon algunos contenidos debido a la configuración de reproducción automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rCL/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rCL/strings.xml new file mode 100644 index 0000000000..d949ef8b58 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rCL/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Limpiar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Protección de seguimiento activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La Protección de seguimiento ha bloqueado rastreadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Protección de seguimiento desactivada para este sitio</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información del sitio</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargando</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Algunos contenidos han sido bloqueados por los ajustes de reproducción automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rES/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rES/strings.xml new file mode 100644 index 0000000000..f4e14a2865 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rES/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Limpiar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protección contra rastreo está activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protección contra rastreo ha bloqueado rastreadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protección contra rastreo está desactivada para este sitio web</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información del sitio</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargando</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Algunos contenidos han sido bloqueados por los ajustes de reproducción automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rMX/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rMX/strings.xml new file mode 100644 index 0000000000..cd4388769d --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es-rMX/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Limpiar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protección contra rastreo está activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protección contra rastreo ha bloqueado rastreadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protección contra rastreo está desactivada para este sitio</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información del sitio</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargando</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Parte del contenido ha sido bloqueado por la configuración de reproducción automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es/strings.xml new file mode 100644 index 0000000000..f4e14a2865 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-es/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Limpiar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protección contra rastreo está activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protección contra rastreo ha bloqueado rastreadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protección contra rastreo está desactivada para este sitio web</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información del sitio</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargando</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Algunos contenidos han sido bloqueados por los ajustes de reproducción automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-et/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-et/strings.xml new file mode 100644 index 0000000000..7fb1096fd7 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-et/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menüü</string> + <string name="mozac_clear_button_description">Tühjenda</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Jälitamisvastane kaitse on sees</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Jälitamisvastane kaitse on jälitajaid blokkinud</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Täiustatud jälitamisvastane kaitse on sellel saidil väljas</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Saidi teave</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Laadimine</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Osa sisu on automaatse esitamise sättega blokitud</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-eu/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-eu/strings.xml new file mode 100644 index 0000000000..5a1ee5a682 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-eu/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menua</string> + <string name="mozac_clear_button_description">Garbitu</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Jarraipenaren babesa gaituta dago</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Jarraipenaren babesak jarraipen-elementuak blokeatu ditu</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Jarraipenaren babesa desgaituta dago webgune honetarako</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Gunearen informazioa</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Kargatzen</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Eduki batzuk blokeatu egin dira erreprodukzio automatikoko ezarpenetan oinarrituta</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fa/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fa/strings.xml new file mode 100644 index 0000000000..f381a2069f --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fa/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">منو</string> + <string name="mozac_clear_button_description">پاک کردن</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">حفاظت در برابر ردیابی روشن است</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">حفاظت در برابر ردیابی، ردیابها را مسدود کرده است</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">حفاظت در برابر ردیابی برای این پایگاه خاموش است</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">اطلاعات پایگاه</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">در حال بار کردن</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">برخی از محتواها توسط تنظیمات پخش خودکار مسدود شدهاند</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ff/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ff/strings.xml new file mode 100644 index 0000000000..b774316dfb --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ff/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Dosol</string> + <string name="mozac_clear_button_description">Momtu</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ndeenka Dewindol nani e</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ndeenka Dewindol faliima rewindotooɓe</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ndeenka Dewindol ko ko ñifi e ndee lowre</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Humpito lowre</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Nana loowa</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fi/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fi/strings.xml new file mode 100644 index 0000000000..53206238cc --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fi/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Valikko</string> + <string name="mozac_clear_button_description">Tyhjennä</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Seurannan suojaus on päällä</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Seurannan suojaus on estänyt seuraimia</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Seurannan suojaus ei ole käytössä tällä sivustolla</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Sivustotiedot</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Ladataan</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Automaattisen toiston asetus on estänyt osan sisällöstä</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fr/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fr/strings.xml new file mode 100644 index 0000000000..13e1cf9c99 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fr/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Effacer</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protection contre le pistage est activée</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protection contre le pistage a bloqué des traqueurs</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protection contre le pistage est désactivée pour ce site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informations sur le site</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Chargement en cours</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Certains contenus ont été bloqués par le paramètre de lecture automatique</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fur/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fur/strings.xml new file mode 100644 index 0000000000..40ef2bdb1c --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fur/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menù</string> + <string name="mozac_clear_button_description">Nete</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protezion da lis spiis e je ative</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protezion da lis spiis e à blocât spiis</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protezion da lis spiis e je disativade par chest sît</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informazions sît</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Daûr a cjamâ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Cualchi contignût al è stât blocât de impostazion pe riproduzion automatiche</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fy-rNL/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fy-rNL/strings.xml new file mode 100644 index 0000000000..d00bd6b3c1 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-fy-rNL/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Wiskje</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Beskerming tsjin folgjen is ynskeakele</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Beskerming tsjin folgjen hat trackers blokkearre</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Beskerming tsjin folgjen is út foar dizze website</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Website-ynformaasje</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Lade</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Guon ynhâld is blokkearre troch de ynstelling foar automatysk ôfspyljen</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ga-rIE/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ga-rIE/strings.xml new file mode 100644 index 0000000000..ba4f41d62f --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ga-rIE/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Roghchlár</string> + <string name="mozac_clear_button_description">Bánaigh</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Tá Cosaint ar Lorgaireacht ar siúl</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Chuir Cosaint ar Lorgaireacht cosc ar lorgairí</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Tá Cosaint ar Lorgaireacht múchta don suíomh seo</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Eolas faoin suíomh</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Á lódáil</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gd/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gd/strings.xml new file mode 100644 index 0000000000..d694698b3d --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gd/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Clàr-taice</string> + <string name="mozac_clear_button_description">Falamhaich</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Tha an dìon o thracadh air</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Bhac gleus an dìon o thracadh tracaichean</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Tha an dìon o thracadh dheth air an làrach seo</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Fiosrachadh mun làrach</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Ga luchdadh</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Chaidh cuid dhen t-susbaint a bhacadh an cois roghainn na fèin-chluich</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gl/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gl/strings.xml new file mode 100644 index 0000000000..c5ca829d30 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gl/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Limpar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Protección contra o rastrexo activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">A protección contra o rastrexo bloqueou rastrexadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">A protección contra o rastrexo está desactivada para este sitio</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Información sobre o sitio</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">A cargar</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">A configuración de reprodución automática bloqueou algúns contidos</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gn/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gn/strings.xml new file mode 100644 index 0000000000..8926b42b0a --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gn/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Poravorã</string> + <string name="mozac_clear_button_description">Mopotĩ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Tapykuehoha ñemo’ã oñemyandy</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ñemo’ã jehekaha ojoko tapykuehohápe</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ñemo’ã jehekaha ndoikovéima ko tendápe g̃uarã</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Marandu tenda rehegua</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Henyhẽhína</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Ojejoko ndahetái tetepy ñemboheta ijeheguíva ñemboheko rupive</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gu-rIN/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gu-rIN/strings.xml new file mode 100644 index 0000000000..a6ff2d26b0 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-gu-rIN/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">મેનુ</string> + <string name="mozac_clear_button_description">સાફ કરો</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ટ્રેકિંગ સુરક્ષા ચાલુ છે</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ટ્રેકિંગ સુરક્ષા દ્વારા ટ્રેકર્સને અવરોધિત કરવામાં આવ્યા છે</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">આ સાઇટ માટે ટ્રેકિંગ સુરક્ષા બંધ છે</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">સાઇટ માહિતી</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">લોડ કરી રહ્યું છે</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hi-rIN/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hi-rIN/strings.xml new file mode 100644 index 0000000000..2d3c7d9b42 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hi-rIN/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">मेन्यू</string> + <string name="mozac_clear_button_description">साफ करें</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ट्रैकिंग सुरक्षा चालू है</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ट्रैकिंग सुरक्षा ने ट्रैकरों को अवरुद्ध कर दिया है</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">इस साइट के लिए ट्रैकिंग सुरक्षा बंद है</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">साइट सूचना</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">लोड हो रहा है</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hil/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hil/strings.xml new file mode 100644 index 0000000000..b02bc03a94 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hil/strings.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Klaro</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Loading</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hr/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hr/strings.xml new file mode 100644 index 0000000000..420583468b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hr/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Izbornik</string> + <string name="mozac_clear_button_description">Izbriši</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Zaštita od praćenja je uključena</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Zaštita od praćenja je blokirala programe za praćenje</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Zaštita od praćenja je isključena za ovu stranicu</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informacije o web mjestu</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Učitavanje</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Neki sadržaji su blokirani zbog postavki automatske reprodukcije</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hsb/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hsb/strings.xml new file mode 100644 index 0000000000..a11de2c512 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hsb/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meni</string> + <string name="mozac_clear_button_description">Wuprózdnić</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Slědowanski škit je zmóžnjeny</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Slědowanski škit je přesćěhowaki blokował</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Slědowanski škit je znjemóžnjeny za tute sydło</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Sydłowe informacije</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Začituje so</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Někajki wobsah je so přez wothrawanske nastajenje zablokował</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hu/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hu/strings.xml new file mode 100644 index 0000000000..cc8955eddc --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hu/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menü</string> + <string name="mozac_clear_button_description">Törlés</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Követés elleni védelem bekapcsolva</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">A követés elleni védelem nyomkövetőket blokkolt</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">A követés elleni védelem le van tiltva ezen az oldalon</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Oldalinformációk</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Betöltés</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Bizonyos tartalmakat letiltott az automatikus lejátszási beállítás</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hy-rAM/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hy-rAM/strings.xml new file mode 100644 index 0000000000..c6cfc9bd94 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-hy-rAM/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Ցանկ</string> + <string name="mozac_clear_button_description">Մաքրել</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Հետագծման պաշտպանությունը միաց. է</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Հետագծման պաշտպանությունն արգելափակել է հետագծիչներին</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Հետագծման պաշտպանությունը անջատված է այս կայքի համար</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Կայքի տեղեկությունները</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Բեռնում է</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Որոշ բովանդակություն արգելափակվել է ինքնանվագարկման կարգավորումով</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ia/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ia/strings.xml new file mode 100644 index 0000000000..1a929bb9ed --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ia/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Vacuar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Protection contra le traciamento active</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Le protection contra le traciamento ha blocate traciatores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Le protection contra le traciamento es disactivate pro iste sito.</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informationes del sito</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargamento</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Alcun contento ha essite blocate per le parametros del autoreproduction</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-in/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-in/strings.xml new file mode 100644 index 0000000000..2d7074c6ba --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-in/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Bersihkan</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Perlindungan Pelacakan aktif</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Perlindungan Pelacakan telah memblokir pelacak</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Perlindungan Pelacakan dinonaktifkan untuk situs ini</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informasi situs</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Memuat</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Beberapa konten telah diblokir dengan pengaturan putar-otomatis</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-is/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-is/strings.xml new file mode 100644 index 0000000000..a40c2a72d4 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-is/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Valmynd</string> + <string name="mozac_clear_button_description">Hreinsa</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Vörn gegn gagnasöfnun virk</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Vörn gegn gagnasöfnun hefur lokað á gagnasafnara</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Vörn gegn gagnasöfnun er ekki virk fyrir þetta svæði</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Upplýsingar um vefsvæði</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Hleður</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Lokað hefur verið sumt efni með stillingum fyrir sjálfvirka afspilun</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-it/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-it/strings.xml new file mode 100644 index 0000000000..a443d319ae --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-it/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Cancella</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protezione antitracciamento è attiva</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protezione antitracciamento ha bloccato contenuti traccianti</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protezione antitracciamento è disattivata per questo sito</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informazioni sito</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Caricamento…</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Alcuni contenuti sono stati bloccati dall’impostazione per la riproduzione automatica</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-iw/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-iw/strings.xml new file mode 100644 index 0000000000..22c7da4e39 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-iw/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">תפריט</string> + <string name="mozac_clear_button_description">ניקוי</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">הגנת מעקב פעילה</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">הגנת מעקב חסמה רכיבי מעקב</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">הגנת מעקב כבויה עבור אתר זה</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">פרטי האתר</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">בטעינה</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">תוכן מסויים נחסם על־ידי ההגדרה של הניגון האוטומטי</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ja/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ja/strings.xml new file mode 100644 index 0000000000..f1c8802dcd --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ja/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">メニュー</string> + <string name="mozac_clear_button_description">消去</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">トラッキング防止はオンです</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">トラッキング防止によりトラッカーをブロックしました</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">このサイトではトラッキング防止がオフです</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">サイト情報</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">読み込み中</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">一部のコンテンツは自動再生設定によってブロックされています</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ka/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ka/strings.xml new file mode 100644 index 0000000000..bf438a8ed7 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ka/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">მენიუ</string> + <string name="mozac_clear_button_description">გასუფთავება</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">თვალთვალისგან დაცვა ჩართულია</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">თვალთვალისგან დაცვამ შეზღუდა მეთვალყურეები</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">თვალთვალისგან დაცვა გამორთულია ამ საიტზე</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">საიტის მონაცემები</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">იტვირთება</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">ზოგიერთი მასალა შეიზღუდა თვითგაშვების პარამეტრებით</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kaa/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kaa/strings.xml new file mode 100644 index 0000000000..e4ad1073b0 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kaa/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menyu</string> + <string name="mozac_clear_button_description">Tazalaw</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Baqlaw qorǵanıwı qosılǵan</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Baqlaw qorǵanıw funkciyası trekkerlerdi blokladı</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Bul sayt ushın baqlaw qorǵanıwı óshirilgen</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Sayt maǵlıwmatları</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Júklenbekte</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Ayrım kontentler avtomatik sazlawlar tárepinen bloklanǵan</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kab/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kab/strings.xml new file mode 100644 index 0000000000..9ded9a9925 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kab/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Umuɣ</string> + <string name="mozac_clear_button_description">Sfeḍ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ammesten mgal aḍfaṛ yermed</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ammesten mgal aḍfaṛ yessewḥel ineḍfaṛen</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ammesten mgal aḍfaṛ insa akka tura i usmel-a</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Asmel n telɣut</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Asali</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Yettusewḥel kra n yigburen s aɣewwar n tɣuri tawurmant</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kk/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kk/strings.xml new file mode 100644 index 0000000000..b066e651a9 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kk/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Мәзір</string> + <string name="mozac_clear_button_description">Тазарту</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Бақылаудан қорғаныс іске қосулы</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Бақылаудан қорғаныс трекерлерді бұғаттады</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Бақылаудан қорғаныс бұл сайт үшін сөндірілген.</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Сайт ақпараты</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Жүктелуде</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Кейбір құрама автоойнату баптауларымен бұғатталған</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kmr/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kmr/strings.xml new file mode 100644 index 0000000000..29542924a0 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kmr/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menû</string> + <string name="mozac_clear_button_description">Paqij bike</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Parastina ji Şopandinê vekirî ye</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Parastina ji şopandinê şopdar asteng kirin</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Parastina ji şopadinê, ji bo vê malperê girtî ye</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Agahiyên malperê</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Tê barkirin</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Hin naverok ji aliyê eyara lêdana-otomatîk ve hatin astengkirin</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kn/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kn/strings.xml new file mode 100644 index 0000000000..ec07a646a6 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-kn/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">ಪರಿವಿಡಿ</string> + <string name="mozac_clear_button_description">ಅಳಿಸು</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ಜಾಡು ಇರಿಸುವಿಕೆ ಇಂದ ರಕ್ಷಣೆ ಶುರುವಾಗಿದೆ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ಟ್ರ್ಯಾಕಿಂಗ್ ಪ್ರೊಟೆಕ್ಷನ್ ಟ್ರ್ಯಾಕರ್ಗಳನ್ನು ನಿರ್ಬಂಧಿಸಿದೆ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ಈ ಸೈಟ್ಗಾಗಿ ಟ್ರ್ಯಾಕಿಂಗ್ ಪ್ರೊಟೆಕ್ಷನ್ ಆಫ್ ಆಗಿದೆ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">ತಾಣದ ಮಾಹಿತಿ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">ಲೋಡ್ ಆಗುತ್ತಿದೆ</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ko/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ko/strings.xml new file mode 100644 index 0000000000..365b186580 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ko/strings.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">메뉴</string> + <!-- Content description: For the clear URL text button. --> + <string name="mozac_clear_button_description">지우기</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">추적 방지 기능이 켜져 있음</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">추적 방지 기능이 추적기를 차단함</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">이 사이트에 추적 방지 기능이 꺼져 있음</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">사이트 정보</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">읽는 중</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">자동 재생 설정에 의해 일부 콘텐츠가 차단되었습니다.</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ldrtl/dimens.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ldrtl/dimens.xml new file mode 100644 index 0000000000..a36c7c4366 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ldrtl/dimens.xml @@ -0,0 +1,8 @@ +<?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/. --> +<resources> + <!-- DisplayToolbar --> + <dimen name="mozac_browser_toolbar_origin_padding_end">16dp</dimen> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lij/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lij/strings.xml new file mode 100644 index 0000000000..31fd025526 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lij/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menû</string> + <string name="mozac_clear_button_description">Scancella</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Proteçion anti-traciamento açeiza</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">A proteçion anti-traciamento a l\'à blocou di traciatoî</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">A proteçion anti-traciamento a l\'é asmortâ pe sto scito</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informaçioin do scito</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Carego</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lo/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lo/strings.xml new file mode 100644 index 0000000000..d9327a731d --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lo/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">ເມນູ</string> + <string name="mozac_clear_button_description">ລົບລ້າງ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ການປ້ອງກັນການຕິດຕາມກຳລັງເປີດຢູ່</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ການປ້ອງກັນການຕິດຕາມໄດ້ບັອກຕົວຕິດຕາມ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ການປ້ອງກັນການຕິດຕາມໄດ້ປິດສຳລັບເວັບໄຊທນີ້</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">ຂໍ້ມູນເວັບໄຊ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">ກຳລັງໂຫລດ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">ເນື້ອຫາບາງອັນຖືກບລັອກໂດຍການຕັ້ງຄ່າການຫຼີ້ນອັດຕະໂນມັດ</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lt/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lt/strings.xml new file mode 100644 index 0000000000..433b57f18e --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-lt/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meniu</string> + <string name="mozac_clear_button_description">Išvalyti</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Apsauga nuo stebėjimo įjungta</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Apsaugo nuo stebėjimo užblokavo stebėjimo elementus</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Apsauga nuo stebėjimo šioje svetainėje išjungta</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Svetainės informacija</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Įkeliama</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Dalį turinio užblokavo automatinio grojimo nuostatos</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-mix/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-mix/strings.xml new file mode 100644 index 0000000000..1636f653d5 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-mix/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Katsi</string> + <string name="mozac_clear_button_description">Ku^un</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Chika va^a ña sau</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Chika va^a ña sau</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Chika va^a ña sau nu pagina yo^o </string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Tu^tu sitio yo^o</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Sachuin</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Ma ku kunu ña ku reproducción automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ml/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ml/strings.xml new file mode 100644 index 0000000000..9f376452a4 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ml/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">മെനു</string> + <string name="mozac_clear_button_description">മായ്ക്കുക</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ട്രാക്കിങ്ങ് സംരക്ഷണം ഓൺ ആണ്</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ട്രാക്കിംഗ് സംരക്ഷണം ട്രാക്കറുകളെ തടഞ്ഞു</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ഈ സൈറ്റിന് ട്രാക്കിംഗ് പരിരക്ഷ ഇപ്പോൾ ഓഫാണ്</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">സൈറ്റ് വിവരങ്ങള്</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">ലഭ്യമാക്കുന്നു</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-mr/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-mr/strings.xml new file mode 100644 index 0000000000..5430ce7327 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-mr/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">मेनू</string> + <string name="mozac_clear_button_description">साफ करा</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ट्रॅकिंग संरक्षण चालू आहे</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ट्रॅकिंग संरक्षणने ट्रॅकर्स अवरोधित केले आहेत</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">या साइटसाठी ट्रॅकिंग संरक्षण बंद आहे</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">साईट माहिती</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">लोड होत आहे</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-my/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-my/strings.xml new file mode 100644 index 0000000000..006be61ee2 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-my/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">စာရင်း</string> + <string name="mozac_clear_button_description">ရှင်းလင်းပါ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ခြေရာခံကာကွယ်မှုကို ဖွင့်ထားသည်</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ခြေရာခံကာကွယ်မှုသည် ခြေရာခံသူများကိုပိတ်ဆို့ထားသည်။</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ဒီ site အတွက်အကာအကွယ်ပေးမှုကိုပိတ်ထားသည်</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">ဆိုက်အချက်အလက်</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">အလုပ်လုပ်နေတယ်</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">အလိုအလျောက်ဖွင့်ခြင်း ဆက်တင်မှ အကြောင်းအရာအချို့အား ပိတ်ထားသည်။</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nb-rNO/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nb-rNO/strings.xml new file mode 100644 index 0000000000..f9cb99c55d --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nb-rNO/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meny</string> + <string name="mozac_clear_button_description">Tøm</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Sporingsbeskyttelse er på</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Sporingsbeskyttelse har blokkert sporere</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Sporingsbeskyttelse er slått av for dette nettstedet</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informasjon om nettstedet</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Laster</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Noe av innholdet er blokkert av autoavspillings-innstillingene </string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ne-rNP/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ne-rNP/strings.xml new file mode 100644 index 0000000000..6a4341aafd --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ne-rNP/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">मेनु</string> + <string name="mozac_clear_button_description">खाली गर्नुहोस्</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ट्र्याकिंग संरक्षण सक्रिय छ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ट्र्याकिङ्ग सुरक्षाले ट्रयाकरहरुलाई रोकेको छ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">हाल यस साइटको लागी ट्रयाकिङ् सुरक्षा बन्द गरिएको छ।</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">साइट जानकारी</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">लोड हुँदैछ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">केहि सामग्री स्वतः प्ले सेटिङ्ग द्वारा रोकिएको छ</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nl/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nl/strings.xml new file mode 100644 index 0000000000..b6e9b732c1 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nl/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Wissen</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Bescherming tegen volgen is ingeschakeld</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Bescherming tegen volgen heeft trackers geblokkeerd</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Bescherming tegen volgen is uit voor deze website</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Website-informatie</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Laden</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Sommige inhoud is geblokkeerd door de instelling voor automatisch afspelen</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nn-rNO/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nn-rNO/strings.xml new file mode 100644 index 0000000000..c77b3373d0 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-nn-rNO/strings.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meny</string> + <!-- Content description: For the clear URL text button. --> + <string name="mozac_clear_button_description">Tøm</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Sporingsvern er på</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Sporingsvern har blokkert sporarar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Sporingsvern er slått av for denne nettstaden</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informasjon om nettstaden</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Lastar</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Noko innhald har vorte blokkert av autoavspelings-innstillingane</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-oc/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-oc/strings.xml new file mode 100644 index 0000000000..4cc824a694 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-oc/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menú</string> + <string name="mozac_clear_button_description">Escafar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La proteccion contra lo seguiment es activada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La proteccion contra lo seguiment a blocat de traçadors</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La proteccion contra lo seguiment es desactivada</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informacions del site</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargament</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Una part del contengut es estat blocat per la configuracion de la lectura automatica</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-or/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-or/strings.xml new file mode 100644 index 0000000000..9ca67e8959 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-or/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">ମେନୁ</string> + <string name="mozac_clear_button_description">ଖାଲି କରନ୍ତୁ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ଟ୍ରାକିଂ ସୁରକ୍ଷା ଚାଲୁଛି</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ଟ୍ରାକିଂ ସୁରକ୍ଷା ଟ୍ରାକରଗୁଡ଼ିକୁ ରୋକି ଦେଇଛି</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ଟ୍ରାକିଂ ସୁରକ୍ଷା ଏହି ସାଇଟ ପାଇଁ ବନ୍ଦ ଅଛି</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">ସାଇଟ ସୂଚନା</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">ଧାରଣ କରୁଅଛି</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pa-rIN/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pa-rIN/strings.xml new file mode 100644 index 0000000000..6a85a4ac94 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pa-rIN/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">ਮੇਨੂ</string> + <string name="mozac_clear_button_description">ਸਾਫ਼ ਕਰੋ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ਟਰੈਕ ਕਰਨ ਤੋਂ ਸੁਰੱਖਿਆ ਚਾਲੂ ਹੈ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ਟਰੈਕਿੰਗ ਸੁਰੱਖਿਆ ਟਰੈਕਾਂ ਉੱਤੇ ਪਾਬੰਦੀ ਲਗਾਉਂਦੀ ਹੈ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ਇਸ ਸਾਈਟ ਲਈ ਟਰੈਕਿੰਗ ਸੁਰੱਖਿਆ ਬੰਦ ਹੈ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">ਸਾਈਟ ਜਾਣਕਾਰੀ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">ਲੋਡ ਕੀਤਾ ਜਾ ਰਿਹਾ ਹੈ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">ਕੁਝ ਸਮੱਗਰੀ ਨੂੰ ਆਪੇ-ਪਲੇਅ ਦੀ ਸੈਟਿੰਗ ਰਾਹੀਂ ਪਾਬੰਦੀ ਲਾਈ ਹੈ</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pa-rPK/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pa-rPK/strings.xml new file mode 100644 index 0000000000..f48af403b2 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pa-rPK/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">مینو</string> + <string name="mozac_clear_button_description">صاف کرو</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ٹوہ لاوݨ توں سرکھیا چالو اے</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ٹوہ لاوݨ توں کجھ روک لاۓ گئے ہن</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ٹوہ لاوݨ توں سرکھیا بند ہو گیا</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">سائٹ جاݨکاری</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">لوڈ کیتا جا رہا اے</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">خود بخود چلݨ نال کجھ وستوآں روکے گئے</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pl/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pl/strings.xml new file mode 100644 index 0000000000..e3a08b4901 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pl/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Wyczyść</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ochrona przed śledzeniem jest włączona</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ochrona przed śledzeniem zablokowała elementy śledzące</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ochrona przed śledzeniem jest wyłączona na tej witrynie</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informacje o witrynie</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Wczytywanie</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Część treści została zablokowana przez ustawienie automatycznego odtwarzania</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pt-rBR/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pt-rBR/strings.xml new file mode 100644 index 0000000000..2eb5de65bb --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pt-rBR/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Limpar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Proteção contra rastreamento ativada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">A proteção contra rastreamento bloqueou rastreadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">A proteção contra rastreamento está desativada neste site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informações do site</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Carregando</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Algum conteúdo foi bloqueado pela configuração de reprodução automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pt-rPT/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pt-rPT/strings.xml new file mode 100644 index 0000000000..c3bbee9e20 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-pt-rPT/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Limpar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Proteção contra monitorização está ativada</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">A proteção contra a monitorização bloqueou rastreadores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">A proteção contra monitorização está desativada para este site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informação do site</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">A carregar</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Algum conteúdo foi bloqueado pela configuração de reprodução automática</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-rm/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-rm/strings.xml new file mode 100644 index 0000000000..667b07fb64 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-rm/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Stizzar</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">La protecziun cunter il fastizar è activa</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">La protecziun cunter il fastizar ha bloccà fastizaders</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">La protecziun cunter il fastizar è deactivada per questa website</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Infurmaziuns davart la website</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Chargiar</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Tscherts cuntegns èn vegnids bloccads dal parameter da la reproducziun automatica</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ro/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ro/strings.xml new file mode 100644 index 0000000000..72dee0c902 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ro/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meniu</string> + <string name="mozac_clear_button_description">Șterge</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Protecția împotriva urmăririi este activată</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Protecția împotriva urmăririi a blocat elementele de urmărire</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Protecția împotriva urmăririi este dezactivată pentru acest site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informații despre site</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Se încarcă</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ru/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ru/strings.xml new file mode 100644 index 0000000000..e80b24a880 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ru/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Меню</string> + <string name="mozac_clear_button_description">Очистить</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Защита от отслеживания включена</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Защита от отслеживания заблокировала трекеры</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Защита от отслеживания отключена для этого сайта</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Сведения о сайте</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Загрузка</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Некоторое содержимое было заблокировано настройками автовоспроизведения</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sat/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sat/strings.xml new file mode 100644 index 0000000000..a80afdc3a6 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sat/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">ᱢᱮᱱᱩ</string> + <string name="mozac_clear_button_description">ᱯᱷᱟᱨᱪᱟ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ᱯᱟᱸᱡᱟ ᱟᱰ ᱪᱟᱹᱞᱩ ᱢᱮᱱᱟᱜ-ᱟ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ᱯᱟᱸᱡᱟ ᱨᱚᱯᱷᱟ ᱯᱟᱧᱡᱟ ᱫᱟᱱᱟᱲ ᱠᱚ ᱟᱠᱚᱴ ᱠᱮᱜᱼᱟᱭ</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ᱯᱟᱸᱡᱟ ᱨᱚᱯᱷᱟ ᱵᱚᱸᱫᱚ ᱢᱮᱱᱟᱜ-ᱟ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">ᱥᱟᱭᱤᱴ ᱨᱮᱭᱟᱜ ᱠᱷᱚᱵᱚᱨ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">ᱞᱚᱰᱤᱝ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">ᱟᱡ ᱛᱮ ᱮᱛᱦᱚᱵ ᱥᱟᱡᱟᱣ ᱠᱚ ᱠᱷᱟᱹᱛᱤᱨ ᱛᱮ ᱠᱤᱪᱷᱤ ᱡᱤᱱᱤᱥ ᱠᱚ ᱵᱞᱚᱠ ᱠᱟᱱᱟ</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sc/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sc/strings.xml new file mode 100644 index 0000000000..5194a4765e --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sc/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menù</string> + <string name="mozac_clear_button_description">Isbòida</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">S’amparu contra sa sighidura est ativu</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">S’amparu contra sa sighidura at blocadu sighidores</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Sa protetzione contra sa sighidura est disativada pro custu situ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informatziones de su situ</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Carrighende</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-si/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-si/strings.xml new file mode 100644 index 0000000000..9f233e7acc --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-si/strings.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">වට්ටෝරුව</string> + <!-- Content description: For the clear URL text button. --> + <string name="mozac_clear_button_description">මකන්න</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ලුහුබැඳීමේ රැකවරණය සක්රියයි</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ලුහුබැඳීමේ රැකවරණයෙන් අවහිරයි</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">අඩවිය සඳහා ලුහුබැඳීමේ රැකවරණය අබලයි</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">අඩවියේ තොරතුරු</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">පූරණය වෙමින්</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">ස්වයං වාදන සැකසුම මගින් ඇතැම් අන්තර්ගත අවහිර කර ඇත</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sk/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sk/strings.xml new file mode 100644 index 0000000000..471775b209 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sk/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Ponuka</string> + <string name="mozac_clear_button_description">Vymazať</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ochrana pred sledovaním je zapnutá</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ochrana pred sledovaním zablokovala sledovacie prvky</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ochrana pred sledovaním je na tejto stránke vypnutá</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informácie o stránke</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Načítava sa</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Niektorý obsah bol zablokovaný nastavením automatického prehrávania</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-skr/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-skr/strings.xml new file mode 100644 index 0000000000..9a10e8b1c5 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-skr/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">مینیو</string> + <string name="mozac_clear_button_description">صاف کرو</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">سراغ کاری تحفظ چالو ہے</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">سراغ کاری تحفظ نے سُراغ رساں کوں بلاک کر ݙتا ہے</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">سراغ کاری تحفظ ایں سائٹ کیتے بند ہے</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">سائٹ ڄاݨکاری</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">لوڈ تھیندا پئے</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">کجھ مواد کوں آٹو پلے ترتیباں نال بلاک کر ݙتا ڳئے</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sl/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sl/strings.xml new file mode 100644 index 0000000000..5ae6ff80cb --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sl/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meni</string> + <string name="mozac_clear_button_description">Počisti</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Zaščita pred sledenjem je vključena</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Zaščita pred sledenjem je zavrnila sledilce</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Zaščita pred sledenjem je za to stran izključena</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Podatki o strani</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Nalaganje</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Nastavitev samodejnega predvajanja je zavrnila nekaj vsebine</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sq/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sq/strings.xml new file mode 100644 index 0000000000..21085e31c7 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sq/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Spastroje</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Mbrojtje Nga Gjurmimet është aktive</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Mbrojtja Nga Gjurmimet ka bllokuar gjurmues</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Mbrojtja Nga Gjurmimet është e çaktivizuar për këtë sajt</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Hollësi sajti</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Po ngarkohet</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Është bllokuar lëndë nga rregullimi i vetëluajtjes</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sr/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sr/strings.xml new file mode 100644 index 0000000000..5e70cab0c1 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sr/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Мени</string> + <string name="mozac_clear_button_description">Обриши</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Заштита од праћења је укључена</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Заштита од праћења је блокирала пратиоце</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Заштита од праћења је искључена за ову страницу</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Информације о страници</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Учитавање</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Неки садржај је блокиран због подешавања аутоматске репродукције</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-su/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-su/strings.xml new file mode 100644 index 0000000000..0d3478fd00 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-su/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Beresihan</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Kilung Palacakan keur hurung</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Kilung Palacakan geus meungpeuk palacak</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Kilung Palacakan pareum pikeun ieu loka</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Émbaran loka</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Ngamuat</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Sababaraha kontén dipeungpeuk ku setélan otoplay</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sv-rSE/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sv-rSE/strings.xml new file mode 100644 index 0000000000..66022b1088 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-sv-rSE/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Meny</string> + <string name="mozac_clear_button_description">Rensa</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Spårningsskydd är på</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Spårningsskydd har blockerat spårare</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Spårningsskydd är avstängt för den här webbplatsen</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Webbplatsinformation</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Laddar</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">En del innehåll har blockerats av inställningen för automatisk uppspelning</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-szl/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-szl/strings.xml new file mode 100644 index 0000000000..e6537d32b1 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-szl/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Myni</string> + <string name="mozac_clear_button_description">Wypucuj</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ôchrōna ôd śledzynio je załōnczōno</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ôchrōna ôd śledzynio szperuje śledzōnce elymynty</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Na tyj strōnie ôchrōna ôd śledzynio je wyłōnczōno</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informacyje ô strōnie</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Ladowanie</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Nasztalowanie autōmatycznego puszczanio zaszperowało kōnsek zawartości</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ta/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ta/strings.xml new file mode 100644 index 0000000000..9b6e317f6c --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ta/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">பட்டி</string> + <string name="mozac_clear_button_description">துடை</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">தடமறியல் பாதுகாப்பு இயக்கத்தில்</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">தடமறியல் பாதுகாப்பு தடமறிவான்களை முடக்கியது</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">தடமறியல் பாதுகாப்பு இத்தளத்தில் அணைக்கப்பட்டுள்ளது</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">தளத்தகவல்கள்</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">ஏற்றுகிறது</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">தன்னியக்க அமைப்பால் சில உள்ளடக்கம் தடுக்கப்பட்டுள்ளது</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-te/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-te/strings.xml new file mode 100644 index 0000000000..504c84b58d --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-te/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">మెనూ</string> + <string name="mozac_clear_button_description">తుడిచివేయి</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ట్రాకింగ్ సంరక్షణ చేతనంగా ఉంది</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ట్రాకింగ్ సంరక్షణ ట్రాకర్లను నిరోధించింది</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">ఈ సైటుకి ట్రాకింగ్ సంరక్షణ ఆపివేయబడింది</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">సైటు సమాచారం</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">వస్తోంది</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">ఆటోప్లే అమరిక ద్వారా కొంత కంటెంట్ నిరోధించబడింది</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tg/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tg/strings.xml new file mode 100644 index 0000000000..af36f39670 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tg/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Меню</string> + <string name="mozac_clear_button_description">Пок кардан</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Муҳофизат аз пайгирӣ фаъол аст</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Муҳофизат аз пайгирӣ васоити пайгириро манъ кард</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Муҳофизат аз пайгирӣ барои ин сомона хомӯш аст</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Маълумот дар бораи сомона</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Бор шуда истодааст</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Баъзеи муҳтаво тавассути танзими пахши худкор манъ карда шуд</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-th/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-th/strings.xml new file mode 100644 index 0000000000..55f06924fa --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-th/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">เมนู</string> + <string name="mozac_clear_button_description">ล้าง</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">การป้องกันการติดตามเปิดอยู่</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">การป้องกันการติดตามได้ปิดกั้นตัวติดตาม</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">การป้องกันการติดตามปิดอยู่สำหรับไซต์นี้</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">ข้อมูลไซต์</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">กำลังโหลด</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">เนื้อหาบางส่วนถูกปิดกั้นด้วยการตั้งค่าเล่นอัตโนมัติ</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tl/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tl/strings.xml new file mode 100644 index 0000000000..4e5e6b3300 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tl/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Burahin</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Nakabukas ang Tracking Protection</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">May naharang na mga tracker ang Tracking Protection</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Nakasara ang Tracking Protection sa site na ito</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Impormasyon sa site</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Naglo-load</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">May ilang content na naharang dahil sa autoplay setting</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tok/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tok/strings.xml new file mode 100644 index 0000000000..d9f3149d1b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tok/strings.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <string name="mozac_clear_button_description">o weka ale</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">lipu li ken ala lukin e sona sina</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">lipu li weka e lipu lukin</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">lipu ni la weka pi lipu lukin li lon ala</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">sona lipu</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">o awen</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tr/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tr/strings.xml new file mode 100644 index 0000000000..c7ede965df --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tr/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menü</string> + <string name="mozac_clear_button_description">Temizle</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">İzlenme koruması açık</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">İzlenme koruması, takip kodlarını engelledi</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Bu sitede izlenme koruması kapalı</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Site bilgileri</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Yükleniyor</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Otomatik oynatma ayarınız bazı içerikleri engelledi</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-trs/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-trs/strings.xml new file mode 100644 index 0000000000..ef86e00be9 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-trs/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menû</string> + <string name="mozac_clear_button_description">Nā\'nïn\'</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Sa narrán riña sa naga\'nāj a</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Narrán sa dugumî ñù\' riña nej sa naga\'nāj a</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Nitāj si \'iaj sun sa narán riña sa naga\'nāj a riña sitiô nan</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Nuguan\' huā rayi\'î sitiô nan</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Hìaj ayì\'ij</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Huā da’āj nej sa mà riñaj narán gi’iaj guendâ nù sa duguachín man’an sa ni’io’</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tt/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tt/strings.xml new file mode 100644 index 0000000000..3a463ee5cf --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tt/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Меню</string> + <string name="mozac_clear_button_description">Чистарту</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Күзәтелүдән Саклау кабызылган</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Күзәтүдән саклау күзәтеп торучыларны блоклады</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Бу сайт өчен Күзәтелүдән Саклау сүндерелгән</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Сайт турында мәгълүмат</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Йөкләү</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Автоуйнату көйләүләре аркасында кайбер эчтәлекләр блокланды</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tzm/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tzm/strings.xml new file mode 100644 index 0000000000..d451c5972c --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-tzm/strings.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Umuɣ</string> + <string name="mozac_clear_button_description">Sfeḍ</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Asmel n wasit</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Asali</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ug/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ug/strings.xml new file mode 100644 index 0000000000..59c98b81f7 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ug/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">تىزىملىك</string> + <string name="mozac_clear_button_description">تازىلاش</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">ئىزلاشتىن توسۇش ئىقتىدارى ئوچۇق</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">ئىز قوغلاش قوغدىغۇچىسى ئىز قوغلىغۇچىلارنى توستى</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">بۇ توربېكەتكە نىسبەتەن ئىزلاش ئېتىلگەن</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">بېكەت ئۇچۇرى</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">يۈكلەۋاتىدۇ</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">بەزى مەزمۇنلار «ئاپتوماتىك قويۇش» تەرىپىدىن توسۇلدى</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-uk/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-uk/strings.xml new file mode 100644 index 0000000000..66c444cdb2 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-uk/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Меню</string> + <string name="mozac_clear_button_description">Очистити</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Захист від стеження увімкнено</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Захист від стеження заблокував стеження</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Захист від стеження вимкнено для цього сайту</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Інформація про сайт</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Завантаження</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Деякий вміст заблоковано налаштуванням автовідтворення</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ur/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ur/strings.xml new file mode 100644 index 0000000000..78470d254c --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-ur/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">مینیو</string> + <string name="mozac_clear_button_description">صاف کریں</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">سراغ کاری تحفظ چالو ہے</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">سراغ کاری تحفظ نے سُراغ رساں کو مسدود کردیا ہے</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">سراغ کاری تحفظ اس سائٹ کے لیئے بند ہے</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">سائٹ کی معلومات</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">لوڈ کر رہا ہے</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">کچھ مشمولات کو آٹو پلے سیٹنگ سے مسدود کردیا گیا ہے</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-uz/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-uz/strings.xml new file mode 100644 index 0000000000..ec69af71f6 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-uz/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menyu</string> + <string name="mozac_clear_button_description">Tozalash</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Kuzatuvdan himoya yoniq</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Kuzatuvdan himoya funksiyasi kuzatuvchilarni blokladi</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Bu sayt uchun kuzatuvdan himoya funksiyasi oʻchirilgan</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Sayt maʼlumoti</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Yuklanmoqda</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Avtomatik ishga tushirish sozlamasi tufayli ayrim kontentlar bloklandi</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-vec/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-vec/strings.xml new file mode 100644 index 0000000000..15a625bcbc --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-vec/strings.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Pulisi</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ƚa protesion antitraciamento ƚa xe ativa</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ƚa protesion antitraciamento ƚa ga blocà contenudi tracianti</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ƚa protesion antitraciamento ƚa xe disativà par sto sito</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Informasioni sito</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Cargamento</string> + </resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-vi/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-vi/strings.xml new file mode 100644 index 0000000000..e64db6cc20 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-vi/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Dọn dẹp</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Trình chống theo dõi đang bật</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Trình chống theo dõi đã chặn trình theo dõi</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Đã tắt Trình chống theo dõi cho trang web này</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Thông tin về trang web</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Đang tải</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Một số nội dung đã bị chặn bởi cài đặt tự động phát</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-yo/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-yo/strings.xml new file mode 100644 index 0000000000..6f46be1286 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-yo/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Mẹ́nù</string> + <string name="mozac_clear_button_description">Paárẹ́</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Ìtọpinpin Ìdàábòbò wà ní títàn </string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Ìtọpinpin ìdàábòbò ti dènà atọpinpin</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Ìtọpinpin ìdàábòbò ti di pípa fún ìkànnì yìí</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Ìfitóniléti ìkànnì</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Ó ń gbáradì</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Àwọn àkòónú kan ti di dídénà ààtò ìfi-ara-ẹni-ṣisẹ́</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-zh-rCN/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-zh-rCN/strings.xml new file mode 100644 index 0000000000..a82dafc588 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-zh-rCN/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">菜单</string> + <string name="mozac_clear_button_description">清除</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">已开启跟踪保护</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">跟踪保护已拦截跟踪器</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">已关闭对此网站的跟踪保护</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">网站信息</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">正在加载</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">某些内容已被自动播放设置阻止</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values-zh-rTW/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-zh-rTW/strings.xml new file mode 100644 index 0000000000..09884c0633 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values-zh-rTW/strings.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">選單</string> + <string name="mozac_clear_button_description">清除</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">追蹤保護功能已開啟</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">追蹤保護功能已封鎖追蹤器</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">已關閉針對此網站的追蹤保護功能</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">網站資訊</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">載入中</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">某些內容已由自動播放設定封鎖</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values/attrs_browser_toolbar.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/attrs_browser_toolbar.xml new file mode 100644 index 0000000000..431bb6b080 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/attrs_browser_toolbar.xml @@ -0,0 +1,33 @@ +<?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/. --> + +<resources> + <declare-styleable name="BrowserToolbar"> + <attr name="browserToolbarHintColor" format="color"/> + <attr name="browserToolbarTextColor" format="color"/> + <attr name="browserToolbarTextSize" format="dimension"/> + <attr name="browserToolbarSecurityIcon" format="reference"/> + <attr name="browserToolbarInsecureColor" format="color"/> + <attr name="browserToolbarSecureColor" format="color"/> + <attr name="browserToolbarMenuColor" format="color"/> + <attr name="browserToolbarSuggestionBackgroundColor" format="color" /> + <attr name="browserToolbarSuggestionForegroundColor" format="color" /> + <attr name="browserToolbarClearColor" format="color"/> + <attr name="browserToolbarTrackingProtectionAndSecurityIndicatorSeparatorColor" format="color"/> + <attr name="browserToolbarFadingEdgeSize" format="dimension" /> + <attr name="browserToolbarProgressBarGravity"> + <enum name="bottom" value="0" /> + <enum name="top" value="1" /> + </attr> + </declare-styleable> + + <declare-styleable name="BrowserToolbarSiteSecurityState"> + <attr name="state_site_secure" format="boolean"/> + </declare-styleable> + + <declare-styleable name="ActionContainer"> + <attr name="actionContainerItemSize" format="dimension" /> + </declare-styleable> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values/dimens.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/dimens.xml new file mode 100644 index 0000000000..23fd755686 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/dimens.xml @@ -0,0 +1,31 @@ +<?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/. --> +<resources> + <dimen name="mozac_browser_toolbar_default_toolbar_height">56dp</dimen> + + <!-- DisplayToolbar --> + <dimen name="mozac_browser_toolbar_progress_bar_height">3dp</dimen> + <dimen name="mozac_browser_toolbar_icons_separator_height">24dp</dimen> + <dimen name="mozac_browser_toolbar_icons_separator_width">1dp</dimen> + <dimen name="mozac_browser_toolbar_page_action_separator_width">4dp</dimen> + <dimen name="mozac_browser_toolbar_url_fading_edge_size">24dp</dimen> + <dimen name="mozac_browser_toolbar_icon_padding">12dp</dimen> + <dimen name="mozac_browser_toolbar_icon_size">24dp</dimen> + <dimen name="mozac_browser_toolbar_menu_padding">16dp</dimen> + <dimen name="mozac_browser_toolbar_origin_padding_end">0dp</dimen> + + <!-- EditToolbar --> + <dimen name="mozac_browser_toolbar_url_horizontal_padding">8dp</dimen> + <dimen name="mozac_browser_toolbar_url_vertical_padding">0dp</dimen> + <dimen name="mozac_browser_toolbar_url_gone_margin_end">8dp</dimen> + <dimen name="mozac_browser_toolbar_cancel_padding">16dp</dimen> + + <dimen name="mozac_browser_toolbar_url_textsize">15sp</dimen> + <dimen name="mozac_browser_toolbar_title_textsize">15sp</dimen> + <dimen name="mozac_browser_toolbar_url_with_title_textsize">12sp</dimen> + + <dimen name="mozac_browser_toolbar_pageaction_size">48dp</dimen> + <dimen name="mozac_browser_toolbar_browseraction_size">48dp</dimen> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values/ids.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/ids.xml new file mode 100644 index 0000000000..20e28a0c58 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/ids.xml @@ -0,0 +1,8 @@ +<?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/. --> +<resources> + <item name="mozac_browser_toolbar_title_view" type="id"/> + <item name="mozac_browser_toolbar_url_view" type="id"/> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/main/res/values/strings.xml b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/strings.xml new file mode 100644 index 0000000000..3c2d7dcf1b --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/main/res/values/strings.xml @@ -0,0 +1,21 @@ +<?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/. --> +<resources> + <!-- Content description (not visible, for screen readers etc.): Description for the overflow menu button in the browser toolbar. --> + <string name="mozac_browser_toolbar_menu_button">Menu</string> + <string name="mozac_clear_button_description">Clear</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, but none trackers have been blocked or detected. --> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_no_trackers_blocked">Tracking Protection is on</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection enabled, and trackers have been blocked or detected.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_on_trackers_blocked1">Tracking Protection has blocked trackers</string> + <!-- Content description: For the tracking protection toolbar icon, it is set when the site has tracking protection disabled.--> + <string name="mozac_browser_toolbar_content_description_tracking_protection_off_for_a_site1">Tracking Protection is off for this site</string> + <!-- Content description: For the site security information icon (the site security icon).--> + <string name="mozac_browser_toolbar_content_description_site_info">Site information</string> + <!-- Announcement made by the screen reader when the progress bar is shown and a page is loading --> + <string name="mozac_browser_toolbar_progress_loading">Loading</string> + <!-- Content description: For the autoplay toolbar icon, it is set when the auto play permission is blocking content playing.--> + <string name="mozac_browser_toolbar_content_description_autoplay_blocked">Some content has been blocked by the autoplay setting</string> +</resources> diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/AsyncFilterListenerTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/AsyncFilterListenerTest.kt new file mode 100644 index 0000000000..e9af1506d1 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/AsyncFilterListenerTest.kt @@ -0,0 +1,350 @@ +/* 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 mozilla.components.browser.toolbar + +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.asCoroutineDispatcher +import kotlinx.coroutines.async +import kotlinx.coroutines.cancelChildren +import kotlinx.coroutines.isActive +import kotlinx.coroutines.test.runTest +import mozilla.components.concept.toolbar.AutocompleteDelegate +import mozilla.components.concept.toolbar.AutocompleteResult +import mozilla.components.support.test.mock +import mozilla.components.ui.autocomplete.AutocompleteView +import mozilla.components.ui.autocomplete.InlineAutocompleteEditText +import org.junit.Assert.assertEquals +import org.junit.Assert.fail +import org.junit.Test +import org.mockito.Mockito.atLeast +import org.mockito.Mockito.atLeastOnce +import org.mockito.Mockito.never +import org.mockito.Mockito.spy +import org.mockito.Mockito.verify +import java.util.concurrent.Executor + +@ExperimentalCoroutinesApi // for runTest +class AsyncFilterListenerTest { + @Test + fun `filter listener cancels prior filter executions`() = runTest { + val urlView: AutocompleteView = mock() + val filter: suspend (String, AutocompleteDelegate) -> Unit = mock() + + val dispatcher = spy( + Executor { + it.run() + }.asCoroutineDispatcher(), + ) + + val listener = AsyncFilterListener(urlView, dispatcher, filter) + + verify(dispatcher, never()).cancelChildren() + + listener("test") + + verify(dispatcher, atLeastOnce()).cancelChildren() + } + + @Test + fun `filter delegate checks for cancellations before it runs, passes results to autocomplete view`() = runTest { + var filter: suspend (String, AutocompleteDelegate) -> Unit = { query, delegate -> + assertEquals("test", query) + delegate.applyAutocompleteResult( + AutocompleteResult( + input = "test", + text = "testing.com", + url = "http://www.testing.com", + source = "asyncTest", + totalItems = 1, + ), + ) + } + + val dispatcher = spy( + Executor { + it.run() + }.asCoroutineDispatcher(), + ) + + var didCallApply = 0 + + var listener = AsyncFilterListener( + object : AutocompleteView { + override val originalText: String = "test" + + override fun applyAutocompleteResult(result: InlineAutocompleteEditText.AutocompleteResult) { + assertEquals("asyncTest", result.source) + assertEquals("testing.com", result.text) + assertEquals(1, result.totalItems) + didCallApply += 1 + } + + override fun noAutocompleteResult() { + fail() + } + }, + dispatcher, + filter, + this.coroutineContext, + ) + + verify(dispatcher, never()).isActive + + async { listener("test") }.await() + + // Checked if parent scope is still active. Somehow, each access to 'isActive' registers as 4? + verify(dispatcher, atLeast(4)).isActive + // Passed the result to the view's apply method exactly once. + assertEquals(1, didCallApply) + + filter = { query, delegate -> + assertEquals("moz", query) + delegate.applyAutocompleteResult( + AutocompleteResult( + input = "moz", + text = "mozilla.com", + url = "http://www.mozilla.com", + source = "asyncTestTwo", + totalItems = 2, + ), + ) + } + listener = AsyncFilterListener( + object : AutocompleteView { + override val originalText: String = "moz" + + override fun applyAutocompleteResult(result: InlineAutocompleteEditText.AutocompleteResult) { + assertEquals("asyncTestTwo", result.source) + assertEquals("mozilla.com", result.text) + assertEquals(2, result.totalItems) + didCallApply += 1 + } + + override fun noAutocompleteResult() { + fail() + } + }, + dispatcher, + filter, + this.coroutineContext, + ) + + async { listener("moz") }.await() + + verify(dispatcher, atLeast(8)).isActive + assertEquals(2, didCallApply) + } + + @Test + fun `delegate discards stale results`() = runTest { + val filter: suspend (String, AutocompleteDelegate) -> Unit = { query, delegate -> + assertEquals("test", query) + delegate.applyAutocompleteResult( + AutocompleteResult( + input = "test", + text = "testing.com", + url = "http://www.testing.com", + source = "asyncTest", + totalItems = 1, + ), + ) + } + + val dispatcher = Executor { + it.run() + }.asCoroutineDispatcher() + + val listener = AsyncFilterListener( + object : AutocompleteView { + override val originalText: String = "nolongertest" + + override fun applyAutocompleteResult(result: InlineAutocompleteEditText.AutocompleteResult) { + fail() + } + + override fun noAutocompleteResult() { + fail() + } + }, + dispatcher, + filter, + this.coroutineContext, + ) + + listener("test") + } + + @Test + fun `delegate discards stale lack of results`() = runTest { + val filter: suspend (String, AutocompleteDelegate) -> Unit = { query, delegate -> + assertEquals("test", query) + delegate.noAutocompleteResult("test") + } + + val dispatcher = Executor { + it.run() + }.asCoroutineDispatcher() + + val listener = AsyncFilterListener( + object : AutocompleteView { + override val originalText: String = "nolongertest" + + override fun applyAutocompleteResult(result: InlineAutocompleteEditText.AutocompleteResult) { + fail() + } + + override fun noAutocompleteResult() { + fail() + } + }, + dispatcher, + filter, + this.coroutineContext, + ) + + listener("test") + } + + @Test + fun `delegate passes through non-stale lack of results`() = runTest { + val filter: suspend (String, AutocompleteDelegate) -> Unit = { query, delegate -> + assertEquals("test", query) + delegate.noAutocompleteResult("test") + } + + val dispatcher = Executor { + it.run() + }.asCoroutineDispatcher() + + var calledNoResults = 0 + val listener = AsyncFilterListener( + object : AutocompleteView { + override val originalText: String = "test" + + override fun applyAutocompleteResult(result: InlineAutocompleteEditText.AutocompleteResult) { + fail() + } + + override fun noAutocompleteResult() { + calledNoResults += 1 + } + }, + dispatcher, + filter, + this.coroutineContext, + ) + + async { listener("test") }.await() + + assertEquals(1, calledNoResults) + } + + @Test + fun `delegate discards results if parent scope was cancelled`() = runTest { + var preservedDelegate: AutocompleteDelegate? = null + + val filter: suspend (String, AutocompleteDelegate) -> Unit = { query, delegate -> + preservedDelegate = delegate + assertEquals("test", query) + delegate.applyAutocompleteResult( + AutocompleteResult( + input = "test", + text = "testing.com", + url = "http://www.testing.com", + source = "asyncTest", + totalItems = 1, + ), + ) + } + + val dispatcher = Executor { + it.run() + }.asCoroutineDispatcher() + + var calledResults = 0 + val listener = AsyncFilterListener( + object : AutocompleteView { + override val originalText: String = "test" + + override fun applyAutocompleteResult(result: InlineAutocompleteEditText.AutocompleteResult) { + assertEquals("asyncTest", result.source) + assertEquals("testing.com", result.text) + assertEquals(1, result.totalItems) + calledResults += 1 + } + + override fun noAutocompleteResult() { + fail() + } + }, + dispatcher, + filter, + this.coroutineContext, + ) + + async { + listener("test") + listener("test") + }.await() + + // This result application should be discarded, because scope has been cancelled by the second + // 'listener' call above. + preservedDelegate!!.applyAutocompleteResult( + AutocompleteResult( + input = "test", + text = "testing.com", + url = "http://www.testing.com", + source = "asyncCancelled", + totalItems = 1, + ), + ) + + assertEquals(2, calledResults) + } + + @Test + fun `delegate discards lack of results if parent scope was cancelled`() = runTest { + var preservedDelegate: AutocompleteDelegate? = null + + val filter: suspend (String, AutocompleteDelegate) -> Unit = { query, delegate -> + preservedDelegate = delegate + assertEquals("test", query) + delegate.noAutocompleteResult("test") + } + + val dispatcher = Executor { + it.run() + }.asCoroutineDispatcher() + + var calledResults = 0 + val listener = AsyncFilterListener( + object : AutocompleteView { + override val originalText: String = "test" + + override fun applyAutocompleteResult(result: InlineAutocompleteEditText.AutocompleteResult) { + fail() + } + + override fun noAutocompleteResult() { + calledResults += 1 + } + }, + dispatcher, + filter, + this.coroutineContext, + ) + + async { + listener("test") + listener("test") + }.await() + + // This "no results" call should be discarded, because scope has been cancelled by the second + // 'listener' call above. + preservedDelegate!!.noAutocompleteResult("test") + + assertEquals(2, calledResults) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/BrowserToolbarTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/BrowserToolbarTest.kt new file mode 100644 index 0000000000..3e535faa96 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/BrowserToolbarTest.kt @@ -0,0 +1,1044 @@ +/* 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 mozilla.components.browser.toolbar + +import android.content.Context +import android.graphics.drawable.Drawable +import android.util.AttributeSet +import android.view.View +import android.view.ViewParent +import android.view.accessibility.AccessibilityEvent +import android.view.accessibility.AccessibilityManager +import android.widget.ImageButton +import androidx.coordinatorlayout.widget.CoordinatorLayout +import androidx.core.view.inputmethod.EditorInfoCompat +import androidx.core.view.isGone +import androidx.core.view.isVisible +import androidx.test.ext.junit.runners.AndroidJUnit4 +import mozilla.components.browser.toolbar.display.DisplayToolbar +import mozilla.components.browser.toolbar.display.DisplayToolbarViews +import mozilla.components.browser.toolbar.display.MenuButton +import mozilla.components.browser.toolbar.edit.EditToolbar +import mozilla.components.concept.toolbar.AutocompleteDelegate +import mozilla.components.concept.toolbar.Toolbar +import mozilla.components.concept.toolbar.Toolbar.SiteSecurity +import mozilla.components.concept.toolbar.Toolbar.SiteTrackingProtection +import mozilla.components.support.ktx.kotlin.MAX_URI_LENGTH +import mozilla.components.support.test.argumentCaptor +import mozilla.components.support.test.mock +import mozilla.components.support.test.robolectric.testContext +import mozilla.components.support.test.whenever +import mozilla.components.ui.widgets.behavior.EngineViewScrollingBehavior +import mozilla.components.ui.widgets.behavior.ViewPosition +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNotEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentCaptor +import org.mockito.ArgumentMatchers +import org.mockito.Mockito.any +import org.mockito.Mockito.mock +import org.mockito.Mockito.never +import org.mockito.Mockito.spy +import org.mockito.Mockito.times +import org.mockito.Mockito.verify +import org.mockito.Mockito.verifyNoMoreInteractions +import org.mockito.Mockito.`when` +import org.robolectric.Robolectric +import org.robolectric.Shadows.shadowOf + +@RunWith(AndroidJUnit4::class) +class BrowserToolbarTest { + + @Test + fun `display toolbar is visible by default`() { + val toolbar = BrowserToolbar(testContext) + assertTrue(toolbar.display.rootView.visibility == View.VISIBLE) + assertTrue(toolbar.edit.rootView.visibility == View.GONE) + } + + @Test + fun `calling editMode() makes edit toolbar visible`() { + val toolbar = BrowserToolbar(testContext) + assertTrue(toolbar.display.rootView.visibility == View.VISIBLE) + assertTrue(toolbar.edit.rootView.visibility == View.GONE) + + toolbar.editMode() + + assertTrue(toolbar.display.rootView.visibility == View.GONE) + assertTrue(toolbar.edit.rootView.visibility == View.VISIBLE) + } + + @Test + fun `calling displayMode() makes display toolbar visible`() { + val toolbar = BrowserToolbar(testContext) + toolbar.editMode() + + assertTrue(toolbar.display.rootView.visibility == View.GONE) + assertTrue(toolbar.edit.rootView.visibility == View.VISIBLE) + + toolbar.displayMode() + + assertTrue(toolbar.display.rootView.visibility == View.VISIBLE) + assertTrue(toolbar.edit.rootView.visibility == View.GONE) + } + + @Test + fun `back presses will not be handled in display mode`() { + val toolbar = BrowserToolbar(testContext) + toolbar.displayMode() + + assertFalse(toolbar.onBackPressed()) + + assertTrue(toolbar.display.rootView.visibility == View.VISIBLE) + assertTrue(toolbar.edit.rootView.visibility == View.GONE) + } + + @Test + fun `back presses will switch from edit mode to display mode`() { + val toolbar = BrowserToolbar(testContext) + toolbar.editMode() + + assertTrue(toolbar.display.rootView.visibility == View.GONE) + assertTrue(toolbar.edit.rootView.visibility == View.VISIBLE) + + assertTrue(toolbar.onBackPressed()) + + assertTrue(toolbar.display.rootView.visibility == View.VISIBLE) + assertTrue(toolbar.edit.rootView.visibility == View.GONE) + } + + @Test + fun `displayUrl will be forwarded to display toolbar immediately`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + val edit: EditToolbar = mock() + + toolbar.display = display + toolbar.edit = edit + + toolbar.url = "https://www.mozilla.org" + + verify(display).url = "https://www.mozilla.org" + verify(edit, never()).updateUrl(ArgumentMatchers.anyString(), ArgumentMatchers.anyBoolean(), ArgumentMatchers.anyBoolean(), ArgumentMatchers.anyBoolean()) + } + + @Test + fun `displayUrl is truncated to prevent extreme cases from slowing down the UI`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + val edit: EditToolbar = mock() + + toolbar.display = display + toolbar.edit = edit + + toolbar.url = "a".repeat(MAX_URI_LENGTH + 1) + toolbar.url = "b".repeat(MAX_URI_LENGTH) + toolbar.url = "c".repeat(MAX_URI_LENGTH - 1) + + val urlCaptor = argumentCaptor<String>() + verify(display, times(3)).url = urlCaptor.capture() + + val capturedValues = urlCaptor.allValues + // Value was too long and should've been truncated + assertEquals("a".repeat(MAX_URI_LENGTH), capturedValues[0]) + // Values should be the same as before + assertEquals("b".repeat(MAX_URI_LENGTH), capturedValues[1]) + assertEquals("c".repeat(MAX_URI_LENGTH - 1), capturedValues[2]) + } + + @Test + fun `searchTerms is truncated in case it is greater than MAX_URI_LENGTH`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit = spy(toolbar.edit) + toolbar.editMode() + + toolbar.setSearchTerms("a".repeat(MAX_URI_LENGTH + 1)) + + // Value was too long and should've been truncated + assertEquals(toolbar.searchTerms.length, MAX_URI_LENGTH) + verify(toolbar.edit).editSuggestion("a".repeat(MAX_URI_LENGTH)) + } + + @Test + fun `searchTerms is not truncated in case it is equal or less than MAX_URI_LENGTH`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit = spy(toolbar.edit) + toolbar.editMode() + + toolbar.setSearchTerms("b".repeat(MAX_URI_LENGTH)) + + // Value should be the same as before + assertEquals(toolbar.searchTerms.length, MAX_URI_LENGTH) + verify(toolbar.edit).editSuggestion("b".repeat(MAX_URI_LENGTH)) + + toolbar.setSearchTerms("c".repeat(MAX_URI_LENGTH - 1)) + + // Value should be the same as before + assertEquals(toolbar.searchTerms.length, MAX_URI_LENGTH - 1) + verify(toolbar.edit).editSuggestion("c".repeat(MAX_URI_LENGTH - 1)) + } + + @Test + fun `last URL will be forwarded to edit toolbar when switching mode`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit = spy(toolbar.edit) + + toolbar.url = "https://www.mozilla.org" + verify(toolbar.edit, never()).updateUrl("https://www.mozilla.org", false) + + toolbar.editMode() + + verify(toolbar.edit).updateUrl("https://www.mozilla.org", false) + } + + @Test + fun `displayProgress will send accessibility events`() { + val toolbar = BrowserToolbar(testContext) + val root = mock(ViewParent::class.java) + shadowOf(toolbar).setMyParent(root) + `when`(root.requestSendAccessibilityEvent(any(), any())).thenReturn(false) + + val shadowAccessibilityManager = shadowOf(testContext.getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager) + shadowAccessibilityManager.setEnabled(true) + shadowAccessibilityManager.setTouchExplorationEnabled(true) + + toolbar.displayProgress(10) + toolbar.displayProgress(50) + toolbar.displayProgress(100) + + // make sure multiple calls to 100% does not trigger "loading" announcement + toolbar.displayProgress(100) + + val captor = ArgumentCaptor.forClass(AccessibilityEvent::class.java) + + verify(root, times(5)).requestSendAccessibilityEvent(any(), captor.capture()) + + assertEquals(AccessibilityEvent.TYPE_ANNOUNCEMENT, captor.allValues[0].eventType) + assertEquals(testContext.getString(R.string.mozac_browser_toolbar_progress_loading), captor.allValues[0].text[0]) + + assertEquals(AccessibilityEvent.TYPE_VIEW_SCROLLED, captor.allValues[1].eventType) + assertEquals(10, captor.allValues[1].scrollY) + assertEquals(100, captor.allValues[1].maxScrollY) + + assertEquals(AccessibilityEvent.TYPE_VIEW_SCROLLED, captor.allValues[2].eventType) + assertEquals(50, captor.allValues[2].scrollY) + assertEquals(100, captor.allValues[2].maxScrollY) + + assertEquals(AccessibilityEvent.TYPE_VIEW_SCROLLED, captor.allValues[3].eventType) + assertEquals(100, captor.allValues[3].scrollY) + assertEquals(100, captor.allValues[3].maxScrollY) + + assertEquals(AccessibilityEvent.TYPE_VIEW_SCROLLED, captor.allValues[4].eventType) + assertEquals(100, captor.allValues[3].scrollY) + assertEquals(100, captor.allValues[3].maxScrollY) + } + + @Test + fun `displayProgress will not send send view scrolled accessibility events if touch exploration is disabled`() { + val toolbar = BrowserToolbar(testContext) + val root = mock(ViewParent::class.java) + shadowOf(toolbar).setMyParent(root) + `when`(root.requestSendAccessibilityEvent(any(), any())).thenReturn(false) + + val shadowAccessibilityManager = shadowOf(testContext.getSystemService(Context.ACCESSIBILITY_SERVICE) as AccessibilityManager) + shadowAccessibilityManager.setEnabled(true) + shadowAccessibilityManager.setTouchExplorationEnabled(false) + + toolbar.displayProgress(10) + toolbar.displayProgress(50) + toolbar.displayProgress(100) + + // make sure multiple calls to 100% does not trigger "loading" announcement + toolbar.displayProgress(100) + + val captor = ArgumentCaptor.forClass(AccessibilityEvent::class.java) + + verify(root, times(1)).requestSendAccessibilityEvent(any(), captor.capture()) + + assertEquals(AccessibilityEvent.TYPE_ANNOUNCEMENT, captor.allValues[0].eventType) + assertEquals(testContext.getString(R.string.mozac_browser_toolbar_progress_loading), captor.allValues[0].text[0]) + } + + @Test + fun `displayProgress will be forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + + toolbar.display = display + + toolbar.displayProgress(10) + toolbar.displayProgress(50) + toolbar.displayProgress(75) + toolbar.displayProgress(100) + + verify(display).updateProgress(10) + verify(display).updateProgress(50) + verify(display).updateProgress(75) + verify(display).updateProgress(100) + + verifyNoMoreInteractions(display) + } + + @Test + fun `internal onUrlEntered callback will be forwarded to urlChangeListener`() { + val toolbar = BrowserToolbar(testContext) + + val mockedListener = object { + var called = false + var url: String? = null + + fun invoke(url: String): Boolean { + this.called = true + this.url = url + return true + } + } + + toolbar.setOnUrlCommitListener(mockedListener::invoke) + toolbar.onUrlEntered("https://www.mozilla.org") + + assertTrue(mockedListener.called) + assertEquals("https://www.mozilla.org", mockedListener.url) + } + + /* + @Test + fun `internal onEditCancelled callback will be forwarded to editListener`() { + val toolbar = BrowserToolbar(testContext) + val listener: Toolbar.OnEditListener = mock() + toolbar.setOnEditListener(listener) + assertEquals(toolbar.edit.editListener, listener) + + toolbar.edit.views.url.onKeyPreIme( + KeyEvent.KEYCODE_BACK, + KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_BACK) + ) + verify(listener, times(1)).onCancelEditing() + }*/ + + @Test + fun `toolbar measure will use full width and fixed 56dp height`() { + val toolbar = BrowserToolbar(testContext) + + val widthSpec = View.MeasureSpec.makeMeasureSpec(1024, View.MeasureSpec.AT_MOST) + val heightSpec = View.MeasureSpec.makeMeasureSpec(800, View.MeasureSpec.AT_MOST) + + toolbar.measure(widthSpec, heightSpec) + + assertEquals(1024, toolbar.measuredWidth) + assertEquals(56, toolbar.measuredHeight) + } + + @Test + fun `toolbar will use provided height with EXACTLY measure spec`() { + val toolbar = BrowserToolbar(testContext) + + val widthSpec = View.MeasureSpec.makeMeasureSpec(1024, View.MeasureSpec.AT_MOST) + val heightSpec = View.MeasureSpec.makeMeasureSpec(800, View.MeasureSpec.EXACTLY) + + toolbar.measure(widthSpec, heightSpec) + + assertEquals(1024, toolbar.measuredWidth) + assertEquals(800, toolbar.measuredHeight) + } + + @Test + fun `display and edit toolbar will use full size of browser toolbar`() { + val toolbar = BrowserToolbar(testContext) + + assertEquals(0, toolbar.display.rootView.measuredWidth) + assertEquals(0, toolbar.display.rootView.measuredHeight) + assertEquals(0, toolbar.edit.rootView.measuredWidth) + assertEquals(0, toolbar.edit.rootView.measuredHeight) + + val widthSpec = View.MeasureSpec.makeMeasureSpec(1024, View.MeasureSpec.AT_MOST) + val heightSpec = View.MeasureSpec.makeMeasureSpec(800, View.MeasureSpec.AT_MOST) + + toolbar.measure(widthSpec, heightSpec) + + assertEquals(1024, toolbar.display.rootView.measuredWidth) + assertEquals(56, toolbar.display.rootView.measuredHeight) + assertEquals(1024, toolbar.edit.rootView.measuredWidth) + assertEquals(56, toolbar.edit.rootView.measuredHeight) + } + + @Test + fun `toolbar will switch back to display mode after an URL has been entered`() { + val toolbar = BrowserToolbar(testContext) + toolbar.editMode() + + assertTrue(toolbar.display.rootView.visibility == View.GONE) + assertTrue(toolbar.edit.rootView.visibility == View.VISIBLE) + + toolbar.onUrlEntered("https://www.mozilla.org") + + assertTrue(toolbar.display.rootView.visibility == View.VISIBLE) + assertTrue(toolbar.edit.rootView.visibility == View.GONE) + } + + @Test + fun `toolbar will switch back to display mode if URL commit listener returns true`() { + val toolbar = BrowserToolbar(testContext) + toolbar.setOnUrlCommitListener { true } + toolbar.editMode() + + assertTrue(toolbar.display.rootView.isGone) + assertTrue(toolbar.edit.rootView.isVisible) + + toolbar.onUrlEntered("https://www.mozilla.org") + + assertTrue(toolbar.display.rootView.isVisible) + assertTrue(toolbar.edit.rootView.isGone) + } + + @Test + fun `toolbar will stay in edit mode if URL commit listener returns false`() { + val toolbar = BrowserToolbar(testContext) + toolbar.setOnUrlCommitListener { false } + toolbar.editMode() + + assertTrue(toolbar.display.rootView.isGone) + assertTrue(toolbar.edit.rootView.isVisible) + + toolbar.onUrlEntered("https://www.mozilla.org") + + assertTrue(toolbar.display.rootView.isGone) + assertTrue(toolbar.edit.rootView.isVisible) + } + + @Test + fun `add browser action will be forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + + toolbar.display = display + + val action = BrowserToolbar.Button(mock(), "Hello") { + // Do nothing + } + + toolbar.addBrowserAction(action) + + verify(display).addBrowserAction(action) + } + + @Test + fun `remove browser action will be forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + + toolbar.display = display + + val action = BrowserToolbar.Button(mock(), "Hello") { + // Do nothing + } + + toolbar.removeBrowserAction(action) + + verify(display).removeBrowserAction(action) + } + + @Test + fun `remove navigation action will be forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + + toolbar.display = display + + val action = BrowserToolbar.Button(mock(), "Hello") { + // Do nothing + } + + toolbar.removeNavigationAction(action) + + verify(display).removeNavigationAction(action) + } + + @Test + fun `remove page action will be forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + + toolbar.display = display + + val action = BrowserToolbar.Button(mock(), "Hello") { + // Do nothing + } + + toolbar.removePageAction(action) + + verify(display).removePageAction(action) + } + + @Test + fun `add page action will be forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + + val display: DisplayToolbar = mock() + + toolbar.display = display + + val action = BrowserToolbar.Button(mock(), "World") { + // Do nothing + } + + toolbar.addPageAction(action) + + verify(display).addPageAction(action) + } + + @Test + fun `add edit action start will be forwarded to edit toolbar`() { + val toolbar = BrowserToolbar(testContext) + + val edit: EditToolbar = mock() + toolbar.edit = edit + + val action = BrowserToolbar.Button(mock(), "QR code scanner") { + // Do nothing + } + + toolbar.addEditActionStart(action) + + verify(edit).addEditActionStart(action) + } + + @Test + fun `add edit action end will be forwarded to edit toolbar`() { + val toolbar = BrowserToolbar(testContext) + + val edit: EditToolbar = mock() + toolbar.edit = edit + + val action = BrowserToolbar.Button(mock(), "QR code scanner") { + // Do nothing + } + + toolbar.addEditActionEnd(action) + + verify(edit).addEditActionEnd(action) + } + + @Test + fun `WHEN removing action end THEN it will be forwarded to the edit toolbar`() { + val toolbar = BrowserToolbar(testContext) + + val edit: EditToolbar = mock() + toolbar.edit = edit + + val action = BrowserToolbar.Button(mock(), "QR code scanner") { + // Do nothing + } + + toolbar.removeEditActionEnd(action) + + verify(edit).removeEditActionEnd(action) + } + + @Test + fun `WHEN hideMenuButton is sent to BrowserToolbar THEN it will be forwarded to the DisplayToolbar`() { + val toolbar = BrowserToolbar(testContext) + + val display: DisplayToolbar = mock() + toolbar.display = display + + toolbar.hideMenuButton() + + verify(display).hideMenuButton() + } + + @Test + fun `WHEN showMenuButton is sent to BrowserToolbar THEN it will be forwarded to the DisplayToolbar`() { + val toolbar = BrowserToolbar(testContext) + + val display: DisplayToolbar = mock() + toolbar.display = display + + toolbar.showMenuButton() + + verify(display).showMenuButton() + } + + @Test + fun `WHEN showPageActionSeparator is sent to BrowserToolbar THEN it will be forwarded to the DisplayToolbar and EditToolbar`() { + val toolbar = BrowserToolbar(testContext) + + val display: DisplayToolbar = mock() + val edit: EditToolbar = mock() + toolbar.display = display + toolbar.edit = edit + + toolbar.showPageActionSeparator() + + verify(display).showPageActionSeparator() + verify(edit).showPageActionSeparator() + } + + @Test + fun `WHEN hidePageActionSeparator is sent to BrowserToolbar THEN it will be forwarded to the DisplayToolbar and EditToolbar`() { + val toolbar = BrowserToolbar(testContext) + + val display: DisplayToolbar = mock() + val edit: EditToolbar = mock() + toolbar.display = display + toolbar.edit = edit + + toolbar.hidePageActionSeparator() + + verify(display).hidePageActionSeparator() + verify(edit).hidePageActionSeparator() + } + + @Test + fun `WHEN setDisplayHorizontalPadding is sent to BrowserToolbar THEN it will be forwarded to the DisplayToolbar`() { + val toolbar = BrowserToolbar(testContext) + + val display: DisplayToolbar = mock() + toolbar.display = display + toolbar.edit = mock() + + toolbar.setDisplayHorizontalPadding(123) + verify(display).setHorizontalPadding(123) + + toolbar.setDisplayHorizontalPadding(0) + verify(display).setHorizontalPadding(0) + } + + @Test + fun `cast to view`() { + // Given + val toolbar = BrowserToolbar(testContext) + + // When + val view = toolbar.asView() + + // Then + assertNotNull(view) + } + + @Test + fun `URL update does not override search terms in edit mode`() { + val toolbar = BrowserToolbar(testContext) + + toolbar.display = spy(toolbar.display) + toolbar.edit = spy(toolbar.edit) + + toolbar.setSearchTerms("mozilla android") + toolbar.url = "https://www.mozilla.com" + toolbar.editMode() + verify(toolbar.display).url = "https://www.mozilla.com" + verify(toolbar.edit).updateUrl("mozilla android", false) + + toolbar.setSearchTerms("") + verify(toolbar.edit).updateUrl("", false) + + toolbar.url = "https://www.mozilla.org" + toolbar.editMode() + verify(toolbar.display).url = "https://www.mozilla.org" + verify(toolbar.edit).updateUrl("https://www.mozilla.org", false) + } + + @Test + fun `add navigation action will be forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + toolbar.display = display + + val action = BrowserToolbar.Button(mock(), "Back") { + // Do nothing + } + + toolbar.addNavigationAction(action) + + verify(display).addNavigationAction(action) + } + + @Test + fun `invalidate actions is forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + val display: DisplayToolbar = mock() + toolbar.display = display + + verify(display, never()).invalidateActions() + + toolbar.invalidateActions() + + verify(display).invalidateActions() + } + + @Test + fun `invalidate actions is forwarded to edit toolbar`() { + val toolbar = BrowserToolbar(testContext) + val edit: EditToolbar = mock() + toolbar.edit = edit + + verify(edit, never()).invalidateActions() + + toolbar.invalidateActions() + + verify(edit).invalidateActions() + } + + @Test + fun `search terms (if set) are forwarded to edit toolbar instead of URL`() { + val toolbar = BrowserToolbar(testContext) + + toolbar.edit = spy(toolbar.edit) + + toolbar.url = "https://www.mozilla.org" + toolbar.setSearchTerms("Mozilla Firefox") + + verify(toolbar.edit, never()).updateUrl("https://www.mozilla.org") + verify(toolbar.edit, never()).updateUrl("Mozilla Firefox") + + toolbar.editMode() + + verify(toolbar.edit, never()).updateUrl("https://www.mozilla.org") + verify(toolbar.edit).updateUrl("Mozilla Firefox") + } + + @Test + fun `search terms are forwarded to edit toolbar when it is active`() { + val toolbar = BrowserToolbar(testContext) + + toolbar.edit = spy(toolbar.edit) + + toolbar.editMode() + + toolbar.setSearchTerms("Mozilla Firefox") + + verify(toolbar.edit).editSuggestion("Mozilla Firefox") + } + + @Test + fun `editListener is set on edit`() { + val toolbar = BrowserToolbar(testContext) + assertNull(toolbar.edit.editListener) + + val listener: Toolbar.OnEditListener = mock() + toolbar.setOnEditListener(listener) + + assertEquals(listener, toolbar.edit.editListener) + } + + @Test + fun `editListener is invoked when switching between modes`() { + val toolbar = BrowserToolbar(testContext) + + val listener: Toolbar.OnEditListener = mock() + toolbar.setOnEditListener(listener) + + toolbar.editMode() + + verify(listener).onStartEditing() + verifyNoMoreInteractions(listener) + + toolbar.displayMode() + + verify(listener).onStopEditing() + verifyNoMoreInteractions(listener) + } + + @Test + fun `editListener is invoked when text changes`() { + val toolbar = BrowserToolbar(testContext) + + val listener: Toolbar.OnEditListener = mock() + toolbar.setOnEditListener(listener) + + toolbar.edit.views.url.onAttachedToWindow() + + toolbar.editMode() + + toolbar.edit.views.url.setText("Hello") + toolbar.edit.views.url.setText("Hello World") + + verify(listener).onStartEditing() + verify(listener).onTextChanged("Hello") + verify(listener).onTextChanged("Hello World") + } + + @Test + fun `titleView visibility is based on being set`() { + val toolbar = BrowserToolbar(testContext) + + assertEquals(toolbar.display.views.origin.titleView.visibility, View.GONE) + toolbar.title = "Mozilla" + assertEquals(toolbar.display.views.origin.titleView.visibility, View.VISIBLE) + toolbar.title = "" + assertEquals(toolbar.display.views.origin.titleView.visibility, View.GONE) + } + + @Test + fun `titleView text is set properly`() { + val toolbar = BrowserToolbar(testContext) + + toolbar.title = "Mozilla" + assertEquals("Mozilla", toolbar.display.views.origin.titleView.text) + assertEquals("Mozilla", toolbar.title) + } + + @Test + fun `titleView fading is set properly with non-null attrs`() { + val attributeSet: AttributeSet = Robolectric.buildAttributeSet().build() + + val toolbar = BrowserToolbar(testContext, attributeSet) + val titleView = toolbar.display.views.origin.titleView + val edgeLength = testContext.resources.getDimensionPixelSize(R.dimen.mozac_browser_toolbar_url_fading_edge_size) + + assertTrue(titleView.isHorizontalFadingEdgeEnabled) + assertEquals(edgeLength, titleView.horizontalFadingEdgeLength) + } + + @Test + fun `Button constructor with drawable`() { + val buttonDefault = BrowserToolbar.Button(mock(), "imageDrawable") {} + + assertEquals(true, buttonDefault.visible()) + assertEquals(BrowserToolbar.DEFAULT_PADDING, buttonDefault.padding) + assertEquals("imageDrawable", buttonDefault.contentDescription) + + val button = BrowserToolbar.Button(mock(), "imageDrawable", visible = { false }) {} + + assertEquals(false, button.visible()) + } + + @Test + fun `ToggleButton constructor with drawable`() { + val buttonDefault = + BrowserToolbar.ToggleButton(mock(), mock(), "imageDrawable", "imageSelectedDrawable") {} + + assertEquals(true, buttonDefault.visible()) + assertEquals(BrowserToolbar.DEFAULT_PADDING, buttonDefault.padding) + + val button = BrowserToolbar.ToggleButton( + mock(), + mock(), + "imageDrawable", + "imageSelectedDrawable", + visible = { false }, + ) {} + + assertEquals(false, button.visible()) + } + + @Test + fun `ReloadPageAction visibility changes update image`() { + val reloadImage: Drawable = mock() + val stopImage: Drawable = mock() + val view: ImageButton = mock() + var reloadPageAction = BrowserToolbar.TwoStateButton(reloadImage, "reload", stopImage, "stop") {} + assertFalse(reloadPageAction.enabled) + reloadPageAction.bind(view) + verify(view).setImageDrawable(reloadImage) + verify(view).contentDescription = "reload" + + reloadPageAction = BrowserToolbar.TwoStateButton(reloadImage, "reload", stopImage, "stop", { false }) {} + reloadPageAction.bind(view) + verify(view).setImageDrawable(stopImage) + verify(view).contentDescription = "stop" + } + + @Test + fun `siteSecure updates the display`() { + val toolbar = BrowserToolbar(testContext) + toolbar.display = spy(toolbar.display) + assertEquals(SiteSecurity.INSECURE, toolbar.siteSecure) + + toolbar.siteSecure = SiteSecurity.SECURE + + verify(toolbar.display).siteSecurity = SiteSecurity.SECURE + } + + @Test + fun `siteTrackingProtection updates the display`() { + val toolbar = BrowserToolbar(testContext) + toolbar.display = spy(toolbar.display) + assertEquals(SiteTrackingProtection.OFF_GLOBALLY, toolbar.siteTrackingProtection) + + toolbar.siteTrackingProtection = SiteTrackingProtection.ON_NO_TRACKERS_BLOCKED + + verify(toolbar.display).setTrackingProtectionState(SiteTrackingProtection.ON_NO_TRACKERS_BLOCKED) + + toolbar.siteTrackingProtection = SiteTrackingProtection.ON_NO_TRACKERS_BLOCKED + verifyNoMoreInteractions(toolbar.display) + } + + @Test + fun `private flag sets IME_FLAG_NO_PERSONALIZED_LEARNING on url edit view`() { + val toolbar = BrowserToolbar(testContext) + val edit = toolbar.edit + + // By default "private mode" is off. + assertEquals( + 0, + edit.views.url.imeOptions and + EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING, + ) + assertEquals(false, toolbar.private) + + // Turning on private mode sets flag + toolbar.private = true + assertNotEquals( + 0, + edit.views.url.imeOptions and + EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING, + ) + assertTrue(toolbar.private) + + // Turning private mode off again - should remove flag + toolbar.private = false + assertEquals( + 0, + edit.views.url.imeOptions and + EditorInfoCompat.IME_FLAG_NO_PERSONALIZED_LEARNING, + ) + assertEquals(false, toolbar.private) + } + + @Test + fun `setAutocompleteListener is forwarded to edit toolbar`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit = mock() + + val filter: suspend (String, AutocompleteDelegate) -> Unit = { _, _ -> + // Do nothing + } + + toolbar.setAutocompleteListener(filter) + + verify(toolbar.edit).setAutocompleteListener(filter) + } + + @Test + fun `WHEN an attempt to refresh autocomplete suggestions is made THEN forward the call to edit toolbar`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit = mock() + toolbar.setAutocompleteListener { _, _ -> } + + toolbar.refreshAutocomplete() + + verify(toolbar.edit).refreshAutocompleteSuggestion() + } + + @Test + fun `onStop is forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + toolbar.display = mock() + + toolbar.onStop() + + verify(toolbar.display).onStop() + } + + @Test + fun `dismiss menu is forwarded to display toolbar`() { + val toolbar = BrowserToolbar(testContext) + toolbar.display = mock() + val displayToolbarViews: DisplayToolbarViews = mock() + val menuButton: MenuButton = mock() + + whenever(toolbar.display.views).thenReturn(displayToolbarViews) + whenever(displayToolbarViews.menu).thenReturn(menuButton) + + toolbar.dismissMenu() + verify(menuButton).dismissMenu() + } + + @Test + fun `enable scrolling is forwarded to the toolbar behavior`() { + // Seems like real instances are needed for things to be set properly + val toolbar = BrowserToolbar(testContext) + val behavior = spy(EngineViewScrollingBehavior(testContext, null, ViewPosition.BOTTOM)) + val params = CoordinatorLayout.LayoutParams(10, 10).apply { + this.behavior = behavior + } + toolbar.layoutParams = params + + toolbar.enableScrolling() + + verify(behavior).enableScrolling() + } + + @Test + fun `disable scrolling is forwarded to the toolbar behavior`() { + // Seems like real instances are needed for things to be set properly + val toolbar = BrowserToolbar(testContext) + val behavior = spy(EngineViewScrollingBehavior(testContext, null, ViewPosition.BOTTOM)) + val params = CoordinatorLayout.LayoutParams(10, 10).apply { + this.behavior = behavior + } + toolbar.layoutParams = params + + toolbar.disableScrolling() + + verify(behavior).disableScrolling() + } + + @Test + fun `expand is forwarded to the toolbar behavior`() { + // Seems like real instances are needed for things to be set properly + val toolbar = BrowserToolbar(testContext) + val behavior = spy(EngineViewScrollingBehavior(testContext, null, ViewPosition.BOTTOM)) + val params = CoordinatorLayout.LayoutParams(10, 10).apply { + this.behavior = behavior + } + toolbar.layoutParams = params + + toolbar.expand() + + verify(behavior).forceExpand(toolbar) + } + + @Test + fun `collapse is forwarded to the toolbar behavior`() { + // Seems like real instances are needed for things to be set properly + val toolbar = BrowserToolbar(testContext) + val behavior = spy(EngineViewScrollingBehavior(testContext, null, ViewPosition.BOTTOM)) + val params = CoordinatorLayout.LayoutParams(10, 10).apply { + this.behavior = behavior + } + toolbar.layoutParams = params + + toolbar.collapse() + + verify(behavior).forceCollapse(toolbar) + } + + @Test + fun `WHEN search terms changes THEN edit listener is notified`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit = spy(toolbar.edit) + toolbar.edit.editListener = mock() + + toolbar.setSearchTerms("") + toolbar.editMode() + + toolbar.setSearchTerms("test") + verify(toolbar.edit.editListener)?.onTextChanged("test") + + toolbar.setSearchTerms("") + verify(toolbar.edit.editListener)?.onTextChanged("") + } + + @Test + fun `WHEN switching to edit mode AND the cursor placement parameter is specified THEN call the correct method to place the cursor`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit = spy(toolbar.edit) + + toolbar.editMode(Toolbar.CursorPlacement.ALL) + + verify(toolbar.edit).selectAll() + + toolbar.editMode(Toolbar.CursorPlacement.END) + + verify(toolbar.edit).selectEnd() + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/DisplayToolbarTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/DisplayToolbarTest.kt new file mode 100644 index 0000000000..a1cfb4c791 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/DisplayToolbarTest.kt @@ -0,0 +1,824 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.graphics.Color +import android.os.Build +import android.view.View +import androidx.core.content.ContextCompat +import androidx.core.view.isGone +import androidx.core.view.isVisible +import androidx.test.ext.junit.runners.AndroidJUnit4 +import mozilla.components.browser.menu.BrowserMenu +import mozilla.components.browser.menu.BrowserMenuBuilder +import mozilla.components.browser.menu.item.SimpleBrowserMenuItem +import mozilla.components.browser.toolbar.BrowserToolbar +import mozilla.components.browser.toolbar.R +import mozilla.components.concept.menu.MenuButton +import mozilla.components.concept.toolbar.Toolbar +import mozilla.components.concept.toolbar.Toolbar.SiteSecurity +import mozilla.components.concept.toolbar.Toolbar.SiteTrackingProtection +import mozilla.components.support.base.Component +import mozilla.components.support.base.facts.Action +import mozilla.components.support.base.facts.processor.CollectionProcessor +import mozilla.components.support.test.any +import mozilla.components.support.test.eq +import mozilla.components.support.test.mock +import mozilla.components.support.test.robolectric.testContext +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNotEquals +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.ArgumentMatchers.anyBoolean +import org.mockito.Mockito.doReturn +import org.mockito.Mockito.mock +import org.mockito.Mockito.never +import org.mockito.Mockito.reset +import org.mockito.Mockito.spy +import org.mockito.Mockito.verify +import org.robolectric.util.ReflectionHelpers +import mozilla.components.ui.icons.R as iconsR + +@RunWith(AndroidJUnit4::class) +class DisplayToolbarTest { + private fun createDisplayToolbar(): Pair<BrowserToolbar, DisplayToolbar> { + val toolbar: BrowserToolbar = mock() + val displayToolbar = DisplayToolbar( + testContext, + toolbar, + View.inflate(testContext, R.layout.mozac_browser_toolbar_displaytoolbar, null), + ) + return Pair(toolbar, displayToolbar) + } + + @Test + fun `clicking on the URL switches the toolbar to editing mode`() { + val (toolbar, displayToolbar) = createDisplayToolbar() + + val urlView = displayToolbar.views.origin.urlView + assertTrue(urlView.performClick()) + + verify(toolbar).editMode() + } + + @Test + fun `progress is forwarded to progress bar`() { + val (_, displayToolbar) = createDisplayToolbar() + + val progressView = displayToolbar.views.progress + + displayToolbar.updateProgress(0) + assertEquals(0, progressView.progress) + assertEquals(View.GONE, progressView.visibility) + + displayToolbar.updateProgress(10) + assertEquals(10, progressView.progress) + assertEquals(View.VISIBLE, progressView.visibility) + + displayToolbar.updateProgress(50) + assertEquals(50, progressView.progress) + assertEquals(View.VISIBLE, progressView.visibility) + + displayToolbar.updateProgress(75) + assertEquals(75, progressView.progress) + assertEquals(View.VISIBLE, progressView.visibility) + + displayToolbar.updateProgress(100) + assertEquals(100, progressView.progress) + assertEquals(View.GONE, progressView.visibility) + } + + @Test + fun `trackingProtectionViewColor will change the color of the trackingProtectionIconView`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.views.trackingProtectionIndicator.colorFilter) + + displayToolbar.colors = displayToolbar.colors.copy( + trackingProtection = Color.BLUE, + ) + + assertNotNull(displayToolbar.views.trackingProtectionIndicator.colorFilter) + assertNotNull(displayToolbar.views.trackingProtectionIndicator.trackingProtectionTint) + } + + @Test + fun `highlightView will change the color of the dot`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.views.highlight.colorFilter) + + displayToolbar.colors = displayToolbar.colors.copy(highlight = Color.BLUE) + + assertNotNull(displayToolbar.views.highlight.colorFilter) + assertNotNull(displayToolbar.views.highlight.highlightTint) + } + + @Test + fun `tracking protection and separator views become visible when states ON OR ACTIVE are set to siteTrackingProtection`() { + val (_, displayToolbar) = createDisplayToolbar() + + val trackingView = displayToolbar.views.trackingProtectionIndicator + val separatorView = displayToolbar.views.separator + + assertTrue(trackingView.visibility == View.GONE) + assertTrue(separatorView.visibility == View.GONE) + + displayToolbar.indicators = listOf( + DisplayToolbar.Indicators.SECURITY, + DisplayToolbar.Indicators.TRACKING_PROTECTION, + ) + displayToolbar.url = "https://www.mozilla.org" + displayToolbar.displayIndicatorSeparator = true + displayToolbar.setTrackingProtectionState(SiteTrackingProtection.ON_NO_TRACKERS_BLOCKED) + + assertTrue(trackingView.isVisible) + assertTrue(separatorView.isVisible) + + displayToolbar.setTrackingProtectionState(SiteTrackingProtection.OFF_GLOBALLY) + + assertTrue(trackingView.visibility == View.GONE) + assertTrue(separatorView.visibility == View.GONE) + + displayToolbar.setTrackingProtectionState(SiteTrackingProtection.ON_TRACKERS_BLOCKED) + + assertTrue(trackingView.isVisible) + assertTrue(separatorView.isVisible) + } + + @Test + fun `setTrackingProtectionIcons will forward to TrackingProtectionIconView`() { + val (_, displayToolbar) = createDisplayToolbar() + + displayToolbar.indicators = listOf(DisplayToolbar.Indicators.TRACKING_PROTECTION) + displayToolbar.setTrackingProtectionState(SiteTrackingProtection.ON_NO_TRACKERS_BLOCKED) + + val oldTrackingProtectionIcon = displayToolbar.views.trackingProtectionIndicator.drawable + assertNotNull(oldTrackingProtectionIcon) + + val drawable1 = + testContext.getDrawable(TrackingProtectionIconView.DEFAULT_ICON_ON_NO_TRACKERS_BLOCKED)!! + val drawable2 = + testContext.getDrawable(TrackingProtectionIconView.DEFAULT_ICON_ON_TRACKERS_BLOCKED)!! + val drawable3 = + testContext.getDrawable(TrackingProtectionIconView.DEFAULT_ICON_OFF_FOR_A_SITE)!! + + displayToolbar.icons = displayToolbar.icons.copy( + trackingProtectionTrackersBlocked = drawable1, + trackingProtectionNothingBlocked = drawable2, + trackingProtectionException = drawable3, + ) + + assertNotEquals( + oldTrackingProtectionIcon, + displayToolbar.views.trackingProtectionIndicator.drawable, + ) + + assertEquals(drawable2, displayToolbar.views.trackingProtectionIndicator.drawable) + + displayToolbar.setTrackingProtectionState(SiteTrackingProtection.ON_TRACKERS_BLOCKED) + + assertNotEquals( + oldTrackingProtectionIcon, + displayToolbar.views.trackingProtectionIndicator.drawable, + ) + + assertEquals( + drawable1, + displayToolbar.views.trackingProtectionIndicator.drawable, + ) + } + + @Test + fun `setHighlight will forward to HighlightView`() { + val (_, displayToolbar) = createDisplayToolbar() + + val oldPermissionIcon = displayToolbar.views.highlight.drawable + assertNotNull(oldPermissionIcon) + + val drawable1 = testContext.getDrawable(HighlightView.DEFAULT_ICON)!! + + displayToolbar.indicators = listOf(DisplayToolbar.Indicators.HIGHLIGHT) + displayToolbar.icons = displayToolbar.icons.copy( + highlight = drawable1, + ) + + assertNotEquals( + oldPermissionIcon, + displayToolbar.views.highlight.drawable, + ) + + displayToolbar.setHighlight(Toolbar.Highlight.PERMISSIONS_CHANGED) + + assertNotEquals( + oldPermissionIcon, + displayToolbar.views.highlight.drawable, + ) + } + + @Test + fun `menu view is gone by default`() { + val (_, displayToolbar) = createDisplayToolbar() + + val menuView = displayToolbar.views.menu + + assertNotNull(menuView) + assertEquals(View.GONE, menuView.impl.visibility) + } + + @Test + fun `menu view becomes visible once a menu builder is set`() { + val (_, displayToolbar) = createDisplayToolbar() + + val menuView = displayToolbar.views.menu + + assertNotNull(menuView) + + assertEquals(View.GONE, menuView.impl.visibility) + + displayToolbar.menuBuilder = BrowserMenuBuilder(emptyList()) + + assertEquals(View.VISIBLE, menuView.impl.visibility) + + displayToolbar.menuBuilder = null + + assertEquals(View.GONE, menuView.impl.visibility) + } + + @Test + fun `no menu builder is set by default`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.menuBuilder) + } + + @Test + fun `menu builder will be used to create and show menu when button is clicked`() { + val (_, displayToolbar) = createDisplayToolbar() + val menuView = displayToolbar.views.menu + + val menuBuilder = mock(BrowserMenuBuilder::class.java) + val menu = mock(BrowserMenu::class.java) + doReturn(menu).`when`(menuBuilder).build(testContext) + + displayToolbar.menuBuilder = menuBuilder + + verify(menuBuilder, never()).build(testContext) + verify(menu, never()).show(menuView.impl) + + menuView.impl.performClick() + + verify(menuBuilder).build(testContext) + verify(menu).show(eq(menuView.impl), any(), any(), anyBoolean(), any()) + verify(menu, never()).invalidate() + + displayToolbar.invalidateActions() + + verify(menu).invalidate() + } + + @Test + fun `browser action gets added as view to toolbar`() { + val contentDescription = "Mozilla" + + val (_, displayToolbar) = createDisplayToolbar() + + assertEquals(0, displayToolbar.views.browserActions.childCount) + + val action = BrowserToolbar.Button(mock(), contentDescription) {} + displayToolbar.addBrowserAction(action) + + assertEquals(1, displayToolbar.views.browserActions.childCount) + + val view = displayToolbar.views.browserActions.getChildAt(0) + assertEquals(contentDescription, view.contentDescription) + } + + @Test + fun `clicking browser action view triggers listener of action`() { + var callbackExecuted = false + + val action = BrowserToolbar.Button(mock(), "Button") { + callbackExecuted = true + } + + val (_, displayToolbar) = createDisplayToolbar() + displayToolbar.addBrowserAction(action) + + assertEquals(1, displayToolbar.views.browserActions.childCount) + val view = displayToolbar.views.browserActions.getChildAt(0) + + assertNotNull(view) + + assertFalse(callbackExecuted) + + view?.performClick() + + assertTrue(callbackExecuted) + } + + @Test + fun `browser action can be removed`() { + val contentDescription = "to-be-removed" + + val (_, displayToolbar) = createDisplayToolbar() + + val action = BrowserToolbar.Button(mock(), contentDescription) {} + // Removing action which was never added has no effect + displayToolbar.removeBrowserAction(action) + + displayToolbar.addBrowserAction(action) + assertEquals(1, displayToolbar.views.browserActions.childCount) + + displayToolbar.removeBrowserAction(action) + assertEquals(0, displayToolbar.views.browserActions.childCount) + } + + @Test + fun `navigation action can be removed`() { + val contentDescription = "to-be-removed" + + val (_, displayToolbar) = createDisplayToolbar() + + val action = BrowserToolbar.Button(mock(), contentDescription) {} + // Removing action which was never added has no effect + displayToolbar.removeNavigationAction(action) + + displayToolbar.addNavigationAction(action) + assertEquals(1, displayToolbar.views.navigationActions.childCount) + + displayToolbar.removeNavigationAction(action) + assertEquals(0, displayToolbar.views.navigationActions.childCount) + } + + @Test + fun `page action can be removed`() { + val contentDescription = "to-be-removed" + + val (_, displayToolbar) = createDisplayToolbar() + + val action = BrowserToolbar.Button(mock(), contentDescription) {} + // Removing action which was never added has no effect + displayToolbar.removePageAction(action) + + displayToolbar.addPageAction(action) + assertEquals(1, displayToolbar.views.pageActions.childCount) + + displayToolbar.removePageAction(action) + assertEquals(0, displayToolbar.views.pageActions.childCount) + } + + @Test + fun `page actions will be added as view to the toolbar`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertEquals(0, displayToolbar.views.pageActions.childCount) + + val action = BrowserToolbar.Button(mock(), "Reader Mode") {} + displayToolbar.addPageAction(action) + + assertEquals(1, displayToolbar.views.pageActions.childCount) + val view = displayToolbar.views.pageActions.getChildAt(0) + assertEquals("Reader Mode", view.contentDescription) + } + + @Test + fun `clicking a page action view will execute the listener of the action`() { + var listenerExecuted = false + + val action = BrowserToolbar.Button(mock(), "Reload") { + listenerExecuted = true + } + + val (_, displayToolbar) = createDisplayToolbar() + displayToolbar.addPageAction(action) + + assertFalse(listenerExecuted) + + assertEquals(1, displayToolbar.views.pageActions.childCount) + val view = displayToolbar.views.pageActions.getChildAt(0) + + assertNotNull(view) + view!!.performClick() + + assertTrue(listenerExecuted) + } + + @Test + fun `navigation actions will be added as view to the toolbar`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertEquals(0, displayToolbar.views.navigationActions.childCount) + + displayToolbar.addNavigationAction(BrowserToolbar.Button(mock(), "Back") {}) + displayToolbar.addNavigationAction(BrowserToolbar.Button(mock(), "Forward") {}) + + assertEquals(2, displayToolbar.views.navigationActions.childCount) + } + + @Test + fun `clicking on navigation action will execute listener of the action`() { + val (_, displayToolbar) = createDisplayToolbar() + + var listenerExecuted = false + val action = BrowserToolbar.Button(mock(), "Back") { + listenerExecuted = true + } + + displayToolbar.addNavigationAction(action) + + assertFalse(listenerExecuted) + + assertEquals(1, displayToolbar.views.navigationActions.childCount) + val view = displayToolbar.views.navigationActions.getChildAt(0) + view.performClick() + + assertTrue(listenerExecuted) + } + + @Test + fun `view of not visible navigation action gets removed after invalidating`() { + val (_, displayToolbar) = createDisplayToolbar() + + var shouldActionBeDisplayed = true + + val action = BrowserToolbar.Button( + mock(), + "Back", + visible = { shouldActionBeDisplayed }, + ) { /* Do nothing */ } + + displayToolbar.addNavigationAction(action) + + assertEquals(1, displayToolbar.views.navigationActions.childCount) + + shouldActionBeDisplayed = false + displayToolbar.invalidateActions() + + assertEquals(0, displayToolbar.views.navigationActions.childCount) + + shouldActionBeDisplayed = true + displayToolbar.invalidateActions() + + assertEquals(1, displayToolbar.views.navigationActions.childCount) + } + + @Test + fun `toolbar should call bind with view argument on action after invalidating`() { + val (_, displayToolbar) = createDisplayToolbar() + + val action = spy(BrowserToolbar.Button(mock(), "Reload") {}) + + displayToolbar.addPageAction(action) + + assertEquals(1, displayToolbar.views.pageActions.childCount) + val view = displayToolbar.views.pageActions.getChildAt(0) + + verify(action, never()).bind(view!!) + + displayToolbar.invalidateActions() + + verify(action).bind(view) + } + + @Test + fun `page action will not be added if visible lambda of action returns false`() { + val (_, displayToolbar) = createDisplayToolbar() + + val visibleAction = BrowserToolbar.Button(mock(), "Reload") {} + val invisibleAction = BrowserToolbar.Button( + mock(), + "Reader Mode", + visible = { false }, + ) {} + + displayToolbar.addPageAction(visibleAction) + displayToolbar.addPageAction(invisibleAction) + + assertEquals(1, displayToolbar.views.pageActions.childCount) + + val view = displayToolbar.views.pageActions.getChildAt(0) + assertEquals("Reload", view.contentDescription) + } + + @Test + fun `browser action will not be added if visible lambda of action returns false`() { + val (_, displayToolbar) = createDisplayToolbar() + + val visibleAction = BrowserToolbar.Button(mock(), "Tabs") {} + val invisibleAction = BrowserToolbar.Button( + mock(), + "Settings", + visible = { false }, + ) {} + + displayToolbar.addBrowserAction(visibleAction) + displayToolbar.addBrowserAction(invisibleAction) + + assertEquals(1, displayToolbar.views.browserActions.childCount) + + val view = displayToolbar.views.browserActions.getChildAt(0) + assertEquals("Tabs", view.contentDescription) + } + + @Test + fun `navigation action will not be added if visible lambda of action returns false`() { + val (_, displayToolbar) = createDisplayToolbar() + + val visibleAction = BrowserToolbar.Button(mock(), "Forward") {} + val invisibleAction = BrowserToolbar.Button( + mock(), + "Back", + visible = { false }, + ) {} + + displayToolbar.addNavigationAction(visibleAction) + displayToolbar.addNavigationAction(invisibleAction) + + assertEquals(1, displayToolbar.views.navigationActions.childCount) + + val view = displayToolbar.views.navigationActions.getChildAt(0) + assertEquals("Forward", view.contentDescription) + } + + @Test + fun `url background will be added and removed from display layout`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.views.background.drawable) + + displayToolbar.setUrlBackground( + ContextCompat.getDrawable( + testContext, + iconsR.drawable.mozac_ic_broken_lock, + ), + ) + + assertNotNull(displayToolbar.views.background.drawable) + + displayToolbar.setUrlBackground(null) + + assertNull(displayToolbar.views.background.drawable) + } + + @Test + fun `titleView does not display when there is no title text`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertTrue(displayToolbar.views.origin.titleView.isGone) + + displayToolbar.title = "Hello World" + + assertTrue(displayToolbar.views.origin.titleView.isVisible) + } + + @Test + fun `toolbar only switches to editing mode if onUrlClicked returns true`() { + val (toolbar, displayToolbar) = createDisplayToolbar() + + displayToolbar.views.origin.urlView.performClick() + + verify(toolbar).editMode() + + reset(toolbar) + displayToolbar.onUrlClicked = { false } + displayToolbar.views.origin.urlView.performClick() + + verify(toolbar, never()).editMode() + + reset(toolbar) + displayToolbar.onUrlClicked = { true } + displayToolbar.views.origin.urlView.performClick() + + verify(toolbar).editMode() + } + + @Test + fun `urlView delegates long click when set`() { + val (_, displayToolbar) = createDisplayToolbar() + + var longUrlClicked = false + + displayToolbar.setOnUrlLongClickListener { + longUrlClicked = true + false + } + + assertFalse(longUrlClicked) + displayToolbar.views.origin.urlView.performLongClick() + assertTrue(longUrlClicked) + } + + @Test + fun `urlView longClickListener can be unset`() { + val (_, displayToolbar) = createDisplayToolbar() + + var longClicked = false + displayToolbar.setOnUrlLongClickListener { + longClicked = true + true + } + + displayToolbar.views.origin.urlView.performLongClick() + assertTrue(longClicked) + longClicked = false + + displayToolbar.setOnUrlLongClickListener(null) + displayToolbar.views.origin.urlView.performLongClick() + + assertFalse(longClicked) + } + + @Test + fun `iconView changes site secure state when site security changes`() { + val (_, displayToolbar) = createDisplayToolbar() + assertEquals(SiteSecurity.INSECURE, displayToolbar.views.securityIndicator.siteSecurity) + + displayToolbar.siteSecurity = SiteSecurity.SECURE + + assertEquals(SiteSecurity.SECURE, displayToolbar.views.securityIndicator.siteSecurity) + + displayToolbar.siteSecurity = SiteSecurity.INSECURE + + assertEquals(SiteSecurity.INSECURE, displayToolbar.views.securityIndicator.siteSecurity) + } + + @Test + fun `securityIconColor is set when securityIconColor changes`() { + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.views.securityIndicator.colorFilter) + + displayToolbar.colors = displayToolbar.colors.copy( + securityIconSecure = Color.BLUE, + securityIconInsecure = Color.BLUE, + ) + + assertNotNull(displayToolbar.views.securityIndicator.colorFilter) + } + + @Test + fun `color filter is set with transparent when securityIconColor changes to transparent and api version is lower than 23`() { + ReflectionHelpers.setStaticField(Build.VERSION::class.java, "SDK_INT", 22) + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.views.securityIndicator.colorFilter) + + displayToolbar.colors = displayToolbar.colors.copy( + securityIconSecure = Color.TRANSPARENT, + securityIconInsecure = Color.TRANSPARENT, + ) + + assertNotNull(displayToolbar.views.securityIndicator.colorFilter) + } + + @Test + fun `color filter is cleared when securityIconColor changes to transparent and api version is bigger than 22`() { + ReflectionHelpers.setStaticField(Build.VERSION::class.java, "SDK_INT", 23) + + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.views.securityIndicator.colorFilter) + + displayToolbar.colors = displayToolbar.colors.copy( + securityIconSecure = Color.TRANSPARENT, + securityIconInsecure = Color.TRANSPARENT, + ) + + assertNull(displayToolbar.views.securityIndicator.colorFilter) + } + + @Test + fun `clicking menu button emits facts with additional extras from builder set`() { + CollectionProcessor.withFactCollection { facts -> + val (_, displayToolbar) = createDisplayToolbar() + val menuView = displayToolbar.views.menu + + val menuBuilder = BrowserMenuBuilder( + listOf(SimpleBrowserMenuItem("Mozilla")), + mapOf( + "customTab" to true, + "test" to "23", + ), + ) + displayToolbar.menuBuilder = menuBuilder + + assertEquals(0, facts.size) + + menuView.impl.performClick() + + assertEquals(1, facts.size) + + val fact = facts[0] + + assertEquals(Component.BROWSER_TOOLBAR, fact.component) + assertEquals(Action.CLICK, fact.action) + assertEquals("menu", fact.item) + assertNull(fact.value) + + assertNotNull(fact.metadata) + + val metadata = fact.metadata!! + assertEquals(2, metadata.size) + assertTrue(metadata.containsKey("customTab")) + assertTrue(metadata.containsKey("test")) + assertEquals(true, metadata["customTab"]) + assertEquals("23", metadata["test"]) + } + } + + @Test + fun `clicking on site security indicator invokes listener`() { + var listenerInvoked = false + + val (_, displayToolbar) = createDisplayToolbar() + + assertNull(displayToolbar.views.securityIndicator.background) + + displayToolbar.setOnSiteSecurityClickedListener { + listenerInvoked = true + } + + assertNotNull(displayToolbar.views.securityIndicator.background) + + displayToolbar.views.securityIndicator.performClick() + + assertTrue(listenerInvoked) + + listenerInvoked = false + + displayToolbar.setOnSiteSecurityClickedListener { } + + assertNotNull(displayToolbar.views.securityIndicator.background) + + displayToolbar.views.securityIndicator.performClick() + + assertFalse(listenerInvoked) + + displayToolbar.setOnSiteSecurityClickedListener(null) + + assertNull(displayToolbar.views.securityIndicator.background) + } + + @Test + fun `Security icon has proper content description`() { + val (_, displayToolbar) = createDisplayToolbar() + val siteSecurityIconView = displayToolbar.views.securityIndicator + + assertNotNull(siteSecurityIconView.contentDescription) + assertEquals( + testContext.getString(R.string.mozac_browser_toolbar_content_description_site_info), + siteSecurityIconView.contentDescription, + ) + } + + @Test + fun `Backgrounding the app dismisses menu if already open`() { + var wasDismissed = false + val (_, displayToolbar) = createDisplayToolbar() + val menuView = displayToolbar.views.menu + menuView.impl.register( + object : MenuButton.Observer { + override fun onDismiss() { + wasDismissed = true + } + }, + ) + menuView.menuBuilder = BrowserMenuBuilder(emptyList()) + menuView.impl.performClick() + + displayToolbar.onStop() + + assertTrue(wasDismissed) + } + + @Test + fun `set a dismiss lambda on the menu button`() { + var wasDismissed = false + val (_, displayToolbar) = createDisplayToolbar() + displayToolbar.setMenuDismissAction { wasDismissed = true } + val menuView = displayToolbar.views.menu + menuView.menuBuilder = BrowserMenuBuilder(emptyList()) + menuView.impl.performClick() + + menuView.dismissMenu() + assertTrue(wasDismissed) + } + + @Test + fun `url formatter used if provided`() { + val (_, displayToolbar) = createDisplayToolbar() + displayToolbar.url = "https://mozilla.org" + assertEquals(displayToolbar.url, displayToolbar.views.origin.url) + + displayToolbar.urlFormatter = { it.replace("https://".toRegex(), "") } + displayToolbar.url = "https://mozilla.org" + assertEquals("mozilla.org", displayToolbar.views.origin.url) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/HighlightViewTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/HighlightViewTest.kt new file mode 100644 index 0000000000..3b4b68bfae --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/HighlightViewTest.kt @@ -0,0 +1,67 @@ +/* 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 mozilla.components.browser.toolbar.display + +import androidx.core.view.isVisible +import androidx.test.ext.junit.runners.AndroidJUnit4 +import mozilla.components.browser.toolbar.R +import mozilla.components.concept.toolbar.Toolbar.Highlight.NONE +import mozilla.components.concept.toolbar.Toolbar.Highlight.PERMISSIONS_CHANGED +import mozilla.components.support.test.robolectric.testContext +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mockito.spy +import org.mockito.Mockito.verify + +@RunWith(AndroidJUnit4::class) +class HighlightViewTest { + + @Test + fun `after setting tint, can get trackingProtectionTint`() { + val view = HighlightView(testContext) + view.setTint(android.R.color.black) + assertEquals(android.R.color.black, view.highlightTint) + } + + @Test + fun `setting status will trigger an icon updated`() { + val view = HighlightView(testContext) + + view.state = PERMISSIONS_CHANGED + + assertEquals(PERMISSIONS_CHANGED, view.state) + assertTrue(view.isVisible) + assertNotNull(view.drawable) + assertEquals( + view.contentDescription, + testContext.getString(R.string.mozac_browser_toolbar_content_description_autoplay_blocked), + ) + + view.state = NONE + + assertEquals(NONE, view.state) + assertNull(view.drawable) + assertFalse(view.isVisible) + assertNull(view.contentDescription) + } + + @Test + fun `setIcons will trigger an icon updated`() { + val view = spy(HighlightView(testContext)) + + view.setIcon( + testContext.getDrawable( + TrackingProtectionIconView.DEFAULT_ICON_ON_NO_TRACKERS_BLOCKED, + )!!, + ) + + verify(view).updateIcon() + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/MenuButtonTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/MenuButtonTest.kt new file mode 100644 index 0000000000..865c1a74ee --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/MenuButtonTest.kt @@ -0,0 +1,156 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.graphics.Color +import android.view.View +import androidx.test.ext.junit.runners.AndroidJUnit4 +import mozilla.components.browser.menu.BrowserMenu +import mozilla.components.browser.menu.BrowserMenuBuilder +import mozilla.components.browser.menu.BrowserMenuHighlight +import mozilla.components.browser.menu.ext.getHighlight +import mozilla.components.browser.menu.item.BrowserMenuHighlightableItem +import mozilla.components.browser.menu.item.SimpleBrowserMenuItem +import mozilla.components.concept.menu.MenuController +import mozilla.components.concept.menu.candidate.DecorativeTextMenuCandidate +import mozilla.components.concept.menu.candidate.TextMenuCandidate +import mozilla.components.support.test.any +import mozilla.components.support.test.mock +import mozilla.components.support.test.robolectric.testContext +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertTrue +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mock +import org.mockito.Mockito.doReturn +import org.mockito.Mockito.never +import org.mockito.Mockito.spy +import org.mockito.Mockito.verify +import org.mockito.Mockito.`when` +import org.mockito.MockitoAnnotations + +@RunWith(AndroidJUnit4::class) +class MenuButtonTest { + @Mock private lateinit var menuBuilder: BrowserMenuBuilder + + @Mock private lateinit var menuController: MenuController + + @Mock private lateinit var menu: BrowserMenu + + @Mock private lateinit var menuButtonInternal: mozilla.components.browser.menu.view.MenuButton + private lateinit var menuButton: MenuButton + + @Before + fun setup() { + MockitoAnnotations.openMocks(this) + `when`(menuBuilder.build(testContext)).thenReturn(menu) + `when`(menuButtonInternal.context).thenReturn(testContext) + + menuButton = MenuButton(menuButtonInternal) + } + + @Test + fun `menu button is visible only if menu builder attached`() { + verify(menuButtonInternal).visibility = View.GONE + + `when`(menuButtonInternal.menuBuilder).thenReturn(mock()) + assertTrue(menuButton.shouldBeVisible()) + + `when`(menuButtonInternal.menuBuilder).thenReturn(null) + assertFalse(menuButton.shouldBeVisible()) + } + + @Suppress("Deprecation") + @Test + fun `menu button sets onDismiss action`() { + val action = {} + menuButton.setMenuDismissAction(action) + + verify(menuButtonInternal).onDismiss = action + } + + @Test + fun `icon displays dot if low highlighted item is present in menu`() { + verify(menuButtonInternal, never()).invalidateBrowserMenu() + verify(menuButtonInternal, never()).setHighlight(any()) + + var isHighlighted = false + val highlight = BrowserMenuHighlight.LowPriority(Color.YELLOW) + val highlightMenuBuilder = spy( + BrowserMenuBuilder( + listOf( + BrowserMenuHighlightableItem( + label = "Test", + startImageResource = 0, + highlight = highlight, + isHighlighted = { isHighlighted }, + ), + ), + ), + ) + doReturn(menu).`when`(highlightMenuBuilder).build(testContext) + + menuButton.menuBuilder = highlightMenuBuilder + `when`(menuButtonInternal.menuBuilder).thenReturn(highlightMenuBuilder) + menuButton.invalidateMenu() + + verify(menuButtonInternal).setHighlight(null) + + isHighlighted = true + menuButton.invalidateMenu() + + assertEquals(highlight, highlightMenuBuilder.items.getHighlight()) + verify(menuButtonInternal).setHighlight(highlight) + } + + @Test + fun `invalidateMenu should invalidate the internal menu`() { + `when`(menuButtonInternal.menuController).thenReturn(null) + `when`(menuButtonInternal.menuBuilder).thenReturn(mock()) + verify(menuButtonInternal, never()).invalidateBrowserMenu() + + menuButton.invalidateMenu() + + verify(menuButtonInternal).invalidateBrowserMenu() + } + + @Test + fun `invalidateMenu should do nothing if using the menu controller`() { + `when`(menuButtonInternal.menuController).thenReturn(menuController) + `when`(menuButtonInternal.menuBuilder).thenReturn(null) + verify(menuButtonInternal, never()).invalidateBrowserMenu() + + menuButton.invalidateMenu() + + verify(menuButtonInternal, never()).invalidateBrowserMenu() + } + + @Test + fun `invalidateMenu should automatically upgrade menu items if both builder and controller are present`() { + val onClick = {} + `when`(menuButtonInternal.menuController).thenReturn(menuController) + `when`(menuButtonInternal.menuBuilder).thenReturn( + BrowserMenuBuilder( + listOf( + SimpleBrowserMenuItem("Item 1", listener = onClick), + SimpleBrowserMenuItem("Item 2"), + ), + ), + ) + verify(menuButtonInternal, never()).invalidateBrowserMenu() + + menuButton.invalidateMenu() + + verify(menuButtonInternal, never()).invalidateBrowserMenu() + verify(menuController).submitList( + listOf( + TextMenuCandidate("Item 1", onClick = onClick), + DecorativeTextMenuCandidate("Item 2"), + ), + ) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/TrackingProtectionIconViewTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/TrackingProtectionIconViewTest.kt new file mode 100644 index 0000000000..5f77d4aa04 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/display/TrackingProtectionIconViewTest.kt @@ -0,0 +1,43 @@ +/* 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 mozilla.components.browser.toolbar.display + +import android.graphics.PorterDuff +import android.graphics.PorterDuffColorFilter +import android.graphics.drawable.AnimatedVectorDrawable +import android.graphics.drawable.Drawable +import androidx.test.ext.junit.runners.AndroidJUnit4 +import mozilla.components.support.test.mock +import mozilla.components.support.test.robolectric.testContext +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotEquals +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class TrackingProtectionIconViewTest { + + @Test + fun `After setting tint, can get trackingProtectionTint`() { + val view = TrackingProtectionIconView(testContext) + view.setTint(android.R.color.black) + assertEquals(android.R.color.black, view.trackingProtectionTint) + } + + @Test + fun `colorFilter is cleared on animatable drawables`() { + val view = TrackingProtectionIconView(testContext) + view.trackingProtectionTint = android.R.color.black + + val drawable = mock<Drawable>() + val animatedDrawable = mock<AnimatedVectorDrawable>() + + view.setOrClearColorFilter(drawable) + assertEquals(PorterDuffColorFilter(android.R.color.black, PorterDuff.Mode.SRC_ATOP), view.colorFilter) + + view.setOrClearColorFilter(animatedDrawable) + assertNotEquals(PorterDuffColorFilter(android.R.color.black, PorterDuff.Mode.SRC_ATOP), view.colorFilter) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/edit/EditToolbarTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/edit/EditToolbarTest.kt new file mode 100644 index 0000000000..49aff8dadd --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/edit/EditToolbarTest.kt @@ -0,0 +1,290 @@ +/* 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 mozilla.components.browser.toolbar.edit + +import android.view.KeyEvent +import android.view.View +import androidx.test.ext.junit.runners.AndroidJUnit4 +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.test.runTest +import mozilla.components.browser.toolbar.BrowserToolbar +import mozilla.components.browser.toolbar.R +import mozilla.components.concept.toolbar.AutocompleteDelegate +import mozilla.components.concept.toolbar.Toolbar +import mozilla.components.support.base.Component +import mozilla.components.support.base.facts.Action +import mozilla.components.support.base.facts.processor.CollectionProcessor +import mozilla.components.support.test.mock +import mozilla.components.support.test.robolectric.testContext +import mozilla.components.ui.autocomplete.InlineAutocompleteEditText +import org.junit.Assert.assertEquals +import org.junit.Assert.assertFalse +import org.junit.Assert.assertNotNull +import org.junit.Assert.assertNull +import org.junit.Assert.assertTrue +import org.junit.Test +import org.junit.runner.RunWith +import java.util.concurrent.CountDownLatch + +@ExperimentalCoroutinesApi // for runTest +@RunWith(AndroidJUnit4::class) +class EditToolbarTest { + private fun createEditToolbar(): Pair<BrowserToolbar, EditToolbar> { + val toolbar: BrowserToolbar = mock() + val displayToolbar = EditToolbar( + testContext, + toolbar, + View.inflate(testContext, R.layout.mozac_browser_toolbar_edittoolbar, null), + ) + return Pair(toolbar, displayToolbar) + } + + @Test + fun `entered text is forwarded to async autocomplete filter`() = runTest { + val toolbar = BrowserToolbar(testContext) + + toolbar.edit.views.url.onAttachedToWindow() + + val latch = CountDownLatch(1) + var invokedWithParams: List<Any?>? = null + toolbar.setAutocompleteListener { p1, p2 -> + invokedWithParams = listOf(p1, p2) + latch.countDown() + } + + toolbar.edit.views.url.setText("Hello") + + // Autocomplete filter will be invoked on a worker thread. + // Serialize here for the sake of tests. + latch.await() + + assertEquals("Hello", invokedWithParams!![0]) + assertTrue(invokedWithParams!![1] is AutocompleteDelegate) + } + + @Test + fun `GIVEN existing user input WHEN a call to refresh autocomplete suggestions is made THEN retart the autocomplete functionality with the current text`() { + val toolbar = BrowserToolbar(testContext) + toolbar.edit.views.url.onAttachedToWindow() + // Fake existing user input. + toolbar.edit.views.url.setText("Test") + val latch = CountDownLatch(1) + var invokedWithParams: List<Any?>? = null + // Only now enable the autocomplete functionality. + toolbar.setAutocompleteListener { p1, p2 -> + invokedWithParams = listOf(p1, p2) + latch.countDown() + } + + toolbar.refreshAutocomplete() + + // Autocomplete filter will be invoked on a worker thread. + // Serialize here for the sake of tests. + latch.await() + assertEquals("Test", invokedWithParams!![0]) + assertTrue(invokedWithParams!![1] is AutocompleteDelegate) + } + + @Test + fun `focus change is forwarded to listener`() { + var listenerInvoked = false + var value = false + + val toolbar = BrowserToolbar(testContext) + toolbar.edit.setOnEditFocusChangeListener { hasFocus -> + listenerInvoked = true + value = hasFocus + } + + // Switch to editing mode and focus view. + toolbar.editMode() + toolbar.edit.views.url.requestFocus() + + assertTrue(listenerInvoked) + assertTrue(value) + + // Switch back to display mode + listenerInvoked = false + toolbar.displayMode() + + assertTrue(listenerInvoked) + assertFalse(value) + } + + @Test + fun `entering text emits facts`() { + CollectionProcessor.withFactCollection { facts -> + val toolbar = BrowserToolbar(testContext) + toolbar.edit.views.url.onAttachedToWindow() + + assertEquals(0, facts.size) + + toolbar.edit.views.url.setText("https://www.mozilla.org") + toolbar.edit.views.url.dispatchKeyEvent( + KeyEvent( + System.currentTimeMillis(), + System.currentTimeMillis(), + KeyEvent.ACTION_DOWN, + KeyEvent.KEYCODE_ENTER, + 0, + ), + ) + + assertEquals(2, facts.size) + + val factDetail = facts[0] + assertEquals(Component.UI_AUTOCOMPLETE, factDetail.component) + assertEquals(Action.IMPLEMENTATION_DETAIL, factDetail.action) + assertEquals("onTextChanged", factDetail.item) + assertEquals("InlineAutocompleteEditText", factDetail.value) + + val fact = facts[1] + assertEquals(Component.BROWSER_TOOLBAR, fact.component) + assertEquals(Action.COMMIT, fact.action) + assertEquals("toolbar", fact.item) + assertNull(fact.value) + + val metadata = fact.metadata + assertNotNull(metadata!!) + assertEquals(1, metadata.size) + assertTrue(metadata.contains("autocomplete")) + assertTrue(metadata["autocomplete"] is Boolean) + assertFalse(metadata["autocomplete"] as Boolean) + } + } + + @Test + fun `entering text emits facts with autocomplete metadata`() { + CollectionProcessor.withFactCollection { facts -> + val toolbar = BrowserToolbar(testContext) + toolbar.edit.views.url.onAttachedToWindow() + + assertEquals(0, facts.size) + + toolbar.edit.views.url.setText("https://www.mozilla.org") + + // Fake autocomplete + toolbar.edit.views.url.autocompleteResult = InlineAutocompleteEditText.AutocompleteResult( + text = "hello world", + source = "test-source", + totalItems = 100, + ) + + toolbar.edit.views.url.dispatchKeyEvent( + KeyEvent( + System.currentTimeMillis(), + System.currentTimeMillis(), + KeyEvent.ACTION_DOWN, + KeyEvent.KEYCODE_ENTER, + 0, + ), + ) + + assertEquals(2, facts.size) + + val factDetail = facts[0] + assertEquals(Component.UI_AUTOCOMPLETE, factDetail.component) + assertEquals(Action.IMPLEMENTATION_DETAIL, factDetail.action) + assertEquals("onTextChanged", factDetail.item) + assertEquals("InlineAutocompleteEditText", factDetail.value) + + val factCommit = facts[1] + assertEquals(Component.BROWSER_TOOLBAR, factCommit.component) + assertEquals(Action.COMMIT, factCommit.action) + assertEquals("toolbar", factCommit.item) + assertNull(factCommit.value) + + val metadata = factCommit.metadata + assertNotNull(metadata!!) + assertEquals(2, metadata.size) + + assertTrue(metadata.contains("autocomplete")) + assertTrue(metadata["autocomplete"] is Boolean) + assertTrue(metadata["autocomplete"] as Boolean) + + assertTrue(metadata.contains("source")) + assertEquals("test-source", metadata["source"]) + } + } + + @Test + fun `clearView gone on init`() { + val (_, editToolbar) = createEditToolbar() + val clearView = editToolbar.views.clear + assertTrue(clearView.visibility == View.GONE) + } + + @Test + fun `clearView visible on updateUrl`() { + val (_, editToolbar) = createEditToolbar() + val clearView = editToolbar.views.clear + + editToolbar.updateUrl("TestUrl", false) + assertTrue(clearView.visibility == View.VISIBLE) + } + + @Test + fun `WHEN shouldAppend is set to true updateUrl should append text`() { + val (_, editToolbar) = createEditToolbar() + + // Initial state + editToolbar.updateUrl(url = "what ") + + // Simulate text update with voice input + val actual = editToolbar.updateUrl(url = "is this", shouldAppend = true, shouldHighlight = true) + val expected = "what is this" + + assertEquals(expected, actual) + assertEquals(expected, editToolbar.views.url.text.toString()) + assertEquals(5, editToolbar.views.url.selectionStart) + assertEquals(12, editToolbar.views.url.selectionEnd) + } + + @Test + fun `setIconClickListener sets a click listener on the icon view`() { + val (_, editToolbar) = createEditToolbar() + val iconView = editToolbar.views.icon + assertFalse(iconView.hasOnClickListeners()) + editToolbar.setIconClickListener { /* noop */ } + assertTrue(iconView.hasOnClickListeners()) + } + + @Test + fun `clearView clears text in urlView`() { + val (_, editToolbar) = createEditToolbar() + val clearView = editToolbar.views.clear + + editToolbar.views.url.setText("https://www.mozilla.org") + assertTrue(editToolbar.views.url.text.isNotBlank()) + + assertNotNull(clearView) + clearView.performClick() + assertTrue(editToolbar.views.url.text.isBlank()) + } + + @Test + fun `editSuggestion sets text in urlView`() { + val (_, editToolbar) = createEditToolbar() + val url = editToolbar.views.url + + url.setText("https://www.mozilla.org") + assertEquals("https://www.mozilla.org", url.text.toString()) + + var callbackCalled = false + + editToolbar.editListener = object : Toolbar.OnEditListener { + override fun onTextChanged(text: String) { + callbackCalled = true + } + } + + editToolbar.editSuggestion("firefox") + + assertEquals("firefox", url.text.toString()) + assertTrue(callbackCalled) + assertEquals("firefox".length, url.selectionStart) + assertTrue(url.hasFocus()) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/internal/ActionContainerTest.kt b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/internal/ActionContainerTest.kt new file mode 100644 index 0000000000..d3f1ddda18 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/java/mozilla/components/browser/toolbar/internal/ActionContainerTest.kt @@ -0,0 +1,99 @@ +/* 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 mozilla.components.browser.toolbar.internal + +import android.view.View +import mozilla.components.browser.toolbar.BrowserToolbar +import mozilla.components.concept.toolbar.Toolbar +import mozilla.components.support.test.robolectric.testContext +import org.junit.Assert.assertEquals +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +import org.mockito.Mockito.mock +import org.robolectric.RobolectricTestRunner + +@RunWith(RobolectricTestRunner::class) +class ActionContainerTest { + private lateinit var actionContainer: ActionContainer + private lateinit var browserAction: Toolbar.Action + + @Before + fun setUp() { + browserAction = BrowserToolbar.Button( + imageDrawable = mock(), + contentDescription = "Test", + visible = { true }, + autoHide = { true }, + weight = { 2 }, + listener = mock(), + ) + actionContainer = ActionContainer(testContext) + } + + @Test + fun `GIVEN multiple actions with different weights WHEN calculateInsertionIndex is called THEN action is placed at right index`() { + actionContainer.addAction( + BrowserToolbar.Button( + imageDrawable = mock(), + contentDescription = "Share", + visible = { true }, + weight = { 1 }, + listener = mock(), + ), + ) + actionContainer.addAction( + BrowserToolbar.Button( + imageDrawable = mock(), + contentDescription = "Reload", + visible = { true }, + weight = { 3 }, + listener = mock(), + ), + ) + val newAction = + BrowserToolbar.Button( + imageDrawable = mock(), + contentDescription = "Translation", + visible = { true }, + weight = { 2 }, + listener = mock(), + ) + + val insertionIndex = actionContainer.calculateInsertionIndex(newAction) + + assertEquals("The insertion index should be", 1, insertionIndex) + } + + @Test + fun `WHEN addAction is called THEN child views are increased`() { + actionContainer.addAction(browserAction) + + assertEquals(1, actionContainer.childCount) + } + + @Test + fun `WHEN removeAction is called THEN child views are decreased`() { + actionContainer.addAction(browserAction) + actionContainer.removeAction(browserAction) + + assertEquals(0, actionContainer.childCount) + } + + @Test + fun `WHEN invalidateAction is called THEN action visibility is reconsidered`() { + val browserToolbarAction = BrowserToolbar.Button( + imageDrawable = mock(), + contentDescription = "Translation", + visible = { false }, + weight = { 2 }, + listener = mock(), + ) + actionContainer.addAction(browserToolbarAction) + actionContainer.invalidateActions() + + assertEquals(View.GONE, actionContainer.visibility) + } +} diff --git a/mobile/android/android-components/components/browser/toolbar/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/mobile/android/android-components/components/browser/toolbar/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000000..cf1c399ea8 --- /dev/null +++ b/mobile/android/android-components/components/browser/toolbar/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1,2 @@ +mock-maker-inline +// This allows mocking final classes (classes are final by default in Kotlin) |