List of usage examples for android.content Context getResources
public abstract Resources getResources();
From source file:Main.java
public static int getScreenH(Context c) { return c.getResources().getDisplayMetrics().heightPixels; }
From source file:Main.java
public static int dip2px(float dp, Context context) { float scale = context.getResources().getDisplayMetrics().density; return (int) (dp * scale + 0.5f); }
From source file:Main.java
public static int dip2px(float dpValue, Context context) { float scale = context.getResources().getDisplayMetrics().density; return (int) (dpValue * scale + 0.5f); }
From source file:Main.java
public static String getResString(Context context, int resId) { return context.getResources().getString(resId); }
From source file:Main.java
public static int pixelsToDp(int pixels, Context context) { float density = context.getResources().getDisplayMetrics().density; return (int) (pixels / density); }
From source file:Main.java
public static int dpToPix(int sizeInDp, Context context) { float scale = context.getResources().getDisplayMetrics().density; return (int) (sizeInDp * scale + 0.5f); }
From source file:Main.java
private static String getString(Context context, int resId) { return context.getResources().getString(resId); }
From source file:Main.java
public static int dpToPixels(int dp, Context context) { float density = context.getResources().getDisplayMetrics().density; return (int) (dp * density); }
From source file:Main.java
public static boolean isZhCN(Context context) { String lang = context.getResources().getConfiguration().locale.getCountry(); return lang.equalsIgnoreCase("CN"); }
From source file:Main.java
public static String getResourceString(Context mContext, int str) { return mContext.getResources().getString(str); }