diff options
Diffstat (limited to 'mobile/android/android-components/components/compose/awesomebar/src')
113 files changed, 1533 insertions, 0 deletions
diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/AndroidManifest.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..e16cda1d34 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/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/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBar.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBar.kt new file mode 100644 index 0000000000..a5d3f10e2a --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBar.kt @@ -0,0 +1,121 @@ +/* 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.compose.browser.awesomebar + +import android.annotation.SuppressLint +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.derivedStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import mozilla.components.compose.browser.awesomebar.internal.SuggestionFetcher +import mozilla.components.compose.browser.awesomebar.internal.Suggestions +import mozilla.components.concept.awesomebar.AwesomeBar +import mozilla.components.concept.base.profiler.Profiler + +/** + * An awesome bar displaying suggestions from the list of provided [AwesomeBar.SuggestionProvider]s. + * + * @param text The text entered by the user and for which the AwesomeBar should show suggestions for. + * @param colors The color scheme the AwesomeBar will use for the UI. + * @param providers The list of suggestion providers to query whenever the [text] changes. + * @param orientation Whether the AwesomeBar is oriented to the top or the bottom of the screen. + * @param onSuggestionClicked Gets invoked whenever the user clicks on a suggestion in the AwesomeBar. + * @param onAutoComplete Gets invoked when the user clicks on the "autocomplete" icon of a suggestion. + * @param onVisibilityStateUpdated Gets invoked when the list of currently displayed suggestions changes. + * @param onScroll Gets invoked at the beginning of the user performing a scroll gesture. + */ +@Composable +fun AwesomeBar( + text: String, + colors: AwesomeBarColors = AwesomeBarDefaults.colors(), + providers: List<AwesomeBar.SuggestionProvider>, + orientation: AwesomeBarOrientation = AwesomeBarOrientation.TOP, + onSuggestionClicked: (AwesomeBar.Suggestion) -> Unit, + onAutoComplete: (AwesomeBar.Suggestion) -> Unit, + onVisibilityStateUpdated: (AwesomeBar.VisibilityState) -> Unit = {}, + onScroll: () -> Unit = {}, + profiler: Profiler? = null, +) { + val groups = remember(providers) { + providers + .groupBy { it.groupTitle() } + .map { + AwesomeBar.SuggestionProviderGroup( + providers = it.value, + title = it.key, + ) + } + } + + AwesomeBar( + text = text, + colors = colors, + groups = groups, + orientation = orientation, + onSuggestionClicked = { _, suggestion -> onSuggestionClicked(suggestion) }, + onAutoComplete = { _, suggestion -> onAutoComplete(suggestion) }, + onVisibilityStateUpdated = onVisibilityStateUpdated, + onScroll = onScroll, + profiler = profiler, + ) +} + +/** + * An awesome bar displaying suggestions in groups from the list of provided [AwesomeBar.SuggestionProviderGroup]s. + * + * @param text The text entered by the user and for which the AwesomeBar should show suggestions for. + * @param colors The color scheme the AwesomeBar will use for the UI. + * @param groups The list of groups of suggestion providers to query whenever the [text] changes. + * @param orientation Whether the AwesomeBar is oriented to the top or the bottom of the screen. + * @param onSuggestionClicked Gets invoked whenever the user clicks on a suggestion in the AwesomeBar. + * @param onAutoComplete Gets invoked when the user clicks on the "autocomplete" icon of a suggestion. + * @param onVisibilityStateUpdated Gets invoked when the list of currently displayed suggestions changes. + * @param onScroll Gets invoked at the beginning of the user performing a scroll gesture. + */ +@Composable +fun AwesomeBar( + text: String, + colors: AwesomeBarColors = AwesomeBarDefaults.colors(), + groups: List<AwesomeBar.SuggestionProviderGroup>, + orientation: AwesomeBarOrientation = AwesomeBarOrientation.TOP, + onSuggestionClicked: (AwesomeBar.SuggestionProviderGroup, AwesomeBar.Suggestion) -> Unit, + onAutoComplete: (AwesomeBar.SuggestionProviderGroup, AwesomeBar.Suggestion) -> Unit, + onVisibilityStateUpdated: (AwesomeBar.VisibilityState) -> Unit = {}, + onScroll: () -> Unit = {}, + profiler: Profiler? = null, +) { + Column( + modifier = Modifier + .fillMaxWidth() + .testTag("mozac.awesomebar") + .background(colors.background), + ) { + val fetcher = remember(groups) { SuggestionFetcher(groups, profiler) } + + // This state does not need to be remembered, because it can change if the providers list changes. + @SuppressLint("UnrememberedMutableState") + val suggestions = derivedStateOf { fetcher.state.value }.value.toList() + .sortedByDescending { it.first.priority }.toMap(LinkedHashMap()) + + LaunchedEffect(text, fetcher) { + fetcher.fetch(text) + } + + Suggestions( + suggestions, + colors, + orientation, + onSuggestionClicked, + onAutoComplete, + onVisibilityStateUpdated, + onScroll, + ) + } +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarColors.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarColors.kt new file mode 100644 index 0000000000..fe31e36153 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarColors.kt @@ -0,0 +1,18 @@ +/* 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.compose.browser.awesomebar + +import androidx.compose.ui.graphics.Color + +/** + * Represents the colors used by the AwesomeBar. + */ +data class AwesomeBarColors( + val background: Color, + val title: Color, + val description: Color, + val autocompleteIcon: Color, + val groupTitle: Color, +) diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarDefaults.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarDefaults.kt new file mode 100644 index 0000000000..a804ad86df --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarDefaults.kt @@ -0,0 +1,39 @@ +/* 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.compose.browser.awesomebar + +import androidx.compose.material.ContentAlpha +import androidx.compose.material.MaterialTheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color + +/** + * Contains the default values used by the AwesomeBar. + */ +object AwesomeBarDefaults { + /** + * Creates an [AwesomeBarColors] that represents the default colors used in an AwesomeBar. + * + * @param background The background of the AwesomeBar. + * @param title The text color for the title of a suggestion. + * @param description The text color for the description of a suggestion. + */ + @Composable + fun colors( + background: Color = MaterialTheme.colors.background, + title: Color = MaterialTheme.colors.onBackground, + description: Color = MaterialTheme.colors.onBackground.copy( + alpha = ContentAlpha.medium, + ), + autocompleteIcon: Color = MaterialTheme.colors.onSurface, + groupTitle: Color = MaterialTheme.colors.onBackground, + ) = AwesomeBarColors( + background, + title, + description, + autocompleteIcon, + groupTitle, + ) +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarFacts.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarFacts.kt new file mode 100644 index 0000000000..bfa748cb06 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarFacts.kt @@ -0,0 +1,44 @@ +/* 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.compose.browser.awesomebar + +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 + +/** + * Facts emitted for telemetry related to the AwesomeBar composable. + */ +object AwesomeBarFacts { + /** + * Specific types of telemetry items. + */ + object Items { + const val PROVIDER_DURATION = "provider_duration" + } + + /** + * Keys used to record metadata about [Items]. + */ + object MetadataKeys { + const val DURATION_PAIR = "duration_pair" + } + + internal fun emitAwesomeBarFact( + action: Action, + item: String, + value: String? = null, + metadata: Map<String, Any>? = null, + ) { + Fact( + Component.COMPOSE_AWESOMEBAR, + action, + item, + value, + metadata, + ).collect() + } +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarOrientation.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarOrientation.kt new file mode 100644 index 0000000000..246f917c1e --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/AwesomeBarOrientation.kt @@ -0,0 +1,13 @@ +/* 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.compose.browser.awesomebar + +/** + * The orientation of the AwesomeBar, whether it's oriented to the bottom or the top. + */ +enum class AwesomeBarOrientation { + TOP, + BOTTOM, +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/Suggestion.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/Suggestion.kt new file mode 100644 index 0000000000..275e336414 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/Suggestion.kt @@ -0,0 +1,184 @@ +/* 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.compose.browser.awesomebar.internal + +import android.graphics.Bitmap +import android.graphics.drawable.Drawable +import androidx.compose.foundation.Image +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.IntrinsicSize +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.defaultMinSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.draw.rotate +import androidx.compose.ui.graphics.ColorFilter +import androidx.compose.ui.graphics.asImageBitmap +import androidx.compose.ui.layout.ContentScale +import androidx.compose.ui.platform.testTag +import androidx.compose.ui.res.painterResource +import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.core.graphics.drawable.toBitmap +import mozilla.components.compose.browser.awesomebar.AwesomeBarColors +import mozilla.components.compose.browser.awesomebar.AwesomeBarOrientation +import mozilla.components.compose.browser.awesomebar.R +import mozilla.components.concept.awesomebar.AwesomeBar +import mozilla.components.ui.icons.R as iconsR + +// We only show one row of text, covering at max screen width. +// Limit bigger texts that could cause slowdowns or even crashes. +private const val SUGGESTION_TEXT_MAX_LENGTH = 100 + +@Composable +internal fun Suggestion( + suggestion: AwesomeBar.Suggestion, + colors: AwesomeBarColors, + orientation: AwesomeBarOrientation, + onSuggestionClicked: () -> Unit, + onAutoComplete: () -> Unit, +) { + Row( + modifier = Modifier + .clickable { onSuggestionClicked() } + .defaultMinSize(minHeight = 56.dp) + .testTag("mozac.awesomebar.suggestion") + .padding(start = 16.dp, top = 8.dp, bottom = 8.dp, end = 8.dp), + ) { + val icon = suggestion.icon + if (icon != null) { + SuggestionIcon( + icon = icon, + indicator = suggestion.indicatorIcon, + ) + } + SuggestionTitleAndDescription( + title = suggestion.title?.take(SUGGESTION_TEXT_MAX_LENGTH), + description = suggestion.description?.take(SUGGESTION_TEXT_MAX_LENGTH), + colors = colors, + modifier = Modifier + .weight(1f) + .align(Alignment.CenterVertically), + ) + if (suggestion.editSuggestion != null) { + AutocompleteButton( + onAutoComplete = onAutoComplete, + orientation = orientation, + colors = colors, + modifier = Modifier.align(Alignment.CenterVertically), + ) + } + } +} + +@Composable +private fun SuggestionTitleAndDescription( + title: String?, + description: String?, + colors: AwesomeBarColors, + modifier: Modifier = Modifier, +) { + Column( + modifier = modifier, + ) { + Text( + text = if (title.isNullOrEmpty()) { + description ?: "" + } else { + title + }, + color = colors.title, + fontSize = 15.sp, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier + .width(IntrinsicSize.Max) + .padding(start = 2.dp, end = 8.dp), + ) + if (description?.isNotEmpty() == true) { + Text( + text = description, + color = colors.description, + fontSize = 12.sp, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier + .width(IntrinsicSize.Max) + .padding(start = 2.dp, end = 8.dp), + ) + } + } +} + +@Composable +private fun SuggestionIcon( + icon: Bitmap, + indicator: Drawable?, +) { + Box( + modifier = Modifier + .width(30.dp) + .height(38.dp), + ) { + Image( + icon.asImageBitmap(), + contentDescription = null, + modifier = Modifier + .padding(top = 8.dp) + .clip(RoundedCornerShape(2.dp)) + .width(24.dp) + .height(24.dp), + contentScale = ContentScale.Crop, + ) + if (indicator != null) { + Image( + indicator.toBitmap().asImageBitmap(), + contentDescription = null, + modifier = Modifier + .padding(top = 22.dp, start = 14.dp) + .width(16.dp) + .height(16.dp), + ) + } + } +} + +@Composable +@Suppress("MagicNumber") +private fun AutocompleteButton( + onAutoComplete: () -> Unit, + colors: AwesomeBarColors, + orientation: AwesomeBarOrientation, + modifier: Modifier, +) { + Image( + painterResource(iconsR.drawable.mozac_ic_append_up_left_24), + colorFilter = ColorFilter.tint(colors.autocompleteIcon), + contentDescription = stringResource(R.string.mozac_browser_awesomebar_edit_suggestion), + modifier = modifier + .size(48.dp) + .rotate( + if (orientation == AwesomeBarOrientation.BOTTOM) { + 270f + } else { + 0f + }, + ) + .clickable { onAutoComplete() } + .padding(12.dp), + ) +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionFetcher.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionFetcher.kt new file mode 100644 index 0000000000..354d2a25c5 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionFetcher.kt @@ -0,0 +1,160 @@ +/* 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.compose.browser.awesomebar.internal + +import android.os.SystemClock +import androidx.annotation.VisibleForTesting +import androidx.compose.runtime.RememberObserver +import androidx.compose.runtime.mutableStateOf +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.asCoroutineDispatcher +import kotlinx.coroutines.launch +import mozilla.components.compose.browser.awesomebar.AwesomeBarFacts +import mozilla.components.compose.browser.awesomebar.AwesomeBarFacts.emitAwesomeBarFact +import mozilla.components.concept.awesomebar.AwesomeBar +import mozilla.components.concept.base.profiler.Profiler +import mozilla.components.support.base.facts.Action +import mozilla.components.support.base.utils.NamedThreadFactory +import mozilla.components.support.utils.ThreadUtils +import java.util.concurrent.Executors + +/** + * Class responsible for fetching search suggestions and exposing a [state] to observe the current + * list of suggestions from a composable. + */ +internal class SuggestionFetcher( + private val groups: List<AwesomeBar.SuggestionProviderGroup>, + private val profiler: Profiler?, +) : RememberObserver { + private val dispatcher = Executors.newFixedThreadPool( + groups.fold(0, { acc, group -> acc + group.providers.size }), + NamedThreadFactory("SuggestionFetcher"), + ).asCoroutineDispatcher() + + @VisibleForTesting + internal var fetchJob: Job? = null + + /** + * The current list of suggestions as an observable list. + */ + val state = mutableStateOf<Map<AwesomeBar.SuggestionProviderGroup, List<AwesomeBar.Suggestion>>>(emptyMap()) + + /** + * Fetches suggestions for [text] from all providers in all [groups] asynchronously. + * + * The [state] property will be updated whenever new suggestions are available. + */ + suspend fun fetch(text: String) { + profiler?.addMarker("SuggestionFetcher.fetch") // DO NOT ADD ANYTHING ABOVE THIS addMarker CALL. + + fetchJob?.cancel() + + fetchJob = CoroutineScope(dispatcher).launch { + groups.forEach { group -> + group.providers.forEach { provider -> + val profilerStartTime = profiler?.getProfilerTime() // DO NOT ADD ANYTHING ABOVE getProfilerTime. + launch(dispatcher) { fetchFrom(group, provider, text, profilerStartTime) } + } + } + } + } + + /** + * Fetches suggestions from [provider]. + */ + @VisibleForTesting + internal suspend fun fetchFrom( + group: AwesomeBar.SuggestionProviderGroup, + provider: AwesomeBar.SuggestionProvider, + text: String, + profilerStartTime: Double?, + ) { + // At this point, we have a timing value for a provider. + // We have a choice here - we can try grouping different timings together for a + // single user input value, or we can just treat them as entirely independent values. + // These timings are correlated with each other in a sense that they act on the same + // inputs, and are executed at the same time. However, our goal here is to track performance + // of the providers. Each provider acts independently from another; recording their performance + // at an individual level will allow us to track that performance over time. + // Tracked value will be reflected both in perceived user experience (how quickly results from + // a provider show up), and in a purely technical interpretation of how quickly providers + // fulfill requests. + // Grouping also poses timing challenges - as user is typing, we're trying to cancel these + // provider requests. Given that each request can take an arbitrary amount of time to execute, + // grouping correctly becomes tricky and we run a risk of omitting certain values - or, of + // adding a bunch of complexity just for the sake of "correct grouping". + val start = SystemClock.elapsedRealtimeNanos() + val suggestions = provider.onInputChanged(text) + val end = SystemClock.elapsedRealtimeNanos() + emitProviderQueryTimingFact(provider, timingNs = end - start) + + processResultFrom(group, provider, suggestions, profilerStartTime) + } + + /** + * Updates [state] to include the [suggestions] from [provider]. + */ + @Synchronized + @VisibleForTesting + internal fun processResultFrom( + group: AwesomeBar.SuggestionProviderGroup, + provider: AwesomeBar.SuggestionProvider, + suggestions: List<AwesomeBar.Suggestion>, + profilerStartTime: Double?, + ) { + val suggestionMap = state.value + + val updatedSuggestions = (suggestionMap[group] ?: emptyList()) + .filter { suggestion -> suggestion.provider != provider } + .toMutableList() + + updatedSuggestions.addAll(suggestions) + updatedSuggestions.sortByDescending { suggestion -> suggestion.score } + + if (updatedSuggestions.isNotEmpty()) { + group.priority = updatedSuggestions[0].score + } + + val updatedSuggestionMap = suggestionMap.toMutableMap() + updatedSuggestionMap[group] = updatedSuggestions + state.value = updatedSuggestionMap + val profilerEndTime = profiler?.getProfilerTime() // THIS MUST OCCUR RIGHT AFTER STATE UPDATE. + + // Markers can only be added on the main thread right now. + profiler?.let { + ThreadUtils.postToMainThread { + profiler.addMarker( + "Suggestion update", + profilerStartTime, + profilerEndTime, + provider::class.simpleName, + ) + } + } + } + + override fun onAbandoned() { + dispatcher.close() + } + + override fun onForgotten() { + dispatcher.close() + } + + override fun onRemembered() = Unit +} + +@Suppress("MagicNumber") +internal fun emitProviderQueryTimingFact(provider: AwesomeBar.SuggestionProvider, timingNs: Long) { + emitAwesomeBarFact( + Action.INTERACTION, + AwesomeBarFacts.Items.PROVIDER_DURATION, + metadata = mapOf( + // We only care about millisecond precision here, so convert from ns to ms before emitting. + AwesomeBarFacts.MetadataKeys.DURATION_PAIR to (provider to (timingNs / 1_000_000L)), + ), + ) +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionGroup.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionGroup.kt new file mode 100644 index 0000000000..0d76d0c21a --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionGroup.kt @@ -0,0 +1,35 @@ +/* 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.compose.browser.awesomebar.internal + +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import mozilla.components.compose.browser.awesomebar.AwesomeBarColors + +/** + * Renders a header for a group of suggestions. + */ +@Composable +internal fun SuggestionGroup( + title: String, + colors: AwesomeBarColors, +) { + Text( + title, + color = colors.groupTitle, + modifier = Modifier + .padding( + vertical = 12.dp, + horizontal = 16.dp, + ) + .fillMaxWidth(), + fontSize = 14.sp, + ) +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/Suggestions.kt b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/Suggestions.kt new file mode 100644 index 0000000000..b505d1503f --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/java/mozilla/components/compose/browser/awesomebar/internal/Suggestions.kt @@ -0,0 +1,168 @@ +/* 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.compose.browser.awesomebar.internal + +import android.os.Parcelable +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.LazyListState +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.runtime.RememberObserver +import androidx.compose.runtime.getValue +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberUpdatedState +import androidx.compose.runtime.snapshotFlow +import androidx.compose.ui.Modifier +import androidx.compose.ui.platform.testTag +import kotlinx.coroutines.flow.combine +import kotlinx.coroutines.flow.distinctUntilChangedBy +import kotlinx.parcelize.Parcelize +import mozilla.components.compose.browser.awesomebar.AwesomeBarColors +import mozilla.components.compose.browser.awesomebar.AwesomeBarOrientation +import mozilla.components.concept.awesomebar.AwesomeBar + +@Composable +internal fun Suggestions( + suggestions: Map<AwesomeBar.SuggestionProviderGroup, List<AwesomeBar.Suggestion>>, + colors: AwesomeBarColors, + orientation: AwesomeBarOrientation, + onSuggestionClicked: (AwesomeBar.SuggestionProviderGroup, AwesomeBar.Suggestion) -> Unit, + onAutoComplete: (AwesomeBar.SuggestionProviderGroup, AwesomeBar.Suggestion) -> Unit, + onVisibilityStateUpdated: (AwesomeBar.VisibilityState) -> Unit, + onScroll: () -> Unit, +) { + val state = rememberLazyListState() + + ScrollHandler(state, onScroll) + + LazyColumn( + state = state, + modifier = Modifier.testTag("mozac.awesomebar.suggestions"), + ) { + suggestions.forEach { (group, suggestions) -> + val title = group.title + if (suggestions.isNotEmpty() && !title.isNullOrEmpty()) { + item(ItemKey.SuggestionGroup(group.id)) { + SuggestionGroup(title, colors) + } + } + + items( + items = suggestions.take(group.limit), + key = { suggestion -> ItemKey.Suggestion(group.id, suggestion.provider.id, suggestion.id) }, + ) { suggestion -> + Suggestion( + suggestion, + colors, + orientation, + onSuggestionClicked = { onSuggestionClicked(group, suggestion) }, + onAutoComplete = { onAutoComplete(group, suggestion) }, + ) + } + } + } + + val currentSuggestions by rememberUpdatedState(suggestions) + val currentOnVisibilityStateUpdated by rememberUpdatedState(onVisibilityStateUpdated) + + LaunchedEffect(Unit) { + // This effect is launched on the initial composition, and cancelled when `Suggestions` leaves the Composition. + // The flow below emits new values when either the latest list of suggestions changes, or the visibility or + // position of any suggestion in that list changes. + snapshotFlow { currentSuggestions } + .combine(snapshotFlow { state.layoutInfo.visibleItemsInfo }) { suggestions, visibleItemsInfo -> + VisibleItems( + suggestions = suggestions, + visibleItemKeys = visibleItemsInfo.map { it.key as ItemKey }, + ) + } + .distinctUntilChangedBy { it.visibleItemKeys } + .collect { currentOnVisibilityStateUpdated(it.toVisibilityState()) } + } +} + +/** + * An effect for handling scrolls in a [LazyColumn]. Will invoke [onScroll] at the beginning + * of a scroll gesture. + */ +@Composable +private fun ScrollHandler( + state: LazyListState, + onScroll: () -> Unit, +) { + val scrollInProgress = state.isScrollInProgress + remember(scrollInProgress) { + ScrollHandlerImpl(scrollInProgress, onScroll) + } +} + +/** + * [RememberObserver] implementation that will make sure that [onScroll] get called only once as + * long as [scrollInProgress] doesn't change. + */ +private class ScrollHandlerImpl( + private val scrollInProgress: Boolean, + private val onScroll: () -> Unit, +) : RememberObserver { + override fun onAbandoned() = Unit + override fun onForgotten() = Unit + + override fun onRemembered() { + if (scrollInProgress) { + onScroll() + } + } +} + +/** + * A stable, unique key for an item in the [Suggestions] list. + */ +internal sealed interface ItemKey { + @Parcelize + data class SuggestionGroup(val id: String) : ItemKey, Parcelable + + @Parcelize + data class Suggestion( + val groupId: String, + val providerId: String, + val suggestionId: String, + ) : ItemKey, Parcelable +} + +/** + * A snapshot of all the fetched suggestions to show in the [Suggestions] list, and the keys of the visible items + * in that list, ordered top to bottom. The intersection of the two is the current [AwesomeBar.VisibilityState]. + */ +internal data class VisibleItems( + val suggestions: Map<AwesomeBar.SuggestionProviderGroup, List<AwesomeBar.Suggestion>>, + val visibleItemKeys: List<ItemKey>, +) { + fun toVisibilityState(): AwesomeBar.VisibilityState = + if (visibleItemKeys.isEmpty()) { + AwesomeBar.VisibilityState() + } else { + AwesomeBar.VisibilityState( + // `suggestions` is insertion-ordered, and `toMap()` preserves that order, so the groups in + // `visibleProviderGroups` are in the same order as they're shown in the awesomebar. + visibleProviderGroups = suggestions.mapNotNull { (group, suggestions) -> + val visibleSuggestions = suggestions.filter { suggestion -> + val suggestionItemKey = ItemKey.Suggestion( + groupId = group.id, + providerId = suggestion.provider.id, + suggestionId = suggestion.id, + ) + visibleItemKeys.contains(suggestionItemKey) + } + if (visibleSuggestions.isNotEmpty()) { + group to visibleSuggestions + } else { + null + } + }.toMap(), + ) + } +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-am/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-am/strings.xml new file mode 100644 index 0000000000..9c811b081b --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-am/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">ጥቆማን ተቀበል እና አርትዕ</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ar/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ar/strings.xml new file mode 100644 index 0000000000..fca9a6d723 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ar/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">اقبل الاقتراح وحرّره</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ast/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ast/strings.xml new file mode 100644 index 0000000000..c3681052e8 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ast/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceptar ya editar la suxerencia</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-azb/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-azb/strings.xml new file mode 100644 index 0000000000..6856d82e37 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-azb/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">تکلیفلری قبول و دوزهلیش ائدین</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ban/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ban/strings.xml new file mode 100644 index 0000000000..5592ff756e --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ban/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Cumpu miwah uah saran</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-be/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-be/strings.xml new file mode 100644 index 0000000000..7a05d5c150 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-be/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Прыняць і рэдагаваць прапанову</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-bg/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-bg/strings.xml new file mode 100644 index 0000000000..fee7ceb76d --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-bg/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Приемане и редакция на предложението</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-br/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-br/strings.xml new file mode 100644 index 0000000000..647d3ccc51 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-br/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Asantiñ hag embann ar c‘hinnig</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-bs/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-bs/strings.xml new file mode 100644 index 0000000000..12124a89c9 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-bs/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Prihvati i uredi prijedlog</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ca/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ca/strings.xml new file mode 100644 index 0000000000..db7a40ac20 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ca/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accepta i edita el suggeriment</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cak/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cak/strings.xml new file mode 100644 index 0000000000..e0ec236f51 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cak/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Tik\'ul chuqa\' tinuk\' chilab\'enïk</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ceb/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ceb/strings.xml new file mode 100644 index 0000000000..33fd4d981a --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ceb/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Dawata ug usba ang sugyot</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ckb/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ckb/strings.xml new file mode 100644 index 0000000000..32a9820f12 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ckb/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">ڕازیبە و پێشنیارەکە دەستکاریبکە</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-co/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-co/strings.xml new file mode 100644 index 0000000000..7485b24bbe --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-co/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accettà è mudificà a suggestione</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cs/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cs/strings.xml new file mode 100644 index 0000000000..ef57156331 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cs/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Přijmout a upravit návrh</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cy/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cy/strings.xml new file mode 100644 index 0000000000..8476dd6ad7 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-cy/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Derbyn a golygu awgrym</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-da/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-da/strings.xml new file mode 100644 index 0000000000..4dd702661c --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-da/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accepter og rediger forslag</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-de/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-de/strings.xml new file mode 100644 index 0000000000..a3e5839463 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-de/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Vorschlag annehmen und bearbeiten</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-dsb/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-dsb/strings.xml new file mode 100644 index 0000000000..6e0d778296 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-dsb/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Naraźenje akceptěrowaś a wobźěłaś</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-el/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-el/strings.xml new file mode 100644 index 0000000000..f66fb02587 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-el/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Αποδοχή και επεξεργασία πρότασης</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-en-rCA/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-en-rCA/strings.xml new file mode 100644 index 0000000000..a5fd6b47e3 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-en-rCA/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accept and edit suggestion</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-en-rGB/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-en-rGB/strings.xml new file mode 100644 index 0000000000..a5fd6b47e3 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-en-rGB/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accept and edit suggestion</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-eo/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-eo/strings.xml new file mode 100644 index 0000000000..79f9e026ed --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-eo/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Akcepti kaj modifi sugeston</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rAR/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rAR/strings.xml new file mode 100644 index 0000000000..76061a6811 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rAR/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceptar y editar sugerencia</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rCL/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rCL/strings.xml new file mode 100644 index 0000000000..76061a6811 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rCL/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceptar y editar sugerencia</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rES/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rES/strings.xml new file mode 100644 index 0000000000..76061a6811 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rES/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceptar y editar sugerencia</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rMX/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rMX/strings.xml new file mode 100644 index 0000000000..76061a6811 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es-rMX/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceptar y editar sugerencia</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es/strings.xml new file mode 100644 index 0000000000..76061a6811 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-es/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceptar y editar sugerencia</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-et/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-et/strings.xml new file mode 100644 index 0000000000..30d1bc57c6 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-et/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Nõustu ja muuda soovitust</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-eu/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-eu/strings.xml new file mode 100644 index 0000000000..c2d90b206e --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-eu/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Onartu eta editatu iradokizuna</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fa/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fa/strings.xml new file mode 100644 index 0000000000..51d494d857 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fa/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">پذیرش و ویرایش پیشنهاد</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fi/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fi/strings.xml new file mode 100644 index 0000000000..26c1bf745d --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fi/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Hyväksy ehdotus ja muokkaa sitä</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fr/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fr/strings.xml new file mode 100644 index 0000000000..4854ede352 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fr/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accepter et modifier la suggestion</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fur/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fur/strings.xml new file mode 100644 index 0000000000..3fce06ba6c --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fur/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Acete e modifiche sugjeriment</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fy-rNL/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fy-rNL/strings.xml new file mode 100644 index 0000000000..e3be14f405 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-fy-rNL/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Suggestje akseptearje en bewurkje</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gd/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gd/strings.xml new file mode 100644 index 0000000000..48b3251c4b --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gd/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Gabh ris is deasaich am moladh</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gl/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gl/strings.xml new file mode 100644 index 0000000000..cc1aafdc78 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gl/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceptar e editar a suxestión</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gn/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gn/strings.xml new file mode 100644 index 0000000000..041524a8c8 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-gn/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Emoneĩ ha embosako’i ñe’ẽporã</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hi-rIN/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hi-rIN/strings.xml new file mode 100644 index 0000000000..4bcd2e4b94 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hi-rIN/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">सुझाव को स्वीकारें और संपादित करें</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hr/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hr/strings.xml new file mode 100644 index 0000000000..12124a89c9 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hr/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Prihvati i uredi prijedlog</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hsb/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hsb/strings.xml new file mode 100644 index 0000000000..e83f6c018c --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hsb/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Namjet přiwzać a wobdźěłać</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hu/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hu/strings.xml new file mode 100644 index 0000000000..bc890be834 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hu/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Elfogadás és a javaslat szerkesztése</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hy-rAM/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hy-rAM/strings.xml new file mode 100644 index 0000000000..5283d8d707 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-hy-rAM/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Ընդունել և խմբագրել առաջարկությունը</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ia/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ia/strings.xml new file mode 100644 index 0000000000..5631621fdc --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ia/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Acceptar e rediger suggestion</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-in/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-in/strings.xml new file mode 100644 index 0000000000..54967054e7 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-in/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Terima dan ubah saran</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-is/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-is/strings.xml new file mode 100644 index 0000000000..10c6b79c14 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-is/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Samþykkja og breyta tillögu</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-it/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-it/strings.xml new file mode 100644 index 0000000000..c6812c4865 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-it/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accetta e modifica suggerimento</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-iw/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-iw/strings.xml new file mode 100644 index 0000000000..d595def498 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-iw/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">לקבל ולערוך את ההצעה</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ja/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ja/strings.xml new file mode 100644 index 0000000000..ea9a12d306 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ja/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">提案を受け入れて編集</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ka/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ka/strings.xml new file mode 100644 index 0000000000..1a1664e0a0 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ka/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">მიღება და შემოთავაზების ჩასწორება</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kaa/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kaa/strings.xml new file mode 100644 index 0000000000..450efcd9a1 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kaa/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Usınıslardı qabıllaw hám ózgertiw</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kab/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kab/strings.xml new file mode 100644 index 0000000000..3117f7591b --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kab/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Qbel syen ẓreg asumer</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kk/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kk/strings.xml new file mode 100644 index 0000000000..83d4d9261a --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kk/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Ұсынысты қабылдау және түзету</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kmr/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kmr/strings.xml new file mode 100644 index 0000000000..d7dc068c21 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-kmr/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Pêşniyarê bipejirîne û sererast bike</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ko/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ko/strings.xml new file mode 100644 index 0000000000..308e45797f --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ko/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">제안 수락 및 편집</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-lo/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-lo/strings.xml new file mode 100644 index 0000000000..eed7f6e8c0 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-lo/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">ຍອມຮັບ ແລະ ແກ້ໄຂຄຳແນະນຳ</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-lt/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-lt/strings.xml new file mode 100644 index 0000000000..2b5c72b442 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-lt/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Priimti ir redaguoti pasiūlymą</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-mr/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-mr/strings.xml new file mode 100644 index 0000000000..42c0a8df5b --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-mr/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">सूचना स्वीकारा व संपादित करा</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-my/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-my/strings.xml new file mode 100644 index 0000000000..63b5bee53a --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-my/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">အကြံပြုချက်အားလက်ခံ၍တည်းဖြတ်မည်</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nb-rNO/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nb-rNO/strings.xml new file mode 100644 index 0000000000..f141385354 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nb-rNO/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Godta og rediger forslag</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ne-rNP/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ne-rNP/strings.xml new file mode 100644 index 0000000000..905e09f84b --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ne-rNP/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">सुझाव स्वीकार्नुहोस् र सम्पादन गर्नुहोस्</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nl/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nl/strings.xml new file mode 100644 index 0000000000..f2379344d1 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nl/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Suggestie accepteren en bewerken</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nn-rNO/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nn-rNO/strings.xml new file mode 100644 index 0000000000..f141385354 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-nn-rNO/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Godta og rediger forslag</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-oc/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-oc/strings.xml new file mode 100644 index 0000000000..fce8718fd2 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-oc/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Acceptar e modificar la suggestion</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-or/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-or/strings.xml new file mode 100644 index 0000000000..2e861cce89 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-or/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">ସ୍ୱୀକାର କରି ପରାମର୍ଶଟିକୁ ସମ୍ପାଦନ କରନ୍ତୁ</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pa-rIN/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pa-rIN/strings.xml new file mode 100644 index 0000000000..ba64f33a8a --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pa-rIN/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">ਸੁਝਾਅ ਮੰਨੋ ਤੇ ਸੋਧੋ</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pa-rPK/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pa-rPK/strings.xml new file mode 100644 index 0000000000..1ea85cff8d --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pa-rPK/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">تجویز منو تے سودھو</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pl/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pl/strings.xml new file mode 100644 index 0000000000..7de1109e3d --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pl/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Przyjmij i modyfikuj podpowiedź</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pt-rBR/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pt-rBR/strings.xml new file mode 100644 index 0000000000..478fab2ca3 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pt-rBR/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceitar e editar sugestão</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pt-rPT/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pt-rPT/strings.xml new file mode 100644 index 0000000000..478fab2ca3 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-pt-rPT/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Aceitar e editar sugestão</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-rm/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-rm/strings.xml new file mode 100644 index 0000000000..693ab380d5 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-rm/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Acceptar la proposta e modifitgar</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ru/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ru/strings.xml new file mode 100644 index 0000000000..c690872c02 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ru/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Выбрать и изменить подсказку</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sat/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sat/strings.xml new file mode 100644 index 0000000000..a57202cf0c --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sat/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">ᱵᱟᱛᱟᱣᱢᱮ ᱟᱨ ᱥᱩᱡᱷᱟᱹᱣ ᱥᱟᱯᱲᱟᱣ ᱢᱮ</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sc/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sc/strings.xml new file mode 100644 index 0000000000..ea90dc6e82 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sc/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Atzeta e modìfica su cussìgiu</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-si/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-si/strings.xml new file mode 100644 index 0000000000..2ebd54bc30 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-si/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">යෝජනාව පිළිගෙන සංස්කරණය</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sk/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sk/strings.xml new file mode 100644 index 0000000000..e9b00f0de7 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sk/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Akceptovať návrh a pokračovať v úprave</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-skr/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-skr/strings.xml new file mode 100644 index 0000000000..10bff0878f --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-skr/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">تجویز کوں قبول کرو تے تبدیلی کرو</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sl/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sl/strings.xml new file mode 100644 index 0000000000..7fe0c78a16 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sl/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Sprejmi in uredi predlog</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sq/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sq/strings.xml new file mode 100644 index 0000000000..d4a0920d65 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sq/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Pranoni dhe përpunoni sugjerimin</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sr/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sr/strings.xml new file mode 100644 index 0000000000..f361a3045d --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sr/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Прихвати и уреди предлог</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-su/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-su/strings.xml new file mode 100644 index 0000000000..4b049e8e1f --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-su/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Tampa jeung édit saran</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sv-rSE/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sv-rSE/strings.xml new file mode 100644 index 0000000000..e9e8f2d57e --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-sv-rSE/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Acceptera och redigera förslag</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-szl/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-szl/strings.xml new file mode 100644 index 0000000000..01a3221de9 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-szl/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Akceptuj i edytuj dorada</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ta/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ta/strings.xml new file mode 100644 index 0000000000..822e2ca5da --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ta/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">பரிந்துரையை ஏற்று திருத்து</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tg/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tg/strings.xml new file mode 100644 index 0000000000..d7716c120b --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tg/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Пешниҳодро қабул ва таҳрир намоед</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-th/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-th/strings.xml new file mode 100644 index 0000000000..4f22694ca9 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-th/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">ยอมรับและแก้ไขข้อเสนอแนะ</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tl/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tl/strings.xml new file mode 100644 index 0000000000..5df1097dc7 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tl/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Tanggapin at i-edit ang mungkahi</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tok/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tok/strings.xml new file mode 100644 index 0000000000..1cdbb57528 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tok/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">o kama jo, o ante</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tr/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tr/strings.xml new file mode 100644 index 0000000000..a50a78776c --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tr/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Öneriyi kabul et ve düzenle</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-trs/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-trs/strings.xml new file mode 100644 index 0000000000..087edecc87 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-trs/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Gārāyina nī nādūnāt nuguan\’ narikij</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tt/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tt/strings.xml new file mode 100644 index 0000000000..c15a889dbb --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-tt/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Тәкъдимне кабул итү һәм үзгәртү</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ug/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ug/strings.xml new file mode 100644 index 0000000000..476b29d8a2 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ug/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">تەكلىپنى قوبۇل قىلىپ تەھرىرلەيدۇ</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-uk/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-uk/strings.xml new file mode 100644 index 0000000000..0ae5b6ef4f --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-uk/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Прийняти та змінити пропозицію</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ur/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ur/strings.xml new file mode 100644 index 0000000000..defe8f4812 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-ur/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">تجویز کو قبول کریں اور ترمیم کریں</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-uz/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-uz/strings.xml new file mode 100644 index 0000000000..4dcf317d8c --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-uz/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Tavsiyani qabul qilish va tahrir qilish</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-vi/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-vi/strings.xml new file mode 100644 index 0000000000..292a5cd7fb --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-vi/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Chấp nhận và chỉnh sửa đề xuất</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-yo/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-yo/strings.xml new file mode 100644 index 0000000000..9112ee0856 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-yo/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Gbà á, kí o sì ṣe àtuṣe àbá</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-zh-rCN/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-zh-rCN/strings.xml new file mode 100644 index 0000000000..b21cab3d6c --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-zh-rCN/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">接受并编辑建议</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-zh-rTW/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-zh-rTW/strings.xml new file mode 100644 index 0000000000..87481af094 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values-zh-rTW/strings.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">接受並編輯建議</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/main/res/values/strings.xml b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values/strings.xml new file mode 100644 index 0000000000..467a778b07 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/main/res/values/strings.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> + <!-- Description for the button to accept the search suggestion and continue editing the search. --> + <string name="mozac_browser_awesomebar_edit_suggestion">Accept and edit suggestion</string> +</resources> diff --git a/mobile/android/android-components/components/compose/awesomebar/src/test/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionFetcherTest.kt b/mobile/android/android-components/components/compose/awesomebar/src/test/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionFetcherTest.kt new file mode 100644 index 0000000000..489b13c834 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/test/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionFetcherTest.kt @@ -0,0 +1,69 @@ +/* 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.compose.browser.awesomebar.internal + +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.Job +import mozilla.components.concept.awesomebar.AwesomeBar +import mozilla.components.concept.awesomebar.AwesomeBar.SuggestionProvider +import mozilla.components.concept.awesomebar.AwesomeBar.SuggestionProviderGroup +import mozilla.components.support.test.any +import mozilla.components.support.test.mock +import mozilla.components.support.test.rule.MainCoroutineRule +import mozilla.components.support.test.rule.runTestOnMain +import org.junit.Assert.assertEquals +import org.junit.Rule +import org.junit.Test +import org.mockito.Mockito.doAnswer +import org.mockito.Mockito.inOrder +import org.mockito.Mockito.spy + +@ExperimentalCoroutinesApi // for runTestOnMain +class SuggestionFetcherTest { + @get:Rule + val coroutinesTestRule = MainCoroutineRule() + + @Test + fun `GIVEN a new fetch request THEN all previous queries are cancelled`() = runTestOnMain { + val provider: SuggestionProvider = mock() + val providerGroup = SuggestionProviderGroup(listOf(provider)) + val fetcher = spy(SuggestionFetcher(listOf(providerGroup), null)) + val previousFetchJob: Job = mock() + fetcher.fetchJob = previousFetchJob + doAnswer {}.`when`(fetcher).fetchFrom(any(), any(), any(), any()) + val orderVerifier = inOrder(previousFetchJob, fetcher) + + fetcher.fetch("test") + + orderVerifier.verify(previousFetchJob)!!.cancel() + orderVerifier.verify(fetcher).fetchFrom(providerGroup, provider, "test", null) + } + + @Test + fun `GIVEN a suggestion group THEN the group's priority becomes highest suggestions' score within the group`() = runTestOnMain { + val provider: SuggestionProvider = mock() + val providerGroup = SuggestionProviderGroup(listOf(provider)) + val suggestions = listOf( + AwesomeBar.Suggestion( + provider = provider, + score = Int.MAX_VALUE, + ), + AwesomeBar.Suggestion( + provider = provider, + score = Int.MIN_VALUE, + ), + ) + val fetcher = spy(SuggestionFetcher(listOf(providerGroup), null)) + + fetcher.processResultFrom( + group = providerGroup, + provider = provider, + suggestions = suggestions, + profilerStartTime = null, + ) + + assertEquals(providerGroup.priority, Int.MAX_VALUE) + } +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/test/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionsTest.kt b/mobile/android/android-components/components/compose/awesomebar/src/test/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionsTest.kt new file mode 100644 index 0000000000..488103f99a --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/src/test/java/mozilla/components/compose/browser/awesomebar/internal/SuggestionsTest.kt @@ -0,0 +1,173 @@ +/* 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.compose.browser.awesomebar.internal + +import mozilla.components.concept.awesomebar.AwesomeBar.Suggestion +import mozilla.components.concept.awesomebar.AwesomeBar.SuggestionProvider +import mozilla.components.concept.awesomebar.AwesomeBar.SuggestionProviderGroup +import mozilla.components.support.test.mock +import mozilla.components.support.test.whenever +import org.junit.Assert.assertEquals +import org.junit.Assert.assertTrue +import org.junit.Test + +class SuggestionsTest { + @Test + fun `GIVEN 1 suggestion in 1 group WHEN neither are visible THEN return an empty visibility state`() { + val provider: SuggestionProvider = mock() + + val visibleItems = VisibleItems( + suggestions = mapOf(SuggestionProviderGroup(listOf(provider)) to listOf(Suggestion(provider))), + visibleItemKeys = emptyList(), + ) + + val visibilityState = visibleItems.toVisibilityState() + assertTrue(visibilityState.visibleProviderGroups.isEmpty()) + } + + @Test + fun `GIVEN 1 suggestion in 1 group WHEN both are visible THEN return a visibility state containing the suggestion`() { + val provider: SuggestionProvider = mock() + whenever(provider.id).thenReturn("provider") + val providerGroup = SuggestionProviderGroup(listOf(provider)) + val providerGroupSuggestions = listOf(Suggestion(provider)) + + val visibleItems = VisibleItems( + suggestions = mapOf(providerGroup to providerGroupSuggestions), + visibleItemKeys = listOf( + ItemKey.SuggestionGroup(providerGroup.id), + ItemKey.Suggestion(providerGroup.id, provider.id, providerGroupSuggestions[0].id), + ), + ) + + val visibilityState = visibleItems.toVisibilityState() + assertEquals( + visibilityState.visibleProviderGroups, + mapOf( + providerGroup to providerGroupSuggestions, + ), + ) + } + + @Test + fun `GIVEN 1 suggestion in 1 group WHEN only the suggestion is visible THEN return a visibility state containing the suggestion`() { + val provider: SuggestionProvider = mock() + whenever(provider.id).thenReturn("provider") + val providerGroup = SuggestionProviderGroup(listOf(provider)) + val providerGroupSuggestions = listOf(Suggestion(provider)) + + val visibleItems = VisibleItems( + suggestions = mapOf(providerGroup to providerGroupSuggestions), + visibleItemKeys = listOf( + ItemKey.Suggestion(providerGroup.id, provider.id, providerGroupSuggestions[0].id), + ), + ) + + val visibilityState = visibleItems.toVisibilityState() + assertEquals( + visibilityState.visibleProviderGroups, + mapOf( + providerGroup to providerGroupSuggestions, + ), + ) + } + + @Test + fun `GIVEN 2 suggestions in 1 group WHEN all are visible THEN return a visibility state containing the suggestions`() { + val provider: SuggestionProvider = mock() + whenever(provider.id).thenReturn("provider") + val providerGroup = SuggestionProviderGroup(listOf(provider)) + val providerGroupSuggestions = listOf(Suggestion(provider), Suggestion(provider)) + + val visibleItems = VisibleItems( + suggestions = mapOf(providerGroup to providerGroupSuggestions), + visibleItemKeys = listOf( + ItemKey.SuggestionGroup(providerGroup.id), + ItemKey.Suggestion(providerGroup.id, provider.id, providerGroupSuggestions[0].id), + ItemKey.Suggestion(providerGroup.id, provider.id, providerGroupSuggestions[1].id), + ), + ) + + val visibilityState = visibleItems.toVisibilityState() + assertEquals( + visibilityState.visibleProviderGroups, + mapOf( + providerGroup to providerGroupSuggestions, + ), + ) + } + + @Test + fun `GIVEN 2 suggestions in 2 groups WHEN 1 suggestion is visible in 1 group THEN return a visibility state containing the suggestion`() { + val firstProvider: SuggestionProvider = mock() + whenever(firstProvider.id).thenReturn("firstProvider") + val secondProvider: SuggestionProvider = mock() + whenever(secondProvider.id).thenReturn("secondProvider") + val thirdProvider: SuggestionProvider = mock() + whenever(thirdProvider.id).thenReturn("thirdProvider") + val firstProviderGroup = SuggestionProviderGroup(listOf(firstProvider, secondProvider)) + val firstProviderGroupSuggestions = listOf(Suggestion(firstProvider), Suggestion(secondProvider)) + val secondProviderGroup = SuggestionProviderGroup(listOf(secondProvider, thirdProvider)) + val secondProviderGroupSuggestions = listOf(Suggestion(secondProvider), Suggestion(thirdProvider)) + + val visibleItems = VisibleItems( + suggestions = mapOf( + firstProviderGroup to firstProviderGroupSuggestions, + secondProviderGroup to secondProviderGroupSuggestions, + ), + visibleItemKeys = listOf( + ItemKey.SuggestionGroup(firstProviderGroup.id), + ItemKey.Suggestion(firstProviderGroup.id, secondProvider.id, firstProviderGroupSuggestions[1].id), + ), + ) + + val visibilityState = visibleItems.toVisibilityState() + assertEquals( + visibilityState.visibleProviderGroups, + mapOf( + firstProviderGroup to listOf(firstProviderGroupSuggestions[1]), + ), + ) + } + + @Test + fun `GIVEN 2 suggestions in 2 groups WHEN 1 suggestion is visible in each group THEN return a visibility state containing the suggestions`() { + val firstProvider: SuggestionProvider = mock() + whenever(firstProvider.id).thenReturn("firstProvider") + + val secondProvider: SuggestionProvider = mock() + whenever(secondProvider.id).thenReturn("secondProvider") + + val thirdProvider: SuggestionProvider = mock() + whenever(thirdProvider.id).thenReturn("thirdProvider") + + val firstProviderGroup = SuggestionProviderGroup(listOf(firstProvider, secondProvider)) + val firstProviderGroupSuggestions = listOf(Suggestion(firstProvider), Suggestion(secondProvider)) + + val secondProviderGroup = SuggestionProviderGroup(listOf(secondProvider, thirdProvider)) + val secondProviderGroupSuggestions = listOf(Suggestion(secondProvider), Suggestion(thirdProvider)) + + val visibleItems = VisibleItems( + suggestions = mapOf( + firstProviderGroup to firstProviderGroupSuggestions, + secondProviderGroup to secondProviderGroupSuggestions, + ), + visibleItemKeys = listOf( + ItemKey.SuggestionGroup(firstProviderGroup.id), + ItemKey.Suggestion(firstProviderGroup.id, firstProvider.id, firstProviderGroupSuggestions[0].id), + ItemKey.SuggestionGroup(secondProviderGroup.id), + ItemKey.Suggestion(secondProviderGroup.id, thirdProvider.id, secondProviderGroupSuggestions[1].id), + ), + ) + val visibilityState = visibleItems.toVisibilityState() + assertEquals( + visibilityState.visibleProviderGroups, + mapOf( + firstProviderGroup to listOf(firstProviderGroupSuggestions[0]), + secondProviderGroup to listOf(secondProviderGroupSuggestions[1]), + ), + ) + } +} diff --git a/mobile/android/android-components/components/compose/awesomebar/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/mobile/android/android-components/components/compose/awesomebar/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 0000000000..cf1c399ea8 --- /dev/null +++ b/mobile/android/android-components/components/compose/awesomebar/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) |