Hide irrelevant settings on tablets

This commit is contained in:
arkon
2021-05-23 13:05:45 -04:00
parent 10a638c6b8
commit 1b52acdad7
4 changed files with 36 additions and 23 deletions

View File

@@ -258,3 +258,10 @@ fun Context.createFileInCacheDir(name: String): File {
file.createNewFile()
return file
}
/**
* We consider anything with a width of >= 600dp as a tablet, i.e. with layouts in layout-sw600dp.
*/
fun Context.isTablet(): Boolean {
return resources.configuration.screenWidthDp >= 600
}