List of usage examples for android.content Context getResources
public abstract Resources getResources();
From source file:Main.java
public static int px2dip(float pxValue, Context mContext) { float scale = mContext.getResources().getDisplayMetrics().density; return (int) (pxValue / scale + 0.5f); }
From source file:Main.java
public static String getStrng(Context context, int resId) { return context.getResources().getString(resId); }
From source file:Main.java
public static int dip2px(float dipValue, Context mContext) { float scale = mContext.getResources().getDisplayMetrics().density; return (int) (dipValue * scale + 0.5f); }
From source file:Main.java
public static String getStringByRes(Context context, int resis) { return context.getResources().getString(resis); }
From source file:Main.java
public static String getResourceString(Context ctx, int stringid) { return ctx.getResources().getString(stringid); }
From source file:Main.java
static public int getIntResource(Context c, int id) { return (Integer) c.getResources().getInteger(id); }
From source file:Main.java
public static int getHeightInPx(Context context) { return context.getResources().getDisplayMetrics().heightPixels; }
From source file:Main.java
public static int getWidthInPx(Context context) { return context.getResources().getDisplayMetrics().widthPixels; }
From source file:Main.java
public static float spToPx(int dp, Context context) { return (context.getResources().getDisplayMetrics().density * dp + 0.5f); }
From source file:Main.java
/** * @param emojiUnicode/* ww w. j a v a2s. co m*/ * @param c * @return */ public static Integer getEmoticonResId(String emojiUnicode, Context c) { return c.getResources().getIdentifier("emoji_" + emojiUnicode, "drawable", c.getPackageName()); }