AndroidアプリでActionBarをアニメーション化しようとしています。そこで、ActionBarの背景として使用されるアニメーションのドローアブルを作成しました。
getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.bad_info));
R.drawable.bad_infoは次のようになります。
<?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>
ActionBarのアニメーションをコードから「オン」および「オフ」にするにはどうすればよいですか?逆にアニメーションを実現するためのヒントを教えてくれるかもしれません。
ありがとう。