android - Set layout_anchor at runtime on FloatingActionButton -
i trying animate android.support.design.widget.floatingactionbutton pinned appbarlayout. can set fine within layout xml , shows fine. doing shared element transition layout , fab showing before view set. tried set visibility gone , invisible seem disregarded if layout_anchor set in layout xml. there anyway around this?
i activity load shared element transition fade in fab. can't hide fab on load. without using layout_anchor prefer keep if possible.
if have fab the app:layout_anchor
attribute, , want set visibility should use this:
coordinatorlayout.layoutparams params = (coordinatorlayout.layoutparams) fab.getlayoutparams(); params.setanchorid(view.no_id); fab.setlayoutparams(params); fab.setvisibility(view.gone);
if want set theapp:layout_anchor
dinamically can use same code:
coordinatorlayout.layoutparams p = (coordinatorlayout.layoutparams) fab.getlayoutparams(); p.setanchorid(xxxx); fab.setlayoutparams(p);
Comments
Post a Comment