-
Notifications
You must be signed in to change notification settings - Fork 521
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
Fixes #4586: Improve text scaling according to screen reader #4695
Fixes #4586: Improve text scaling according to screen reader #4695
Conversation
Thanks @vrajdesai78. I think this seems sensible, but I have two questions:
|
…om/vrajdesai78/oppia-android into Improve-text-scaling-promoted-list
I have added all changes from previous PR. For test I have added one test but not sure it was not failing when we have width set in dp. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vrajdesai78 PTAL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vrajdesai78. Took a full pass. Many of the comments are duplicates, but I wanted to make sure each case I found for repeated issues were covered by comments.
From a top-level perspective:
- I think the PR title needs to be updated since this PR is now covering more than just the promoted story list fixes
- In the original PR there were changes made to app/src/main/res/layout/recently_played_fragment.xml -- why were these dropped here?
- Are there any other files that require similar changes (e.g. for toolbars & nav menus)?
- How will developers make sure that they know how to address these sp vs. dp cases long-term? Having a test or check seems important here since it's clear that simply reusing an existing pattern may have different results depending on the view being modified.
app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vrajdesai78. Took another pass--PTAL.
app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
Outdated
Show resolved
Hide resolved
@BenHenning I have updated test and also added screenshot of failing test case in the PR description. Can you PTAL. Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vrajdesai78 I have one suggested.
Also approving this PR not to block you and also relying for test on @BenHenning 's suggestions.
Unassigning @rt4914 since they have already approved the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocking this because of this comment thread #4695 (comment) @BenHenning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vrajdesai78. Just to clarify one part of your PR description: should "Failing robolectric tests when we change the width in sp." be "Failing robolectric tests when we change the width to dp" (notice the emphasis)? The current wording doesn't seem correct since the entire intent is to be using sp here.
app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
Outdated
Show resolved
Hide resolved
app/src/sharedTest/java/org/oppia/android/app/home/HomeActivityTest.kt
Outdated
Show resolved
Hide resolved
@BenHenning, I have replied to all of your comments, can you PTAL. Thanks |
My latest comment @vrajdesai78 @BenHenning #4695 (comment) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vrajdesai78. PR LGTM, so I'm deferring to @rt4914 to resolve my last convo thread (but I'm happy to take another look if needed). I also took a pass on the doc--please let me know when it's ready for another pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this PR.
Replying to @BenHenning comment
- The implementation of promoted stories recyclerview will change as mentioned in [A11Y] Improve text scaling in promoted story card #4703 . This change is needed to mainly fix one primary issue, i.e., currently we have a fixed-width of
280
for promoted-story-cards but it should be eithermatch_parent
so as to provide better experience to non-sighted users. Other details related to implementation are mentioned in the issue description - No TODO has been mentioned in the code as this is neither related to xml files directly nor to bindable adapter, mostly we will need to create a new adapter to implement this functionality. Currently not sure if we can tie this to one single file, therefore not mentioned in code.
- I will apply those wiki changes as mentioned in Fixes #4586: Improve text scaling according to screen reader #4695 (comment)
Unassigning @rt4914 since they have already approved the PR. |
Explanation
Fixes #4586: Changed layout_width to sp instead of dp as per this comment. This actually solves the problem of text scaling. Improved text scaling by setting layout_height and layout_width to wrap_content and setting min_height = 48dp and min_width = 48dp (may vary in some cases). Introduced a tests which will make sure that width is set in SP not in DP.
Note: In accessibility scanner it still shows to improve text scaling but visually or practically this solution looks accurate.
Essential Checklist
Screenshots For Mobile (Promoted Story Card)
Screenshots for Tablet (Promoted Story Card)
Failing robolectric tests when we change the width in dp.