private LayoutInflater inflater;
inflater = LayoutInflater.from(this);
View view = inflater.inflate(R.layout.dialog_set_password, null);
et_new_password_set = (EditText) view.findViewById(R.id.new_password_set);
et_new_password_again_set = (EditText) view.findViewById(R.id.new_password_again_set);
et_new_password_again_set.setOnEditorActionListener(editorActionListener);
// et_new_password_set.setKeyListener(keylistener);
// et_new_password_again_set.setKeyListener(keylistener);
et_new_password_set.addTextChangedListener(new MyTextWatcher(et_new_password_set));
et_new_password_again_set.addTextChangedListener(new MyTextWatcher(et_new_password_again_set));
et_new_password_set.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD
| InputType.TYPE_CLASS_TEXT);
et_new_password_again_set
.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD
| InputType.TYPE_CLASS_TEXT);
cb_show_pw_set = (CheckBox) view.findViewById(R.id.cb_show_pw_set);
cb_show_pw_set.setOnCheckedChangeListener(checkListener);
// TextView clearTv = (TextView) view.findViewById(R.id.clearPwd);
// clearTv.setOnClickListener(clearPwdListener);
setPWBuilder.setView(view);
dialog_set_password.xml:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ScrollView" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:scrollbars="vertical">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:gravity="left">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="@string/input_new_password" />
<EditText android:id="@+id/new_password_set" android:inputType="textPassword"
android:layout_width="fill_parent" android:layout_height="wrap_content"
style="@style/PwdInputStyle" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content" android:text="@string/input_new_password_again" />
<EditText android:id="@+id/new_password_again_set" android:inputType="textPassword"
android:layout_width="fill_parent" android:layout_height="wrap_content"
style="@style/PwdInputStyle" />
<CheckBox android:id="@+id/cb_show_pw_set"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:text="@string/show_password" />
<!--
<TextView android:id="@+id/clearPwd" android:text="@string/clear_password_from_file"
android:textColor="#0000ff" android:textSize="16sp" android:textStyle="bold"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
-->
</LinearLayout>
</ScrollView>
分享到:
相关推荐
在我们从Android小学生 进阶到 Android中学生的路上,肯定需要经历 自定义View。 大神已经给出了,最精简的Demo,我这里 顺水推舟,把一些基础知识 标记在代码之中,各位可以一边看源码 一边学基础。 觉得文章有用,...
android 自定义view比较综合的例子,涉及到一些复杂的实现效果,有一些基础的人可以参考下。
笔者之前已经写过了一些自定义View的文章,在此对其也就不从头说起了,如有兴趣的读者可以看一下笔者的前两篇文章。 [android 自定义view的使用(最佳demo——返回标题栏)]...
方式一:设置View的setOnTouchListener(),重写onTouch方法;方式二:实现view的onTouchEvent()方法。实现自定义view的拖动、点击事件。
android项目下对图片高斯模糊毛玻璃,自定义view,模糊程度可控制,高斯模糊毛玻璃,自定义view,模糊程度可控制
Android音频剪辑裁剪自定义view,拖动剪切音频的时长,滑动滑块实时显示对应的时间点,指针可以滑动
android自定义View实现SwitchView
Android中自定义View操作Android中自定义View操作Android中自定义View操作
首先是这次自定义View的效果图,是一张饼图。如果是用java写的话也就几十行,觉得换成Kotlin的话可能会更少。 示例代码 主要的功能是可以任设定数据的个数,我这里是4个数据,可以任意设定每个数据的颜色。 #####...
android 自定义view及自定义属性
Android自定义View实现转盘旋转的效果
博客《开发自定义View》对应源码,博客地址:http://blog.csdn.net/harvic880925/article/details/38295431
android使用自定义view和自定义button实现的小demo,可以实现button的点击变换背景等功能
根据声音大小变化的自定义View,长方形,圆柱形(仿音频)
根据鸿洋大神博客所写。自己的学习笔记。自定义View实现验证码。
android 自定义View界面大合集
android demo,自定义控件view,点击该自定义view,onclick随机生成数字
自定义View的详细流程,自定义控件的三种方式,自定义ViewGroup,以及事件拦截机制
什么是自定义View 为什么使用自定义View 如何自定义控件
方向控制自定义View Android方向控制自定义View Android方向控制自定义View Android