项目介绍:
demo | Aug 26, 2016 | |
gradle/wrapper | Oct 12, 2016 | |
guideview | Aug 12, 2016 | |
.gitignore | Jul 29, 2016 | |
LICENSE.txt | Jul 23, 2016 | |
README.md | Oct 12, 2016 | |
build.gradle | Oct 12, 2016 | |
demo.png | Aug 11, 2016 | |
gradle.properties | Jul 23, 2016 | |
gradlew | Jul 23, 2016 | |
gradlew.bat | Jul 23, 2016 | |
netease_demo.png | Oct 12, 2016 | |
settings.gradle | Aug 26, 2016 |
GuideView
-
gradle
[Java] 查看源文件 复制代码1compile
'cn.Lemon:guideview:0.1.6'
-
方法回调顺序
[Java] 查看源文件 复制代码12* 方法回调:创建GuideView -- initParams(初始化参数) -- getTargetViewPosition(获取TargetView位置核心方法) --
* show(添加GuideView进DecorView) -- addHintView -- GuideView.onMeasure -- GuideView.onLayout -- GuideView.Draw -- drawMaskLayer(绘制完毕)
-
使用
[Java] 查看源文件 复制代码01020304050607080910111213141516171819202122232425262728293031323334@Override
public
void
onResume() {
super
.onResume();
fragment.post(
new
Runnable() {
@Override
public
void
run() {
showGuideViews();
}
});
}
public
void
showGuideViews() {
TextView mHintView =
new
TextView(getActivity());
mHintView.setText(\"列夫·托尔斯泰曾在《安娜·卡列尼娜》里说过:幸福的家庭都是相似的\");
mHintView.setTextSize(20f);
mHintView.setTextColor(Color.WHITE);
mGVOne =
new
GuideView.Builder(getActivity())
.setTargetView(R.id.text_one)
.setHintView(mHintView)
.setHintViewDirection(Direction.BOTTON)
.setTransparentOvalPadding(
20
)
.setHintViewMarginTop(
100
)
.setOnClickListener(
new
View.OnClickListener() {
@Override
public
void
onClick(View v) {
mGVOne.hide();
mGVTwo.show();
}
})
.create();
mGVOne.show();
}
-
Demo效果图
License
This project is licensed under the terms of the Apache License 2.0