Skip to content

Commit 1895443

Browse files
author
Hugo Castelani
authored
Add isTablet method
1 parent 66869a9 commit 1895443

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utilcode/src/main/java/com/blankj/utilcode/util/ScreenUtils.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,4 +174,13 @@ public static int getSleepDuration() {
174174
return -123;
175175
}
176176
}
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().getBoolean(R.bool.isTablet);
185+
}
177186
}

0 commit comments

Comments
 (0)