Skip to content

Commit a061eb3

Browse files
committed
fix #1821: remove DisplayUtis.isTablet() method
1 parent 7339f98 commit a061eb3

File tree

1 file changed

+5
-17
lines changed

1 file changed

+5
-17
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/DisplayUtils.java

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ public static boolean isLandscape(Context context) {
2020
return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
2121
}
2222

23-
public static boolean isLandscapeTablet(Context context) {
24-
return isLandscape(context) && isTablet(context);
25-
}
26-
2723
public static Point getDisplayPixelSize(Context context) {
2824
WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
2925
Display display = wm.getDefaultDisplay();
@@ -43,7 +39,8 @@ public static int getDisplayPixelHeight(Context context) {
4339
}
4440

4541
public static int dpToPx(Context context, int dp) {
46-
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, context.getResources().getDisplayMetrics());
42+
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
43+
context.getResources().getDisplayMetrics());
4744
return (int) px;
4845
}
4946

@@ -52,20 +49,11 @@ public static int pxToDp(Context context, int px) {
5249
return (int) ((px/displayMetrics.density)+0.5);
5350
}
5451

55-
/**
56-
* Deprecated method, returns true on some phones.
57-
*/
58-
@Deprecated
59-
public static boolean isTablet(Context context) {
60-
// http://stackoverflow.com/a/8427523/1673548
61-
if (context == null)
62-
return false;
63-
return (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
64-
}
65-
6652
public static boolean isXLarge(Context context) {
67-
if ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_XLARGE)
53+
if ((context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK)
54+
== Configuration.SCREENLAYOUT_SIZE_XLARGE) {
6855
return true;
56+
}
6957
return false;
7058
}
7159

0 commit comments

Comments
 (0)