1

I'm trying to animate ActionBar in my Android app. So I've wrote a animated drawable, which is used as background in ActionBar:

getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.bad_info));    

R.drawable.bad_info looks like:

<?xml version="1.0" encoding="utf-8"?>

<animation-list
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/selected"
        android:oneshot="false">

    <item android:duration="50">
        <shape>
            <gradient android:type="linear"
                      android:endColor="#630000"
                      android:startColor="#FF0202"
                      android:angle="270"/>
        </shape>
    </item>

    <item android:duration="50">
        <shape>
            <gradient android:type="linear"
                      android:endColor="#3C0000"
                      android:startColor="#FF0202"
                      android:angle="90"/>
        </shape>
    </item>

</animation-list>

How can I "turn on" and "turn off" animation in ActionBar from code? Maybe you will give me a hint how to realize an animation by the other way.

Thanx.

Adam
  • 842
  • 2
  • 14
  • 22
  • Hi, I've posted a very similar question http://stackoverflow.com/questions/12912956/is-it-possible-to-use-transitiondrawable-on-the-actionbar did you find a solution for it? – Budius Oct 16 '12 at 14:34

0 Answers0