[Galaxy S II General] remuntada78:
Hi to all , i'm trying to make the notification panel background animated image with listpreference to choose 2 images animated, i added 4 xml files in SystemUI/res/drawables folder they are animation.xml , animation_1.xml , animation_b.xml, animation_b_1.xml.

animation.xml contains this

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/animation_1" />
<item android:drawable="@drawable/animation_1" />
</selector>

animation_1 contains this

<?xml version="1.0" encoding="utf-8"?>
<animation-list android:oneshot="false" android:repeatMode="reverse"
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:duration="150" android:drawable="@drawable/animation01" />
<item android:duration="150" android:drawable="@drawable/animation02" />
<item android:duration="150" android:drawable="@drawable/animation03" />
<item android:duration="150" android:drawable="@drawable/animation04" />
<item android:duration="150" android:drawable="@drawable/animation05" />
<item android:duration="150" android:drawable="@drawable/animation06" />
<item android:duration="150" android:drawable="@drawable/animation07" />
<item android:duration="150" android:drawable="@drawable/animation08" />
<item android:duration="150" android:drawable="@drawable/animation09" />
<item android:duration="150" android:drawable="@drawable/animation10" />
<item android:duration="150" android:drawable="@drawable/animation11" />
<item android:duration="150" android:drawable="@drawable/animation12" />
<item android:duration="150" android:drawable="@drawable/animation13" />
<item android:duration="150" android:drawable="@drawable/animation14" />
<item android:duration="150" android:drawable="@drawable/animation15" />
<item android:duration="150" android:drawable="@drawable/animation16" />
<item android:duration="150" android:drawable="@drawable/animation17" />
<item android:duration="150" android:drawable="@drawable/animation18" />
<item android:duration="150" android:drawable="@drawable/animation19" />
<item android:duration="150" android:drawable="@drawable/animation20" />
<item android:duration="150" android:drawable="@drawable/animation21" />
<item android:duration="150" android:drawable="@drawable/animation22" />
<item android:duration="150" android:drawable="@drawable/animation23" />
<item android:duration="150" android:drawable="@drawable/animation24" />
<item android:duration="150" android:drawable="@drawable/animation25" />
<item android:duration="150" android:drawable="@drawable/animation26" />
<item android:duration="150" android:drawable="@drawable/animation27" />
<item android:duration="150" android:drawable="@drawable/animation28" />
<item android:duration="150" android:drawable="@drawable/animation29" />
<item android:duration="150" android:drawable="@drawable/animation30" />
<item android:duration="150" android:drawable="@drawable/animation31" />
<item android:duration="150" android:drawable="@drawable/animation32" />
<item android:duration="150" android:drawable="@drawable/animation33" />
<item android:duration="150" android:drawable="@drawable/animation34" />
<item android:duration="150" android:drawable="@drawable/animation35" />
</animation-list>

animation_b contains this

<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/animation_b_1" />
<item android:drawable="@drawable/animation_b_1" />
</selector>

and animation_b_1 contains this

<?xml version="1.0" encoding="utf-8"?>
<animation-list android:oneshot="false" android:repeatMode="reverse"
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:duration="150" android:drawable="@drawable/animation_b_01" />
<item android:duration="150" android:drawable="@drawable/animation_b_02" />
<item android:duration="150" android:drawable="@drawable/animation_b_03" />
<item android:duration="150" android:drawable="@drawable/animation_b_04" />
<item android:duration="150" android:drawable="@drawable/animation_b_05" />
<item android:duration="150" android:drawable="@drawable/animation_b_06" />
<item android:duration="150" android:drawable="@drawable/animation_b_07" />
<item android:duration="150" android:drawable="@drawable/animation_b_08" />
<item android:duration="150" android:drawable="@drawable/animation_b_09" />
<item android:duration="150" android:drawable="@drawable/animation_b_10" />
<item android:duration="150" android:drawable="@drawable/animation_b_11" />
<item android:duration="150" android:drawable="@drawable/animation_b_12" />
<item android:duration="150" android:drawable="@drawable/animation_b_13" />
<item android:duration="150" android:drawable="@drawable/animation_b_14" />
<item android:duration="150" android:drawable="@drawable/animation_b_15" />
<item android:duration="150" android:drawable="@drawable/animation_b_16" />
<item android:duration="150" android:drawable="@drawable/animation_b_17" />
<item android:duration="150" android:drawable="@drawable/animation_b_18" />
<item android:duration="150" android:drawable="@drawable/animation_b_19" />
<item android:duration="150" android:drawable="@drawable/animation_b_20" />
<item android:duration="150" android:drawable="@drawable/animation_b_21" />
<item android:duration="150" android:drawable="@drawable/animation_b_22" />
<item android:duration="150" android:drawable="@drawable/animation_b_23" />
<item android:duration="150" android:drawable="@drawable/animation_b_24" />
<item android:duration="150" android:drawable="@drawable/animation_b_25" />
<item android:duration="150" android:drawable="@drawable/animation_b-26" />
<item android:duration="150" android:drawable="@drawable/animation_b_27" />
<item android:duration="150" android:drawable="@drawable/animation_b_28" />
<item android:duration="150" android:drawable="@drawable/animation_b_29" />
<item android:duration="150" android:drawable="@drawable/animation_b_30" />
<item android:duration="150" android:drawable="@drawable/animation_b_31" />
<item android:duration="150" android:drawable="@drawable/animation_b_32" />
<item android:duration="150" android:drawable="@drawable/animation_b_33" />
<item android:duration="150" android:drawable="@drawable/animation_b_34" />
<item android:duration="150" android:drawable="@drawable/animation_b_35" />
</animation-list>

then i added the relative pngs in res/drawable-nodpi folder and changed tw_status_bar_expanded.xml file

from this

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/notification_panel"[COLOR="Red"] android:background="@drawable/notification_panel_bg" [/COLOR]android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
<include android:layout_width="fill_parent" android:layout_height="@dimen/tw_notification_panel_header_height" layout="@layout/tw_status_bar_expanded_header" />
<TextView android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_marginTop="@dimen/tw_notification_panel_header_height" />

to this

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:id="@id/notification_panel"[COLOR="Red"] android:background="@drawable/animation" [/COLOR]android:paddingTop="@dimen/notification_panel_padding_top" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginLeft="@dimen/notification_panel_margin_left"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginBottom="@dimen/tw_close_handle_underlap">
<include android:layout_width="fill_parent" android:layout_height="@dimen/tw_notification_panel_header_height" layout="@layout/tw_status_bar_expanded_header" />
<TextView android:gravity="center" android:id="@id/emergency_calls_only" android:paddingBottom="4.0dip" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<View android:background="#ff091a24" android:layout_width="fill_parent" android:layout_height="1.0dip" android:layout_marginTop="@dimen/tw_notification_panel_header_height" />

and manage all with this method in PhoneStatusBar.smali file

.method public notificationpanelbackground()V
.locals 5

iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;

invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v1

const-string v2, "notification_panel_bg_chooser"

const v3, 0x0

invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v1

const v2, 0x1

if-eq v1, v2, :cond_0

const v2, 0x7f0210a7 [COLOR="Red"]this is id of animation.xml[/COLOR]

goto :goto_0

:cond_0
const v2, 0x7f021082 [COLOR="Red"]this is id of animation_b.xml[/COLOR]

:goto_0
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationPanel:Landroid/view/View;

invoke-virtual {v3, v2}, Landroid/view/View;->setBackgroundResource(I)V

return-void
.end method

but as you can see in the video , the background are not animated

[YOUTUBE]R-jn-FQegIo[/YOUTUBE]

is show only the first frame

someone have any suggestion?

thanks in advance