android - Manipulate a tab fragment during runtime -
i got 3 fragments each on seperate tab. on 1 tab want have fragment in card-style. 1 row should [ ________ ________ +]. after pressing +button want second identical row appear. how achive that? professional way manipulate tagfragments during runtime? how can implement trancisions?
i got it. can add additional rows by:
@override public void onclick(view v) { switch (v.getid()) { case r.id.imagebuttonadd: if(i==0){ raisecounterbyone(); counter.settext(counterstart.tostring()); test = getactivity().findviewbyid(r.id.testview3); test.setvisibility(view.visible); i++; } else if(i==1){ raisecounterbyone(); counter.settext(counterstart.tostring()); test = getactivity().findviewbyid(r.id.testview4); test.setvisibility(view.visible); i++; } break; case r.id.imagebuttoncancel2: log.d("","close"); test = getactivity().findviewbyid(r.id.testview3); test.setvisibility(view.gone); i--; break; case r.id.imagebuttoncancel3: log.d("","close"); test = getactivity().findviewbyid(r.id.testview4); test.setvisibility(view.gone); i--; break; default: break; } }
is there better way more flexible? array or loop? there opportunity put views array? want set maximum number of rows can added. furthermore index each row later use.
Comments
Post a Comment