MaterialIntroView
介绍:
一个app功能引导的库,类似于 Fabulous App 上的效果。
运行效果:
使用说明:
使用
new MaterialIntroView.Builder(this)
.enableDotAnimation(true)
.setFocusGravity(FocusGravity.CENTER)
.setFocusType(Focus.MINIMUM)
.setDelayMillis(500)
.enableFadeAnimation(true)
.performClick(true)
.setInfoText("Hi There! Click this card and see what happens.")
.setTarget(view)
.setUsageId("intro_card") //THIS SHOULD BE UNIQUE ID
.show();
导入
Project build.gradle
repositories {
maven {
url "https://jitpack.io"
}
}
Module build.gradle
dependencies {
compile 'com.github.iammert:MaterialIntroView:1.5'
}
Builder 方法
.setMaskColor(Color.Blue)
.setDelayMillis(3000) //starts after 3 seconds passed
.enableFadeAnimation(true) //View will appear/disappear with fade in/out animation
//ie. If your button's width has MATCH_PARENT.
//Focus.ALL is not a good option. You can use
//Focus.MINIMUM or Focus.NORMAL. See demos below.
.setFocusType(Focus.MINIMUM)
.setFocusType(Focus.NORMAL)
.setFocusType(Focus.ALL)
//ie. You can focus on left of RecyclerView list item.
.setFocusGravity(FocusGravity.LEFT)
.setFocusType(FocusGravity.CENTER)
.setFocusType(FocusGravity.RIGHT)
.setTarget(myButton) //Focus on myButton
.setTargetPadding(30) //add 30px padding to focus circle
.setInfoText("This is info text!") //Setting text will enable info dialog
.setTextColor(Color.Black) //Info dialog's text color is set to black
.setInfoTextSize(30) //Change text size
.setUsageId("intro_fab_button") //Store intro view status whether it is learnt or not
.enableDotAnimation(true) //Shows dot animation center of focus area
.performClick(true) //Trigger click operation when user click focused area.
//If you don't want to perform click automatically
//You can disable perform clik and handle it yourself
.setListener(new MaterialIntroListener() {
@Override
public void onUserClicked(String materialIntroViewId) {
}
})
Configuration 方法
//Create global config instance to not write same config to builder
//again and again.
MaterialIntroConfiguration config = new MaterialIntroConfiguration();
config.setDelayMillis(1000);
config.setFadeAnimationEnabled(true);
...
.setConfiguration(config) //
Demos
已下载
0