本文整理汇总了Java中android.text.method.HideReturnsTransformationMethod类的典型用法代码示例。如果您正苦于以下问题:Java HideReturnsTransformationMethod类的具体用法?Java HideReturnsTransformationMethod怎么用?Java HideReturnsTransformationMethod使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HideReturnsTransformationMethod类属于android.text.method包,在下文中一共展示了HideReturnsTransformationMethod类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: beautyView
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
private void beautyView() {
beautyEditText(this.mInputAccount, L10NString.getString("umgr_please_input_username"), this.mAccountTextWatcher);
beautyCleanButton(this.mClearInputAccount, this);
this.mInputAccountLayout.setOnClickListener(this);
beautyCleanButton(this.mClearInputPassword, this);
this.mInputPassword.setOnClickListener(this);
beautyEditText(this.mInputPassword, L10NString.getString("umgr_please_input_password"), this.mPasswordTextWatcher);
beautyColorTextView(this.mRegister, "#007dc4", false, L10NString.getString("umgr_whether_register_ornot"), this);
beautyColorTextView(this.mFindpwd, "#007dc4", false, L10NString.getString("umgr_whether_forget_password"), this);
beautyColorTextView(this.mSwitchAccount, "#007dc4", false, L10NString.getString("umgr_third_login_qihoo_tip"), this);
beautyButtonGreen(this.mLogin, L10NString.getString("umgr_login"), this);
beautyTextView(this.mAgreeClause1, L10NString.getString("umgr_login_agree_clause_1"));
beautyTextView(this.mAgreeClauseUser, L10NString.getString("umgr_agree_clause_2_user"));
beautyColorTextView(this.mAgreement, "#0099e5", true, L10NString.getString("umgr_agree_clause_2_agreement"), this);
beautyTextView(this.mAnd, L10NString.getString("umgr_agree_clause_2_and"));
beautyColorTextView(this.mPrivacy, "#0099e5", true, L10NString.getString("umgr_agree_clause_2_privacy"), this);
beautyCheckButton(this.mShowPwd, new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
LoginActivity.this.mInputPassword.setTransformationMethod(LoginActivity.this.mShowPwd.isChecked() ? HideReturnsTransformationMethod.getInstance() : PasswordTransformationMethod.getInstance());
}
});
loadPrivateConfig();
}
示例2: updatePasswordVisibility
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
private void updatePasswordVisibility() {
if (mPasswordVisible) {
setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
setTransformationMethod(PasswordTransformationMethod.getInstance());
}
Drawable drawable = ContextCompat.getDrawable(getContext(),R.drawable.ic_remove_red_eye_black_18dp);
Drawable wrap = DrawableCompat.wrap(drawable);
if (mPasswordVisible) {
DrawableCompat.setTint(wrap, ContextCompat.getColor(getContext(), R.color.colorPrimary));
DrawableCompat.setTintMode(wrap, PorterDuff.Mode.SRC_IN);
wrap = wrap.mutate();
} else {
DrawableCompat.setTint(wrap, Color.BLACK);
DrawableCompat.setTintMode(wrap, PorterDuff.Mode.SRC_IN);
wrap = wrap.mutate();
}
setCompoundDrawablesWithIntrinsicBounds(null, null, wrap, null);
setCompoundDrawablePadding(10);
}
示例3: initViews
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
/**
* 初始化视图
*/
private void initViews() {
accountEdit = (CleanEditText) this.findViewById(R.id.et_email_phone);
accountEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);
accountEdit.setTransformationMethod(HideReturnsTransformationMethod
.getInstance());
passwordEdit = (CleanEditText) this.findViewById(R.id.et_password);
passwordEdit.setImeOptions(EditorInfo.IME_ACTION_DONE);
passwordEdit.setImeOptions(EditorInfo.IME_ACTION_GO);
passwordEdit.setTransformationMethod(PasswordTransformationMethod
.getInstance());
passwordEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId,
KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE
|| actionId == EditorInfo.IME_ACTION_GO) {
clickLogin();
}
return false;
}
});
}
示例4: setText
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
public void setText(String name, String text) {
if (!mConformanceMode) {
if (null == mScrollText) {
mScrollText = new ScrollView(mContext);
mScrollText.setScrollBarStyle(SCROLLBARS_OUTSIDE_INSET);
addView(mScrollText, new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 0, 0));
if (DEBUG) {
mScrollText.setBackgroundColor(0xFF00FF00);
}
}
if (null == mTextView) {
mTextView = new TextView(mContext);
mTextView.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
mScrollText.addView(mTextView);
}
mScrollText.requestFocus();
}
mTextView.setVisibility(View.VISIBLE);
mTextView.setText(text);
// Let the text in Mms can be selected.
mTextView.setTextIsSelectable(true);
}
示例5: onTouchEvent
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
boolean touchable = ( getWidth() - mWidth - Interval < event.getX() ) && (event.getX() < getWidth() - Interval);
if (touchable) {
isVisible = !isVisible;
if (isVisible){
//设置EditText文本为可见的
setTransformationMethod(HideReturnsTransformationMethod.getInstance());
}else{
//设置EditText文本为隐藏的
setTransformationMethod(PasswordTransformationMethod.getInstance());
}
}
}
return super.onTouchEvent(event);
}
示例6: onTouchEvent
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
@Override
public boolean onTouchEvent(MotionEvent event) {
final int lens = this.getText().toString().length();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
boolean isClean = (event.getX() > (getWidth() - getTotalPaddingRight())) && (event.getX() < (getWidth() - getPaddingRight()));
if (isClean) {
this.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
setSelection(lens);
}
}
break;
case MotionEvent.ACTION_UP: {
this.setTransformationMethod(PasswordTransformationMethod.getInstance());
setSelection(lens);
}
break;
default:
break;
}
return super.onTouchEvent(event);
}
示例7: onCheckedChanged
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
switch (buttonView.getId()) {
case R.id.ap_button:
if (isChecked) {
//Turn on AP
enableAP();
} else {
//Turn off AP
disableAP();
}
break;
case R.id.checkBox:
if (!isChecked) {
passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
} else {
passwordEditText.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
}
}
}
示例8: init
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
@AfterViews
protected void init() {
setTitle(R.string.regist3);
// phone="11112345685";
passwdCheck.setOnCheckedChangeListener(new OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if(isChecked){
// mEditTextPw.setInputType(InputType.TYPE_TEXT_VARIATION_NORMAL);
mEditTextPw.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
mEditTextPw.setSelection(mEditTextPw.getText().length());
}else{
mEditTextPw.setTransformationMethod(PasswordTransformationMethod.getInstance());
mEditTextPw.setSelection(mEditTextPw.getText().length());
// mEditTextPw.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
}
}
});
}
示例9: setText
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
public void setText(String name, String text) {
if (!mConformanceMode) {
if (null == mScrollText) {
mScrollText = new ScrollView(mContext);
mScrollText.setScrollBarStyle(SCROLLBARS_OUTSIDE_INSET);
addView(mScrollText, new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, 0, 0));
if (DEBUG) {
mScrollText.setBackgroundColor(0xFF00FF00);
}
}
if (null == mTextView) {
mTextView = new TextView(mContext);
mTextView.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
mScrollText.addView(mTextView);
}
mScrollText.requestFocus();
}
mTextView.setVisibility(View.VISIBLE);
mTextView.setText(text);
}
示例10: onTouchEvent
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
/**
* 因为我们不能直接给EditText设置点击事件,所以我们用记住我们按下的位置来模拟点击事件
* 当我们按下的位置在 EditText的宽度 - 图标到控件右侧的间距 - 图标的宽度 和
* EditText的宽度 - 图标到控件右侧的间距 之间我们就算点击了图标,竖直方向没有考虑
* @param event
* @return
*/
@Override
public boolean onTouchEvent(MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_UP){
if(getCompoundDrawables()[2] != null){
boolean isTouched = event.getX() > (getWidth() - getTotalPaddingRight())
&& (event.getX() < (getWidth() - getPaddingLeft()));
if(isTouched){
if(mRightClickListener == null){
if(funcType == TYPE_CAN_CLEAR){
this.setText("");
}else if(funcType == TYPE_CAN_WATCH_PWD){
if(eyeOpen){
//变为密文,TYPE_CLASS_TEXT 和 TYPE_TEXT_VARIATION_PASSWORD 必须一起使用
this.setTransformationMethod(PasswordTransformationMethod.getInstance());
eyeOpen = false;
}else{
//变为明文
this.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
eyeOpen = true;
}
switchWatchPwdIcon();
}
}else {
//如果没有则回调
mRightClickListener.onClick(this);
}
}
}
}
return super.onTouchEvent(event);
}
示例11: setPwdVisible
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
private void setPwdVisible(boolean b) {
if (!b){
ivEye.setBackgroundResource(R.drawable.eye_close);
ivEye.setTag(false);
etPwd.setTransformationMethod(PasswordTransformationMethod.getInstance());
}else{
ivEye.setBackgroundResource(R.drawable.eye_open);
ivEye.setTag(true);
etPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
}
etPwd.invalidate();
}
示例12: showPwd
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
@OnClick(R.id.iv_pwd)
public void showPwd() {
// 明文显示
if (isShow) {
etPwd.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
ivPwd.setImageResource(R.drawable.ic_visibility_blue_500_24dp);
} else {
// 密码显示
etPwd.setTransformationMethod(PasswordTransformationMethod.getInstance());
ivPwd.setImageResource(R.drawable.ic_visibility_off_grey_500_24dp);
}
isShow = !isShow;
}
示例13: togglePassword
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
private void togglePassword() {
showPassword = !showPassword;
if (showPassword) {
imageValidfy.setImageResource(R.drawable.ic_password_show);
editText.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
imageValidfy.setImageResource(R.drawable.ic_password_normal);
editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
editText.setSelection(editText.length());
}
示例14: initListener
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
private void initListener() {
mainLayout.setOnSoftKeyboardVisibilityChangeListener(
new SoftKeyboardHandledLinearLayout.SoftKeyboardVisibilityChangeListener() {
@Override
public void onSoftKeyboardShow() {
avatarLayout.setVisibility(View.GONE);
listenerSoftInput();
}
@Override
public void onSoftKeyboardHide() {
avatarLayout.setVisibility(View.VISIBLE);
listenerSoftInput();
}
});
mShow.setOnToggleChanged(new SwitchButton.OnToggleChanged() {
@Override
public void onToggle(boolean isChecked) {
if (isChecked) {
//如果选中,显示密码
mPasswordEditText.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
//否则隐藏密码
mPasswordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
}
});
}
示例15: initListener
import android.text.method.HideReturnsTransformationMethod; //导入依赖的package包/类
private void initListener() {
mainLayout.setOnSoftKeyboardVisibilityChangeListener(
new SoftKeyboardHandledLinearLayout.SoftKeyboardVisibilityChangeListener() {
@Override
public void onSoftKeyboardShow() {
avatarLayout.setVisibility(View.GONE);
bottomLayout.setVisibility(View.VISIBLE);
listenerSoftInput();
}
@Override
public void onSoftKeyboardHide() {
avatarLayout.setVisibility(View.VISIBLE);
bottomLayout.setVisibility(View.VISIBLE);
listenerSoftInput();
}
});
mShow.setOnToggleChanged(new SwitchButton.OnToggleChanged() {
@Override
public void onToggle(boolean isChecked) {
if (isChecked) {
//如果选中,显示密码
mPasswordEditText.setTransformationMethod(HideReturnsTransformationMethod.getInstance());
} else {
//否则隐藏密码
mPasswordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
}
}
});
}