how to prevent system font-size changing effects to android application?

android, android-fonts

Solution

If you require your text to remain the same size, you'll have to use `dp`.

To quote the documentation:

An `sp` is the same base unit, but is scaled by the user's preferred text size (it’s a scale-independent pixel), so you should use this measurement unit when defining text size (but never for layout sizes).

Emphasis mine.

So you're seeing the expected behaviour for using `sp` as your units for text size.

I don't understand what you mean about using dp taking too long to maintain your app - as far as I can tell, it'll exactly be the same amount of effort? (perhaps less, though it'll likely make it less usable for users with poor eyesight)

Problem

I recently finished developing my android application. I used sp (Scaled pixels) for all textSize. The problem is when i adjusted the system font-size, my application's font-sizes are changing. I can use dp (Device independent pixels) but it will take too long to maintain my application. I referenced text size from this. Is there a way to prevent system font-size changing effects to my application ?

Original source

Related problems