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

getTextZoom() on IOS returns 100 regardless of whatever text size has been selected from accessibility! #29

Open
srameshr opened this issue Feb 1, 2016 · 6 comments

Comments

@srameshr
Copy link

srameshr commented Feb 1, 2016

After my document load has been triggered I fire the getTextZoom method:

 MobileAccessibility.getTextZoom(function(zoom) {
  console.log(zoom); // This returns 100 regardless of system font accessibility size
});
@majornista
Copy link
Collaborator

Have you tried calling MobileAccessibility.usePreferredTextZoom(true); before calling MobileAccessibility.getTextZoom to make sure that your app subscribes to the OS level text scaling?

https://github.com/phonegap/phonegap-mobile-accessibility#mobileaccessibilityusepreferredtextzoomboolean

@srameshr
Copy link
Author

srameshr commented Feb 2, 2016

Yeah tried it again. Still the same thing. It just passes the value 100 to the callback function.

@majornista
Copy link
Collaborator

I'm not able to replicate on iOS 9.2.1. Could you provide any further detail on your test environment?

@ostigley
Copy link

For anyone else coming across this now, I think the getTextZoom function is now returning a promise, and does not take a callback as indicated in the documentation. MY implementation seems to be working on IOS and Android:

 const mBA = this.mobileAccessibility;
      mBA.getTextZoom()
        .then(textZoom => {
          // if the device zoom is between 100% and 125%, then use it
          if (100 < textZoom && textZoom < 126) {
            mBA.usePreferredTextZoom(true);
          } else if (textZoom > 125) {
            // if the device zoom is greater than 125%, then ignore it and use 125%, otherwise our designs will break
            mBA.usePreferredTextZoom(false);
            mBA.setTextZoom(125);
          } else {
            // if the device zoom is less than 100%, then ignore it and use 100%, otherwise our designs will break
            mBA.usePreferredTextZoom(false);
            mBA.setTextZoom(100);
          }

@m-saifuddin
Copy link

Dear @ostigley ,

Can you tell me exactly where I use your suggested code ? so solve the issue.

@m-saifuddin
Copy link

Dear,
Firstly Good Work!!.

This plugin works fine in Android but I am facing the same issue.. in iOS getTextZoom function return me 100 value even changing the text size in accessibility.

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

No branches or pull requests

4 participants