android - Toolbar as self-managed ActionBar vs Toolbar as framework managed ActionBar -


alright, trying understand lose if use toolbar self-managed actionbar , not use setsupportactionbar.

afaik, actionbar is, provide placeholders logo, navigation , menu items , let fragments add/customize menu items.

the same functionality achieved using toolbar.setlogo(), toolbar.setnavigationicon(), toolbar.setnavigationonclicklistener() , toolbar.inflatemenu() apis. of course, directing menu handling logic fragments might lost think not big of deal if activity knows fragment on top , changes menu items accordingly.

i trying make sure :

  • if can achieve every actionbar capability using toolbar , menuitems (and not using setsupportactionbar()).
  • is ok not have exhaustive knowledge of actionbar apis. of actionbar apis confusing. using sethomeasup api show hamburger icon, icon etc., doesn't feel right. if starts learning android today, need understand framework's actionbar apis?

update : in article android design support library under section coordinatorlayout , app bar, learnt new paradigm app bar replacement action bar paradigm. think action bar deprecated , should used new app bar paradigm covers new material design user experiences.

yes can use achieve similar capabilities of actionbar in toolbar.

mainly difference lies toolbar becomes part of view can more fun playing them scrolling techniques

you can use toolbar separately view & perform actionbar alike functionalities. example, in 1 of app use 2 toolbar 1 set setsupportactionbar() while other used other functionalities.

conclusion: depends upon requirements if want use toolbar self or framework. none less can use both.

i hope answers question well.


Comments

Popular posts from this blog

python - TypeError: start must be a integer -

c# - DevExpress RepositoryItemComboBox BackColor property ignored -

django - Creating multiple model instances in DRF3 -