MaterialShowcaseView
介绍:
一个Material Design主题的ShowcaseView(使用场景提示)。
运行效果:
使用说明:
这个库很大程度上是受到了ShowcaseView library的启发。
自从谷歌介绍了Material design设计理念之后,我很少简单一个简洁扁平的showcase 视图(Youtube app也许是一个很好的例子)。唯一一个是它。很长时间内,这是一个伟大的库但是现在它的主题看起来有点过时了。
/build.gradle
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
/app/build.gradle
compile 'com.github.deano2390:MaterialShowcaseView:1.0.5'
注意: 有人提到他们需要添加@aar 后缀才能从JitPack得到:
compile 'com.github.deano2390:MaterialShowcaseView:1.0.5@aar'
这里是单个showcase view的最基本用法,你可以查看sample app获得更高级的用法。
// single example
new MaterialShowcaseView.Builder(this)
.setTarget(mButtonShow)
.setDismissText("GOT IT")
.setContentText("This is some amazing feature you should know about")
.setDelay(withDelay) // optional but starting animations immediately in onCreate can make them choppy
.singleUse(SHOWCASE_ID) // provide a unique ID used to ensure it is only shown once
.show();
// sequence example
ShowcaseConfig config = new ShowcaseConfig();
config.setDelay(500); // half second between each showcase view
MaterialShowcaseSequence sequence = new MaterialShowcaseSequence(this, SHOWCASE_ID);
sequence.setConfig(config);
sequence.addSequenceItem(mButtonOne,
"This is button one", "GOT IT");
sequence.addSequenceItem(mButtonTwo,
"This is button two", "GOT IT");
sequence.addSequenceItem(mButtonThree,
"This is button three", "GOT IT");
sequence.start();
已下载
0