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

WIP - Pinch to zoom TextView handling #202

Closed
wants to merge 5 commits into from

Conversation

mzorz
Copy link
Contributor

@mzorz mzorz commented Nov 21, 2019

Fixes #153

This PR aims at responding to the pinch to zoom gesture on Emoji / TextView with a combination of scale and changing the view's width and height.

There's various parts to this PR:

  • 204fb9e does some cleanup; removes no longer used frmBorder and imgClose handling on views, which were hidden and therefore lacked any specific use
  • 253bb50 simplifies the view_photo_editor_text layout further and is now just the minimum needed: a TextView with app:autoSizeTextType="uniform" to signal we want it to change it's font Size according to the view size
  • e25ff09: contains work related to having a special treatment for Emoji (will be the same for ViewType.TEXT after we get Emoji right), as it's of particular interest that Autosizing TextViews need the width and height to be set in a specific way (and that in turn as well depends on the layout where the views are being placed, in our case photoEditorView is a RelativeLayout, take a look into the addViewToParent method), special note on this comment:

Note: If you set autosizing in an XML file, it is not recommended to use the value "wrap_content" for the layout_width or layout_height attributes of a TextView. It may produce unexpected results.

=============
Issues found
Known issues found with TextViewCompat's Autosizeable TextViews
https://issuetracker.google.com/issues/68787108
https://issuetracker.google.com/issues/38468964

The first one in particular is not good as I can see it's not working well when shrinking on width on emoji

https://cloudup.com/ccGNffHgmKZ
TextView’s autosizeable feature doesn’t seem to work well with emoji when shrinking on width (although it does work well when shrinking on height, as can be seen in the video)

This is work in progress.

@peril-automattic
Copy link

You can test the changes on this Pull Request by downloading the APK here.

@mzorz
Copy link
Contributor Author

mzorz commented Nov 22, 2019

For the reasons outlined above in the description (struggle to make the view not crop emojis on width):

The first one in particular is not good as I can see it's not working well when shrinking on width on emoji
https://cloudup.com/ccGNffHgmKZ
TextView’s autosizeable feature doesn’t seem to work well with emoji when shrinking on width (although it does work well when shrinking on height, as can be seen in the video)

We're closing this in favor of #204

@mzorz mzorz closed this Nov 22, 2019
@mzorz mzorz deleted the issue/153-textview-fontsize branch November 22, 2019 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pinch to zoom: change TextView fontSize
1 participant