Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Privacy-Preserving Analytics Settings Polishing (DEV) (#2322)
Browse files Browse the repository at this point in the history
* Updated settings icons

* added navigation to analytics more information fragment

* linting

* fixed max length

* removed unneeded marging at botton of scrollview

* added dimens

* aligned fonts

* added row click

* updated doc

* aligned fonts
  • Loading branch information
axelherbstreith authored Feb 11, 2021
1 parent 1d9dfab commit 7d40940
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,29 @@ class SettingsPrivacyPreservingAnalyticsFragment :

binding.apply {

// Privacy Preserving Analytics Switch
val updateAnalyticsSwitch =
settingsPpaSwitchRow.settingsSwitchRowSwitch
// Additional click target to toggle switch
val updateAnalyticsRow =
settingsPpaSwitchRow.settingsSwitchRow

settingsPpaHeader.headerButtonBack.buttonIcon.setOnClickListener {
popBackStack()
}

settingsPpaSwitchRow.settingsSwitchRowSwitch.setOnCheckedChangeListener { view, _ ->
updateAnalyticsSwitch.setOnCheckedChangeListener { view, _ ->
// Make sure that listener is called by user interaction
if (!view.isPressed) return@setOnCheckedChangeListener

viewModel.analyticsToggleEnabled()
}

// Additional click target to toggle switch
updateAnalyticsRow.setOnClickListener {
if (updateAnalyticsRow.isEnabled) viewModel.analyticsToggleEnabled()
}

federalStateRow.setOnClickListener {
doNavigate(
SettingsPrivacyPreservingAnalyticsFragmentDirections
Expand All @@ -69,6 +81,13 @@ class SettingsPrivacyPreservingAnalyticsFragment :
)
)
}

moreInfoRow.setOnClickListener {
doNavigate(
SettingsPrivacyPreservingAnalyticsFragmentDirections
.actionSettingsPrivacyPreservingAnalyticsFragmentToPpaMoreInfoFragment()
)
}
}

viewModel.ageGroup.observe2(this) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="17dp"
android:height="17dp"
android:viewportWidth="17"
android:viewportHeight="17">
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="M1.1385,0.148C0.8616,-0.0673 0.4612,-0.0477 0.2067,0.2067C-0.0689,0.4824 -0.0689,0.9294 0.2067,1.205L15.5009,16.4991L15.5674,16.5579C15.8443,16.7732 16.2447,16.7536 16.4991,16.4991C16.7748,16.2235 16.7748,15.7765 16.4991,15.5009L1.205,0.2067L1.1385,0.148ZM1,5.2H3.2035L4,5.9965V15H1V5.2ZM6.6,15V8.5965L9.4,11.3965V15H6.6ZM12.2,15V14.1965L13.0035,15H12.2ZM12.2,10.2035L15,13.0035V9H12.2V10.2035ZM6.6,4.6035L9.4,7.4035V1H6.6V4.6035Z"
android:pathData="M13.1385,12.148C12.8616,11.9327 12.4612,11.9523 12.2067,12.2067C11.9311,12.4824 11.9311,12.9294 12.2067,13.205L27.5009,28.4991L27.5674,28.5579C27.8443,28.7732 28.2447,28.7536 28.4991,28.4991C28.7748,28.2235 28.7748,27.7765 28.4991,27.5009L13.205,12.2067L13.1385,12.148ZM13,17.2H15.2035L16,17.9965V27H13V17.2ZM18.6,27V20.5965L21.4,23.3965V27H18.6ZM24.2,27V26.1965L25.0035,27H24.2ZM24.2,22.2035L27,25.0035V21H24.2V22.2035ZM18.6,16.6035L21.4,19.4035V13H18.6V16.6035Z"
android:fillColor="#C00F2D"
android:fillType="evenOdd"/>
</vector>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:pathData="M5,9.2H8V19H5V9.2ZM10.6,5H13.4V19H10.6V5ZM16.2,13H19V19H16.2V13Z"
android:pathData="M11,16.8H14.8571V28H11V16.8ZM18.2,12H21.8V28H18.2V12ZM25.4,21.1429H29V28H25.4V21.1429Z"
android:fillColor="#007FAD"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
android:id="@+id/scrollview"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="@dimen/spacing_small"
app:layout_constraintBottom_toTopOf="@+id/guideline_bottom"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -41,7 +40,7 @@
android:id="@+id/onboarding_illustration"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:layout_marginTop="@dimen/spacing_small"
android:contentDescription="@string/onboarding_ppa_illustration_description"
android:focusable="true"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -55,7 +54,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/guideline_start"
android:layout_marginTop="19dp"
android:layout_marginTop="@dimen/spacing_small"
android:layout_marginEnd="@dimen/guideline_end"
android:contentDescription="@string/onboarding_ppa_headline"
android:focusable="true"
Expand All @@ -70,7 +69,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/guideline_start"
android:layout_marginTop="35dp"
android:layout_marginTop="@dimen/spacing_medium"
android:layout_marginEnd="@dimen/guideline_end"
android:contentDescription="@string/onboarding_ppa_body"
android:focusable="true"
Expand Down Expand Up @@ -238,7 +237,7 @@
style="@style/cardTracing"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="42dp"
android:layout_marginTop="@dimen/spacing_large"
android:orientation="vertical"
app:layout_constraintEnd_toStartOf="@+id/guideline_card_end"
app:layout_constraintStart_toStartOf="@+id/guideline_card_start"
Expand All @@ -262,7 +261,7 @@
style="@style/body1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="27dp"
android:layout_marginTop="@dimen/spacing_normal"
android:focusable="true"
android:text="@string/ppa_settings_privacy_information_body"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -271,11 +270,11 @@

<TextView
android:id="@id/legal_point_consent"
style="@style/subtitle"
style="@style/body1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginTop="23dp"
android:layout_marginStart="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_normal"
android:focusable="true"
android:text="@string/ppa_onboarding_privacy_information_point_consent"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -294,11 +293,11 @@

<TextView
android:id="@id/legal_point_identity"
style="@style/subtitle"
style="@style/body1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginTop="23dp"
android:layout_marginStart="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_normal"
android:focusable="true"
android:text="@string/ppa_onboarding_privacy_information_point_identity"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -317,11 +316,11 @@

<TextView
android:id="@id/legal_point_sixteen"
style="@style/subtitle"
style="@style/body1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="13dp"
android:layout_marginTop="23dp"
android:layout_marginStart="@dimen/spacing_small"
android:layout_marginTop="@dimen/spacing_normal"
android:focusable="true"
android:text="@string/ppa_onboarding_privacy_information_point_sixteen"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -343,7 +342,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@id/more_info_row"
style="@style/row"
android:layout_marginTop="22dp"
android:layout_marginTop="@dimen/spacing_normal"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -352,7 +351,7 @@

<TextView
android:id="@id/more_info_title"
style="@style/subtitle"
style="@style/body1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:focusable="true"
Expand Down
3 changes: 3 additions & 0 deletions Corona-Warn-App/src/main/res/navigation/nav_graph.xml
Original file line number Diff line number Diff line change
Expand Up @@ -568,5 +568,8 @@
<action
android:id="@+id/action_settingsPrivacyPreservingAnalyticsFragment_to_analyticsUserInputFragment"
app:destination="@id/analyticsUserInputFragment" />
<action
android:id="@+id/action_settingsPrivacyPreservingAnalyticsFragment_to_ppaMoreInfoFragment"
app:destination="@id/ppaMoreInfoFragment" />
</fragment>
</navigation>

0 comments on commit 7d40940

Please sign in to comment.