Tuesday 15 May 2012

android - Smooth transition of layout size using threads -



android - Smooth transition of layout size using threads -

i changing height , width of layout programmatically . changing problem aren't changing smoothly, since using thread. want layout size(height , width) have smooth transition. code :

final handler handler = new handler(); runnable runable = new runnable() { @override public void run() { seek { log.d("this working", "this working"); handler.postdelayed(this, 100); if ((w >= minwidth) && (w < maxwidth) && (toggle == 1)) { w++; h++; if (w == maxwidth) { toggle = 0; } } else { w--; h--; if (w == minwidth) { toggle = 1; } } view view_instance = (view) findviewbyid(r.id.surface); layoutparams params = view_instance.getlayoutparams(); params.width = w; params.height = h; view_instance.setlayoutparams(params); } grab (exception e) { // todo: handle exception } { //also phone call same runnable handler.postdelayed(this, 100); } } }; handler.postdelayed(runable, 100);

thank you

android multithreading delay transition

No comments:

Post a Comment