have you tried to use ActionBarSherlock? It supports old compatibility and has quite a lot of available examples.
Showcaseview not displaying action bar items
-
29-09-2022 - |
Question
So in my project I am using a showcaseview to create a tutorial for the user. When I point the ShowcaseView to any action bar id, the result is this:
My question is is it possible to have the showcaseview target the specific items in the action bar rather than just a general overview like the one shown above. The code is being run in the overridden onCreateOptionsMenu method and is in the context of an activity. Here is the code that I am currently using:
actionBarViews = new ShowcaseViews(activity);
ShowcaseView.ConfigOptions co = new ShowcaseView.ConfigOptions();
co.hideOnClickOutside = true;
actionBarViews.addView(new ItemViewProperties(R.id.sendmessage,
R.string.send_title, R.string.send_tutorial,
ShowcaseView.ITEM_ACTION_ITEM, 0, co));
actionBarViews.addView(new ItemViewProperties(R.id.tutorial_menu,
R.string.tutorial_title, R.string.tutorial_tutorial,
ShowcaseView.ITEM_ACTION_OVERFLOW, 0, co));
actionBarViews.show();
If it is impossible to currently target actionbaritems, is there another way to go about implementing a tutorial.
Solution 3
OTHER TIPS
This may be a little late, but this may be useful for other users who find this thread. I used the following code to highlight my action button with ShowCaseView
//for action button with id "ACTION_BUTTON_ID"
ShowcaseView.ConfigOptions co = new ShowcaseView.ConfigOptions();
co.showcaseId = ShowcaseView.ITEM_ACTION_ITEM;
co.hideOnClickOutside = true;
ActionItemTarget target = new ActionItemTarget(this.getActivity(),R.id.ACTION_BUTTON_ID);
final ShowcaseView sv = ShowcaseView.insertShowcaseView(target,getActivity(),R.string.instruction_title_text,R.string.instruction_details_text);
sv.show();
use it like this
new ShowcaseView.Builder(activity)
// .withMaterialShowcase()
// .setStyle(R.style.CustomShowcaseTheme3)
.setTarget(Target.NONE)
.setOnClickListener(this)
//.withMaterialShowcase()
.blockAllTouches()
.useDecorViewAsParent() //this is the difference
.build();
then target your view in action bar