Copione merged onto master
commit
1c22b4a2b4
|
@ -215,7 +215,8 @@
|
|||
android:name=".crashes.CrashListActivity"
|
||||
android:exported="false" />
|
||||
|
||||
<activity android:name=".widget.VoiceSearchActivity" />
|
||||
<activity android:name=".widget.VoiceSearchActivity"
|
||||
android:theme="@style/Theme.AppCompat.Translucent"/>
|
||||
|
||||
<activity
|
||||
android:name=".settings.account.AuthCustomTabActivity"
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.ext
|
||||
|
||||
import org.mozilla.fenix.library.downloads.DownloadItem
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
* Checks a List of DownloadItems to verify whether items
|
||||
* on that list are present on the disk or not. If a user has
|
||||
* deleted the downloaded item it should not show on the downloaded
|
||||
* list.
|
||||
*/
|
||||
fun List<DownloadItem>.filterNotExistsOnDisk(): List<DownloadItem> {
|
||||
return this.filter {
|
||||
File(it.filePath).exists()
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ import android.view.View
|
|||
import android.view.ViewGroup
|
||||
import kotlinx.android.synthetic.main.fragment_downloads.view.*
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import mozilla.components.browser.state.state.content.DownloadState
|
||||
import mozilla.components.feature.downloads.AbstractFetchDownloadService
|
||||
import mozilla.components.lib.state.ext.consumeFrom
|
||||
import mozilla.components.support.base.feature.UserInteractionHandler
|
||||
|
@ -18,6 +19,7 @@ import org.mozilla.fenix.R
|
|||
import org.mozilla.fenix.browser.browsingmode.BrowsingMode
|
||||
import org.mozilla.fenix.components.StoreProvider
|
||||
import org.mozilla.fenix.components.metrics.Event
|
||||
import org.mozilla.fenix.ext.filterNotExistsOnDisk
|
||||
import org.mozilla.fenix.ext.requireComponents
|
||||
import org.mozilla.fenix.ext.showToolbar
|
||||
import org.mozilla.fenix.library.LibraryPageFragment
|
||||
|
@ -37,13 +39,16 @@ class DownloadFragment : LibraryPageFragment<DownloadItem>(), UserInteractionHan
|
|||
|
||||
val items = requireComponents.core.store.state.downloads.map {
|
||||
DownloadItem(
|
||||
it.value.id,
|
||||
it.value.id.toString(),
|
||||
it.value.fileName,
|
||||
it.value.filePath,
|
||||
it.value.contentLength.toString(),
|
||||
it.value.contentType
|
||||
it.value.contentType,
|
||||
it.value.status
|
||||
)
|
||||
}
|
||||
}.filter {
|
||||
it.status == DownloadState.Status.COMPLETED
|
||||
}.filterNotExistsOnDisk()
|
||||
|
||||
downloadStore = StoreProvider.get(this) {
|
||||
DownloadFragmentStore(
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
package org.mozilla.fenix.library.downloads
|
||||
|
||||
import mozilla.components.browser.state.state.content.DownloadState
|
||||
import mozilla.components.lib.state.Action
|
||||
import mozilla.components.lib.state.State
|
||||
import mozilla.components.lib.state.Store
|
||||
|
@ -17,11 +18,12 @@ import mozilla.components.lib.state.Store
|
|||
* @property contentType The type of file the download is
|
||||
*/
|
||||
data class DownloadItem(
|
||||
val id: Long,
|
||||
val id: String,
|
||||
val fileName: String?,
|
||||
val filePath: String,
|
||||
val size: String,
|
||||
val contentType: String?
|
||||
val contentType: String?,
|
||||
val status: DownloadState.Status
|
||||
)
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,6 +34,11 @@ class VoiceSearchActivity : AppCompatActivity() {
|
|||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
if (Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH).resolveActivity(packageManager) == null) {
|
||||
finish()
|
||||
return
|
||||
}
|
||||
|
||||
// Retrieve the previous intent from the saved state
|
||||
previousIntent = savedInstanceState?.get(PREVIOUS_INTENT) as Intent?
|
||||
if (previousIntent.isForSpeechProcessing()) {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- App name for private browsing mode, only the "Private" portion should be localized. -->
|
||||
<string name="app_name_private_2">Məxfi Firefox Preview</string>
|
||||
<!-- App name for private browsing mode, only the "Private" portion should be localized. -->
|
||||
<string name="app_name_private_3">Firefox Preview (Məxfi)</string>
|
||||
<!-- Home Fragment -->
|
||||
<!-- Content description (not visible, for screen readers etc.): "Three dot" menu button. -->
|
||||
<string name="content_description_menu">Digər seçimlər</string>
|
||||
|
@ -13,23 +9,17 @@
|
|||
<string name="content_description_disable_private_browsing_button">Məxfi səyahəti söndür</string>
|
||||
<!-- Placeholder text shown in the search bar before a user enters text -->
|
||||
<string name="search_hint">Ünvanı daxil et və ya axtar</string>
|
||||
<!-- No Open Tabs Message Header -->
|
||||
<string name="no_open_tabs_header_2">Açıq vərəq yoxdur</string>
|
||||
<!-- No Open Tabs Message Description -->
|
||||
<string name="no_open_tabs_description">Açıq vərəqləriniz burada göstəriləcək.</string>
|
||||
|
||||
<!-- Private Browsing -->
|
||||
<!-- Title for private session option -->
|
||||
<string name="private_browsing_title">Məxfi sessiyadasınız</string>
|
||||
<!-- Explanation for private browsing displayed to users on home view when they first enable private mode
|
||||
The first parameter is the name of the app defined in app_name (for example: Fenix) -->
|
||||
<string name="private_browsing_placeholder_description">%1$s tətbiqdən çıxdığınızda və ya bütün məxfi səyahət vərəq və pəncərələrini qapatdığınızda axtarış və səyahət tarixçənizi təmizləyir. Bu sizi saytlar və internet provayderiniz üçün anonim etməsə də,
|
||||
onlayn məlumatlarınızı bu cihazı işlədən digər şəxslərdən saxlamağınızı asanlaşdırır.</string>
|
||||
<string name="private_browsing_common_myths">Məxfi səyahət haqqında olan əfsanələr</string>
|
||||
<!-- Delete session button to erase your history in a private session -->
|
||||
<string name="private_browsing_delete_session">Sessiyanı sil</string>
|
||||
|
||||
<!-- Private mode shortcut "contextual feature recommender" (CFR) -->
|
||||
<!-- Private mode shortcut "contextual feature recommendation" (CFR) -->
|
||||
<!-- Text for the main message -->
|
||||
<string name="cfr_message">Ana ekranınızdan məxfi vərəqləri açmaq üçün qısayol əlavə edin.</string>
|
||||
<!-- Text for the positive button -->
|
||||
|
@ -84,8 +74,6 @@
|
|||
<string name="browser_menu_new_tab">Yeni vərəq</string>
|
||||
<!-- Browser menu button that saves the current tab to a collection -->
|
||||
<string name="browser_menu_save_to_collection_2">Kolleksiyaya saxla</string>
|
||||
<!-- Browser menu button that opens a dialog to report issues with the current site -->
|
||||
<string name="browser_menu_report_issue">Saytla bağlı problem xəbər et</string>
|
||||
<!-- Browser menu button that open a share menu to share the current site -->
|
||||
<string name="browser_menu_share">Paylaş</string>
|
||||
<!-- Share menu title, displayed when a user is sharing their current site -->
|
||||
|
@ -99,7 +87,7 @@
|
|||
<!-- Browser menu text shown in custom tabs to indicate this is a Fenix tab
|
||||
The first parameter is the name of the app defined in app_name (for example: Fenix) -->
|
||||
<string name="browser_menu_powered_by2">%1$s Tərəfindən</string>
|
||||
<!-- Browser menu button to put the the current page in reader mode -->
|
||||
<!-- Browser menu button to put the current page in reader mode -->
|
||||
<string name="browser_menu_read">Oxuyucu vörünüşü</string>
|
||||
<!-- Browser menu button to open the current page in an external app -->
|
||||
<string name="browser_menu_open_app_link">Tətbiqdə aç</string>
|
||||
|
@ -119,14 +107,8 @@
|
|||
<!-- Search Fragment -->
|
||||
<!-- Button in the search view that lets a user search by scanning a QR code -->
|
||||
<string name="search_scan_button">Skanla</string>
|
||||
<!-- Button in the search view that lets a user search by using a shortcut -->
|
||||
<string name="search_shortcuts_button">Qısayollar</string>
|
||||
<!-- Button in the search view when shortcuts are displayed that takes a user to the search engine settings -->
|
||||
<string name="search_shortcuts_engine_settings">Axtarış mühərriyi tənzimləmələri</string>
|
||||
<!-- DEPRECATED: Header displayed when selecting a shortcut search engine -->
|
||||
<string name="search_shortcuts_search_with">Bununla axtar:</string>
|
||||
<!-- Header displayed when selecting a shortcut search engine -->
|
||||
<string name="search_shortcuts_search_with_2">Bu dəfə bununla axtarın:</string>
|
||||
<!-- Button in the search view that lets a user navigate to the site in their clipboard -->
|
||||
<string name="awesomebar_clipboard_title">Buferdəki keçidi doldur</string>
|
||||
<!-- Button in the search suggestions onboarding that allows search suggestions in private sessions -->
|
||||
|
@ -223,8 +205,6 @@
|
|||
<string name="developer_tools_category">Tərtibatçı alətləri</string>
|
||||
<!-- Preference for developers -->
|
||||
<string name="preferences_remote_debugging">USB ilə məsafəli sazlama</string>
|
||||
<!-- Preference title for switch preference to show search shortcuts -->
|
||||
<string name="preferences_show_search_shortcuts">Axtarış qısayollarını göstər</string>
|
||||
<!-- Preference title for switch preference to show search suggestions -->
|
||||
<string name="preferences_show_search_suggestions">Axtarış təkliflərini göstər</string>
|
||||
<!-- Preference title for switch preference to show search suggestions also in private mode -->
|
||||
|
@ -273,10 +253,6 @@
|
|||
<string name="sync_last_synced_summary">Son uğurlu olan: %s</string>
|
||||
<!-- Label summary showing never synced -->
|
||||
<string name="sync_never_synced_summary">Son uğurlu olan: heç vaxt</string>
|
||||
<!-- Text for displaying the default device name.
|
||||
The first parameter is the application name, the second is the device manufacturer name
|
||||
and the third is the device model. -->
|
||||
<string name="default_device_name">%s - %s %s</string>
|
||||
|
||||
<!-- Send Tab -->
|
||||
<!-- Name of the "receive tabs" notification channel. Displayed in the "App notifications" system settings for the app -->
|
||||
|
@ -373,8 +349,6 @@
|
|||
<string name="library_reading_list">Oxuma siyahısı</string>
|
||||
<!-- Menu Item Label for Search in Library -->
|
||||
<string name="library_search">Axtar</string>
|
||||
<!-- Library Page Title -->
|
||||
<string name="library_title">Kitabxana</string>
|
||||
<!-- Settings Page Title -->
|
||||
<string name="settings_title">Tənzimləmələr</string>
|
||||
<!-- Content description (not visible, for screen readers etc.): "Menu icon for items on a history item" -->
|
||||
|
@ -401,8 +375,6 @@
|
|||
<string name="tabs_menu_close_all_tabs">Bütün vərəqləri qapat</string>
|
||||
<!-- Open tabs menu item to share all tabs -->
|
||||
<string name="tabs_menu_share_tabs">Vərəqləri paylaş</string>
|
||||
<!-- Open tabs menu item to save tabs to collection -->
|
||||
<string name="tabs_menu_save_to_collection">Kolleksiyaya saxla</string>
|
||||
<!-- Content description (not visible, for screen readers etc.): Opens the tab menu when pressed -->
|
||||
<string name="tab_menu">Vərəq menyusu</string>
|
||||
<!-- Tab menu item to share the tab -->
|
||||
|
@ -523,8 +495,6 @@
|
|||
<!-- Bookmark snackbar message on deletion
|
||||
The first parameter is the host part of the URL of the bookmark deleted, if any -->
|
||||
<string name="bookmark_deletion_snackbar_message">%1$s silindi</string>
|
||||
<!-- Bookmark snackbar message on deleting multiple bookmarks -->
|
||||
<string name="bookmark_deletion_multiple_snackbar_message">Seçilən əlfəcinlər silinir</string>
|
||||
|
||||
<!-- Bookmark undo button for deletion snackbar action -->
|
||||
<string name="bookmark_undo_deletion">GERİ AL</string>
|
||||
|
@ -576,14 +546,11 @@
|
|||
<!-- Summary of delete browsing data on quit preference if it is set to off -->
|
||||
<string name="delete_browsing_data_quit_off">Sönülü</string>
|
||||
|
||||
<!-- Collections -->
|
||||
<!-- Collections header on home fragment -->
|
||||
<string name="collections_header">Kolleksiyalar</string>
|
||||
<!-- Content description (not visible, for screen readers etc.): Opens the collection menu when pressed -->
|
||||
<string name="collection_menu_button_content_description">Kolleksiya menyusu</string>
|
||||
<!-- No Open Tabs Message Header -->
|
||||
<string name="no_collections_header">Kolleksiya yoxdur</string>
|
||||
<!-- No Open Tabs Message Description -->
|
||||
<string name="no_collections_description">Kolleksiyalarınız burada göstəriləcəklər.</string>
|
||||
|
||||
<!-- Title for the "select tabs" step of the collection creator -->
|
||||
<string name="create_collection_select_tabs">Vərəqləri seç</string>
|
||||
|
@ -702,8 +669,6 @@
|
|||
<!-- Title for Accessibility Text Size Scaling Preference -->
|
||||
<string name="preference_accessibility_font_size_title">Şrift ölçüsü</string>
|
||||
|
||||
<!-- Title for the tabs item in Delete browsing data -->
|
||||
<string name="preferences_delete_browsing_data_tabs_title">Açıq Vərəqlər</string>
|
||||
<!-- Subtitle for the tabs item in Delete browsing data, parameter will be replaced with the number of open tabs -->
|
||||
<string name="preferences_delete_browsing_data_tabs_subtitle">%d vərəq</string>
|
||||
|
||||
|
@ -721,8 +686,6 @@
|
|||
<string name="preferences_delete_browsing_data_cookies">Çərəzlər</string>
|
||||
<!-- Title for the site permissions item in Delete browsing data -->
|
||||
<string name="preferences_delete_browsing_data_site_permissions">Sayt icazələri</string>
|
||||
<!-- Category for history items to delete on quit in delete browsing data on quit -->
|
||||
<string name="preferences_delete_browsing_data_on_quit_browsing_history">Səyahət tarixçəsi</string>
|
||||
|
||||
<!-- Action item in menu for the Delete browsing data on quit feature -->
|
||||
<string name="delete_browsing_data_on_quit_action">Çıx</string>
|
||||
|
@ -747,14 +710,15 @@
|
|||
<string name="onboarding_firefox_account_sign_in">Firefox-a daxil ol</string>
|
||||
<!-- text to display in the snackbar once account is signed-in -->
|
||||
<string name="onboarding_firefox_account_sync_is_on">Sync aktivdir</string>
|
||||
<!-- text for tracking protection radio button option for standard level of blocking -->
|
||||
<string name="onboarding_tracking_protection_standard_button">Standart</string>
|
||||
<!-- text for the private browsing onbording card button, that launches settings -->
|
||||
<string name="onboarding_private_browsing_button">Tənzimləmələri aç</string>
|
||||
|
||||
<!-- text for the privacy notice onboarding card header -->
|
||||
<string name="onboarding_privacy_notice_header">Məxfiliyiniz</string>
|
||||
|
||||
<!-- Content description (not visible, for screen readers etc.): Close onboarding screen -->
|
||||
<string name="onboarding_close">Qapat</string>
|
||||
|
||||
<!-- text for the button to finish onboarding -->
|
||||
<string name="onboarding_finish">Səyahətə başlayın</string>
|
||||
|
||||
|
@ -762,6 +726,21 @@
|
|||
<!-- text for the theme picker onboarding card header -->
|
||||
<string name="onboarding_theme_picker_header">Mövzunuzu seçin</string>
|
||||
|
||||
<!-- Automatic theme setting (will follow device setting) -->
|
||||
<string name="onboarding_theme_automatic_title">Avtomatik</string>
|
||||
<!-- Theme setting for dark mode -->
|
||||
<string name="onboarding_theme_dark_title">Tünd mövzu</string>
|
||||
<!-- Theme setting for light mode -->
|
||||
<string name="onboarding_theme_light_title">Açıq mövzu</string>
|
||||
|
||||
<!-- Text shown in snackbar when multiple tabs have been sent to device -->
|
||||
<string name="sync_sent_tabs_snackbar">Vərəqlər göndərildi!</string>
|
||||
<!-- Text shown in snackbar when one tab has been sent to device -->
|
||||
<string name="sync_sent_tab_snackbar">Vərəq göndərildi!</string>
|
||||
<!-- Text shown in snackbar when sharing tabs failed -->
|
||||
<string name="sync_sent_tab_error_snackbar">Göndərilə bilmədi</string>
|
||||
<!-- Title of QR Pairing Fragment -->
|
||||
<string name="sync_scan_code">Kodu skanla</string>
|
||||
<!-- Text shown for settings option for sign with email -->
|
||||
<string name="sign_in_with_email">E-poçt ilə daxil ol</string>
|
||||
<!-- Option to continue signing out of account shown in confirmation dialog to sign out of account -->
|
||||
|
@ -778,28 +757,14 @@
|
|||
<string name="preference_enhanced_tracking_protection_explanation_title">İzlənmədən səyahət edin</string>
|
||||
<!-- Text displayed that links to website about enhanced tracking protection -->
|
||||
<string name="preference_enhanced_tracking_protection_explanation_learn_more">Ətraflı öyrən</string>
|
||||
<!-- Preference for enhanced tracking protection for the standard protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_standard_option">Standart</string>
|
||||
<!-- Preference for enhanced tracking protection for the standard protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_standard">Standart (məsləhətlidir)</string>
|
||||
<!-- Preference description for enhanced tracking protection for the standard protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_standard_description">Tarazlaşdırılmış qoruma və verimlilik.</string>
|
||||
<!-- Preference description for enhanced tracking protection for the standard protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_standard_description_2">Səhifələr normal yüklənəcəklər, amma daha az izləyici əngəllənəcək.</string>
|
||||
<!-- Accessibility text for the Standard protection information icon -->
|
||||
<string name="preference_enhanced_tracking_protection_standard_info_button">Standart izlənmə qorumasında nələr əngəllənir</string>
|
||||
<!-- Preference for enhanced tracking protection for the strict protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_strict">Sərt</string>
|
||||
<!-- Preference for enhanced tracking protection for the strict protection settings, default setting -->
|
||||
<string name="preference_enhanced_tracking_protection_strict_default">Sərt (Ön seçilən)</string>
|
||||
<!-- Preference for enhanced tracking protection for the standard protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_strict_recommended">Sərt (məsləhətlidir)</string>
|
||||
<!-- Accessibility text for the Strict protection information icon -->
|
||||
<string name="preference_enhanced_tracking_protection_strict_info_button">Sərt izlənmə qorumasında nələr əngəllənir</string>
|
||||
<!-- Preference for enhanced tracking protection for the custom protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_custom">Fərdi</string>
|
||||
<!-- Preference description for enhanced tracking protection for the strict protection settings -->
|
||||
<string name="preference_enhanced_tracking_protection_custom_description">Hansı izləyici və skriptlərin əngəllənəcəyini seçin</string>
|
||||
<!-- Accessibility text for the Strict protection information icon -->
|
||||
<string name="preference_enhanced_tracking_protection_custom_info_button">Fərdi izlənmə qorumasında nələr əngəllənir</string>
|
||||
<!-- Header for categories that are being blocked by current Enhanced Tracking Protection settings -->
|
||||
|
@ -1015,4 +980,5 @@
|
|||
<string name="login_deletion_confirmation">Bu hesabı silmək istədiyinizə əminsiniz?</string>
|
||||
<!-- Positive action of a dialog asking to delete -->
|
||||
<string name="dialog_delete_positive">Sil</string>
|
||||
</resources>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -1032,11 +1032,6 @@
|
|||
<string name="onboarding_private_browsing_button">Abrir configurações</string>
|
||||
<!-- text for the privacy notice onboarding card header -->
|
||||
<string name="onboarding_privacy_notice_header">Sua privacidade</string>
|
||||
<!-- text for the privacy notice onboarding card description
|
||||
The first parameter is the name of the app (e.g. Firefox Preview) -->
|
||||
<string name="onboarding_privacy_notice_description">Projetamos o %s para lhe dar o controle sobre o que você compartilha
|
||||
online e o que compartilha conosco.
|
||||
</string>
|
||||
<!-- Text for the button to read the privacy notice -->
|
||||
<string name="onboarding_privacy_notice_read_button">Leia nosso aviso de privacidade</string>
|
||||
|
||||
|
|
|
@ -400,7 +400,7 @@
|
|||
<!-- Preference for account login -->
|
||||
<string name="preferences_sync_sign_in">Autentificare</string>
|
||||
<!-- Preference for reconnecting to FxA sync -->
|
||||
<string name="preferences_sync_sign_in_to_reconnect">Autentifică-te pentru reconectare</string>
|
||||
<string name="preferences_sync_sign_in_to_reconnect">Intră în cont pentru reconectare</string>
|
||||
<!-- Preference for removing FxA account -->
|
||||
<string name="preferences_sync_remove_account">Șterge contul</string>
|
||||
|
||||
|
@ -632,7 +632,7 @@
|
|||
<!-- Bookmark folder editing screen title -->
|
||||
<string name="edit_bookmark_folder_fragment_title">Editează dosarul</string>
|
||||
<!-- Bookmark sign in button message -->
|
||||
<string name="bookmark_sign_in_button">Autentifică-te pentru a vedea marcajele sincronizate</string>
|
||||
<string name="bookmark_sign_in_button">Intră în cont pentru a vedea marcajele sincronizate</string>
|
||||
<!-- Bookmark URL editing field label -->
|
||||
<string name="bookmark_url_label">URL</string>
|
||||
<!-- Bookmark FOLDER editing field label -->
|
||||
|
@ -782,7 +782,7 @@
|
|||
<!-- Sub-header in the dialog to share a link to an app from the most-recent sorted list -->
|
||||
<string name="share_link_recent_apps_subheader">Folosite recent</string>
|
||||
<!-- An option from the share dialog to sign into sync -->
|
||||
<string name="sync_sign_in">Autentifică-te în Sync</string>
|
||||
<string name="sync_sign_in">Intră în contul Sync</string>
|
||||
<!-- An option from the share dialog to send link to all other sync devices -->
|
||||
<string name="sync_send_to_all">Trimite pe toate dispozitivele</string>
|
||||
<!-- An option from the share dialog to reconnect to sync -->
|
||||
|
@ -792,7 +792,7 @@
|
|||
<!-- An option to connect additional devices -->
|
||||
<string name="sync_connect_device">Conectează alt dispozitiv</string>
|
||||
<!-- The dialog text shown when additional devices are not available -->
|
||||
<string name="sync_connect_device_dialog">Pentru a trimite o filă, autentifică-te în Firefox pe cel puțin un alt dispozitiv.</string>
|
||||
<string name="sync_connect_device_dialog">Pentru a trimite o filă, intră în contul Firefox de pe cel puțin un alt dispozitiv.</string>
|
||||
|
||||
<!-- Confirmation dialog button -->
|
||||
<string name="sync_confirmation_button">Am înțeles</string>
|
||||
|
@ -986,7 +986,7 @@
|
|||
<!-- text for the automatic sign-in button while signing in is in process -->
|
||||
<string name="onboarding_firefox_account_signing_in">Autentificare…</string>
|
||||
<!-- text for the button to manually sign into Firefox account. The word "Firefox" should not be translated -->
|
||||
<string name="onboarding_firefox_account_sign_in">Autentifică-te în Firefox</string>
|
||||
<string name="onboarding_firefox_account_sign_in">Intră în contul Firefox</string>
|
||||
<!-- text for the button to stay signed out when presented with an option to automatically sign-in. -->
|
||||
<string name="onboarding_firefox_account_stay_signed_out">Rămâi deconectat</string>
|
||||
<!-- text to display in the snackbar once account is signed-in -->
|
||||
|
@ -1068,7 +1068,7 @@
|
|||
<!-- Text shown for sign in pairing when ready -->
|
||||
<string name="sign_in_ready_for_scan">Gata de scanare</string>
|
||||
<!-- Text shown for settings option for sign with pairing -->
|
||||
<string name="sign_in_with_camera">Autentifică-te cu camera</string>
|
||||
<string name="sign_in_with_camera">Autentificare cu camera</string>
|
||||
<!-- Text shown for settings option for sign with email -->
|
||||
<string name="sign_in_with_email">Folosește e-mailul în schimb</string>
|
||||
<!-- Text shown in confirmation dialog to sign out of account -->
|
||||
|
@ -1246,7 +1246,7 @@
|
|||
<!-- Syncing saved logins in Fenix needs reconnect to sync -->
|
||||
<string name="preferences_passwords_sync_logins_reconnect">Reconectare</string>
|
||||
<!-- Syncing saved logins in Fenix needs login -->
|
||||
<string name="preferences_passwords_sync_logins_sign_in">Autentifică-te în Sync</string>
|
||||
<string name="preferences_passwords_sync_logins_sign_in">Intră în contul Sync</string>
|
||||
<!-- Preference to access list of saved logins -->
|
||||
<string name="preferences_passwords_saved_logins">Date de autentificare salvate</string>
|
||||
<!-- Description of empty list of saved passwords. Placeholder is replaced with app name. -->
|
||||
|
@ -1464,7 +1464,7 @@
|
|||
<!-- Text displayed in the synced tabs screen when a user is not signed in to Firefox Sync describing Synced Tabs -->
|
||||
<string name="synced_tabs_sign_in_message">Afișează o listă de file de pe celelalte dispozitive.</string>
|
||||
<!-- Text displayed on a button in the synced tabs screen to link users to sign in when a user is not signed in to Firefox Sync -->
|
||||
<string name="synced_tabs_sign_in_button">Autentifică-te în Sync</string>
|
||||
<string name="synced_tabs_sign_in_button">Intră în contul Sync</string>
|
||||
|
||||
<!-- Top Sites -->
|
||||
<!-- Title text displayed in the dialog when top sites limit is reached. -->
|
||||
|
|
|
@ -0,0 +1,77 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
package org.mozilla.fenix.ext
|
||||
|
||||
import mozilla.components.browser.state.state.content.DownloadState
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
|
||||
import org.mozilla.fenix.library.downloads.DownloadItem
|
||||
import java.io.File
|
||||
|
||||
@RunWith(FenixRobolectricTestRunner::class)
|
||||
class ListTest {
|
||||
|
||||
@Test
|
||||
fun `Test download in list but not on disk removed from list`() {
|
||||
val filePath1 = "filepath.txt"
|
||||
val filePath3 = "filepath3.txt"
|
||||
|
||||
var file1 = File(filePath1)
|
||||
var file3 = File(filePath3)
|
||||
|
||||
// Create files
|
||||
file1.createNewFile()
|
||||
file3.createNewFile()
|
||||
|
||||
val item1 = DownloadItem("71", "filepath.txt", filePath1, "71 Mb", "Image/png", DownloadState.Status.COMPLETED)
|
||||
val item2 = DownloadItem("71", "filepath2.txt", "filepath2.txt", "71 Mb", "Image/png", DownloadState.Status.COMPLETED)
|
||||
val item3 = DownloadItem("71", "filepath3.txt", filePath3, "71 Mb", "Image/png", DownloadState.Status.COMPLETED)
|
||||
|
||||
val testList = mutableListOf(item1, item2, item3)
|
||||
val comparisonList: MutableList<DownloadItem> = mutableListOf(item1, item3)
|
||||
|
||||
val resultList = testList.filterNotExistsOnDisk()
|
||||
|
||||
assertEquals(comparisonList, resultList)
|
||||
|
||||
// Cleanup files
|
||||
file1.delete()
|
||||
file3.delete()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `Test download in list and on disk remain in list`() {
|
||||
val filePath1 = "filepath.txt"
|
||||
val filePath2 = "filepath.txt"
|
||||
val filePath3 = "filepath3.txt"
|
||||
|
||||
var file1 = File(filePath1)
|
||||
var file2 = File(filePath2)
|
||||
var file3 = File(filePath3)
|
||||
|
||||
// Create files
|
||||
file1.createNewFile()
|
||||
file2.createNewFile()
|
||||
file3.createNewFile()
|
||||
|
||||
val item1 = DownloadItem("71", "filepath.txt", filePath1, "71 Mb", "text/plain", DownloadState.Status.COMPLETED)
|
||||
val item2 = DownloadItem("72", "filepath2.txt", filePath2, "71 Mb", "text/plain", DownloadState.Status.COMPLETED)
|
||||
val item3 = DownloadItem("73", "filepath3.txt", filePath3, "71 Mb", "text/plain", DownloadState.Status.COMPLETED)
|
||||
|
||||
val testList = mutableListOf(item1, item2, item3)
|
||||
val comparisonList: MutableList<DownloadItem> = mutableListOf(item1, item2, item3)
|
||||
|
||||
val resultList = testList.filterNotExistsOnDisk()
|
||||
|
||||
assertEquals(comparisonList, resultList)
|
||||
|
||||
// Cleanup files
|
||||
file1.delete()
|
||||
file2.delete()
|
||||
file3.delete()
|
||||
}
|
||||
}
|
|
@ -10,6 +10,7 @@ import io.mockk.verify
|
|||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import kotlinx.coroutines.test.TestCoroutineScope
|
||||
import mozilla.components.browser.state.state.content.DownloadState
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
@ -20,7 +21,7 @@ import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
|
|||
@ExperimentalCoroutinesApi
|
||||
@RunWith(FenixRobolectricTestRunner::class)
|
||||
class DownloadControllerTest {
|
||||
private val downloadItem = DownloadItem(0, "title", "url", "77", "jpg")
|
||||
private val downloadItem = DownloadItem("0", "title", "url", "77", "jpg", DownloadState.Status.COMPLETED)
|
||||
private val scope: CoroutineScope = TestCoroutineScope()
|
||||
private val store: DownloadFragmentStore = mockk(relaxed = true)
|
||||
private val state: DownloadFragmentState = mockk(relaxed = true)
|
||||
|
|
|
@ -7,11 +7,12 @@ package org.mozilla.fenix.library.downloads
|
|||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import io.mockk.verifyAll
|
||||
import mozilla.components.browser.state.state.content.DownloadState
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class DownloadInteractorTest {
|
||||
private val downloadItem = DownloadItem(0, "title", "url", "5.6 mb", "png")
|
||||
private val downloadItem = DownloadItem("0", "title", "url", "5.6 mb", "png", DownloadState.Status.COMPLETED)
|
||||
val controller: DownloadController = mockk(relaxed = true)
|
||||
val interactor = DownloadInteractor(controller)
|
||||
|
||||
|
|
|
@ -7,12 +7,14 @@ package org.mozilla.fenix.widget
|
|||
import android.app.Activity
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.os.Bundle
|
||||
import android.speech.RecognizerIntent.ACTION_RECOGNIZE_SPEECH
|
||||
import android.speech.RecognizerIntent.EXTRA_LANGUAGE_MODEL
|
||||
import android.speech.RecognizerIntent.EXTRA_RESULTS
|
||||
import android.speech.RecognizerIntent.LANGUAGE_MODEL_FREE_FORM
|
||||
import androidx.appcompat.app.AppCompatActivity.RESULT_OK
|
||||
import androidx.test.core.app.ApplicationProvider
|
||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
|
@ -21,6 +23,7 @@ import org.junit.Assert.assertTrue
|
|||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.mozilla.fenix.FenixApplication
|
||||
import org.mozilla.fenix.HomeActivity.Companion.OPEN_TO_BROWSER_AND_LOAD
|
||||
import org.mozilla.fenix.IntentReceiverActivity
|
||||
import org.mozilla.fenix.helpers.FenixRobolectricTestRunner
|
||||
|
@ -28,7 +31,7 @@ import org.mozilla.fenix.widget.VoiceSearchActivity.Companion.PREVIOUS_INTENT
|
|||
import org.mozilla.fenix.widget.VoiceSearchActivity.Companion.SPEECH_PROCESSING
|
||||
import org.mozilla.fenix.widget.VoiceSearchActivity.Companion.SPEECH_REQUEST_CODE
|
||||
import org.robolectric.Robolectric
|
||||
import org.robolectric.Shadows
|
||||
import org.robolectric.Shadows.shadowOf
|
||||
import org.robolectric.android.controller.ActivityController
|
||||
import org.robolectric.shadows.ShadowActivity
|
||||
|
||||
|
@ -37,7 +40,7 @@ import org.robolectric.shadows.ShadowActivity
|
|||
class VoiceSearchActivityTest {
|
||||
|
||||
private lateinit var controller: ActivityController<VoiceSearchActivity>
|
||||
private lateinit var activity: Activity
|
||||
private lateinit var activity: VoiceSearchActivity
|
||||
private lateinit var shadow: ShadowActivity
|
||||
|
||||
@Before
|
||||
|
@ -47,21 +50,36 @@ class VoiceSearchActivityTest {
|
|||
|
||||
controller = Robolectric.buildActivity(VoiceSearchActivity::class.java, intent)
|
||||
activity = controller.get()
|
||||
shadow = Shadows.shadowOf(activity)
|
||||
shadow = shadowOf(activity)
|
||||
}
|
||||
|
||||
private fun allowVoiceIntentToResolveActivity() {
|
||||
val context = ApplicationProvider.getApplicationContext<FenixApplication>()
|
||||
val shadowPackageManager = shadowOf(context.packageManager)
|
||||
val component = ComponentName("com.test", "Test")
|
||||
shadowPackageManager.addActivityIfNotPresent(component)
|
||||
shadowPackageManager.addIntentFilterForActivity(
|
||||
component,
|
||||
IntentFilter(ACTION_RECOGNIZE_SPEECH).apply { addCategory(Intent.CATEGORY_DEFAULT) })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `process intent with speech processing set to true`() {
|
||||
allowVoiceIntentToResolveActivity()
|
||||
controller.create()
|
||||
|
||||
val intentForResult = shadow.peekNextStartedActivityForResult()
|
||||
assertEquals(SPEECH_REQUEST_CODE, intentForResult.requestCode)
|
||||
assertEquals(ACTION_RECOGNIZE_SPEECH, intentForResult.intent.action)
|
||||
assertEquals(LANGUAGE_MODEL_FREE_FORM, intentForResult.intent.getStringExtra(EXTRA_LANGUAGE_MODEL))
|
||||
assertEquals(
|
||||
LANGUAGE_MODEL_FREE_FORM,
|
||||
intentForResult.intent.getStringExtra(EXTRA_LANGUAGE_MODEL)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `process intent with speech processing set to false`() {
|
||||
allowVoiceIntentToResolveActivity()
|
||||
val intent = Intent()
|
||||
intent.putExtra(SPEECH_PROCESSING, false)
|
||||
|
||||
|
@ -75,6 +93,7 @@ class VoiceSearchActivityTest {
|
|||
|
||||
@Test
|
||||
fun `process null intent`() {
|
||||
allowVoiceIntentToResolveActivity()
|
||||
val controller = Robolectric.buildActivity(VoiceSearchActivity::class.java, null)
|
||||
val activity = controller.get()
|
||||
|
||||
|
@ -85,6 +104,7 @@ class VoiceSearchActivityTest {
|
|||
|
||||
@Test
|
||||
fun `save previous intent to instance state`() {
|
||||
allowVoiceIntentToResolveActivity()
|
||||
val previousIntent = Intent().apply {
|
||||
putExtra(SPEECH_PROCESSING, true)
|
||||
}
|
||||
|
@ -101,6 +121,7 @@ class VoiceSearchActivityTest {
|
|||
|
||||
@Test
|
||||
fun `process intent with speech processing in previous intent set to true`() {
|
||||
allowVoiceIntentToResolveActivity()
|
||||
val savedInstanceState = Bundle()
|
||||
val previousIntent = Intent().apply {
|
||||
putExtra(SPEECH_PROCESSING, true)
|
||||
|
@ -115,6 +136,7 @@ class VoiceSearchActivityTest {
|
|||
|
||||
@Test
|
||||
fun `handle speech result`() {
|
||||
allowVoiceIntentToResolveActivity()
|
||||
controller.create()
|
||||
|
||||
val resultIntent = Intent().apply {
|
||||
|
@ -129,13 +151,17 @@ class VoiceSearchActivityTest {
|
|||
val browserIntent = shadow.peekNextStartedActivity()
|
||||
|
||||
assertTrue(activity.isFinishing)
|
||||
assertEquals(ComponentName(activity, IntentReceiverActivity::class.java), browserIntent.component)
|
||||
assertEquals(
|
||||
ComponentName(activity, IntentReceiverActivity::class.java),
|
||||
browserIntent.component
|
||||
)
|
||||
assertEquals("hello world", browserIntent.getStringExtra(SPEECH_PROCESSING))
|
||||
assertTrue(browserIntent.getBooleanExtra(OPEN_TO_BROWSER_AND_LOAD, false))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `handle invalid result code`() {
|
||||
allowVoiceIntentToResolveActivity()
|
||||
controller.create()
|
||||
|
||||
val resultIntent = Intent()
|
||||
|
@ -147,4 +173,10 @@ class VoiceSearchActivityTest {
|
|||
|
||||
assertTrue(activity.isFinishing)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `handle no activity able to resolve voice intent`() {
|
||||
controller.create()
|
||||
assertTrue(activity.isFinishing)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
object AndroidComponents {
|
||||
const val VERSION = "56.0.20200819190136"
|
||||
const val VERSION = "56.0.20200821184145"
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ from voluptuous import All, Any, Optional, Range, Required
|
|||
|
||||
|
||||
BETA_SEMVER = re.compile(r'^v\d+\.\d+\.\d+-beta\.\d+$')
|
||||
PRODUCTION_SEMVER = re.compile(r'^v\d+\.\d+\.\d+(-rc\.\d+)?$')
|
||||
RELEASE_SEMVER = re.compile(r'^v\d+\.\d+\.\d+(-rc\.\d+)?$')
|
||||
|
||||
|
||||
extend_parameters_schema({
|
||||
|
@ -48,8 +48,8 @@ def resolve_release_type(head_tag):
|
|||
return ""
|
||||
elif BETA_SEMVER.match(head_tag):
|
||||
return "beta"
|
||||
elif PRODUCTION_SEMVER.match(head_tag):
|
||||
return "production"
|
||||
elif RELEASE_SEMVER.match(head_tag):
|
||||
return "release"
|
||||
else:
|
||||
raise ValueError('Github tag must be in semver format and prefixed with a "v", '
|
||||
'e.g.: "v1.0.0-beta.0" (beta), "v1.0.0-rc.0" (production) or "v1.0.0" (production)')
|
||||
'e.g.: "v1.0.0-beta.0" (beta), "v1.0.0-rc.0" (release) or "v1.0.0" (release)')
|
||||
|
|
Loading…
Reference in New Issue