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

Gestures on PDFs #6996

Merged

Conversation

nucleogenesis
Copy link
Member

Summary

Adds hammerjs and in PDF Renderer make use of it to handle pinch-zoom gestures on mobile.

Does not work on iOS because Apple's pinch zooming always zooms the whole window without regard for any kind of meta viewport settings (ie, maximum-scale or user-scalable).

However, it works on Android.

Basically, a pinch will call the same zoomIn or zoomOut function as tapping the + and - buttons do. They're throttled to 1 second to avoid accidentally zooming all the way in with one pinch.

NOTE: Not tested in a real life proper "app context" running the Android app - but still a valuable addition for non-app users who do use android devices anyway.

Reviewer guidance

Open a PDF using an Android device and pinch zoom in and out.

Testing this without an actual device is a pain - but if you use Genymotion read this (it wasn't perfect for me, but good enough early on)

References

#3710


Contributor Checklist

PR process:

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Testing:

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

Reviewer Checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@nucleogenesis nucleogenesis added the TODO: needs review Waiting for review label Jun 5, 2020
@nucleogenesis nucleogenesis added this to the android-mvp milestone Jun 5, 2020
@codecov
Copy link

codecov bot commented Jun 8, 2020

Codecov Report

Merging #6996 into app-support will decrease coverage by 0.14%.
The diff coverage is 0.00%.

Impacted Files Coverage Δ
...s/pdf_viewer/assets/src/views/PdfRendererIndex.vue 0.00% <0.00%> (ø)
...plugins/user/assets/src/views/SignInPage/index.vue 29.10% <0.00%> (-15.00%) ⬇️
.../assets/src/views/userAccounts/PasswordTextbox.vue 61.76% <0.00%> (-8.24%) ⬇️
kolibri/plugins/user/kolibri_plugin.py 83.33% <0.00%> (-7.58%) ⬇️
...ibri/core/assets/src/state/modules/core/actions.js 23.47% <0.00%> (-1.94%) ⬇️
kolibri/core/auth/api.py 86.70% <0.00%> (-1.07%) ⬇️
kolibri/core/device/serializers.py 92.53% <0.00%> (ø)
kolibri/deployment/default/urls.py 93.33% <0.00%> (ø)
kolibri/deployment/default/dev_urls.py 0.00% <0.00%> (ø)
kolibri/core/discovery/utils/filesystem/posix.py 57.28% <0.00%> (ø)
... and 9 more

@indirectlylit
Copy link
Contributor

@mrpau-dev would you mind testing this on Android?

Co-authored-by: Devon Rueckner <indirectlylit@users.noreply.github.com>
@mrpau-richard
Copy link
Contributor

@indirectlylit I'm having the same issue with the installer built in this PR. The Kolibri Android app crashes after I launch it.

@indirectlylit
Copy link
Contributor

merging to get it in place for integration testing

@indirectlylit indirectlylit merged commit a505f69 into learningequality:app-support Jun 17, 2020
@indirectlylit indirectlylit modified the milestones: android-mvp, 0.14.0 Jul 6, 2020
@jonboiser jonboiser removed the TODO: needs review Waiting for review label Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants