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

Text unit is set in dp instead of sp #4735

Closed
JishnuGoyal opened this issue Nov 17, 2022 · 13 comments · Fixed by #5134
Closed

Text unit is set in dp instead of sp #4735

JishnuGoyal opened this issue Nov 17, 2022 · 13 comments · Fixed by #5134
Assignees
Labels
bug End user-perceivable behaviors which are not desirable. good first issue This item is good for new contributors to make their pull request. Impact: Low Low perceived user impact (e.g. edge cases). Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.

Comments

@JishnuGoyal
Copy link
Contributor

JishnuGoyal commented Nov 17, 2022

Describe the bug

The text unit is dp instead sp which results in an accessibility error.

To Reproduce
Steps to reproduce the behavior:

  1. On profiles page, click on add user profile option
  2. Toolbar text has accessibility issue

Suggested Solution:
If you notice code of https://github.com/oppia/oppia-android/blob/da80fab4a78997cb8ab190292f0676117f2722fc/app/src/main/res/layout/admin_pin_activity.xml
we are not using any Toolbar in this xml file. Instead we are setting the title from

resourceHandler.getStringInLocale(R.string.admin_auth_activity_add_profiles_title)

What we can do is that instead of using the toolbar/action-bar of activity we can introduce our own Toolbar in xml file and can use it in activity & its presenter to set the text. This way we can easily control sp vs dp metric.
Similar Implementation

Environment

  • Device/emulator being used:
  • Android or SDK version (e.g. Android 5 or SDK 21): Android 12
  • App version (you can get this through system app settings or via the admin controls menu in-app): 0.10-beta-5e64fae55e
@BenHenning
Copy link
Member

Android 12-specific issue, and one that has marginal benefits so considering it an a11y nice-to-have. Not release blocking.

@BenHenning
Copy link
Member

Ah actually, this might not be 12-specific if the text itself is using the wrong unit. That being said, we just changed the way titles work back to the old flow so this may no longer be an issue.

@rt4914
Copy link
Contributor

rt4914 commented May 16, 2023

Ah actually, this might not be 12-specific if the text itself is using the wrong unit. That being said, we just changed the way titles work back to the old flow so this may no longer be an issue.

Just tested it and its still an issue and I have updated the issue description to mention one possible solution.

@adhiamboperes adhiamboperes added good first issue This item is good for new contributors to make their pull request. bug End user-perceivable behaviors which are not desirable. Impact: High High perceived user impact (breaks a critical feature or blocks a release). Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. Impact: Low Low perceived user impact (e.g. edge cases). and removed Impact: High High perceived user impact (breaks a critical feature or blocks a release). labels May 30, 2023
@Akshatkamboj14
Copy link
Member

Hey @rt4914 when I am trying to add toolbar as proposed in the example, the system toolbar and my toolbar both are displayed simultaneously and plus when I am changing the title

resourceHandler.getStringInLocale(R.string.admin_auth_activity_add_profiles_title)
to let's suppose something else it's not changing that even.

@rt4914
Copy link
Contributor

rt4914 commented Jun 19, 2023

@Akshatkamboj14 I cannot confirm the exact issue without the PR, but the main changes that you will need to apply in are the activity file, its corresponding xml file and may need to change AndroidManifest.xml file and may need to add android:theme="@style/OppiaThemeWithoutActionBar" to corresponding activity.

Also, I am a bit inactive these days, so please assign these issues to @MohitGupta121 or @BenHenning or any other active team-member for faster replies. Thanks.

@prafulbbandre
Copy link
Contributor

Hi @adhiamboperes,
I would like to work on this issue.

@adityamishra9
Copy link

Hi @adhiamboperes , please allow me to work on this issue

@adhiamboperes
Copy link
Collaborator

Hi @void-iish, thanks for your interest in contributing to this issue, but it is already assigned to @prafulbbandre. Why don't you take a look at other unassigned issues here, and let me know which one interests you?

@Vishwajith-Shettigar
Copy link
Collaborator

can i work on this issue ?

@prafulbbandre prafulbbandre removed their assignment Aug 12, 2023
@adhiamboperes
Copy link
Collaborator

can i work on this issue ?

@Vishwajith-Shettigar, we ask that you give us a brief description of how you would go about solving the issue, or otherwise put up a draft pull request.

@Vishwajith-Shettigar
Copy link
Collaborator

Vishwajith-Shettigar commented Aug 12, 2023

can i work on this issue ?

@Vishwajith-Shettigar, we ask that you give us a brief description of how you would go about solving the issue, or otherwise put up a draft pull request.

Here is my approach

  1. Setting noActionbar for admin_pin_activity.
  2. setting up own toolbar in admin_pin_activity.
  3. using AdminPinActivityPresenter we can set the title

Can you tell me am I going right please, that would be really helpful.

@Vishwajith-Shettigar
Copy link
Collaborator

Vishwajith-Shettigar commented Aug 13, 2023

i have made a draft pull request #5132, please guide me.
Thank you

@Vishwajith-Shettigar
Copy link
Collaborator

Here is a new pull request #5134. Hope this works.

adhiamboperes added a commit that referenced this issue Sep 5, 2023
## Explanation
Fix #4735 , Added toolbar in admin_pin_activity xml file inorder to
control the title size using sp.

<!--
- Explain what your PR does. If this PR fixes an existing bug, please
include
- "Fixes #bugnum:" in the explanation so that GitHub can auto-close the
issue
  - when this PR is merged.
  -->

## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

## For UI-specific PRs only

Before fix
Admin pin activity
| Light mode| 
|--------|
|![before
light](https://github.com/oppia/oppia-android/assets/76042077/e80cd747-b04c-43c5-96b9-848dc5db3400)
|

After fix
|Light mode| Dark mode|
|-----------|--------------|
|
![afterlightmode](https://github.com/oppia/oppia-android/assets/76042077/4445ebd1-3fde-40f4-a4cb-cb3716aad43e)
|
![afterdarkmode](https://github.com/oppia/oppia-android/assets/76042077/98bd0994-5f4d-464f-b170-d21e167a9eaa)
|

Co-authored-by: Adhiambo Peres <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug End user-perceivable behaviors which are not desirable. good first issue This item is good for new contributors to make their pull request. Impact: Low Low perceived user impact (e.g. edge cases). Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.
Development

Successfully merging a pull request may close this issue.

9 participants