aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/foundation/e/privacycentralapp/features
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/foundation/e/privacycentralapp/features')
-rw-r--r--app/src/main/java/foundation/e/privacycentralapp/features/dashboard/DashboardFragment.kt19
1 files changed, 19 insertions, 0 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 32549c9..3f849a6 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
@@ -24,6 +24,7 @@ import android.text.Html.FROM_HTML_MODE_LEGACY
import android.view.View
import android.widget.Toast
import androidx.core.content.ContextCompat.getColor
+import androidx.core.os.bundleOf
import androidx.core.view.isVisible
import androidx.fragment.app.activityViewModels
import androidx.fragment.app.commit
@@ -56,6 +57,13 @@ class DashboardFragment :
NavToolbarFragment(R.layout.fragment_dashboard),
MVIView<DashboardFeature.State, DashboardFeature.Action> {
+ companion object {
+ private const val PARAM_HIGHLIGHT_INDEX = "PARAM_HIGHLIGHT_INDEX"
+ fun buildArgs(highlightIndex: Int): Bundle = bundleOf(
+ PARAM_HIGHLIGHT_INDEX to highlightIndex
+ )
+ }
+
private val dependencyContainer: DependencyContainer by lazy {
(this.requireActivity().application as PrivacyCentralApplication).dependencyContainer
}
@@ -69,11 +77,15 @@ class DashboardFragment :
private var qpDisabledSnackbar: Snackbar? = null
+ private var highlightIndexOnStart: Int? = null
+
private var updateUIJob: Job? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+ highlightIndexOnStart = arguments?.getInt(PARAM_HIGHLIGHT_INDEX, -1)
+
updateUIJob = lifecycleScope.launchWhenStarted {
viewModel.dashboardFeature.takeView(this, this@DashboardFragment)
}
@@ -250,6 +262,13 @@ class DashboardFragment :
),
FROM_HTML_MODE_LEGACY
)
+
+ highlightIndexOnStart?.let {
+ binding.graph.post {
+ graphHolder.highlightIndex(it)
+ }
+ highlightIndexOnStart = null
+ }
}
if (state.allowedTrackersCount != null && state.trackersCount != null) {