1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-11-30 07:00:21 +01:00

Changed isTablet check

This commit is contained in:
DrKLO 2014-09-24 19:08:25 +04:00
parent 3eed85a31d
commit 4d5b43f6d7
5 changed files with 18 additions and 2 deletions

View File

@ -80,7 +80,7 @@ android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 327
versionCode 328
versionName "1.9.0"
}
}

View File

@ -41,6 +41,7 @@ public class AndroidUtilities {
public static int statusBarHeight = 0;
public static float density = 1;
public static Point displaySize = new Point();
private static Boolean isTablet = null;
public static int[] arrColors = {0xffee4928, 0xff41a903, 0xffe09602, 0xff0f94ed, 0xff8f3bf7, 0xfffc4380, 0xff00a1c4, 0xffeb7002};
public static int[] arrUsersAvatars = {
@ -268,7 +269,10 @@ public class AndroidUtilities {
}
public static boolean isTablet() {
return (ApplicationLoader.applicationContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE;
if (isTablet == null) {
isTablet = ApplicationLoader.applicationContext.getResources().getBoolean(R.bool.isTablet);
}
return isTablet;
}
public static int getColorIndex(int id) {

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="isTablet">true</bool>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="isTablet">true</bool>
</resources>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<bool name="isTablet">false</bool>
</resources>