android - AppCompat ActionBar restoring original layout -
in app, use mainactivity storing main layout (drawerlayout, coordinatorlayout content root, toolbar , fragment holder in it), , various fragments screens.
on 1 particular screen i'd expand actionbar size, , give specific content (remove toggle button, menu bar, etc., , specify own layout). done mainactivity.toolbar.setcustomview();
. works pretty well, when navigate different fragment, i'd restore original layout. there simple way of doing this?
yes, in order remove custom view , restore appcompat actionbar can call setdisplayoptions.
getactivity().getactionbar().setdisplayoptions(actionbar.display_show_title | actionbar.display_show_home);
Comments
Post a Comment