Android performance problems with view animation (sliding in/out) -
i have fullscreen view flipper on galaxy tab containing 2 relative layouts, each of displaying between 5 , ten image views.
i having problems when try slide 1 of view flipper viewso ut , other in, "animation" nothing , switches.
if remove 1 of image views in each of view flipper children animation fine.
can somehow force use mixed down version of image animation, or relative layout container causing performance problem?
there should nothing going on @ time flipper animation occurs can't understand problem.
thanks
edit: of problematic code: perhaps might indicate areas causing performance problems?
i have in onclick, 2 method calls, used switching backwards through views , forward. view "generated" before being added flipper , switched.
so, on click of button (for example) have (amongst other things) ....
nextview = new relativelayout(this); makeaview(selectedviewobjects, viewholder2); switchviewnow(-1); currentview = nextview; ... private void makeaview(viewobjects vobjects, relativelayout nextview) { for(object obj : vobjects.viewobjects) { if(obj instanceof image) { addimageview(nextview, obj); { else { if(obj instanceof anim) { addanimview(nextview, obj); } }
where image custom view implementation displaying static image , anim custom view implementation displaying animationdrawable (multiframe image cycle).
next have switch method:
private void switchviewnow(int direction) { if(direction == -1) { viewframe.setinanimation(animclass.infromleftanimation(null)); viewframe.setoutanimation(animclass.outtorightanimation(null)); viewframe.shownext(); } else if(direction == 1) { viewframe.setinanimation(animclass.infromrightanimation(null)); viewframe.setoutanimation(animclass.outtoleftanimation(null)); viewframe.shownext(); } }
i wrong, looks me have overloaded nextview in confusing way.
it defined outside of makeaview, makeaview expects parameter names nextview.
you passing viewholder2 nextview function.
this means makeaview not change 'global' nextview, change viewholder2.
but seem assume 'global' nextview has been modified because use assign currentview.
i think place start if assign unique names these 2 versions of nextview.
i wonder if still looking solution: post rather old , ignored.
Comments
Post a Comment