Android开发,透明指示层、引导层、功能说明层的分享及使用
2016-11-28 17:14
465 查看
应公司开发要求,需要实现第一次打开应用,对某一界面的一个或多个按钮或空间进行指示说明得功能。
通过对网上代码的改写,实现了该功能。
但由于不想依赖包套多的缘故,公司要求使用JAR包的方式,于是通过研究,将该功能集成成功。
下面是下载地址:ZXGuideUtil.jar
先放一下效果图
这是原始界面
这是显示第一个引导
第二个引导
这是引导文字在控件上方的情况
下面开始使用
使用前,你需要建立一个layout文件layout_guideview
代码如下
以及两个图片,这个就不好上传了,我是下面这种
arrawUp.png
arrawDown.png
然后就可以了,下面是使用方法
addList方法,需要传入三个参数
View 需要显示引导界面的控件
Component类型的参数 一般来说使用ANCHOR_BOTTOM和ANCHOR_TOP,代表了引导箭头在控件上方还是下方
String 这个就是引导的文字
注意,addList的顺序决定了引导界面显示的顺序
最后记得Show一下就可以了
感谢您的阅读。
通过对网上代码的改写,实现了该功能。
但由于不想依赖包套多的缘故,公司要求使用JAR包的方式,于是通过研究,将该功能集成成功。
下面是下载地址:ZXGuideUtil.jar
先放一下效果图
这是原始界面
这是显示第一个引导
第二个引导
这是引导文字在控件上方的情况
下面开始使用
使用前,你需要建立一个layout文件layout_guideview
代码如下
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <TextView android:id="@+id/guide_text1" android:layout_width="100dp" android:layout_height="wrap_content" android:textColor="@color/color_white" android:visibility="gone" /> <ImageView android:id="@+id/guide_image1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="@mipmap/arrow_up" android:visibility="gone" /> <ImageView android:id="@+id/guide_image2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="@mipmap/arrow_down" android:visibility="gone" /> <TextView android:id="@+id/guide_text2" android:layout_width="100dp" android:layout_height="wrap_content" android:textColor="@color/color_white" android:visibility="gone" /> </LinearLayout>该layout文件是引导层的说明及图片
以及两个图片,这个就不好上传了,我是下面这种
arrawUp.png
arrawDown.png
然后就可以了,下面是使用方法
LinearLayout mView = (LinearLayout) View.inflate(this, R.layout.layout_guideview, null); ZXGuideBuilder zxGuideBuilder = new ZXGuideBuilder(GuideViewActivity.this, mView); zxGuideBuilder.addList(tv, Component.ANCHOR_BOTTOM, "我我我我我我我我我我我我我我我我我我我我"); zxGuideBuilder.addList(btn, Component.ANCHOR_BOTTOM, "我我我我我我我我我我我我我我我我我我我我"); zxGuideBuilder.addList(et, Component.ANCHOR_BOTTOM, "我我我我我我我我我我我我我我我我我我我我"); zxGuideBuilder.addList(sw, Component.ANCHOR_TOP, "我我我我我我我我我我我我我我我我我我我我"); zxGuideBuilder.addList(cb, Component.ANCHOR_TOP, "我我我我我我我我我我我我我我我我我我我我"); zxGuideBuilder.show();构造方法需要传两个参数,context和引导说明图片的view,就是我们刚刚引入的那个
addList方法,需要传入三个参数
View 需要显示引导界面的控件
Component类型的参数 一般来说使用ANCHOR_BOTTOM和ANCHOR_TOP,代表了引导箭头在控件上方还是下方
String 这个就是引导的文字
注意,addList的顺序决定了引导界面显示的顺序
最后记得Show一下就可以了
感谢您的阅读。
相关文章推荐
- Android开发之使用SharedPreferences实现QQ登陆的选项框记忆功能(源代码分享)
- Android开发之ActionBar结合Fragment的导航功能的使用(源代码分享)
- 使用友盟SNS_SDK为Android应用加入SNS分享、同步功能
- Android使用分享功能
- Android开发 如何快速实现分享功能
- Android使用系统Intent实现分享功能及将应用加入分享列表
- Android开发(21)--有关Spinner控件的使用说明
- android项目开发(1)我是大侦探-----功能说明
- Android开发工具Dev Tools的使用说明
- android分享功能开发-短信,微博
- Android开发 QQ sso登录和分享到QQ好友功能,调用本地QQ客户端
- Android 制作引导层 使用透明的activity
- 举例说明BroadcastReceiver的使用方法----实现android手机开机之后显示画面的功能
- android分享功能开发
- [Android开发]Android之使用Http协议实现文件上传功能
- android分享功能开发!!!
- 使用Mina框架开发 QQ Android 客户端(3) 登陆功能的实现
- android 分享功能开发
- Android开发 如何快速实现分享功能
- Android开发(21)--有关Spinner控件的使用说明