程序锁学习(指纹识别的基础)------阿冬专栏

Posted 阿冬专栏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了程序锁学习(指纹识别的基础)------阿冬专栏相关的知识,希望对你有一定的参考价值。

高级工具--程序锁界面设计(一)


转载自:http://blog.csdn.net/asmcvc/article/details/18356007

界面效果图:


在加载安装的应用程序列表时,显示进度条:


布局文件:

[html]  view plain  copy  
  1. <?xml version="1.0" encoding="utf-8"?>  
  2.   
  3. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  4.     android:orientation="vertical" android:layout_width="match_parent"  
  5.     android:layout_height="match_parent">  
  6.     <TextView style="@style/title_center_text"  
  7.         android:text="程序锁"/>  
  8.     <View style="@style/splitter_view"/>  
  9.   
  10.     <RelativeLayout  
  11.         android:layout_height="fill_parent"  
  12.         android:layout_width="fill_parent">  
  13.         <LinearLayout  
  14.             android:id="@+id/ll_applock_loading"  
  15.             android:gravity="center"  
  16.             android:orientation="vertical"  
  17.             android:visibility="invisible"  
  18.             android:layout_height="fill_parent"  
  19.             android:layout_width="fill_parent">  
  20.             <ProgressBar  
  21.                 android:layout_height="wrap_content"  
  22.                 android:layout_width="wrap_content" />  
  23.             <TextView style="@style/content_text"  
  24.                 android:text="正在加载程序信息……"/>  
  25.         </LinearLayout>  
  26.         <ListView  
  27.             android:fastScrollEnabled="true"  
  28.             android:id="@+id/lv_applock"  
  29.             android:layout_height="match_parent"  
  30.             android:layout_width="match_parent"/>  
  31.     </RelativeLayout>  
  32. </LinearLayout>  
实际上在加载过程中进度控件是覆盖掉ListView的,当加载完毕后发送消息通知,消息处理过程隐藏掉进度控件即可。

ListView的每一个item的布局:

[html]  view plain  copy  
  1. <?xml version="1.0" encoding="utf-8"?>  
  2.   
  3. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  4.     android:orientation="horizontal" android:layout_width="match_parent"  
  5.     android:layout_height="wrap_content">  
  6.     <ImageView  
  7.         android:id="@+id/iv_applock_icon"  
  8.         android:layout_height="wrap_content"  
  9.         android:layout_width="wrap_content"  
  10.         android:layout_alignParentLeft="true"/>  
  11.     <TextView style="@style/content_text"  
  12.         android:id="@+id/iv_applock_name"  
  13.         android:layout_toRightOf="@+id/iv_applock_icon"/>  
  14.     <ImageView  
  15.         android:id="@+id/iv_applock_status"  
  16.         android:layout_height="wrap_content"  
  17.         android:layout_width="wrap_content"  
  18.         android:layout_alignParentRight="true"/>  
  19. </RelativeLayout>  
用来显示程序图标的ImageView,显示应用程序名的TextView,和锁定状态的ImageView。


界面在加载时先获取已安装的程序列表,保存应用程序的信息用一个AppInfo类来表示:

[java]  view plain  copy  
  1. package com.example.mobilesafe.engine;  
  2.   
  3. import android.graphics.drawable.Drawable;  
  4.   
  5. /** 
  6.  * Created by sing on 14-1-15. 
  7.  * desc: 
  8.  */  
  9. public class AppInfo   
  10.   
  11.     private static final String TAG = "AppInfo";  
  12.   
  13.     //包名  
  14.     private String packname;  
  15.   
  16.     //应用程序版本号  
  17.     private String version;  
  18.   
  19. IOS 指纹识别的简单使用

    git@oschina使用学习--------阿冬专栏!!!

    git@oschina使用学习--------阿冬专栏!!!

    Java Web中的ActionDaoServiceModel学习笔记-----阿冬专栏

    Java Web中的ActionDaoServiceModel学习笔记-----阿冬专栏

    Source Insight--------阿冬专栏!!!