Cannot find any documentation on how to config ShowcaseView.
This is from ShowcaseView GitHub pages:
Usage
To use ShowcaseView, use one of the insertShowcaseView(..) calls. These take:
- A Target which represents what should be showcased. See the wiki for more details.
- An Activity
- Optional title and detail strings (or resource ids) which show on the ShowcaseView
- Optional a ConfigOptions which can alter the behaviour of ShowcaseView. See the wiki for more details
The only working link is the wiki one, where i cannot find anything about ConfigOptions and how to use it, other links are broken.
I'm trying to write down a little tutorial for my app, here's what I deduced by studying the source code:
ShowcaseView.ConfigOptions co = new ShowcaseView.ConfigOptions();
co.hideOnClickOutside = false;
//show only first one once?!
co.shotType = ShowcaseView.TYPE_ONE_SHOT;
co.showcaseId=1;
co.centerText=true;
co.noButton=false;
co.block = true;
RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams(android.view.ViewGroup.LayoutParams.MATCH_PARENT, android.view.ViewGroup.LayoutParams.MATCH_PARENT);
lps.addRule(RelativeLayout.CENTER_IN_PARENT);
lps.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
int margin = 10;
lps.setMargins(margin, margin, margin, margin);
co.buttonLayoutParams = lps;
ShowcaseViews svs = new ShowcaseViews(this);
ShowcaseViews.ItemViewProperties ivp;
ivp= new ItemViewProperties(
R.id.target1,
R.string.target1_tit,
R.string.target1_desc,
0.4f,
co
);
svs.addView(ivp);
co.showcaseId=2;
ivp= new ItemViewProperties(
R.id.target2,
R.string.target2_tit,
R.string.target2_desc,
0.4f,
co
);
svs.addView(ivp);
co.showcaseId=3;
ivp= new ItemViewProperties(
R.id.target3,
R.string.target3_tit,
R.string.target3_desc,
0.4f,
co
);
svs.addView(ivp);
svs.show();
but i cannot figure out many things:
- how to place title and message strings at the center of the screen (ConfigOption.centerText has no effect?)
- how to resize text (i would like it bigger)
- how to place the OK button elsewhere (ConfigOption.buttonLayoutParams has no effect)
- how to dismiss showcase (or display next one) when user touches the target view
thanx.