-
Notifications
You must be signed in to change notification settings - Fork 6
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
[DON'T MERGE] fontSize/scale handler switch management (scaling refactor part 6 - final) #214
Closed
mzorz
wants to merge
10
commits into
issue/207-fontsize-scaling-callback
from
issue/207-fontsize-scaling-callback-scale-switcher
Closed
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
You can test the changes on this Pull Request by downloading the APK here. |
… max - this way the gesturedetector can act immediately and doesn't get stuck
…e the view the same proportions when zooming in
…gesture (scaling in or out?)
mzorz
changed the title
WIP - fontSize/scale handler switch management
fontSize/scale handler switch management
Nov 29, 2019
mzorz
changed the title
fontSize/scale handler switch management
fontSize/scale handler switch management (scaling refactor part 6)
Nov 29, 2019
mzorz
changed the title
fontSize/scale handler switch management (scaling refactor part 6)
fontSize/scale handler switch management (scaling refactor part 6 - final)
Nov 29, 2019
7 tasks
mzorz
changed the title
fontSize/scale handler switch management (scaling refactor part 6 - final)
[DON'T MERGE] fontSize/scale handler switch management (scaling refactor part 6 - final)
Dec 2, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a
ScaleGestureDetector
and a mechanism to switch between handling pinch-to-zoom withscale
or view's size (width
/height
) when each of their maximum / minimum are reached.if user is zooming in (and size is smaller than maximum), first we augment the view's size. Once it reaches the fontSize maximum, we switch to augmenting the view's
scale
.if user is zooming out (and scale is greater than minimum), we first reduce the scale. Once scale reaches its minimum (1.0) we switch to resizing the view (the fontSize will be adapted correspondingly by the AutoResizeTextView).
most of the switching logic done in 76f245f
Important drawbacks and considerations:
LAYER_TYPE_SOFTWARE
back in in order to avoid having the view disappear and fail rendering 😞 8489100develop
current state of things on a Samsung J2 shows this doesn't really add much more image quality - it is kept a bit better as we expand the emoji up to it's best maximum fontSize available, but then switching to the scale handler happens quickly enough as to not notice much gain there. Videos here https://cloudup.com/ckH_e_69vAL (you can seedevelop
is there first on the left, and this branch on the right).Leaving the PR open for further studying / checks but overall I think it's worth spending time on other areas of the app, given this approach after all doesn't seem to make things much better.