android - Change Height of layout smooth -
i have searched , tryed few methods of how change height of view smooth animation. easiest way found , convenient one:
scaleanimation scaleanimation = new scaleanimation(viewgroup.layoutparams.wrap_content, viewgroup.layoutparams.wrap_content, mainlayout.getmeasuredheight(), mainlayout.getmeasuredheight() - mediacontroller.getmeasuredheight() - conv.topixels(20), animation.relative_to_self, 0.5f, animation.relative_to_self, 0.5f); musiclistlayout.setanimation(scaleanimation); musiclistlayout.startlayoutanimation(); however method doesn't work , don't know why. have tryed few more make 1 work or find 1 will.
i have playlist have ( wrap_content, wrap_content ) , when play on song me mediacontroller shows up, want translate/animate recyclerview , mediacontroller change theyr dimension fit on screen.
thank's help.
easiest way (api>11, think): change height directly, no animation @ all, , set android:animatelayoutchanges="true" on parent view in layout.
to change animation duration, try calling container.getlayouttransition().setduration(duration) container above mentioned parent view.
Comments
Post a Comment