Created
January 3, 2023 09:04
-
-
Save mezhevikin/b0486bfd518f64770f739b3914aedc52 to your computer and use it in GitHub Desktop.
Detect android tablet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val Context.isTablet: Boolean get() { | |
val layout = resources.configuration.screenLayout and Configuration.SCREENLAYOUT_SIZE_MASK | |
return layout == Configuration.SCREENLAYOUT_SIZE_LARGE || layout == Configuration.SCREENLAYOUT_SIZE_XLARGE | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment