From 1f6068976da88f4009f680816de96fabdade4e12 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 8 Apr 2022 17:52:45 +0100 Subject: [PATCH] updating terms ids and applying design specified colours to the checkbox --- .../main/res/color/checkbox_tint_selector.xml | 5 +++ .../ftueauth/terms/FtueAuthTermsFragment.kt | 8 ++-- .../main/res/drawable/ic_privacy_policy.xml | 10 +++++ .../res/layout/fragment_ftue_login_terms.xml | 44 +++++++++---------- vector/src/main/res/layout/item_policy.xml | 5 ++- 5 files changed, 44 insertions(+), 28 deletions(-) create mode 100644 library/ui-styles/src/main/res/color/checkbox_tint_selector.xml create mode 100644 vector/src/main/res/drawable/ic_privacy_policy.xml diff --git a/library/ui-styles/src/main/res/color/checkbox_tint_selector.xml b/library/ui-styles/src/main/res/color/checkbox_tint_selector.xml new file mode 100644 index 0000000000..67e2e68570 --- /dev/null +++ b/library/ui-styles/src/main/res/color/checkbox_tint_selector.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt index 877a85126a..0c3c480cfe 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/terms/FtueAuthTermsFragment.kt @@ -68,11 +68,11 @@ class FtueAuthTermsFragment @Inject constructor( } private fun setupViews() { - views.displayNameSubmit.setOnClickListener { submit() } + views.termsSubmit.setOnClickListener { submit() } views.loginTermsPolicyList.setHasFixedSize(false) views.loginTermsPolicyList.configureWith(policyController, hasFixedSize = false, dividerDrawable = R.drawable.divider_horizontal) - views.displayNameGutterStart.doOnLayout { - val gutterSize = views.contentRoot.width * (views.displayNameGutterStart.layoutParams as ConstraintLayout.LayoutParams).guidePercent + views.termsGutterStart.doOnLayout { + val gutterSize = views.contentRoot.width * (views.termsGutterStart.layoutParams as ConstraintLayout.LayoutParams).guidePercent policyController.horizontalPadding = gutterSize.roundToInt() } policyController.listener = this @@ -88,7 +88,7 @@ class FtueAuthTermsFragment @Inject constructor( policyController.setData(loginTermsViewState.localizedFlowDataLoginTermsChecked) // Button is enabled only if all checkboxes are checked - views.displayNameSubmit.isEnabled = loginTermsViewState.allChecked() + views.termsSubmit.isEnabled = loginTermsViewState.allChecked() } override fun setChecked(localizedFlowDataLoginTerms: LocalizedFlowDataLoginTerms, isChecked: Boolean) { diff --git a/vector/src/main/res/drawable/ic_privacy_policy.xml b/vector/src/main/res/drawable/ic_privacy_policy.xml new file mode 100644 index 0000000000..08c63ba44b --- /dev/null +++ b/vector/src/main/res/drawable/ic_privacy_policy.xml @@ -0,0 +1,10 @@ + + + diff --git a/vector/src/main/res/layout/fragment_ftue_login_terms.xml b/vector/src/main/res/layout/fragment_ftue_login_terms.xml index 7101ba7546..c388b963d9 100644 --- a/vector/src/main/res/layout/fragment_ftue_login_terms.xml +++ b/vector/src/main/res/layout/fragment_ftue_login_terms.xml @@ -14,14 +14,14 @@ android:layout_height="wrap_content"> + app:layout_constraintBottom_toTopOf="@id/termsHeaderSubtitle" + app:layout_constraintEnd_toEndOf="@id/termsGutterEnd" + app:layout_constraintStart_toStartOf="@id/termsGutterStart" + app:layout_constraintTop_toBottomOf="@id/termsHeaderIcon" /> + app:layout_constraintEnd_toEndOf="@id/termsGutterEnd" + app:layout_constraintStart_toStartOf="@id/termsGutterStart" + app:layout_constraintTop_toBottomOf="@id/termsHeaderTitle" /> + app:layout_constraintTop_toBottomOf="@id/termsHeaderSubtitle" />