效果图看原帖
https://github.com/fredericojssilva/ShowTipsView
本人在其基础上
新增了方法:setCanceledOnTouchOutside(boolean),是否可以点击任意位置使ShowTipsView消失,默认为false
修改了不能显示半透明背景的bug,目前默认背景为半透明0x66000000,可通过setBackgroundColor(color)设置
其他地方的微调
使用方法:
上面的示例代码中,ShowTipsView中能够设置的参数几乎全用到了
注意方法displayOneTime(int),一旦设置了该方法,ShowTipsView就不能重复显示了,因为一般来说,教学指引只在软件第一次安装运行后出现,无需每次运行软件的时候出现。
displayOneTime(int)的参数就是保存在SharedPreferences里的key,用于表示是否显示过,而不是指显示的次数。
具体的代码见附件,只要将其中的类copy到你的包里面即可使用
别忘了还有一个动画fade_in.xml
另一个类似的Android库:TourGuide
http://www.open-open.com/lib/view/open1437053882021.html
一个用于app指向性功能高亮的库
http://www.jcodecraeer.com/a/opensource/2015/1111/3675.html
https://github.com/fredericojssilva/ShowTipsView
本人在其基础上
新增了方法:setCanceledOnTouchOutside(boolean),是否可以点击任意位置使ShowTipsView消失,默认为false
修改了不能显示半透明背景的bug,目前默认背景为半透明0x66000000,可通过setBackgroundColor(color)设置
其他地方的微调
使用方法:
- ShowTipsView showtips = new ShowTipsBuilder(this)
- .setTarget(findViewById(R.id.btn_right))
- .setTitle("下一步")
- .setTitleColor(0xFFCCCC00)
- .setDescription("点击下一步就会进入下一页:)")
- .setDescriptionColor(0xFFFFFFFF)
- .setDelay(1000)
- .setBackgroundColor(0x66000000)
- .setCircleColor(0xFFFFFFFF)
- .setButtonText("知道了")
- .setCanceledOnTouchOutside(true)
- // .displayOneTime(0)
- .build();
- showtips.setCallback(new ShowTipsViewInterface(){
- @Override
- public void onGotItClick() {
- }
- });
- showtips.show(this);
上面的示例代码中,ShowTipsView中能够设置的参数几乎全用到了
注意方法displayOneTime(int),一旦设置了该方法,ShowTipsView就不能重复显示了,因为一般来说,教学指引只在软件第一次安装运行后出现,无需每次运行软件的时候出现。
displayOneTime(int)的参数就是保存在SharedPreferences里的key,用于表示是否显示过,而不是指显示的次数。
具体的代码见附件,只要将其中的类copy到你的包里面即可使用
别忘了还有一个动画fade_in.xml
- <?xml version="1.0" encoding="utf-8"?>
- <set xmlns:android="http://schemas.android.com/apk/res/android" >
- <alpha
- android:duration="800"
- android:fromAlpha="0.0"
- android:interpolator="@android:anim/accelerate_interpolator"
- android:toAlpha="1.0" />
- </set>
另一个类似的Android库:TourGuide
http://www.open-open.com/lib/view/open1437053882021.html
一个用于app指向性功能高亮的库
http://www.jcodecraeer.com/a/opensource/2015/1111/3675.html
- showtipsview.rar (4.4 KB)