Android : Paging a view with sliding left or right -
i have problem achiving sertant effect in app working on. senario
on first activity display list, , once item clicked display new activity holds more details item.
now want implement pageing on detailed page user can slide left or right , gets next or previusly item displayed without having go list select.
i got adapter items no biggy getting information item shown , "siblings are"
i have been playing around view flipper far can see needs "views" rendered in stumic of viewflipper , dont dare render 300 items out oncreate. tips on using 3 views , populate em oncreate??
i have called same activity , animation slides in plus , intent telling data show, must poor preformance that.
any ideas ?
if u want see animation/function want. tjek out google latitude pageing on u friends detailed page.
//thx in advanced
i've implemented same behavior using viewflipper
loading views on demand.
here snapshot of doing. it's not same wanted, can follow same approach.
/** * starts new activity. * @param activitytostart activity class. */ public static void startactivity(class<?> activitytostart) { string name = activitytostart.getname(); while (history.contains(name)) { name += "1"; } view view = activity.getlocalactivitymanager().startactivity(name, new intent(activity, activitytostart)).getdecorview(); history.add(name); addview(view, name); } public void addview(view newview, string name) { // add name history. history.add(name); // change view. flipper.addview(newview); if(history.size() != 1) { flipper.setinanimation(infromupanimation()); view oldview = getactivityat(history.size() - 2); flipper.setoutanimation(outfrombottomanimation()); flipper.shownext(); } } private void back() { if(history.size() > 1) { view oldview = getactivityat(history.size() - 1); flipper.setinanimation(infrombottomanimation()); setremoveanimation(oldview, outtoupanimation(), history.remove(history.size() - 1)); flipper.showprevious(); } else { finish(); } }
here i've 3 functions (to start new activity in case might change inflate view if want, second add view, third remove view when user hit back).
hope helps!
Comments
Post a Comment