自定义view

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>

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值