Tutorial by Examples

Step 1: Create a transition drawable in XML Save this file transition.xml in res/drawable folder of your project. <transition xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/image1"/> <item android:drawable=...
public void setCardColorTran(View view) { ColorDrawable[] color = {new ColorDrawable(Color.BLUE), new ColorDrawable(Color.RED)}; TransitionDrawable trans = new TransitionDrawable(color); if(Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN) { view.setBackgrou...

Page 1 of 1