Lines Matching refs:context
29 public static Context createThemedContext(Context context, boolean forceDark) {
30 boolean isLightTheme = isLightTheme(context);
32 context = new ContextThemeWrapper(context, R.style.Theme_AppCompat);
35 return new ContextThemeWrapper(context, isLightTheme ?
39 public static int getThemeResource(Context context, int attr) {
41 return context.getTheme().resolveAttribute(attr, value, true) ? value.resourceId : 0;
44 public static Drawable getThemeDrawable(Context context, int attr) {
45 int res = getThemeResource(context, attr);
46 return res != 0 ? context.getResources().getDrawable(res) : null;
49 private static boolean isLightTheme(Context context) {
51 return context.getTheme().resolveAttribute(R.attr.isLightTheme, value, true)