transitiondrawable - Transition Drawable for actionbar in Android -


is possible use transition drawable actionbar , how? should use xml like:

 <xml version="1.0" encoding="utf-8"/>  <transition xmlns:android="http://schemas.android.com/apk/res/android"/>  <item android:drawable="@drawable/first_image"/>  <item android:drawable="@drawable/second_image"/>  </transition> 

but how continue here?

yes, possible. can without xml, create transitiondrawable in code:

drawable firstimage = getdrawable(r.drawable.first_image); drawable secondimage = getdrawable(r.drawable.secondimage); transitiondrawable transition = new transitiondrawable(new drawable[] {         firstimage, secondimage}); 

after set transition background actionbar:

getsupportactionbar().setbackgrounddrawable(transition); 

and start transition:

transition.starttransition(1000); 

also can set transition background toolbar.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -