Skip to content

Instantly share code, notes, and snippets.

@mortenjust
Last active September 17, 2015 23:39
Show Gist options
  • Save mortenjust/47cd06172fb82baa86ff to your computer and use it in GitHub Desktop.
Save mortenjust/47cd06172fb82baa86ff to your computer and use it in GitHub Desktop.
Transition drawable - fade between two drawables, colors, whatevers!
d = (TransitionDrawable) myLittleButton.getDrawable();
d.startTransition(DURATION);
<?xml version="1.0" encoding="UTF-8"?>
<transition xmlns:android="http://schemas.android.com/apk/res/android">
<!-- The drawables used here can be solid colors, gradients, shapes, images, etc. -->
<item android:drawable="@color/quicksettings_background" />
<item android:drawable="@color/semitransparent_grey" />
</transition>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment