详解Android 手机卫士设置向导页面

所属分类: 软件编程 / Android 阅读数: 1796
收藏 0 赞 0 分享

推荐阅读:

 浅析Android手机卫士自定义控件的属性

浅析Android手机卫士关闭自动更新

设置向导页面,通过SharedPreferences来判断是否已经设置过了,跳转到不同的页面

自定义样式

在res/values/styles.xml中

添加节点<style name=””>,设置名称属性

在<style>节点里面,添加节点<item name=””>设置名称属性,就是布局的各种参数

在<item>的文本里面,设置布局的各种参数值

在布局文件中引用样式,style=”@style/xxxxxxxxxxxx

在TextView的左侧放置小图标

使用左侧图标属性android:drawableLeft=”@android:drawable/xxxxxxxxxxx”,引用android系统的图标,例如:@android:drawable/star_big_on

图标垂直居中对齐,使用对齐属性 android:gravity=”center_vertical”

引导页下面的小圆点

线性布局,横向,ImageView,包裹内容,整体居中

使用系统图标 @android:drawable/presence_online

@android:drawable/presence_invisible

自定义按钮状态背景

在res/drawable/button.xml文件中定义,添加节点<selector>

定义按钮按下状态 添加<item>节点,设置状态属性android:state_pressed=”true”

设置图片属性android:drawable=”xxxx”

设置按钮焦点状态 添加<item>节点,设置状态属性android:state_focus=”true”

定义按钮默认图片 添加<item>节点,设置图片属性android:drawable=”xxxx”

设置图片属性android:drawable=”xxxx”

布局文件中,给按钮设置背景,android:background=”@drawable/xxxxx”

activity_lost_find.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#2D89EF"
android:gravity="center"
android:text="1.手机防盗设置向导"
android:textColor="#fff"
android:textSize="18sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="8dp"
android:text="手机防盗包含以下功能:"
android:textSize="16sp" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="SIM卡变更报警" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="GPS追踪" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="远程数据销毁" />
<TextView
style="@style/guide_text_list"
android:drawableLeft="@android:drawable/btn_star_big_on"
android:text="远程锁屏" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_online" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_invisible" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_invisible" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/presence_invisible" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:textColor="#444"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:background="@drawable/button_selector"
android:text="下一步" />
</RelativeLayout>
</LinearLayout> 

button_selector.xml

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/barcode_btn_guide_pressed" android:state_focused="true"></item>
<item android:drawable="@drawable/barcode_btn_guide_pressed" android:state_pressed="true"></item>
<item android:drawable="@drawable/barcode_btn_guide_normal"></item>
</selector>

 

更多精彩内容其他人还在看

Android动态加载Activity原理详解

这篇文章主要介绍了Android动态加载Activity原理详解的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

Android App中实现相册瀑布流展示的实例分享

这篇文章主要介绍了Android App中实现相册瀑布流展示的实例分享,例子中利用到了缓存LruCache类的相关算法来解决大量加载问题,需要的朋友可以参考下
收藏 0 赞 0 分享

Android开发中ImageLoder进行图片加载和缓存

这篇文章主要介绍了Android开发中ImageLoder进行图片加载和缓存的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

详解Android Activity之间切换传递数据的方法

这篇文章主要介绍了详解Android Activity之间切换传递数据的方法 的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

详解Android 手机卫士设置向导页面

这篇文章主要介绍了详解Android 手机卫士设置向导页面的相关资料,需要的朋友可以参考下
收藏 0 赞 0 分享

深入浅析Android手机卫士保存密码时进行md5加密

一般的手机没有root权限,进不去data/data目录,当手机刷机了后,拥有root权限,就可以进入data/data目录,查看我们保存的密码文件,因此我们需要对存入的密码进行MD5加密,接下来通过本文给大家介绍Android手机卫士保存密码时进行md5加密,需要的朋友一起学习
收藏 0 赞 0 分享

Android仿百度外卖自定义下拉刷新效果

大家在使用百度外卖的订餐的时候,会看到有个下拉刷新功能非常不错,今天小编就通过代码给大家介绍android仿百度外卖自定义下拉刷新,感兴趣的朋友一起学习吧
收藏 0 赞 0 分享

详解Android中Service服务的基础知识及编写方法

这篇文章主要介绍了详解Android中Service服务的基础知识及编写方法,包括Service的启动流程及生命周期等基本内容,需要的朋友可以参考下
收藏 0 赞 0 分享

实例讲解Android中的AIDL内部进程通信接口使用

这篇文章主要通过实例介绍了Android中的AIDL内部进程通信接口使用,文中通过一个音乐播放的服务编写例子来讲解AIDL的传递对象及一般使用步骤,需要的朋友可以参考下
收藏 0 赞 0 分享

浅析Android系统的架构以及程序项目的目录结构

这篇文章主要介绍了Android系统的架构以及程序项目的目录结构,是安卓开发入门学习中的基础知识,需要的朋友可以参考下
收藏 0 赞 0 分享
查看更多