androidandroid-layouttabletscreen-density

Android - layout directory in large density (2.25)


I have a strange bug on Samsung Galaxy Tab E (Nougat 7.0 API 24): I have 2 layout directory (layout and layout-sw600dp) when I change the "Screen Zoom" on the "Settings" to "Huge" the device for some reason is taking the XML from the "layout" directory and not from the "layout-sw600dp", for all the others density it works perfectly except the this one.

Is there a solution for this bug?


Solution

  • It's not only in Galaxy devices but you can have this in any device exceeding the sw system.

    So instead of making specific folders like layout-sw600 etc, I recommend you to make specific layouts using ConstraintLayout.

    ConstraintLayout not only makes your layout flexible but also adjusts it's size based on the increase or decrease in Density Pixels of the devices and also saves your. Development Time. I faced a similar issue long time back and decided to use ConstraintLayout for the same.

    A good codelab from Google on ConstraintLayout can be found here:

    https://codelabs.developers.google.com/codelabs/constraint-layout/index.html?index=..%2F..%2Fio2018#0

    Hope it helps. Good luck.