Slander
Slander

Reputation: 225

How to know if a user has activated the "bigger font" accessibility option in android?

How can I determine if a user has the "bigger font" option activated in the accessibility page of an android device?

Upvotes: 4

Views: 197

Answers (1)

Devrim
Devrim

Reputation: 15533

public float fontScale

Current user preference for the scaling factor for fonts, relative to the base density scaling.

You can get current scale:

float scale = getResources().getConfiguration().fontScale;

Default value must be 1. You can debug and see the value for "bigger font"'s value.

http://developer.android.com/reference/android/content/res/Configuration.html#fontScale

Upvotes: 4

Related Questions