Conductor: show Toolbar as actionBar for each controller

Created on 2 Apr 2016  路  4Comments  路  Source: bluelinelabs/Conductor

can you give a sample to show toolbar as action bar in each of controllers ?

Most helpful comment

The demo app is now updated to have a toolbar. The HomeController has an options menu to demonstrate how that's done, and BaseController shows how the actionbar can be referenced from within a Controller. Again though, if this was production, I would use DI to grab the actionbar rather than casting the host activity.

All 4 comments

You'd probably want to have a toolbar in the hosting activity that all controllers share, not one per controller, as that would make for some awkward looking transitions. The toolbar could then be injected into controllers using dagger (recommended) or referenced directly from the hosting activity. This would give controllers the ability to set the title, options menu, etc.

thanks
if possible add toolbar activity in your sample .

The demo app is now updated to have a toolbar. The HomeController has an options menu to demonstrate how that's done, and BaseController shows how the actionbar can be referenced from within a Controller. Again though, if this was production, I would use DI to grab the actionbar rather than casting the host activity.

What would I be injecting?? can you help me with some clarification. on what needs to be injected into either the base or the home controller?

thank you

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tomblenz picture tomblenz  路  4Comments

vincent-paing picture vincent-paing  路  6Comments

lenguyenthanh picture lenguyenthanh  路  5Comments

JakeWharton picture JakeWharton  路  7Comments

jpetitto picture jpetitto  路  4Comments