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

Fix #3822: Remove maxLines contsraint's to enable long text to linebreak #4547

Merged
merged 6 commits into from
Sep 16, 2022

Conversation

KevinGitonga
Copy link
Contributor

@KevinGitonga KevinGitonga commented Sep 1, 2022

Explanation

Fix #3822: This PR fixes Portuguese text cut off by completely removing maxLines contraint's used in the several variations of the onboarding_slide layouts on the title text . This allows for the text to easily break to the next line incase the text is very long to fit in a single line.

Essential Checklist

  • 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: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

Phone screenshots

Before Portrait After Portrait
Before Landscape After Landscape

Tab screenshots

Before Portrait After Portrait
Before Landscape After Landscape

@BenHenning
Copy link
Member

@KevinGitonga my only concern with the solution is it may not work for longer translations that we might encounter in the future. I wonder: is it reasonable to introduce line-wrapping here, instead, for cases when the title is too long?

@rt4914 curious about your thoughts here, too.

@BenHenning BenHenning assigned KevinGitonga and unassigned BenHenning Sep 1, 2022
@KevinGitonga
Copy link
Contributor Author

@BenHenning it actually makes sense to move the extra text to next line, I have updated maxLines from 1 to 2 to allow the extra text to move to the next line. This is with assumption that the translated text can never be more than 2 lines. I have reverted changes on end and start margins as this will not work and the device's screen gets thinner line wrapping would work better.

@BenHenning
Copy link
Member

@BenHenning it actually makes sense to move the extra text to next line, I have updated maxLines from 1 to 2 to allow the extra text to move to the next line. This is with assumption that the translated text can never be more than 2 lines. I have reverted changes on end and start margins as this will not work and the device's screen gets thinner line wrapping would work better.

Thanks @KevinGitonga. Can you also update the screenshots in the PR? It's hard to verify the code just by looking at it, so the screenshots are really important to also convey the difference from a user's perspective.

I'm also assigning @rt4914 so that he can leave his thoughts.

@BenHenning BenHenning assigned rt4914 and KevinGitonga and unassigned BenHenning Sep 5, 2022
@KevinGitonga KevinGitonga removed their assignment Sep 5, 2022
Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinGitonga Please update your PR title and description as you are not making any change to margins.

Thanks.

@@ -45,7 +45,7 @@
android:layout_marginBottom="16dp"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:maxLines="1"
android:maxLines="2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove this maxLines attributes completely for this screen. So that even if in some screen it goes to three-lines the UI will be visible fully.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes Applied.

@rt4914 rt4914 assigned KevinGitonga and unassigned rt4914 Sep 7, 2022
@KevinGitonga KevinGitonga changed the title Reduce MarginStart and MarginEnd. Remove and Update maxLines contraint's to enable lengthy text to linebreak. Sep 8, 2022
@KevinGitonga
Copy link
Contributor Author

@KevinGitonga Please update your PR title and description as you are not making any change to margins.

Thanks.

Hey @rt4914 have made the changes as requested PTAL.

@KevinGitonga KevinGitonga assigned rt4914 and unassigned KevinGitonga Sep 8, 2022
@KevinGitonga KevinGitonga changed the title Remove and Update maxLines contraint's to enable lengthy text to linebreak. Remove and Update maxLines contsraint's to enable lengthy text to linebreak. Sep 8, 2022
Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -41,7 +41,7 @@
android:layout_marginTop="48dp"
android:layout_marginEnd="160dp"
android:gravity="center_horizontal"
android:maxLines="1"
android:maxLines="2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same previous comment applies to this code too.

Remove maxLines attribute.

Also, please re-generate screenshots and update PR description just to be sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted.

@@ -43,7 +43,7 @@
android:layout_marginBottom="16dp"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:maxLines="1"
android:maxLines="2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same previous comment applies to this code too.

Remove maxLines attribute.

Also, please re-generate screenshots and update PR description just to be sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted.

@@ -43,7 +43,7 @@
android:layout_marginEnd="160dp"
android:fontFamily="sans-serif-medium"
android:gravity="center_horizontal"
android:maxLines="1"
android:maxLines="2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same previous comment applies to this code too.

Remove maxLines attribute.

Also, please re-generate screenshots and update PR description just to be sure

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted.

@rt4914 rt4914 assigned KevinGitonga and unassigned rt4914 Sep 12, 2022
@KevinGitonga KevinGitonga removed their assignment Sep 13, 2022
@KevinGitonga
Copy link
Contributor Author

KevinGitonga commented Sep 13, 2022

@rt4914 have made changes. For phone screenshots they are similar to those shared and for the tablet also they remain as i had updated. This is after checking on my device and tablet emulator on both Portrait and Landscape. PTAL.

Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks.

@rt4914
Copy link
Contributor

rt4914 commented Sep 14, 2022

@KevinGitonga CI checks are failing. Have a look.

@rt4914 rt4914 assigned KevinGitonga and unassigned rt4914 Sep 14, 2022
@oppiabot oppiabot bot added the PR: LGTM label Sep 14, 2022
@KevinGitonga KevinGitonga changed the title Remove and Update maxLines contsraint's to enable lengthy text to linebreak. Remove maxLines contsraint's to enable long text to linebreak. Sep 15, 2022
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @KevinGitonga! This also LGTM.

@BenHenning
Copy link
Member

Except one thing @KevinGitonga: please make sure to update the title to include the bug being fixed (as I edited just now) for future PRs.

@BenHenning BenHenning changed the title Remove maxLines contsraint's to enable long text to linebreak. Fix #3822: Remove maxLines contsraint's to enable long text to linebreak Sep 16, 2022
@BenHenning BenHenning merged commit 1eebfb5 into oppia:develop Sep 16, 2022
@KevinGitonga
Copy link
Contributor Author

Except one thing @KevinGitonga: please make sure to update the title to include the bug being fixed (as I edited just now) for future PRs.

Thank's @BenHenning well noted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Portuguese] Text cut off in the title for onboarding slide 1
3 participants