List of usage examples for android.content Context getResources
public abstract Resources getResources();
From source file:Main.java
public static int getSceneOrientation(Context context) { return context.getResources().getConfiguration().orientation; }
From source file:Main.java
public static boolean isLandscape(Context context) { return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE; }
From source file:Main.java
public static String getMyCountryCode(Context context) { return context.getResources().getConfiguration().locale.getLanguage() + "_" + context.getResources().getConfiguration().locale.getCountry(); }
From source file:Main.java
public static int deviceHeight(Context context) { return context.getResources().getDisplayMetrics().heightPixels; }
From source file:Main.java
public static int deviceWidth(Context context) { return context.getResources().getDisplayMetrics().widthPixels; }
From source file:Main.java
public static float getDimension(int resourceID, Context mContext) { return mContext.getResources().getDimension(resourceID); }
From source file:Main.java
public static boolean isScreenOriatationPortrait(Context context) { return context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT; }
From source file:Main.java
public static String getResourceString(Context c, int id) { return c.getResources().getString(id); }
From source file:Main.java
public static String getScreenWidth(Context context) { int i = context.getResources().getDisplayMetrics().widthPixels; return (new StringBuilder()).append(i).toString(); }
From source file:Main.java
public static Locale getLocale(Context context) { return context.getResources().getConfiguration().locale; }