From e676952b11996125ef0686e33b346c79c584675d Mon Sep 17 00:00:00 2001 From: Yogesh Kumar Date: Thu, 31 Dec 2020 05:48:48 +0530 Subject: [PATCH 1/2] accessibility improvements --- .../java/org/oppia/android/app/profile/ProfileInputView.kt | 1 + app/src/main/res/layout/add_profile_activity.xml | 6 +++++- app/src/main/res/values/strings.xml | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt b/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt index cad177e1a7b..8da375c932b 100644 --- a/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt +++ b/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt @@ -58,6 +58,7 @@ class ProfileInputView @JvmOverloads constructor( label.text = attributes.getString(R.styleable.ProfileInputView_label) input = bindingInterface.provideProfileInputViewBindingInput(profileInputView) input.textAlignment = View.TEXT_ALIGNMENT_VIEW_START + input.contentDescription = profileInputView.contentDescription errorText = bindingInterface.provideProfileInputViewBindingErrorText(profileInputView) orientation = VERTICAL if ( diff --git a/app/src/main/res/layout/add_profile_activity.xml b/app/src/main/res/layout/add_profile_activity.xml index db90913172e..3393a373f9b 100644 --- a/app/src/main/res/layout/add_profile_activity.xml +++ b/app/src/main/res/layout/add_profile_activity.xml @@ -42,6 +42,7 @@ android:layout_width="120dp" android:layout_height="120dp" android:clickable="true" + android:contentDescription="@string/add_profile_profile_picture" android:focusable="true" android:src="@drawable/ic_default_avatar" app:add_shadow="true" @@ -54,6 +55,7 @@ android:id="@+id/add_profile_activity_edit_user_image_view" android:layout_width="48dp" android:layout_height="48dp" + android:contentDescription="@string/add_profile_edit_profile_picture" android:paddingStart="12dp" android:paddingTop="12dp" android:src="@drawable/rounded_white_background_with_shadow" @@ -80,6 +82,7 @@ android:layout_marginStart="28dp" android:layout_marginTop="16dp" android:layout_marginEnd="28dp" + android:contentDescription="@string/add_profile_enter_name" app:inputLength="36" app:label="@string/add_profile_input_name" app:layout_constraintEnd_toEndOf="parent" @@ -104,6 +107,7 @@ android:layout_width="48dp" android:layout_height="48dp" android:layout_marginEnd="16dp" + android:contentDescription="@string/add_profile_info_button" android:padding="12dp" android:src="@drawable/ic_info_icon" app:layout_constraintEnd_toEndOf="parent" @@ -199,7 +203,7 @@ android:layout_height="wrap_content" android:layout_marginTop="60dp" android:layout_marginEnd="28dp" - android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/start_button_transparent_background}" + android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/state_button_inactive_background}" android:clickable="@{viewModel.isButtonActive()}" android:gravity="center" android:text="@string/add_profile_create_btn" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 465ff3ed0f4..92eec306065 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -211,6 +211,10 @@ Save Add Profile + Your avatar image + Edit your avatar image + Enter a name for this profile. + Information about pin Name* 3-Digit PIN* Confirm 3-Digit PIN* From 718628c3bf2382b0aa6d1b2690b242f5d1d32ca7 Mon Sep 17 00:00:00 2001 From: Yogesh Kumar Date: Thu, 31 Dec 2020 14:11:47 +0530 Subject: [PATCH 2/2] basic accessibility issues resolved --- .../java/org/oppia/android/app/profile/ProfileInputView.kt | 1 - app/src/main/res/layout/add_profile_activity.xml | 7 +++---- app/src/main/res/values/colors.xml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt b/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt index 8da375c932b..cad177e1a7b 100644 --- a/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt +++ b/app/src/main/java/org/oppia/android/app/profile/ProfileInputView.kt @@ -58,7 +58,6 @@ class ProfileInputView @JvmOverloads constructor( label.text = attributes.getString(R.styleable.ProfileInputView_label) input = bindingInterface.provideProfileInputViewBindingInput(profileInputView) input.textAlignment = View.TEXT_ALIGNMENT_VIEW_START - input.contentDescription = profileInputView.contentDescription errorText = bindingInterface.provideProfileInputViewBindingErrorText(profileInputView) orientation = VERTICAL if ( diff --git a/app/src/main/res/layout/add_profile_activity.xml b/app/src/main/res/layout/add_profile_activity.xml index 3393a373f9b..afb146d6504 100644 --- a/app/src/main/res/layout/add_profile_activity.xml +++ b/app/src/main/res/layout/add_profile_activity.xml @@ -82,7 +82,6 @@ android:layout_marginStart="28dp" android:layout_marginTop="16dp" android:layout_marginEnd="28dp" - android:contentDescription="@string/add_profile_enter_name" app:inputLength="36" app:label="@string/add_profile_input_name" app:layout_constraintEnd_toEndOf="parent" @@ -167,7 +166,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/black_54}" android:textSize="16sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> @@ -178,7 +177,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/black_54" android:textSize="14sp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/add_profile_activity_allow_download_heading_text_view" @@ -203,7 +202,7 @@ android:layout_height="wrap_content" android:layout_marginTop="60dp" android:layout_marginEnd="28dp" - android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/state_button_inactive_background}" + android:background="@{viewModel.isButtonActive() ? @drawable/state_button_primary_background : @drawable/start_button_transparent_background}" android:clickable="@{viewModel.isButtonActive()}" android:gravity="center" android:text="@string/add_profile_create_btn" diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 103ec07182c..875e89fc9b5 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -76,7 +76,7 @@ #00A89F #61999999 #61000000 - #61000000 + #99000000 #CCCCCC #923026