[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
    android:orientation="vertical" >

    TextView
        android:layout_width
        android:layout_height="40dp"
        android:background="#2D89EF"
        android:gravity="center"
        android:text="1.手机防盗设置向导"
        android:textColor="#fff"
        android:textSize="18sp" />

    ="wrap_content"
        android:layout_marginLeft="10dp"
        android:layout_marginTop="8dp"="手机防盗包含以下功能:"="16sp" style="@style/guide_text_list"
        android:drawableLeft="@android:drawable/btn_star_big_on"="SIM卡变更报警" ="GPS追踪" ="远程数据销毁" ="远程锁屏" LinearLayout
        ="center_horizontal"
        android:orientation="horizontal" >

        ImageView
            
            android:layout_height
            android:src="@android:drawable/presence_online" />

        ="@android:drawable/presence_invisible" />
    </LinearLayoutRelativeLayout
        ="match_parent" Button
            android:textColor="#444"
            android:layout_width
            android:layout_alignParentBottom="true"
            android:layout_alignParentRight
            android:layout_marginBottom
            android:layout_marginRight
            android:background="@drawable/button_selector"
            android:text="下一步" RelativeLayout>

>

 

button_selector.xml

selector ="http://schemas.android.com/apk/res/android"item android:drawable="@drawable/barcode_btn_guide_pressed" android:state_focused="true"></item>
     android:state_pressed="@drawable/barcode_btn_guide_normal"selector>

 

相关文章

Android 如何解决dialog弹出时无法捕捉Activity的back事件 在...
Android实现自定义带文字和图片的Button 在Android开发中经常...
Android 关于长按back键退出应用程序的实现最近在做一个Andr...
android自带的时间选择器只能精确到分,但是对于某些应用要求...