Methods Summary |
---|
public static android.content.Context | createThemedContext(android.content.Context context)
boolean isLightTheme = isLightTheme(context);
return new ContextThemeWrapper(context, isLightTheme ?
R.style.Theme_MediaRouter_Light : R.style.Theme_MediaRouter);
|
public static android.graphics.drawable.Drawable | getThemeDrawable(android.content.Context context, int attr)
int res = getThemeResource(context, attr);
return res != 0 ? context.getResources().getDrawable(res) : null;
|
public static int | getThemeResource(android.content.Context context, int attr)
TypedValue value = new TypedValue();
return context.getTheme().resolveAttribute(attr, value, true) ? value.resourceId : 0;
|
private static boolean | isLightTheme(android.content.Context context)
TypedValue value = new TypedValue();
return context.getTheme().resolveAttribute(R.attr.isLightTheme, value, true)
&& value.data != 0;
|