mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 09:25:49 +03:00
updating terms ids and applying design specified colours to the checkbox
This commit is contained in:
parent
059b2a5424
commit
1f6068976d
5 changed files with 44 additions and 28 deletions
|
@ -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>
|
|
@ -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) {
|
||||
|
|
10
vector/src/main/res/drawable/ic_privacy_policy.xml
Normal file
10
vector/src/main/res/drawable/ic_privacy_policy.xml
Normal 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>
|
|
@ -14,14 +14,14 @@
|
|||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/displayNameGutterStart"
|
||||
android:id="@+id/termsGutterStart"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintGuide_percent="@dimen/ftue_auth_gutter_start_percent" />
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/displayNameGutterEnd"
|
||||
android:id="@+id/termsGutterEnd"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
|
@ -31,29 +31,29 @@
|
|||
android:id="@+id/headerSpacing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="52dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/displayNameHeaderIcon"
|
||||
app:layout_constraintBottom_toTopOf="@id/termsHeaderIcon"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0"
|
||||
app:layout_constraintVertical_chainStyle="packed" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/displayNameHeaderIcon"
|
||||
android:id="@+id/termsHeaderIcon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:background="@drawable/circle"
|
||||
android:backgroundTint="?colorSecondary"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_user_fg"
|
||||
app:layout_constraintBottom_toTopOf="@id/displayNameHeaderTitle"
|
||||
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd"
|
||||
android:src="@drawable/ic_privacy_policy"
|
||||
app:layout_constraintBottom_toTopOf="@id/termsHeaderTitle"
|
||||
app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
|
||||
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:tint="@color/palette_white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/displayNameHeaderTitle"
|
||||
android:id="@+id/termsHeaderTitle"
|
||||
style="@style/Widget.Vector.TextView.Title.Medium"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -61,13 +61,13 @@
|
|||
android:gravity="center"
|
||||
android:text="@string/ftue_auth_terms_title"
|
||||
android:textColor="?vctr_content_primary"
|
||||
app:layout_constraintBottom_toTopOf="@id/displayNameHeaderSubtitle"
|
||||
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd"
|
||||
app:layout_constraintStart_toStartOf="@id/displayNameGutterStart"
|
||||
app:layout_constraintTop_toBottomOf="@id/displayNameHeaderIcon" />
|
||||
app:layout_constraintBottom_toTopOf="@id/termsHeaderSubtitle"
|
||||
app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
|
||||
app:layout_constraintStart_toStartOf="@id/termsGutterStart"
|
||||
app:layout_constraintTop_toBottomOf="@id/termsHeaderIcon" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/displayNameHeaderSubtitle"
|
||||
android:id="@+id/termsHeaderSubtitle"
|
||||
style="@style/Widget.Vector.TextView.Subtitle"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -76,9 +76,9 @@
|
|||
android:text="@string/ftue_auth_terms_subtitle"
|
||||
android:textColor="?vctr_content_secondary"
|
||||
app:layout_constraintBottom_toTopOf="@id/titleContentSpacing"
|
||||
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd"
|
||||
app:layout_constraintStart_toStartOf="@id/displayNameGutterStart"
|
||||
app:layout_constraintTop_toBottomOf="@id/displayNameHeaderTitle" />
|
||||
app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
|
||||
app:layout_constraintStart_toStartOf="@id/termsGutterStart"
|
||||
app:layout_constraintTop_toBottomOf="@id/termsHeaderTitle" />
|
||||
|
||||
<Space
|
||||
android:id="@+id/titleContentSpacing"
|
||||
|
@ -86,7 +86,7 @@
|
|||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/loginTermsPolicyList"
|
||||
app:layout_constraintHeight_percent="0.03"
|
||||
app:layout_constraintTop_toBottomOf="@id/displayNameHeaderSubtitle" />
|
||||
app:layout_constraintTop_toBottomOf="@id/termsHeaderSubtitle" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/loginTermsPolicyList"
|
||||
|
@ -101,20 +101,20 @@
|
|||
android:id="@+id/entrySpacing"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/displayNameSubmit"
|
||||
app:layout_constraintBottom_toTopOf="@id/termsSubmit"
|
||||
app:layout_constraintHeight_percent="0.05"
|
||||
app:layout_constraintTop_toBottomOf="@id/loginTermsPolicyList" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/displayNameSubmit"
|
||||
android:id="@+id/termsSubmit"
|
||||
style="@style/Widget.Vector.Button.Login"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/login_signup_submit"
|
||||
android:textAllCaps="true"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="@id/displayNameGutterEnd"
|
||||
app:layout_constraintStart_toStartOf="@id/displayNameGutterStart"
|
||||
app:layout_constraintEnd_toEndOf="@id/termsGutterEnd"
|
||||
app:layout_constraintStart_toStartOf="@id/termsGutterStart"
|
||||
app:layout_constraintTop_toBottomOf="@id/entrySpacing" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
android:id="@+id/adapter_item_policy_checkbox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:buttonTint="@color/checkbox_tint_selector"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
@ -47,9 +48,9 @@
|
|||
<ImageView
|
||||
android:id="@+id/adapter_item_policy_arrow"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="22dp"
|
||||
android:importantForAccessibility="no"
|
||||
android:layout_height="16dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:importantForAccessibility="no"
|
||||
android:rotationY="@integer/rtl_mirror_flip"
|
||||
android:src="@drawable/ic_arrow_right"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
|
Loading…
Reference in a new issue