updating terms ids and applying design specified colours to the checkbox

This commit is contained in:
Adam Brown 2022-04-08 17:52:45 +01:00
parent 059b2a5424
commit 1f6068976d
5 changed files with 44 additions and 28 deletions

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="?vctr_content_tertiary" android:state_checked="false" />
<item android:color="?colorPrimary" android:state_checked="true" />
</selector>

View file

@ -68,11 +68,11 @@ class FtueAuthTermsFragment @Inject constructor(
} }
private fun setupViews() { private fun setupViews() {
views.displayNameSubmit.setOnClickListener { submit() } views.termsSubmit.setOnClickListener { submit() }
views.loginTermsPolicyList.setHasFixedSize(false) views.loginTermsPolicyList.setHasFixedSize(false)
views.loginTermsPolicyList.configureWith(policyController, hasFixedSize = false, dividerDrawable = R.drawable.divider_horizontal) views.loginTermsPolicyList.configureWith(policyController, hasFixedSize = false, dividerDrawable = R.drawable.divider_horizontal)
views.displayNameGutterStart.doOnLayout { views.termsGutterStart.doOnLayout {
val gutterSize = views.contentRoot.width * (views.displayNameGutterStart.layoutParams as ConstraintLayout.LayoutParams).guidePercent val gutterSize = views.contentRoot.width * (views.termsGutterStart.layoutParams as ConstraintLayout.LayoutParams).guidePercent
policyController.horizontalPadding = gutterSize.roundToInt() policyController.horizontalPadding = gutterSize.roundToInt()
} }
policyController.listener = this policyController.listener = this
@ -88,7 +88,7 @@ class FtueAuthTermsFragment @Inject constructor(
policyController.setData(loginTermsViewState.localizedFlowDataLoginTermsChecked) policyController.setData(loginTermsViewState.localizedFlowDataLoginTermsChecked)
// Button is enabled only if all checkboxes are checked // 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) { override fun setChecked(localizedFlowDataLoginTerms: LocalizedFlowDataLoginTerms, isChecked: Boolean) {

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="71dp"
android:height="70dp"
android:viewportWidth="71"
android:viewportHeight="70">
<path
android:pathData="M19.778,21.722C19.778,18.501 22.389,15.889 25.611,15.889H45.056C48.277,15.889 50.889,18.501 50.889,21.722V48.944C50.889,52.166 48.277,54.778 45.056,54.778H25.611C22.389,54.778 19.778,52.166 19.778,48.944V21.722ZM25.611,39.708C25.611,38.903 26.264,38.25 27.069,38.25H43.597C44.403,38.25 45.056,38.903 45.056,39.708C45.056,40.514 44.403,41.167 43.597,41.167H27.069C26.264,41.167 25.611,40.514 25.611,39.708ZM27.069,45.056C26.264,45.056 25.611,45.708 25.611,46.514C25.611,47.319 26.264,47.972 27.069,47.972H35.819C36.625,47.972 37.278,47.319 37.278,46.514C37.278,45.708 36.625,45.056 35.819,45.056H27.069Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
</vector>

View file

@ -14,14 +14,14 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/displayNameGutterStart" android:id="@+id/termsGutterStart"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintGuide_percent="@dimen/ftue_auth_gutter_start_percent" /> app:layout_constraintGuide_percent="@dimen/ftue_auth_gutter_start_percent" />
<androidx.constraintlayout.widget.Guideline <androidx.constraintlayout.widget.Guideline
android:id="@+id/displayNameGutterEnd" android:id="@+id/termsGutterEnd"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
@ -31,29 +31,29 @@
android:id="@+id/headerSpacing" android:id="@+id/headerSpacing"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="52dp" android:layout_height="52dp"
app:layout_constraintBottom_toTopOf="@id/displayNameHeaderIcon" app:layout_constraintBottom_toTopOf="@id/termsHeaderIcon"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0" app:layout_constraintVertical_bias="0"
app:layout_constraintVertical_chainStyle="packed" /> app:layout_constraintVertical_chainStyle="packed" />
<ImageView <ImageView
android:id="@+id/displayNameHeaderIcon" android:id="@+id/termsHeaderIcon"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="0dp"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:background="@drawable/circle" android:background="@drawable/circle"
android:backgroundTint="?colorSecondary" android:backgroundTint="?colorSecondary"
android:contentDescription="@null" android:contentDescription="@null"
android:src="@drawable/ic_user_fg" android:src="@drawable/ic_privacy_policy"
app:layout_constraintBottom_toTopOf="@id/displayNameHeaderTitle" app:layout_constraintBottom_toTopOf="@id/termsHeaderTitle"
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd" app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
app:layout_constraintHeight_percent="0.12" app:layout_constraintHeight_percent="0.12"
app:layout_constraintStart_toStartOf="@id/displayNameGutterStart" app:layout_constraintStart_toStartOf="@id/termsGutterStart"
app:layout_constraintTop_toBottomOf="@id/headerSpacing" app:layout_constraintTop_toBottomOf="@id/headerSpacing"
app:tint="@color/palette_white" /> app:tint="@color/palette_white" />
<TextView <TextView
android:id="@+id/displayNameHeaderTitle" android:id="@+id/termsHeaderTitle"
style="@style/Widget.Vector.TextView.Title.Medium" style="@style/Widget.Vector.TextView.Title.Medium"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -61,13 +61,13 @@
android:gravity="center" android:gravity="center"
android:text="@string/ftue_auth_terms_title" android:text="@string/ftue_auth_terms_title"
android:textColor="?vctr_content_primary" android:textColor="?vctr_content_primary"
app:layout_constraintBottom_toTopOf="@id/displayNameHeaderSubtitle" app:layout_constraintBottom_toTopOf="@id/termsHeaderSubtitle"
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd" app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
app:layout_constraintStart_toStartOf="@id/displayNameGutterStart" app:layout_constraintStart_toStartOf="@id/termsGutterStart"
app:layout_constraintTop_toBottomOf="@id/displayNameHeaderIcon" /> app:layout_constraintTop_toBottomOf="@id/termsHeaderIcon" />
<TextView <TextView
android:id="@+id/displayNameHeaderSubtitle" android:id="@+id/termsHeaderSubtitle"
style="@style/Widget.Vector.TextView.Subtitle" style="@style/Widget.Vector.TextView.Subtitle"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -76,9 +76,9 @@
android:text="@string/ftue_auth_terms_subtitle" android:text="@string/ftue_auth_terms_subtitle"
android:textColor="?vctr_content_secondary" android:textColor="?vctr_content_secondary"
app:layout_constraintBottom_toTopOf="@id/titleContentSpacing" app:layout_constraintBottom_toTopOf="@id/titleContentSpacing"
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd" app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
app:layout_constraintStart_toStartOf="@id/displayNameGutterStart" app:layout_constraintStart_toStartOf="@id/termsGutterStart"
app:layout_constraintTop_toBottomOf="@id/displayNameHeaderTitle" /> app:layout_constraintTop_toBottomOf="@id/termsHeaderTitle" />
<Space <Space
android:id="@+id/titleContentSpacing" android:id="@+id/titleContentSpacing"
@ -86,7 +86,7 @@
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/loginTermsPolicyList" app:layout_constraintBottom_toTopOf="@id/loginTermsPolicyList"
app:layout_constraintHeight_percent="0.03" app:layout_constraintHeight_percent="0.03"
app:layout_constraintTop_toBottomOf="@id/displayNameHeaderSubtitle" /> app:layout_constraintTop_toBottomOf="@id/termsHeaderSubtitle" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/loginTermsPolicyList" android:id="@+id/loginTermsPolicyList"
@ -101,20 +101,20 @@
android:id="@+id/entrySpacing" android:id="@+id/entrySpacing"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/displayNameSubmit" app:layout_constraintBottom_toTopOf="@id/termsSubmit"
app:layout_constraintHeight_percent="0.05" app:layout_constraintHeight_percent="0.05"
app:layout_constraintTop_toBottomOf="@id/loginTermsPolicyList" /> app:layout_constraintTop_toBottomOf="@id/loginTermsPolicyList" />
<Button <Button
android:id="@+id/displayNameSubmit" android:id="@+id/termsSubmit"
style="@style/Widget.Vector.Button.Login" style="@style/Widget.Vector.Button.Login"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/login_signup_submit" android:text="@string/login_signup_submit"
android:textAllCaps="true" android:textAllCaps="true"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd" app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
app:layout_constraintStart_toStartOf="@id/displayNameGutterStart" app:layout_constraintStart_toStartOf="@id/termsGutterStart"
app:layout_constraintTop_toBottomOf="@id/entrySpacing" /> app:layout_constraintTop_toBottomOf="@id/entrySpacing" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -12,6 +12,7 @@
android:id="@+id/adapter_item_policy_checkbox" android:id="@+id/adapter_item_policy_checkbox"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:buttonTint="@color/checkbox_tint_selector"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -47,9 +48,9 @@
<ImageView <ImageView
android:id="@+id/adapter_item_policy_arrow" android:id="@+id/adapter_item_policy_arrow"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="22dp" android:layout_height="16dp"
android:importantForAccessibility="no"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:importantForAccessibility="no"
android:rotationY="@integer/rtl_mirror_flip" android:rotationY="@integer/rtl_mirror_flip"
android:src="@drawable/ic_arrow_right" android:src="@drawable/ic_arrow_right"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"