Who Needs a Sidebar Anyway ?

Looks familiar.....

Been looking at UI functionality for a while. Tried some extensions that added action bars or sidebars, or swiping sidebars, but found nothing that floated my boat, and also resulted in the introduction of additional buttons to press hamburgers and three dots, etc.

So I set about seeing what could be done to the basic UI using only native AI2 components.

  1. Hide the title bar
  2. Create your own title bar with an arrangement with labels and a button, and format to look like the title bar (Device Default in my case)
  3. Make the button a hamburger icon
  4. Create routines using the notifier to replicate the About Screen and the Close Application options provided in the original three dots menu. ( I disregarded the Settings option as this doesn't really add to the piece).
  5. Set up a spinner with an elements list for what you want, set item 1 in the elements list as "Close Menu"
  6. Create an extended if then / else if block for all the options returned from the spinner
  7. Include a block before calling the spinner to set the selection index to 1 (this sets the spinner to "Close Menu" when it opens. If you press "Close Menu" the spinner closes, and nothing happens ;) )

And there you have it, a one press solution to access and do just about anything in your app from: opening a sub menu spinner for more options, running activity starters, opening different screens / arrangements, the list goes on.

In my blocks below I have included all the settings for the faux title bar and the spinner to help with understanding, but many of these can be set in the designer

(the "evaluate but ignore result block is to show the colour generated from rgb values for the faux title bar, I then use the android colour value to set it. More info on colours HERE

BLOCKS

titlebarspinner.webm