Skip to content

Instantly share code, notes, and snippets.

@Kvest
Last active October 24, 2016 18:59
Show Gist options
  • Save Kvest/af06f6c2359a6abeb36798a1bf59f58a to your computer and use it in GitHub Desktop.
Save Kvest/af06f6c2359a6abeb36798a1bf59f58a to your computer and use it in GitHub Desktop.
public class TextColorTransition extends Transition {
...
private void captureValues(@NonNull TransitionValues transitionValues) {
if (transitionValues.view instanceof TextView) {
Bundle extraData = (Bundle)transitionValues.view.getTag(R.id.tag_transition_extra_properties);
int color;
if (extraData != null && extraData.containsKey(PROPNAME_TEXT_COLOR)) {
color = extraData.getInt(PROPNAME_TEXT_COLOR);
} else {
color = ((TextView) transitionValues.view).getCurrentTextColor();
}
transitionValues.values.put(PROPNAME_TEXT_COLOR, color);
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment