In my app, I don't want to allow it to resize as its creating design issues.
I have tried with android:resizeableActivity="false"
in the application tag and the launcher activity tag but it didn't help.
In my app, I don't want to allow it to resize as its creating design issues.
I have tried with android:resizeableActivity="false"
in the application tag and the launcher activity tag but it didn't help.
I have found a solution for it.
If system text size changed or Display size set to Large (Above Android Oreo), Your app will behave as normal (No big text and and zoomed views) with below code:
I will assume you're trying to get display which doesn't change if user changes Accessibility Options on it's phone regarding UI size.
You can get this working by using DisplayMetrics.
With "normal" scale factor values
metrics.xdpi
andmetrics.densityDpi
have the same value. If this is not the case, you can get "real" scale factor, that is one used when user uses normal scaling using following.Than you can use said value to multiply your fixed values from layout so that it can have precise density on different screens. This would also mean that every value in layout must be using
px
instead ofdp
orsp
.While this approach would work, I would strongly recommend not to use it.
Firstly, because it is a lot of work, and it will be hard to maintain that code with future updates.
Secondly, this feature of Android is very convenient, and if your app doesn't compile with it it probably points out that you should construct your layout better.