Phonegap - Ignore font size setting on Android

I had a problem with some Android devices when changing the font size display setting through the configuration.

In a web browser, my application simply ignores this. This is true for some other mobile phones.

But with some specific mobile phones (like Motorola G or X), changing this configuration also affects my Phonegap application.

I do not know how to avoid this so that the application looks consistent.

+5
source share
2 answers

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

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

angular.module('app').controller('IndexController', function ($ionicPlatform, $window) { $ionicPlatform.ready(function(){ if($window.MobileAccessibility){ $window.MobileAccessibility.usePreferredTextZoom(false); } }); }); 
+11
source

For those who use Ionic. The documentation is here .

Install

 $ ionic cordova plugin add phonegap-plugin-mobile-accessibility $ npm install --save @ionic-native/mobile-accessibility 

Add to module, i.e. app.module.ts

 import { MobileAccessibility } from 'ionic-native'; @NgModule({ providers:[MobileAccessibility] }); 

In app.component.ts

 constructor( mobileAccessibility: MobileAccessibility, platform: Platform) { platform .ready() .then(()=>{ mobileAccessibility.usePreferredTextZoom(false); }); } 
0
source

Source: https://habr.com/ru/post/972907/


All Articles