mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Use smallest width instead of width for alt layouts
This commit is contained in:
parent
edeee54fb2
commit
04ebca8413
4 changed files with 2 additions and 2 deletions
|
@ -271,8 +271,8 @@ fun Context.createFileInCacheDir(name: String): File {
|
|||
}
|
||||
|
||||
/**
|
||||
* We consider anything with a width of >= 720dp as a tablet, i.e. with layouts in layout-w720dp.
|
||||
* We consider anything with a width of >= 720dp as a tablet, i.e. with layouts in layout-sw720dp.
|
||||
*/
|
||||
fun Context.isTablet(): Boolean {
|
||||
return (resources.displayMetrics.widthPixels / resources.displayMetrics.density) >= 720
|
||||
return resources.configuration.smallestScreenWidthDp >= 720
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue