From 2ed1870d3780d8d91119c30ab50c2dc3d7db9193 Mon Sep 17 00:00:00 2001 From: Arjun Gupta Date: Wed, 3 Feb 2021 15:51:46 +0530 Subject: [PATCH] Fixes part of #2258: Changes in Add Profile Activity[a11y] (#2456) * Fix #2258: Changes in Add Profile Activity[a11y] Fixes Issue 3 of #2258, Changed the button to diabled according to the state and TextColor as per Chantel's suggesstion * Using color resource instead of hardcoded color * Same changes applied to other orientation files --- app/src/main/res/layout-land/add_profile_activity.xml | 5 +++-- .../main/res/layout-sw600dp-land/add_profile_activity.xml | 5 +++-- .../main/res/layout-sw600dp-port/add_profile_activity.xml | 5 +++-- app/src/main/res/layout/add_profile_activity.xml | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/res/layout-land/add_profile_activity.xml b/app/src/main/res/layout-land/add_profile_activity.xml index 674bf02fdb6..5c41ad46478 100644 --- a/app/src/main/res/layout-land/add_profile_activity.xml +++ b/app/src/main/res/layout-land/add_profile_activity.xml @@ -193,7 +193,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_heading" - android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/grey}" + android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/accessible_grey}" android:textSize="16sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -204,7 +204,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_sub" - android:textColor="@color/light_grey" + android:textColor="@color/accessible_light_grey" android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/add_profile_activity_allow_download_heading_text_view" @@ -231,6 +231,7 @@ android:layout_marginEnd="28dp" android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/start_button_transparent_background}" android:clickable="@{viewModel.isButtonActive()}" + android:enabled="@{viewModel.isButtonActive()}" android:gravity="center" android:text="@string/add_profile_create_btn" android:textAllCaps="true" diff --git a/app/src/main/res/layout-sw600dp-land/add_profile_activity.xml b/app/src/main/res/layout-sw600dp-land/add_profile_activity.xml index c48a1900b50..795e09a2253 100644 --- a/app/src/main/res/layout-sw600dp-land/add_profile_activity.xml +++ b/app/src/main/res/layout-sw600dp-land/add_profile_activity.xml @@ -186,7 +186,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_heading" - android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/grey}" + android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/accessible_grey}" android:textSize="16sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -197,7 +197,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_sub" - android:textColor="@color/light_grey" + android:textColor="@color/accessible_light_grey" android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/add_profile_activity_allow_download_heading_text_view" @@ -223,6 +223,7 @@ android:layout_marginTop="60dp" android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/start_button_transparent_background}" android:clickable="@{viewModel.isButtonActive()}" + android:enabled="@{viewModel.isButtonActive()}" android:gravity="center" android:text="@string/add_profile_create_btn" android:textAllCaps="true" diff --git a/app/src/main/res/layout-sw600dp-port/add_profile_activity.xml b/app/src/main/res/layout-sw600dp-port/add_profile_activity.xml index 2151440f2cc..6d89cc591d7 100644 --- a/app/src/main/res/layout-sw600dp-port/add_profile_activity.xml +++ b/app/src/main/res/layout-sw600dp-port/add_profile_activity.xml @@ -183,7 +183,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_heading" - android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/grey}" + android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/accessible_grey}" android:textSize="16sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -194,7 +194,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_sub" - android:textColor="@color/light_grey" + android:textColor="@color/accessible_light_grey" android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/add_profile_activity_allow_download_heading_text_view" @@ -220,6 +220,7 @@ android:layout_marginTop="60dp" android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/start_button_transparent_background}" android:clickable="@{viewModel.isButtonActive()}" + android:enabled="@{viewModel.isButtonActive()}" android:gravity="center" android:text="@string/add_profile_create_btn" android:textAllCaps="true" diff --git a/app/src/main/res/layout/add_profile_activity.xml b/app/src/main/res/layout/add_profile_activity.xml index 118521213e6..5b631d4ec76 100644 --- a/app/src/main/res/layout/add_profile_activity.xml +++ b/app/src/main/res/layout/add_profile_activity.xml @@ -191,7 +191,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_heading" - android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/grey}" + android:textColor="@{viewModel.validPin ? @color/oppiaPrimaryTextDark : @color/accessible_grey}" android:textSize="16sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -202,7 +202,7 @@ android:layout_height="wrap_content" android:fontFamily="sans-serif" android:text="@string/add_profile_allow_download_sub" - android:textColor="@color/light_grey" + android:textColor="@color/accessible_light_grey" android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/add_profile_activity_allow_download_heading_text_view" @@ -229,6 +229,7 @@ android:layout_marginEnd="28dp" android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/start_button_transparent_background}" android:clickable="@{viewModel.isButtonActive()}" + android:enabled="@{viewModel.isButtonActive()}" android:gravity="center" android:text="@string/add_profile_create_btn" android:textAllCaps="true"