Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Detect Font Size change #65

Open
Skintillion opened this issue Apr 14, 2022 · 0 comments
Open

Detect Font Size change #65

Skintillion opened this issue Apr 14, 2022 · 0 comments

Comments

@Skintillion
Copy link

Skintillion commented Apr 14, 2022

Make sure to check the demo app(s) for sample usage

I tried to

Make sure to check the existing issues in this repository

I did

If the demo apps cannot help and there is no issue for your problem, tell us about it

I have buttons that when the font size is set in System -> Display - >Font Size and Style to a very large font, the buttons become unreadable. I'd like to make them take up an entire row, but to do that I need to know when a user has selected a larger font scale in system settings.

Which platform(s) does your issue occur on?

  • Android (Not using iOS yet)
  • android 30
  • Samsung Galaxy S21 Ultra

Please, provide the following version numbers that your issue occurs with:

  • CLI: 8.1.5

I tried checking the font size of the label in code but it always reads as 12 no matter what. I tried using FontSizeObservable but it didn't report anything useful that I could find to use.

Is there any code involved?

app.js

const accessibilityExt =  require('@nota/nativescript-accessibility-ext');

console.log("App Starting");

const fontSizeObserver = new accessibilityExt.FontScaleObservable();

fontSizeObserver.on(Observable.propertyChangeEvent, (args) => {
    if (args.propertyName === FontScaleObservable.FONT_SCALE) {
       const fontScale = args.value;
       console.log("A Font Scale: " + fontScale);
    }
});

Nothing was logged with the above. Even if I change font sizes

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

No branches or pull requests

1 participant