Why Android use smallestScreenWidthDp to decide which layout to use

21 views Asked by At

Based on the documentation:

https://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources

https://android-developers.googleblog.com/2011/07/new-tools-for-managing-screen-sizes.html

smallestScreenWidthDp is the smallest value of width and height of the activity window. Android system uses this value to decide which layout to use (the layouts specifed in layout/swXXXdp folder). This leads to some weird layout behaviors when height is less than width (so smallestScreenWidthDp = height). Eg:

enter image description here

enter image description here

Why dont' they just choose the layout based on the smallest width of the screen, or more accurately, the smallest width of the app window and don't let developer confused with smallestScreenWidthDp

0

There are 0 answers