demo05
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".MainActivity"> <TextView
android:id="@+id/msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="please input userpassword:"
/>
<EditText
android:id="@+id/password"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<CheckBox
android:id="@+id/show"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="show Password"
/> <TextView
android:id="@+id/xinbei"
android:text="你的性别是:"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="20px"/> </LinearLayout>
=========================== package com.example.chapter06passwordrediogroup; import android.os.Bundle;
import android.app.Activity;
import android.text.method.HideReturnsTransformationMethod;
import android.text.method.PasswordTransformationMethod;
import android.view.Menu;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText; public class MainActivity extends Activity { private EditText password=null;
private CheckBox show =null; @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); this.password= (EditText)super.findViewById(R.id.password);
this.show = (CheckBox)super.findViewById(R.id.show);
this.show.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (show.isChecked()){
MainActivity.this.password.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
}else{
MainActivity.this.password.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
}
}); } @Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
} }
demo05的更多相关文章
- 细说前端自动化打包工具--webpack
背景 记得2004年的时候,互联网开发就是做网页,那时也没有前端和后端的区分,有时一个网站就是一些纯静态的html,通过链接组织在一起.用过Dreamweaver的都知道,做网页就像用word编辑文档 ...
- Vue.js——vue-router 60分钟快速入门
概述 vue-router是Vue.js官方的路由插件,它和vue.js是深度集成的,适合用于构建单页面应用.vue的单页面应用是基于路由和组件的,路由用于设定访问路径,并将路径和组件映射起来.传统的 ...
- java中集合类中Collection接口中的Set接口的常用方法熟悉
1:Set集合由Set接口和Set接口的实现类组成,Set接口继承了Collection接口,因为包含Collection接口的所有方法. 2:由于Set接口中不允许存在重复值,因此可以使用Set集合 ...
- 群里分享的react的收藏一下!今日周末,改了个表单验证然后无所事事了!
今日周末,改了个表单验证然后无所事事了,然后把昨天群里分享的react的收藏一下尽管现在还在研究angular和nodeJs毕竟刚刚开始用有点不熟...没准以后会研究一下react毕竟看着下面这张图还 ...
- java 4种方式读取配置文件 + 修改配置文件
版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] 方式一采用ServletContext读取读取配置文件的realpath然后通过文件流读取出来 方式二采用ResourceB ...
- java 基础三 下雪
通过repaint()方法进行重画. import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.Graphics; p ...
- reactjs
摘自阮一峰博客:http://www.ruanyifeng.com/blog/2015/03/react.html 现在最热门的前端框架,毫无疑问是 React . 上周,基于 React 的 Rea ...
- Commons-Collections 集合工具类的使用
package com.bjsxt.others.commons; import java.util.ArrayList; import java.util.List; import org.apac ...
- React 入门实例教程
现在最热门的前端框架,毫无疑问是 React . 上周,基于 React 的 React Native 发布,结果一天之内,就获得了 5000 颗星,受瞩目程度可见一斑. React 起源于 Face ...
随机推荐
- BLE-NRF51822教程18-overview
转自:http://blog.csdn.NET/xgbing 蓝牙协议栈 nrf51822开发中,蓝牙协议栈和应用开发是分开的. (1)兼容蓝牙4.0低功耗协议栈基带层,L2CAP\AAT\SM\GA ...
- Redis-统计活跃用户
Bitmap(即Bitset)Bitmap是一串连续的2进制数字(0或1),每一位所在的位置为偏移(offset),在bitmap上可执行AND,OR,XOR以及其它位操作. package test ...
- MYSQL 中常用日期时间函数使用
MySQL Date 函数 下面的表格列出了 MySQL 中最重要的内建日期函数: 函数 描述 NOW() 返回当前的日期和时间 CURDATE() 返回当前的日期 CURTIME() 返回当前的时间 ...
- memory_limit的一个bug | 风雪之隅
原文:memory_limit的一个bug | 风雪之隅 27 Nov 09 memory_limit的一个bug 作者: Laruence( ) 本文地址: http://www.laruence. ...
- debian linux 下安装 netbeans(php)
1.安装netbians依赖jdk7 ,所以第一步是 apt-get install openjdk-7-jre 2.安装netbians 通过wget http://dlc.sun.com.edg ...
- [转]Altium Designer 发现的机密
转载自CrazyBingo博客. 进入电子设个世界,PCB是少不了的东西,刚开始画板子的时候,感觉好神奇.那个时候用的是Altium Designer Summer 08 ,现在用的是Altium D ...
- LeetCode Basic Calculator
原题链接在这里:https://leetcode.com/problems/basic-calculator/ Implement a basic calculator to evaluate a s ...
- 网页加载图片问题 插件lazyload
有些项目的,是满屏的背景图片 ,导致页面加载的速度,有简单处理的方法有两个: 1.将背景分割成几分
- C++ version the delaunay triangulation
https://github.com/Bl4ckb0ne/delaunay-triangulation
- Metro之Popup控件的使用(登录)
最终实现效果如下: 添加用户控件LoginPage.xaml,前台代码 <Popup x:Name="LoginPopup" Width="{Binding Ele ...