Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve accessibility support in IPP flows #13414

Open
wants to merge 41 commits into
base: trunk
Choose a base branch
from

Conversation

samiuelson
Copy link
Collaborator

@samiuelson samiuelson commented Jan 29, 2025

Closes: #13250

Description

The goal of this PR is to fix the UI of the card reader connection and payment flows in case font size is increased in the accessibility settings of the device.

  1. The layouts of the dialogs were made scalable. The fixed heights were replaced by wrap_content, and min height was introduced instead. This way the dialogs keep consistent size in case a standard "text size" is set on the device. The height of the dialogs can now scale, however, in case the font scale is increased.
  2. The illustration image views are now hidden in case the font scale is increased significantly (> 1.5).
  3. The programmatically set margins are now removed since the related vertical constraints are corrected in the layout

Steps to reproduce

  1. Go to device settings > search for "accessibility" > Display size and text > increase the font size
  2. Create an order and collect payment with card reader
  3. Notice that the UI is not looking correct (e.g. elements are overlapping each other)

Testing information

Test the following flows with the increased font size settings:

  • Reader connection flow
  • Reader update flow
  • Payment collection flow
  • Reader welcome dialog
  • Reader onboarding

The easy way to test the accessibility settings is to use "Device UI Shortcuts" > "Font size" from the level of Android Studio:
Screenshot 2025-02-06 at 16 28 53
To change the font scale dynamically.

The tests that have been performed

  1. I've tested the above flows with the maximum available font size.
  2. I verified that UI looks good with normal font size as well (regression test).

Images/gif

Screen_recording_20250206_163200.mp4
  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.

@samiuelson samiuelson linked an issue Jan 29, 2025 that may be closed by this pull request
@dangermattic
Copy link
Collaborator

dangermattic commented Jan 29, 2025

2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ This PR is assigned to the milestone 21.7. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 29, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commitb795b90
Direct Downloadwoocommerce-wear-prototype-build-pr13414-b795b90.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 29, 2025

📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.

App Name WooCommerce Android
Platform📱 Mobile
FlavorJalapeno
Build TypeDebug
Commitb795b90
Direct Downloadwoocommerce-prototype-build-pr13414-b795b90.apk

xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/color_surface_elevated"

Check warning

Code scanning / Android Lint

Overdraw: Painting regions more than once Warning

Possible overdraw: Root element paints background @color/color_surface_elevated with a theme that also paints a background (inferred theme is @style/Theme.Woo.DayNight)
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:background="@color/color_surface_elevated"

Check warning

Code scanning / Android Lint

Overdraw: Painting regions more than once Warning

Possible overdraw: Root element paints background @color/color_surface_elevated with a theme that also paints a background (inferred theme is @style/Theme.Woo.DayNight)
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:background="@color/color_surface_elevated"

Check warning

Code scanning / Android Lint

Overdraw: Painting regions more than once Warning

Possible overdraw: Root element paints background @color/color_surface_elevated with a theme that also paints a background (inferred theme is @style/Theme.Woo.DayNight)
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/color_surface_elevated"

Check warning

Code scanning / Android Lint

Overdraw: Painting regions more than once Warning

Possible overdraw: Root element paints background @color/color_surface_elevated with a theme that also paints a background (inferred theme is @style/Theme.Woo.DayNight)
app:layout_constraintEnd_toEndOf="@id/progressImageView"
app:layout_constraintStart_toStartOf="@id/progressImageView"
app:layout_constraintTop_toTopOf="@id/progressImageView" />
<ImageView

Check warning

Code scanning / Android Lint

Image without contentDescription Warning

Missing contentDescription attribute on image
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:context="com.woocommerce.android.ui.payments.cardreader.connect.CardReaderConnectDialogFragment">
android:background="@color/color_surface_elevated"

Check warning

Code scanning / Android Lint

Overdraw: Painting regions more than once Warning

Possible overdraw: Root element paints background @color/color_surface_elevated with a theme that also paints a background (inferred theme is @style/Theme.Woo.DayNight)
@samiuelson samiuelson added category: accessibility Related to accessibility. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. labels Feb 6, 2025
@samiuelson samiuelson added this to the 21.7 milestone Feb 6, 2025
@samiuelson samiuelson marked this pull request as ready for review February 6, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: accessibility Related to accessibility. feature: mobile payments Related to mobile payments / card present payments / Woo Payments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix accessibility in IPP flows
3 participants