MCPcopy Create free account
hub / github.com/Card-Forge/forge / isTabletDevice

Method isTabletDevice

forge-gui-android/src/forge/app/Main.java:288–297  ·  view source on GitHub ↗
(Context activityContext)

Source from the content-addressed store, hash-verified

286 }
287
288 private static boolean isTabletDevice(Context activityContext) {
289 Display display = ((Activity) activityContext).getWindowManager().getDefaultDisplay();
290 DisplayMetrics metrics = new DisplayMetrics();
291 display.getMetrics(metrics);
292
293 float widthInches = metrics.widthPixels / metrics.xdpi;
294 float heightInches = metrics.heightPixels / metrics.ydpi;
295 double diagonalInches = Math.sqrt(Math.pow(widthInches, 2) + Math.pow(heightInches, 2));
296 return diagonalInches >= 7.0;
297 }
298
299 private void displayMessage(View previousView, AndroidAdapter adapter, boolean ex, String msg, boolean manageApp) {
300 TableLayout TL = new TableLayout(this);

Callers 1

onCreateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected