How to prevent app layout changes when user change display size from the android setting application?

1.1k Views Asked by At

Currently, I am developing one android app so in that, I need to implement such functionality that prevents layout scaling whenever user change display size from the android device setting app. enter image description here

I am using the below library for font size and view size. For font size https://github.com/intuit/ssp For view size https://github.com/intuit/sdp

1

There are 1 best solutions below

4
Sunny On

if you need your text to fix size for all screens, you'll have to use dp.

Here is the documentation.

To preserve the visible size of your UI on screens with different densities, you must design your UI using density-independent pixels (dp) as your unit of measurement. One dp is a virtual pixel unit that's roughly equal to one pixel on a medium-density screen (160dpi; the "baseline" density). Android translates this value to the appropriate number of real pixels for each other density.