diff options
author | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2022-09-23 08:05:37 +0000 |
---|---|---|
committer | Guillaume Jacquart <guillaume.jacquart@hoodbrains.com> | 2022-09-23 08:05:37 +0000 |
commit | 50ffbbe6ce0164168443375a4e4797f7dca46be2 (patch) | |
tree | 38548878bead6f07139fb89d940daf13596a8ee0 /app | |
parent | 837e4ffac7d9d2c26e474e3c69847fac43e5d577 (diff) | |
parent | 227c31abea5fd56c7795f973c57729afbec3485b (diff) |
Merge branch '256-app_list_tooltip' into 'main'
256 : Add tooltip info about apps lists.
See merge request e/os/advanced-privacy!91
Diffstat (limited to 'app')
12 files changed, 119 insertions, 16 deletions
diff --git a/app/src/main/java/foundation/e/privacycentralapp/common/TextViewHelpers.kt b/app/src/main/java/foundation/e/privacycentralapp/common/TextViewHelpers.kt new file mode 100644 index 0000000..25a3633 --- /dev/null +++ b/app/src/main/java/foundation/e/privacycentralapp/common/TextViewHelpers.kt @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2022 E FOUNDATION + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package foundation.e.privacycentralapp.common + +import android.content.Context +import android.content.res.ColorStateList +import android.text.Spannable +import android.text.SpannableString +import android.text.style.DynamicDrawableSpan +import android.text.style.ImageSpan +import android.widget.TextView +import androidx.annotation.StringRes +import androidx.appcompat.content.res.AppCompatResources +import androidx.appcompat.widget.TooltipCompat +import foundation.e.privacycentralapp.R + +fun setToolTipForAsterisk( + textView: TextView, + @StringRes textId: Int, + @StringRes tooltipTextId: Int +) { + textView.text = asteriskAsInfoIconSpannable(textView.context, textId, textView.textColors) + TooltipCompat.setTooltipText(textView, textView.context.getString(tooltipTextId)) + + textView.setOnClickListener { it.performLongClick() } +} + +private fun asteriskAsInfoIconSpannable( + context: Context, + @StringRes textId: Int, + tint: ColorStateList +): Spannable { + val spannable = SpannableString(context.getString(textId)) + val index = spannable.lastIndexOf("*") + if (index != -1) { + AppCompatResources.getDrawable(context, R.drawable.ic_info_16dp)?.let { + it.setTintList(tint) + it.setBounds(0, 0, it.intrinsicWidth, it.intrinsicHeight) + spannable.setSpan( + ImageSpan(it, DynamicDrawableSpan.ALIGN_CENTER), + index, + index + 1, + Spannable.SPAN_INCLUSIVE_INCLUSIVE + ) + } + } + return spannable +}
\ No newline at end of file diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/internetprivacy/InternetPrivacyFragment.kt b/app/src/main/java/foundation/e/privacycentralapp/features/internetprivacy/InternetPrivacyFragment.kt index ff8e78f..749fae4 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/features/internetprivacy/InternetPrivacyFragment.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/features/internetprivacy/InternetPrivacyFragment.kt @@ -33,10 +33,11 @@ import foundation.e.privacycentralapp.PrivacyCentralApplication import foundation.e.privacycentralapp.R import foundation.e.privacycentralapp.common.NavToolbarFragment import foundation.e.privacycentralapp.common.ToggleAppsAdapter +import foundation.e.privacycentralapp.common.extensions.toText import foundation.e.privacycentralapp.common.initQuickPrivacySnackbar +import foundation.e.privacycentralapp.common.setToolTipForAsterisk import foundation.e.privacycentralapp.databinding.FragmentInternetActivityPolicyBinding import foundation.e.privacycentralapp.domain.entities.InternetPrivacyMode -import foundation.e.privacycentralapp.common.extensions.toText import kotlinx.coroutines.launch import java.util.Locale @@ -82,6 +83,12 @@ class InternetPrivacyFragment : NavToolbarFragment(R.layout.fragment_internet_ac viewModel.submitAction(InternetPrivacyViewModel.Action.UseHiddenIPAction) } + setToolTipForAsterisk( + textView = binding.ipscramblingSelectApps, + textId = R.string.ipscrambling_select_app, + tooltipTextId = R.string.ipscrambling_app_list_infos + ) + binding.ipscramblingSelectLocation.apply { adapter = ArrayAdapter( requireContext(), android.R.layout.simple_spinner_item, diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/trackers/TrackersFragment.kt b/app/src/main/java/foundation/e/privacycentralapp/features/trackers/TrackersFragment.kt index 4992230..491f625 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/features/trackers/TrackersFragment.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/features/trackers/TrackersFragment.kt @@ -36,6 +36,7 @@ import foundation.e.privacycentralapp.common.AppsAdapter import foundation.e.privacycentralapp.common.GraphHolder import foundation.e.privacycentralapp.common.NavToolbarFragment import foundation.e.privacycentralapp.common.initQuickPrivacySnackbar +import foundation.e.privacycentralapp.common.setToolTipForAsterisk import foundation.e.privacycentralapp.databinding.FragmentTrackersBinding import foundation.e.privacycentralapp.databinding.TrackersItemGraphBinding import foundation.e.privacycentralapp.domain.entities.TrackersPeriodicStatistics @@ -82,6 +83,12 @@ class TrackersFragment : viewModel.submitAction(TrackersViewModel.Action.CloseQuickPrivacyDisabledMessage) } + setToolTipForAsterisk( + textView = binding.trackersAppsListTitle, + textId = R.string.trackers_applist_title, + tooltipTextId = R.string.trackers_applist_infos + ) + viewLifecycleOwner.lifecycleScope.launch { viewLifecycleOwner.repeatOnLifecycle(Lifecycle.State.STARTED) { render(viewModel.state.value) diff --git a/app/src/main/res/drawable/ic_info_16dp.xml b/app/src/main/res/drawable/ic_info_16dp.xml new file mode 100644 index 0000000..063fb73 --- /dev/null +++ b/app/src/main/res/drawable/ic_info_16dp.xml @@ -0,0 +1,20 @@ +<!-- + ~ Copyright (C) 2022 E FOUNDATION + ~ + ~ This program is free software: you can redistribute it and/or modify + ~ it under the terms of the GNU General Public License as published by + ~ the Free Software Foundation, either version 3 of the License, or + ~ (at your option) any later version. + ~ + ~ This program is distributed in the hope that it will be useful, + ~ but WITHOUT ANY WARRANTY; without even the implied warranty of + ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ~ GNU General Public License for more details. + ~ + ~ You should have received a copy of the GNU General Public License + ~ along with this program. If not, see <https://www.gnu.org/licenses/>. + --> +<vector android:height="16dp" android:viewportHeight="24" + android:viewportWidth="24" android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="#000000" android:pathData="M11,7H13V9H11V7ZM11,11H13V17H11V11ZM12,2C6.48,2 2,6.48 2,12C2,17.52 6.48,22 12,22C17.52,22 22,17.52 22,12C22,6.48 17.52,2 12,2ZM12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20Z"/> +</vector> diff --git a/app/src/main/res/layout/fragment_internet_activity_policy.xml b/app/src/main/res/layout/fragment_internet_activity_policy.xml index 328eeae..ee82abf 100644 --- a/app/src/main/res/layout/fragment_internet_activity_policy.xml +++ b/app/src/main/res/layout/fragment_internet_activity_policy.xml @@ -1,7 +1,9 @@ <?xml version="1.0" encoding="utf-8"?> -<layout> -<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" +<layout + xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" + > +<androidx.coordinatorlayout.widget.CoordinatorLayout android:background="@color/background" android:layout_height="match_parent" android:layout_width="match_parent" @@ -103,7 +105,7 @@ <TextView android:id="@+id/ipscrambling_select_apps" android:layout_height="wrap_content" - android:layout_width="match_parent" + android:layout_width="wrap_content" android:layout_marginTop="32dp" android:layout_marginBottom="16dp" android:text="@string/ipscrambling_select_app" diff --git a/app/src/main/res/layout/fragment_trackers.xml b/app/src/main/res/layout/fragment_trackers.xml index b6d5b7b..0cd5980 100644 --- a/app/src/main/res/layout/fragment_trackers.xml +++ b/app/src/main/res/layout/fragment_trackers.xml @@ -66,6 +66,7 @@ app:period="@{@string/trackers_period_year}" /> <TextView + android:id="@+id/trackers_apps_list_title" android:layout_height="wrap_content" android:layout_width="match_parent" android:layout_marginTop="32dp" diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 3a13843..33d1e18 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -45,7 +45,7 @@ \n \n„Mein Standort verwalten“ ermöglicht dir, einen gefälschten Standort anstatt deines echten Aufenthaltsortes zu benutzen. Auf diese Weise wird dein echter Standort nicht mit Apps geteilt, die zu sehr herumspionieren.</string> <string name="ipscrambling_any_location">Zufälliges Land</string> - <string name="ipscrambling_select_app">Wende diese Einstellungen auf alle ausgewählten Anwendungen an:</string> + <string name="ipscrambling_select_app">Wende diese Einstellungen auf alle ausgewählten Anwendungen an * :</string> <string name="user_location_permission_not_granted">Du hast keine Standort-Berechtigung erteilt</string> <string name="please_enter_valid_lat_long">Bitte gib einen gültigen Längen- und Breitengrad an</string> <string name="quick_protection">Schneller Datenschutz</string> @@ -79,7 +79,7 @@ <string name="trackers_period_day">24 Stunden</string> <string name="trackers_period_month">vergangener Monat</string> <string name="trackers_period_year">vergangenes Jahr</string> - <string name="trackers_applist_title">Verwalte Tracker, die von Apps benutzt werden:</string> + <string name="trackers_applist_title">Verwalte Tracker, die von Apps benutzt werden * :</string> <string name="trackers_graph_hours_period_format">HH:mm</string> <string name="trackers_graph_days_period_format">d\'.\' MMMM EEE</string> <string name="trackers_graph_months_period_format">MMMM yyyy</string> diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 6216e07..6f0bc90 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -26,7 +26,7 @@ <string name="ipscrambling_hide_ip_subtitle">Soy anónimo en internet</string> <string name="ipscrambling_location_label">Mi actividad en internet debe aparecer desde:</string> <string name="ipscrambling_any_location">País aleatorio</string> - <string name="ipscrambling_select_app">Aplicar esta configuración a todas las aplicaciones seleccionadas:</string> + <string name="ipscrambling_select_app">Aplicar esta configuración a todas las aplicaciones seleccionadas * :</string> <string name="dashboard_state_title_off">Tu privacidad en linea está desprotegida</string> <string name="dashboard_apps_permissions_subtitle">Gestiona tus permisos</string> <string name="apptrackers_error_quickprivacy_disabled">Habilitar la \"Privacidad rápida\" para poder activar/desactivar los rastreadores.</string> @@ -56,7 +56,7 @@ <string name="trackers_period_day">24 horas</string> <string name="trackers_period_month">Mes pasado</string> <string name="trackers_period_year">Año pasado</string> - <string name="trackers_applist_title">Gestionar rastreadores usados en aplicaciones:</string> + <string name="trackers_applist_title">Gestionar rastreadores usados en aplicaciones * :</string> <string name="trackers_graph_hours_period_format">HH:mm</string> <string name="trackers_graph_days_period_format">EEE d \'de\' MMMM</string> <string name="trackers_graph_months_period_format">MMMM yyyy</string> diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml index 0083095..73945ff 100644 --- a/app/src/main/res/values-fi/strings.xml +++ b/app/src/main/res/values-fi/strings.xml @@ -51,7 +51,7 @@ <string name="trackers_graph_months_period_format">MMMM yyyy</string> <string name="trackers_graph_days_period_format">d MMMM EEE</string> <string name="trackers_graph_hours_period_format">HH:mm</string> - <string name="trackers_applist_title">Hallitse sovellusten käyttämiä seuraimia:</string> + <string name="trackers_applist_title">Hallitse sovellusten käyttämiä seuraimia * :</string> <string name="trackers_period_year">kulunut vuosi</string> <string name="trackers_period_month">kulunut kuukausi</string> <string name="trackers_period_day">24 tuntia</string> @@ -71,7 +71,7 @@ <string name="location_title">Hallitse sijaintiani</string> <string name="ipscrambling_warning_starting_long">Piilotetun IP-palvelumme käynnistäminen vie aikaa. Se voi kestää muutaman minuutin. Ruudulta poistuminen ei keskeytä prosessia.</string> <string name="ipscrambling_error_quickprivacy_disabled">Quick Privacy on otettu käyttöön toimintojen käyttöä varten</string> - <string name="ipscrambling_select_app">Sovella tätä asetusta kaikkiin valittuihin sovelluksiin:</string> + <string name="ipscrambling_select_app">Sovella tätä asetusta kaikkiin valittuihin sovelluksiin * :</string> <string name="ipscrambling_any_location">Satunnaisesta maasta</string> <string name="ipscrambling_location_label">Internet-toimintani täytyy näyttää olevan peräisin:</string> <string name="ipscrambling_tor_disclaimer"><b>Huomaa:</b> Kun tämä vaihtoehto on käytössä, Internetyhteytesi nopeus todennäköisesti alenee merkittävästi.</string> diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 2370646..336cb74 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -29,7 +29,7 @@ <string name="ipscrambling_tor_disclaimer"><b>Note :</b> Tant que cette option est active, votre vitesse de connexion est susceptible d\'être considérablement réduite.</string> <string name="ipscrambling_location_label">Mon activité internet doit apparaître depuis :</string> <string name="ipscrambling_any_location">Pays aléatoire</string> - <string name="ipscrambling_select_app">Appliquer ce paramètre à toutes les applications sélectionnées :</string> + <string name="ipscrambling_select_app">Appliquer ce paramètre à toutes les applications sélectionnées * :</string> <string name="dashboard_graph_trackers_legend">%s pisteurs vous ont profilé au cours des dernières 24 heures</string> <string name="dashboard_am_i_tracked_title">Gérer les pisteurs d\'applications</string> <string name="dashboard_am_i_tracked_subtitle">%1$d pisteurs d\'apps, %2$d pisteurs autorisés</string> @@ -59,7 +59,7 @@ <string name="fake_location_mode">Mode de fausse localisation</string> <string name="trackers_title">Gérer les pisteurs des applications</string> <string name="trackers_count_label">%d pisteurs</string> - <string name="trackers_applist_title">Gérer les pisteurs utilisés dans les applications :</string> + <string name="trackers_applist_title">Gérer les pisteurs utilisés dans les applications * :</string> <string name="trackers_app_trackers_counts">%1$d pisteurs bloqués sur %2$d, %3$d fuites</string> <string name="apptrackers_block_all_toggle">Bloquer les pisteurs</string> <string name="apptrackers_trackers_list_title">Optez pour les pisteurs que vous souhaitez activer/désactiver.</string> diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 1dcd214..23e53cd 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -30,7 +30,7 @@ <string name="ipscrambling_tor_disclaimer"><b>Nota:</b> Se questa scelta viene attivata, la tua velocità su Internet verrà ridotta notevolmente.</string> <string name="ipscrambling_location_label">La mia attività internet deve apparire come se fosse da:</string> <string name="ipscrambling_any_location">Un paese a caso</string> - <string name="ipscrambling_select_app">Applica questa impostazione a tutte le app selezionate:</string> + <string name="ipscrambling_select_app">Applica questa impostazione a tutte le app selezionate * :</string> <string name="location_title">Gestisci la mia posizione</string> <string name="location_use_real_location">Usa la mia posizione reale</string> <string name="location_use_random_location">Usa una posizione a caso plausibile</string> @@ -43,7 +43,7 @@ <string name="trackers_period_day">24 ore</string> <string name="trackers_period_month">mese scorso</string> <string name="trackers_period_year">scorso anno</string> - <string name="trackers_applist_title">Gestisci i trackers usati nelle app:</string> + <string name="trackers_applist_title">Gestisci i trackers usati nelle app * :</string> <string name="trackers_graph_hours_period_format">HH:mm</string> <string name="trackers_graph_days_period_format">EEE d MMMM</string> <string name="trackers_graph_months_period_format">MMMM yyyy</string> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8bcd998..79b2a98 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -51,7 +51,8 @@ <string name="ipscrambling_tor_disclaimer"><b>Note:</b> While this option is active, your Internet speed is likely to be significantly reduced.</string> <string name="ipscrambling_location_label">My internet activity must appear from:</string> <string name="ipscrambling_any_location">Random country</string> - <string name="ipscrambling_select_app">Apply this setting to all selected applications:</string> + <string name="ipscrambling_select_app">Apply this setting to all selected applications * :</string> + <string name="ipscrambling_app_list_infos">Only apps with internet permission are listed.</string> <string name="ipscrambling_error_quickprivacy_disabled">Enabled Quick Privacy to use functionalities</string> <string name="ipscrambling_warning_starting_long">Our scrambling IP service is taking time to launch. It can take a few minutes. Leaving the screen won\'t interrupt the process.</string> <!-- Location --> @@ -70,7 +71,9 @@ <string name="trackers_period_day">24 hours</string> <string name="trackers_period_month">past month</string> <string name="trackers_period_year">past year</string> - <string name="trackers_applist_title">Manage trackers used in applications:</string> + <string name="trackers_applist_title">Manage trackers used in applications * :</string> + <string name="trackers_applist_infos">@string/ipscrambling_app_list_infos</string> + <string name="trackers_graph_hours_period_format">HH:mm</string> <string name="trackers_graph_days_period_format">MMMM d - EEE</string> <string name="trackers_graph_months_period_format">MMMM yyyy</string> |