Skip to content

Instantly share code, notes, and snippets.

@xXxXxXxXxXam
Created August 14, 2012 17:56
Show Gist options
  • Save xXxXxXxXxXam/3351266 to your computer and use it in GitHub Desktop.
Save xXxXxXxXxXam/3351266 to your computer and use it in GitHub Desktop.
public class ThemedView extends View {
public ThemedView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
public ThemedView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ThemedView(Context context) {
super(context);
}
@Override
protected int[] onCreateDrawableState(int extraSpace) {
final int[] state = super.onCreateDrawableState(extraSpace + 2);
mergeDrawableStates(state, ((PocketActivity) getContext()).getThemeState());
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment