user interface - android UI: ImageButton with animation -
i'm looking make imagebutton contains animation drawable, more precisely repetitive tweened animation of progressbar spinner (like view/widget exists this).
in xml specified imagebutton in activity's layout:
<imagebutton android:id="@+id/i_back_cover" android:layout_width="wrap_content" android:layout_height="wrap_content" android:scaletype="centerinside" android:gravity="center" android:layout_weight="1" android:adjustviewbounds="true" android:src="@anim/progress_large"> </imagebutton>
the "progress_large" animation in res/anim/:
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <rotate android:drawable="@drawable/spinner_black_76" android:pivotx="50%" android:pivoty="50%" android:fromdegrees="0" android:todegrees="350" android:duration="1200" /> </set>
i set todegrees
350 now, make sure rotate. spinner_black_76
image.
when open activity having layout, app crashes before displaying.
weird, there's no actual stacktrace in log, killed vm if i'm right (i hardly can believe myself):
10-07 21:16:18.467: info/activitymanager(59): starting activity: intent { act=android.intent.action.edit dat=content://net.lp.collectionista.products/items/book/1 cmp=net.lp.collectionista/.ui.activities.items.book.bookitemeditwindow } 10-07 21:16:18.687: debug/androidruntime(636): shutting down vm 10-07 21:16:18.687: warn/dalvikvm(636): threadid=1: thread exiting uncaught exception (group=0x4001d800) 10-07 21:16:18.687: debug/flurryagent(636): ending session 10-07 21:16:18.977: debug/dalvikvm(636): gc_for_malloc freed 3876 objects / 597200 bytes in 98ms 10-07 21:16:19.007: warn/activitymanager(59): force finishing activity net.lp.collectionista/.ui.activities.items.book.bookitemeditwindow 10-07 21:16:19.016: warn/activitymanager(59): force finishing activity net.lp.collectionista/.ui.activities.collections.book.bookcollectionviewwindow 10-07 21:16:19.507: warn/activitymanager(59): activity pause timeout historyrecord{43fec528 net.lp.collectionista/.ui.activities.items.book.bookitemeditwindow} 10-07 21:16:21.437: info/process(636): sending signal. pid: 636 sig: 9 10-07 21:16:21.487: info/activitymanager(59): process net.lp.collectionista (pid 636) has died. 10-07 21:16:21.517: info/windowmanager(59): win death: window{4400f330 net.lp.collectionista/net.lp.collectionista.ui.activities.collectionslistwindow paused=false} 10-07 21:16:21.517: info/windowmanager(59): win death: window{43fc89d0 net.lp.collectionista/net.lp.collectionista.ui.activities.collections.book.bookcollectionviewwindow paused=true} 10-07 21:16:21.667: info/usagestats(59): unexpected resume of com.android.launcher while resumed in net.lp.collectionista 10-07 21:16:21.727: warn/inputmanagerservice(59): got remoteexception sending setactive(false) notification pid 636 uid 10034 10-07 21:16:27.237: debug/dalvikvm(278): gc_explicit freed 32 objects / 1616 bytes in 81ms 10-07 21:18:14.047: debug/androidruntime(654): >>>>>>>>>>>>>> androidruntime start <<<<<<<<<<<<<<
what doing wrong in case? or better way progressbar round spinner on top of button?
:: smacks forehead ::
i should have realized before starting in on comments.
i'm looking make imagebutton contains animation drawable, more precisely repetitive tweened animation of progressbar spinner (like view/widget exists this).
that isn't animationdrawable
. animationdrawable
frame animation, not tweened one. documentation animation xml indicates:
compiled resource datatype: resource pointer animation.
whereas frame animation:
compiled resource datatype: resource pointer animationdrawable.
hence, don't think can you're trying way you're trying it. use frame animation , use handful of hand-rotated versions of graphic.
Comments
Post a Comment