Android手机卫士之设置密码对话框

作者:wuyudong 时间:2021-08-03 07:24:27 

本文实现初次设置密码验证过程,首先实现如下效果

Android手机卫士之设置密码对话框

布局如下:


<?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
style="@style/TitleStyle"
android:background="#f00"
android:text="设置密码"
/>

<EditText
android:id="@+id/et_set_psd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="设置密码"
/>

<EditText
android:id="@+id/et_confirm_psd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="确认密码"
/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<Button
 android:id="@+id/bt_submit"
 android:layout_width="0dp"
 android:layout_height="wrap_content"
 android:layout_weight="1"
 android:text="确认" />

<Button
 android:id="@+id/bt_cancel"
 android:layout_width="0dp"
 android:layout_height="wrap_content"
 android:layout_weight="1"
 android:text="取消" />
</LinearLayout>

</LinearLayout>

其中TitleStyle的代码如下:


<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
 Theme customizations available in newer API levels can go in
 res/values-vXX/styles.xml, while customizations related to
 backward-compatibility can go here.
-->
</style>

<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">

<!-- 在去头的同时还保持高版本的样式主题 -->
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
<item name="android:windowNoTitle">true</item>
</style>

<style name="TitleStyle">
<item name="android:gravity">center</item>
<item name="android:textSize">20sp</item>
<item name="android:textColor">#000</item>
<item name="android:padding">10dp</item>
<item name="android:background">#0f0</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>

</resources>

来源:http://www.cnblogs.com/wuyudong/archive/2016/10/08/5939823.html

标签:Android,密码,对话框
0
投稿

猜你喜欢

  • C#中const用法详解

    2021-08-12 15:30:29
  • java实现通讯录管理系统

    2021-07-02 00:19:53
  • SpringBoot+SpringCache实现两级缓存(Redis+Caffeine)

    2023-10-02 05:20:58
  • SpringBoot 如何优雅的实现跨服务器上传文件的示例

    2023-07-03 21:42:56
  • Spring Boot配置接口WebMvcConfigurer的实现

    2023-11-27 23:28:50
  • 三道java新手入门面试题,通往自由的道路--多线程

    2023-05-24 23:12:51
  • 安卓GreenDao框架一些进阶用法整理

    2023-06-17 03:27:21
  • java 使用异常的好处总结

    2023-11-29 13:35:49
  • Spring Boot集成Ehcache缓存解决方式

    2023-05-13 08:27:27
  • Spring Cloud下OAUTH2注销的实现示例

    2023-06-01 22:54:58
  • 常用的Java数据结构知识点汇总

    2022-09-09 02:26:02
  • 最优雅地整合 Spring & Spring MVC & MyBatis 搭建 Java 企业级应用(附源码)

    2023-09-26 18:27:57
  • java static块和构造函数的实例详解

    2021-10-04 07:30:17
  • Nacos框架服务注册实现流程

    2023-07-07 10:18:30
  • 新手入门Jvm--jvm概览

    2023-11-09 15:42:31
  • Java关于JDK1.8新特性的Stream流

    2021-06-02 11:36:35
  • java读取解析xml文件实例

    2023-01-04 05:52:40
  • @ConfigurationProperties加载外部配置方式

    2023-11-09 01:14:32
  • Java进程cpu占用过高问题解决

    2021-08-09 00:16:59
  • Java实现配置加载机制

    2023-11-26 09:03:38
  • asp之家 软件编程 m.aspxhome.com