summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/src/main/AndroidManifest.xml7
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt12
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/common/WarningDialog.kt130
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt17
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/domain/entities/MainFeatures.kt22
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/domain/usecases/ShowFeaturesWarningUseCase.kt54
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt1
-rw-r--r--app/src/main/res/layout/alertdialog_do_not_show_again.xml32
-rw-r--r--app/src/main/res/layout/dashboard_item_submenu_button.xml2
-rw-r--r--app/src/main/res/layout/fragment_dashboard.xml192
-rw-r--r--app/src/main/res/layout/trackers_item_graph.xml17
-rw-r--r--app/src/main/res/layout/widget.xml174
-rw-r--r--app/src/main/res/values-de/strings.xml34
-rw-r--r--app/src/main/res/values-es/strings.xml33
-rw-r--r--app/src/main/res/values-fi/strings.xml33
-rw-r--r--app/src/main/res/values-fr/strings.xml33
-rw-r--r--app/src/main/res/values-it/strings.xml33
-rw-r--r--app/src/main/res/values/strings.xml52
-rw-r--r--app/src/main/res/values/themes.xml11
19 files changed, 517 insertions, 372 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b5836dc..3bcd764 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -86,6 +86,13 @@
<category android:name="${mainActivityIntentFilterCategory}"/>
</intent-filter>
</activity>
+ <activity
+ android:name=".common.WarningDialog"
+ android:noHistory="true"
+ android:excludeFromRecents="true"
+ android:launchMode="singleInstance"
+ android:theme="@style/Theme.InvisibleActivity"
+ />
</application>
</manifest> \ No newline at end of file
diff --git a/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt b/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt
index 345307c..f241e67 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/DependencyContainer.kt
@@ -24,6 +24,7 @@ import androidx.lifecycle.DEFAULT_ARGS_KEY
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider
import androidx.lifecycle.viewmodel.CreationExtras
+import foundation.e.privacycentralapp.common.WarningDialog
import foundation.e.privacycentralapp.data.repositories.AppListsRepository
import foundation.e.privacycentralapp.data.repositories.LocalStateRepository
import foundation.e.privacycentralapp.data.repositories.TrackersRepository
@@ -31,6 +32,7 @@ import foundation.e.privacycentralapp.domain.usecases.AppListUseCase
import foundation.e.privacycentralapp.domain.usecases.FakeLocationStateUseCase
import foundation.e.privacycentralapp.domain.usecases.GetQuickPrivacyStateUseCase
import foundation.e.privacycentralapp.domain.usecases.IpScramblingStateUseCase
+import foundation.e.privacycentralapp.domain.usecases.ShowFeaturesWarningUseCase
import foundation.e.privacycentralapp.domain.usecases.TrackersStateUseCase
import foundation.e.privacycentralapp.domain.usecases.TrackersStatisticsUseCase
import foundation.e.privacycentralapp.dummy.CityDataSource
@@ -106,6 +108,10 @@ class DependencyContainer(val app: Application) {
)
}
+ val showFeaturesWarningUseCase by lazy {
+ ShowFeaturesWarningUseCase(localStateRepository = localStateRepository)
+ }
+
val viewModelsFactory by lazy {
ViewModelsFactory(
getQuickPrivacyStateUseCase = getQuickPrivacyStateUseCase,
@@ -126,6 +132,12 @@ class DependencyContainer(val app: Application) {
UpdateTrackersWorker.periodicUpdate(context)
+ WarningDialog.startListening(
+ showFeaturesWarningUseCase,
+ GlobalScope,
+ context
+ )
+
Widget.startListening(
context,
getQuickPrivacyStateUseCase,
diff --git a/app/src/main/java/foundation/e/privacycentralapp/common/WarningDialog.kt b/app/src/main/java/foundation/e/privacycentralapp/common/WarningDialog.kt
new file mode 100644
index 0000000..cbbeffa
--- /dev/null
+++ b/app/src/main/java/foundation/e/privacycentralapp/common/WarningDialog.kt
@@ -0,0 +1,130 @@
+/*
+ * 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.app.Activity
+import android.content.Context
+import android.content.Intent
+import android.graphics.drawable.ColorDrawable
+import android.os.Bundle
+import android.util.Log
+import android.view.View
+import android.widget.CheckBox
+import androidx.appcompat.app.AlertDialog
+import foundation.e.privacycentralapp.PrivacyCentralApplication
+import foundation.e.privacycentralapp.R
+import foundation.e.privacycentralapp.domain.entities.MainFeatures
+import foundation.e.privacycentralapp.domain.entities.MainFeatures.FAKE_LOCATION
+import foundation.e.privacycentralapp.domain.entities.MainFeatures.IP_SCRAMBLING
+import foundation.e.privacycentralapp.domain.entities.MainFeatures.TRACKERS_CONTROL
+import foundation.e.privacycentralapp.domain.usecases.ShowFeaturesWarningUseCase
+import foundation.e.privacycentralapp.main.MainActivity
+import kotlinx.coroutines.CoroutineScope
+import kotlinx.coroutines.flow.launchIn
+import kotlinx.coroutines.flow.map
+
+class WarningDialog : Activity() {
+ companion object {
+ private const val PARAM_FEATURE = "feature"
+
+ fun startListening(
+ showFeaturesWarningUseCase: ShowFeaturesWarningUseCase,
+ appScope: CoroutineScope,
+ appContext: Context
+ ) {
+ showFeaturesWarningUseCase.showWarning().map { feature ->
+ appContext.startActivity(
+ createIntent(context = appContext, feature = feature)
+ )
+ }.launchIn(appScope)
+ }
+
+ private fun createIntent(
+ context: Context,
+ feature: MainFeatures,
+ ): Intent {
+ val intent = Intent(context, WarningDialog::class.java)
+ intent.putExtra(PARAM_FEATURE, feature.name)
+ intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
+ return intent
+ }
+ }
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ getWindow().setBackgroundDrawable(ColorDrawable(0))
+
+ val feature = try {
+ MainFeatures.valueOf(intent.getStringExtra(PARAM_FEATURE) ?: "")
+ } catch (e: Exception) {
+ Log.e("WarningDialog", "Missing mandatory activity parameter", e)
+ finish()
+ return
+ }
+
+ showWarningDialog(feature)
+ }
+
+ private fun showWarningDialog(feature: MainFeatures) {
+ val builder = AlertDialog.Builder(this)
+ builder.setOnDismissListener { finish() }
+
+ val content: View = layoutInflater.inflate(R.layout.alertdialog_do_not_show_again, null)
+ val checkbox = content.findViewById<CheckBox>(R.id.checkbox)
+ builder.setView(content)
+
+ builder.setMessage(
+ when (feature) {
+ TRACKERS_CONTROL -> R.string.warningdialog_trackers_message
+ FAKE_LOCATION -> R.string.warningdialog_location_message
+ IP_SCRAMBLING -> R.string.warningdialog_ipscrambling_message
+ }
+ )
+
+ builder.setTitle(
+ when (feature) {
+ TRACKERS_CONTROL -> R.string.warningdialog_trackers_title
+ FAKE_LOCATION -> R.string.warningdialog_location_title
+ IP_SCRAMBLING -> R.string.warningdialog_ipscrambling_title
+ }
+ )
+
+ builder.setPositiveButton(
+ when (feature) {
+ IP_SCRAMBLING -> R.string.warningdialog_ipscrambling_cta
+ else -> R.string.ok
+ }
+ ) { _, _ ->
+ if (checkbox.isChecked()) {
+ (application as PrivacyCentralApplication)
+ .dependencyContainer.showFeaturesWarningUseCase
+ .doNotShowAgain(feature)
+ }
+ finish()
+ }
+
+ if (feature == TRACKERS_CONTROL) {
+ builder.setNeutralButton(R.string.warningdialog_trackers_secondary_cta) { _, _ ->
+ startActivity(MainActivity.createTrackersIntent(this))
+ finish()
+ }
+ }
+
+ builder.show()
+ }
+}
diff --git a/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt b/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt
index 92ee0c1..6cb4f81 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/data/repositories/LocalStateRepository.kt
@@ -36,6 +36,9 @@ class LocalStateRepository(context: Context) {
private const val KEY_FAKE_LATITUDE = "fakeLatitude"
private const val KEY_FAKE_LONGITUDE = "fakeLongitude"
private const val KEY_FIRST_BOOT = "firstBoot"
+ private const val KEY_HIDE_WARNING_TRACKERS = "hide_warning_trackers"
+ private const val KEY_HIDE_WARNING_LOCATION = "hide_warning_location"
+ private const val KEY_HIDE_WARNING_IPSCRAMBLING = "hide_warning_ipscrambling"
}
private val sharedPref = context.getSharedPreferences(SHARED_PREFS_FILE, Context.MODE_PRIVATE)
@@ -50,7 +53,7 @@ class LocalStateRepository(context: Context) {
val areAllTrackersBlocked: MutableStateFlow<Boolean> = MutableStateFlow(false)
- private val _fakeLocationEnabled = MutableStateFlow(sharedPref.getBoolean(KEY_FAKE_LOCATION, true))
+ private val _fakeLocationEnabled = MutableStateFlow(sharedPref.getBoolean(KEY_FAKE_LOCATION, false))
val fakeLocationEnabled = _fakeLocationEnabled.asStateFlow()
@@ -99,6 +102,18 @@ class LocalStateRepository(context: Context) {
get() = sharedPref.getBoolean(KEY_FIRST_BOOT, true)
set(value) = set(KEY_FIRST_BOOT, value)
+ var hideWarningTrackers: Boolean
+ get() = sharedPref.getBoolean(KEY_HIDE_WARNING_TRACKERS, false)
+ set(value) = set(KEY_HIDE_WARNING_TRACKERS, value)
+
+ var hideWarningLocation: Boolean
+ get() = sharedPref.getBoolean(KEY_HIDE_WARNING_LOCATION, false)
+ set(value) = set(KEY_HIDE_WARNING_LOCATION, value)
+
+ var hideWarningIpScrambling: Boolean
+ get() = sharedPref.getBoolean(KEY_HIDE_WARNING_IPSCRAMBLING, false)
+ set(value) = set(KEY_HIDE_WARNING_IPSCRAMBLING, value)
+
private fun set(key: String, value: Boolean) {
sharedPref.edit().putBoolean(key, value).apply()
}
diff --git a/app/src/main/java/foundation/e/privacycentralapp/domain/entities/MainFeatures.kt b/app/src/main/java/foundation/e/privacycentralapp/domain/entities/MainFeatures.kt
new file mode 100644
index 0000000..0e7f99c
--- /dev/null
+++ b/app/src/main/java/foundation/e/privacycentralapp/domain/entities/MainFeatures.kt
@@ -0,0 +1,22 @@
+/*
+ * 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.domain.entities
+
+enum class MainFeatures {
+ TRACKERS_CONTROL, FAKE_LOCATION, IP_SCRAMBLING
+}
diff --git a/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/ShowFeaturesWarningUseCase.kt b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/ShowFeaturesWarningUseCase.kt
new file mode 100644
index 0000000..e347b34
--- /dev/null
+++ b/app/src/main/java/foundation/e/privacycentralapp/domain/usecases/ShowFeaturesWarningUseCase.kt
@@ -0,0 +1,54 @@
+/*
+ * 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.domain.usecases
+
+import foundation.e.privacycentralapp.data.repositories.LocalStateRepository
+import foundation.e.privacycentralapp.domain.entities.MainFeatures
+import kotlinx.coroutines.flow.Flow
+import kotlinx.coroutines.flow.drop
+import kotlinx.coroutines.flow.dropWhile
+import kotlinx.coroutines.flow.filter
+import kotlinx.coroutines.flow.map
+import kotlinx.coroutines.flow.merge
+
+class ShowFeaturesWarningUseCase(
+ private val localStateRepository: LocalStateRepository
+) {
+
+ fun showWarning(): Flow<MainFeatures> {
+ return merge(
+ localStateRepository.blockTrackers.drop(1).dropWhile { !it }
+ .filter { it && !localStateRepository.hideWarningTrackers }
+ .map { MainFeatures.TRACKERS_CONTROL },
+ localStateRepository.fakeLocationEnabled.drop(1).dropWhile { !it }
+ .filter { it && !localStateRepository.hideWarningLocation }
+ .map { MainFeatures.FAKE_LOCATION },
+ localStateRepository.ipScramblingSetting.drop(1).dropWhile { !it }
+ .filter { it && !localStateRepository.hideWarningIpScrambling }
+ .map { MainFeatures.IP_SCRAMBLING }
+ )
+ }
+
+ fun doNotShowAgain(feature: MainFeatures) {
+ when (feature) {
+ MainFeatures.TRACKERS_CONTROL -> localStateRepository.hideWarningTrackers = true
+ MainFeatures.FAKE_LOCATION -> localStateRepository.hideWarningLocation = true
+ MainFeatures.IP_SCRAMBLING -> localStateRepository.hideWarningIpScrambling = true
+ }
+ }
+}
diff --git a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt
index 4fdbb03..fccfd48 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/widget/WidgetUI.kt
@@ -184,7 +184,6 @@ fun render(
)
setOnClickPendingIntent(R.id.graph_view_trackers_btn, pIntent)
- // setOnClickPendingIntent(R.id.graph_view_trackers_btn_icon, pIntent)
val graphHeightPx = 26.dpToPxF(context)
val maxValue =
diff --git a/app/src/main/res/layout/alertdialog_do_not_show_again.xml b/app/src/main/res/layout/alertdialog_do_not_show_again.xml
new file mode 100644
index 0000000..1b60843
--- /dev/null
+++ b/app/src/main/res/layout/alertdialog_do_not_show_again.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?><!--
+ ~ 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/>.
+ -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:paddingHorizontal="16dp"
+ android:paddingTop="24dp"
+ android:paddingBottom="8dp"
+ >
+ <CheckBox
+ android:id="@+id/checkbox"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+
+ android:text="@string/warningdialog_do_not_show_again"
+ />
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/dashboard_item_submenu_button.xml b/app/src/main/res/layout/dashboard_item_submenu_button.xml
index 9129d07..ef03ea3 100644
--- a/app/src/main/res/layout/dashboard_item_submenu_button.xml
+++ b/app/src/main/res/layout/dashboard_item_submenu_button.xml
@@ -27,7 +27,7 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="16dp"
+ android:paddingHorizontal="16dp"
android:background="?attr/selectableItemBackground"
>
<ImageView
diff --git a/app/src/main/res/layout/fragment_dashboard.xml b/app/src/main/res/layout/fragment_dashboard.xml
index cedf569..b1fdaa0 100644
--- a/app/src/main/res/layout/fragment_dashboard.xml
+++ b/app/src/main/res/layout/fragment_dashboard.xml
@@ -49,122 +49,154 @@
android:background="@color/divider"
/>
-
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:padding="16dp"
+ android:layout_marginTop="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:padding="16dp"
-
- android:layout_marginTop="8dp"
- android:layout_marginBottom="16dp">
- <LinearLayout
+ android:layout_marginBottom="8dp"
+ android:gravity="bottom"
+ android:baselineAligned="false"
+ >
+ <TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:orientation="vertical"
android:gravity="center_horizontal"
- >
-
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_trackers_label"
- android:textSize="12sp"
- android:textColor="@color/secondary_text"
- android:layout_marginBottom="8dp"
- android:textAllCaps="true"
- />
- <TextView
- android:id="@+id/state_trackers"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_trackers_off"
- android:textSize="12sp"
- android:textColor="@color/primary_text"
- android:textAllCaps="true"
- />
- <Switch
- android:id="@+id/toggle_trackers"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_margin="12dp"
- />
- </LinearLayout>
- <LinearLayout
+ android:text="@string/dashboard_state_trackers_label"
+ android:textSize="12sp"
+ android:textColor="@color/secondary_text"
+ android:textAllCaps="true"
+ />
+ <TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:orientation="vertical"
android:gravity="center_horizontal"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_geolocation_label"
- android:textSize="12sp"
- android:textColor="@color/secondary_text"
- android:layout_marginBottom="8dp"
- android:textAllCaps="true"
- />
- <TextView
- android:id="@+id/state_geolocation"
- android:layout_width="wrap_content"
+ android:text="@string/dashboard_state_geolocation_label"
+ android:textSize="12sp"
+ android:textColor="@color/secondary_text"
+ android:textAllCaps="true"
+ />
+ <TextView
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
+ android:text="@string/dashboard_state_ipaddress_label"
+ android:textSize="12sp"
+ android:textColor="@color/secondary_text"
+ android:textAllCaps="true"
+ />
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ android:gravity="bottom"
+ android:baselineAligned="false"
+ >
+ <TextView
+ android:id="@+id/state_trackers"
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
android:layout_height="wrap_content"
- android:text="@string/dashboard_state_geolocation_off"
+ android:text="@string/dashboard_state_trackers_off"
android:textSize="12sp"
android:textColor="@color/primary_text"
android:textAllCaps="true"
/>
- <Switch
- android:id="@+id/toggle_location"
- android:layout_height="wrap_content"
- android:layout_width="wrap_content"
- android:layout_margin="12dp"
- />
- </LinearLayout>
- <LinearLayout
+
+ <TextView
+ android:id="@+id/state_geolocation"
android:layout_width="0dp"
+ android:layout_weight="1"
+ android:gravity="center_horizontal"
android:layout_height="wrap_content"
+ android:text="@string/dashboard_state_geolocation_off"
+ android:textSize="12sp"
+ android:textColor="@color/primary_text"
+ android:textAllCaps="true"
+ />
+ <FrameLayout
+ android:layout_width="0dp"
android:layout_weight="1"
- android:orientation="vertical"
android:gravity="center_horizontal"
- >
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/dashboard_state_ipaddress_label"
- android:textSize="12sp"
- android:textColor="@color/secondary_text"
- android:layout_marginBottom="8dp"
- android:textAllCaps="true"
- />
+ android:layout_height="wrap_content">
<TextView
android:id="@+id/state_ip_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
-android:text="@string/dashboard_state_ipaddress_off"
+ android:layout_gravity="center_horizontal"
+ android:gravity="center_horizontal"
+ android:text="@string/dashboard_state_ipaddress_off"
android:textSize="12sp"
android:textColor="@color/primary_text"
android:textAllCaps="true"
- android:visibility="gone"
+ android:visibility="visible"
/>
<ProgressBar
android:id="@+id/state_ip_address_loader"
+ android:layout_gravity="center_horizontal"
android:layout_width="16dp"
android:layout_height="16dp"
android:indeterminate="true"
+
android:visibility="visible"/>
+ </FrameLayout>
+ </LinearLayout>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal"
+ >
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1"
+ />
+ <Switch
+ android:id="@+id/toggle_trackers"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:padding="12dp"
+ />
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="2"
+ />
+ <Switch
+ android:id="@+id/toggle_location"
+ android:layout_height="wrap_content"
+ android:layout_width="wrap_content"
+ android:padding="12dp"
+ />
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="2"
+ />
<Switch
android:id="@+id/toggle_ipscrambling"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
- android:layout_margin="12dp"
+ android:padding="12dp"
/>
+ <View
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1"
+ />
</LinearLayout>
</LinearLayout>
-
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -219,7 +251,7 @@ android:text="@string/dashboard_state_ipaddress_off"
android:padding="1dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/graph_legend"
- android:layout_marginTop="8dp"
+ android:layout_marginTop="9dp"
android:layout_marginStart="16dp"
android:background="@drawable/ic_legend_blocked"
/>
@@ -227,13 +259,11 @@ android:text="@string/dashboard_state_ipaddress_off"
android:id="@+id/graph_legend_blocked"
android:layout_width="0dp"
android:layout_height="wrap_content"
- tools:text="0 Trackers"
- android:ellipsize="end"
- android:maxLines="1"
+ tools:text="Blockierte Datenlecks"
android:layout_marginStart="8dp"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
+ app:layout_constraintTop_toBottomOf="@+id/graph_legend"
app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed_icon"
android:layout_marginTop="8dp"
android:text="@string/graph_legend_blocked"
@@ -247,22 +277,20 @@ android:text="@string/dashboard_state_ipaddress_off"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked"
app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed"
- android:layout_marginTop="8dp"
+ android:layout_marginTop="9dp"
android:layout_marginStart="16dp"
android:background="@drawable/ic_legend_leaked"
/>
<TextView
android:id="@+id/graph_legend_allowed"
android:layout_width="0dp"
- android:ellipsize="end"
- android:maxLines="1"
android:layout_height="wrap_content"
tools:text="0 Trackers"
android:layout_marginStart="8dp"
android:textSize="12sp"
app:layout_constraintRight_toLeftOf="@id/leaking_app_button"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_allowed_icon"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
+ app:layout_constraintTop_toBottomOf="@+id/graph_legend"
android:layout_marginTop="8dp"
android:text="@string/graph_legend_allowed"
/>
diff --git a/app/src/main/res/layout/trackers_item_graph.xml b/app/src/main/res/layout/trackers_item_graph.xml
index 20106f7..aabc108 100644
--- a/app/src/main/res/layout/trackers_item_graph.xml
+++ b/app/src/main/res/layout/trackers_item_graph.xml
@@ -63,22 +63,19 @@
android:padding="1dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@+id/graph"
- android:layout_marginTop="8dp"
+ android:layout_marginTop="9dp"
android:layout_marginStart="16dp"
android:background="@drawable/ic_legend_blocked"
/>
<TextView
android:id="@+id/graph_legend_blocked"
android:layout_width="0dp"
- android:maxLines="1"
- android:ellipsize="end"
android:layout_height="wrap_content"
tools:text="0 Trackers"
android:layout_marginStart="8dp"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintBottom_toBottomOf="@+id/graph_legend_blocked_icon"
- app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed_icon"
+ app:layout_constraintTop_toBottomOf="@+id/graph" app:layout_constraintRight_toLeftOf="@id/graph_legend_allowed_icon"
android:layout_marginTop="8dp"
android:text="@string/graph_legend_blocked"
/>
@@ -89,9 +86,8 @@
android:layout_height="16dp"
android:padding="1dp"
app:layout_constraintLeft_toRightOf="@+id/graph_legend_blocked"