Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap - Ignore font-size display setting on Android

I'm having an issue with some android devices when changing the font-size display setting through configuration.

In web browser my app is simple ignoring this. This is true for some other mobiles too.

But with some specific mobiles (like Motorola G or X) changing this config also affects my Phonegap app.

I don't know how to avoid this to make the app look consistent

like image 424
edrian Avatar asked Nov 18 '14 20:11

edrian


1 Answers

I've found a solution using this cordova plugin: com.phonegap.plugin.mobile-accessibility

You have to follow installation instructions for the plugin, and then you can use it inside Ionic app. You only have to ensure to call its functions after Cordova 'deviceready' callback (accesed by $ionicPlatform.ready in the example below):

angular.module('app').controller('IndexController', function ($ionicPlatform, $window) {

    $ionicPlatform.ready(function(){
        if($window.MobileAccessibility){
            $window.MobileAccessibility.usePreferredTextZoom(false);
        }
    });
});
like image 111
edrian Avatar answered Oct 12 '22 16:10

edrian