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

Detect Font Size change #65

@Skintillion

Description

@Skintillion

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions