I want to set some view over action bar that will display Tutorial text (Like click here and send email...). Is this possible? I ask because i know that action bar uses the top space on layout, and a fragment or activity uses remaining space.
My second question is how to display all action items on action bar. I use ActionBarSherlock library and i see that i have room for one more action item, but it's not displaying on action bar. I set in xml ifRoom option on item...
Thanks!!!
There are multiple ways to achieve a tutorial-like overlay. Probably the easiest one is to use specially prepared Dialog window with transparent background and without dim behind.
Using custom
Dialog
for tutorial overlayFirst of all we have to prepare content for the
Dialog
. In this example there will be oneTextView
insideRelativeLayout
which is the most useful layout here.Content of
info_overlay.xml
file:Now, we can use this layout to create our
Dialog
:Result
Below is the screenshot of the above solution working. Note the
TextView
overActionBar
.A few notes about solution
setCancelable(false)
to avoid accidental closing of tutorial.Other solutions/helpers
Take a look at Showcase View library as it focuses on creating tutorial-like screens in easy way. I'm not sure however that it can easily overlay actionbars.