Better tablet check logic.

This commit is contained in:
Dmitry Yunitsky 2014-12-11 14:37:13 +03:00 committed by Alex Zolotarev
parent a7b26b6348
commit 58bbb12f0f
4 changed files with 5 additions and 13 deletions

View file

@ -28,4 +28,6 @@
<dimen name="bottom_button_width">46dp</dimen>
<dimen name="bottom_item_height">56dp</dimen>
<bool name="isTablet">true</bool>
</resources>

View file

@ -74,4 +74,6 @@
<dimen name="routing_progress_size">32dp</dimen>
<dimen name="panel_width">400dp</dimen>
<bool name="isTablet">false</bool>
</resources>

View file

@ -19,7 +19,6 @@ import com.mapswithme.maps.bookmarks.data.BookmarkManager;
import com.mapswithme.util.Constants;
import com.mapswithme.util.FbUtil;
import com.mapswithme.util.Utils;
import com.mapswithme.util.UiUtils;
import com.mapswithme.util.log.Logger;
import com.mapswithme.util.log.StubLogger;
import com.mapswithme.util.statistics.Statistics;
@ -107,7 +106,7 @@ public class MWMApplication extends android.app.Application implements ActiveCou
// init native framework
nativeInit(getApkPath(), extStoragePath, extTmpPath,
getOBBGooglePath(), BuildConfig.FLAVOR, BuildConfig.IS_PRO, mIsYota, UiUtils.isTablet());
getOBBGooglePath(), BuildConfig.FLAVOR, BuildConfig.IS_PRO, mIsYota, getResources().getBoolean(R.bool.isTablet));
ActiveCountryTree.addListener(this);

View file

@ -439,17 +439,6 @@ public final class UiUtils
.show();
}
/**
*
* @return whether device is a tablet with 600dp+ minimum width
*/
public static boolean isTablet()
{
final DisplayMetrics metrics = MWMApplication.get().getResources().getDisplayMetrics();
final float minLength = metrics.density * 600;
return metrics.widthPixels > minLength || metrics.heightPixels > minLength;
}
// utility class
private UiUtils()
{}