We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 66869a9 + ee77cca commit e7c9ba3Copy full SHA for e7c9ba3
utilcode/src/main/java/com/blankj/utilcode/util/ScreenUtils.java
@@ -174,4 +174,15 @@ public static int getSleepDuration() {
174
return -123;
175
}
176
177
+
178
+ /**
179
+ * Check if the device is a tablet based on screen size
180
+ *
181
+ * @return {@code true}: Yes<br>{@code false}: No
182
+ */
183
+ public static boolean isTablet() {
184
+ return (Utils.getContext().getResources().getConfiguration().screenLayout
185
+ & Configuration.SCREENLAYOUT_SIZE_MASK)
186
+ >= Configuration.SCREENLAYOUT_SIZE_LARGE;
187
+ }
188
0 commit comments