summaryrefslogtreecommitdiff
path: root/app/src/main/java/foundation
diff options
context:
space:
mode:
authorjacquarg <guillaume.jacquart@hoodbrains.com>2022-03-14 18:36:50 +0100
committerjacquarg <guillaume.jacquart@hoodbrains.com>2022-03-14 18:40:07 +0100
commitfd4b8f04aaf98da778838854c873ec108586451f (patch)
treeb05e098552045c818c149d510d64fbb4355718a3 /app/src/main/java/foundation
parenta8a5374b16df8334163697c86c47a816c5cc7b15 (diff)
Update main screen UI, #4963
Diffstat (limited to 'app/src/main/java/foundation')
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFragment.kt34
1 files changed, 15 insertions, 19 deletions
diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFragment.kt b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFragment.kt
index db9dcce..41f6509 100644
--- a/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFragment.kt
+++ b/app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFragment.kt
@@ -19,6 +19,8 @@ package foundation.e.privacycentralapp.features.dashboard
import android.content.Intent
import android.os.Bundle
+import android.text.Html
+import android.text.Html.FROM_HTML_MODE_LEGACY
import android.view.View
import androidx.core.content.ContextCompat.getColor
import androidx.fragment.app.activityViewModels
@@ -143,21 +145,9 @@ class DashboardFragment :
else R.string.dashboard_state_title_off
)
- binding.stateSubtitle.text = getString(
- if (state.isQuickPrivacyEnabled) R.string.dashboard_state_subtitle_on
- else R.string.dashboard_state_subtitle_off
- )
-
- binding.togglePrivacyCentral.setImageResource(
- if (state.isQuickPrivacyEnabled) R.drawable.ic_quick_privacy_on
- else R.drawable.ic_quick_privacy_off
- )
- binding.stateLabel.setTextColor(
- getColor(
- requireContext(),
- if (state.isQuickPrivacyEnabled) R.color.green_on
- else R.color.orange_off
- )
+ binding.stateIcon.setImageResource(
+ if (state.isQuickPrivacyEnabled) R.drawable.ic_shield_on
+ else R.drawable.ic_shield_off
)
val trackersEnabled = state.isQuickPrivacyEnabled && state.isAllTrackersBlocked
@@ -169,7 +159,7 @@ class DashboardFragment :
getColor(
requireContext(),
if (trackersEnabled) R.color.green_on
- else R.color.black_text
+ else R.color.red_off
)
)
@@ -182,7 +172,7 @@ class DashboardFragment :
getColor(
requireContext(),
if (geolocEnabled) R.color.green_on
- else R.color.black_text
+ else R.color.red_off
)
)
@@ -203,14 +193,20 @@ class DashboardFragment :
getColor(
requireContext(),
if (ipAddressEnabled) R.color.green_on
- else R.color.black_text
+ else R.color.red_off
)
)
state.dayStatistics?.let { graphHolder.data = it }
state.dayLabels?.let { graphHolder.labels = it }
- binding.graphLegend.text = getString(R.string.dashboard_graph_trackers_legend, state.activeTrackersCount?.toString() ?: "No")
+ binding.graphLegend.text = Html.fromHtml(
+ getString(
+ R.string.dashboard_graph_trackers_legend,
+ state.activeTrackersCount?.toString() ?: "No"
+ ),
+ FROM_HTML_MODE_LEGACY
+ )
if (state.activeTrackersCount != null && state.trackersCount != null) {
binding.amITracked.subTitle = getString(R.string.dashboard_am_i_tracked_subtitle, state.trackersCount, state.activeTrackersCount)