-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[Mobile] - Enable font size and line height support and addresses Android issues #38205
Merged
geriux
merged 14 commits into
trunk
from
rnmobile/fix/line-height-android-block-based-themes
Jan 31, 2022
Merged
[Mobile] - Enable font size and line height support and addresses Android issues #38205
geriux
merged 14 commits into
trunk
from
rnmobile/fix/line-height-android-block-based-themes
Jan 31, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geriux
added
[Status] In Progress
Tracking issues with work in progress
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
labels
Jan 25, 2022
Size Change: -430 B (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
… set the minimum line-height to 1 to prevent unexpected results on Android.
geriux
added
the
Mobile App - Automation
Label used to initiate Mobile App PR Automation
label
Jan 27, 2022
geriux
changed the title
[Mobile] - Rich Text - Fixes line height issues on Android for the Heading block
[Mobile] - Enable font size and line height support and addresses Android issues
Jan 27, 2022
1 task
This was referenced Jan 27, 2022
antonis
reviewed
Jan 28, 2022
...ive-aztec/android/src/main/java/org/wordpress/mobile/ReactNativeAztec/ReactAztecManager.java
Show resolved
Hide resolved
antonis
approved these changes
Jan 28, 2022
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.
Great work @geriux 👍
I tested the changes on a Pixel 5 (Android 12) and an iPhone SE 2020 (iOS 14.7.1) and everything worked as expected. The code changes also LGTM 🎉
Thank you for wrangling this 🙇
geriux
deleted the
rnmobile/fix/line-height-android-block-based-themes
branch
January 31, 2022 12:25
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Mobile App - Automation
Label used to initiate Mobile App PR Automation
Mobile App - i.e. Android or iOS
Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR enables font size and line-height support on mobile for block-based themes.
It also includes some fixes on Android and the Heading block.
On Aztec Android, different scales are added to the Heading block. Unfortunately, I couldn't find an easy way to disable this for an specific case like block-based themes. So for now the approach is the following:
isHeadingBlock
to check if the current tag is from a Heading block, e.gh1
,h2
, etc.setBlockType
is called, it triggetssetFontSize
, for cases when the Heading block was already created but its level changes e.g fromh1
toh2
.This also limits the minimum value that can be set for line-height to
1
, lower values break on Android where the block doesn't show the correct height.Testing Instructions
Font size (block-based themes: Calvin, Quadrat, etc.)
Test case 1
Test case 2
h1
,h3
,h4
Test case 3
H1
levelH4
levelDefault
font sizeLine-height (block-based themes: Calvin, Quadrat, etc.)
Test case 1
Test case 2
H1
Test case 3
1
Font size (standard theme: Seedlet)
Test case 1
Test case 2
H1
H3
Line-height (standard theme: Seedlet)
Test case 1
Screenshots
Font size (block-based themes: Calvin, Quadrat, etc.)
Line-height (block-based themes: Calvin, Quadrat, etc.)
Font size (standard theme: Seedlet)
Line-height (standard theme: Seedlet)
Test case 1
Types of changes
New feature
Checklist:
*.native.js
files for terms that need renaming or removal).