當前位置: 首頁>>代碼示例>>Java>>正文


Java HideReturnsTransformationMethod類代碼示例

本文整理匯總了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();
}
 
開發者ID:JackChan1999,項目名稱:letv,代碼行數:24,代碼來源:LoginActivity.java

示例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);
    }
 
開發者ID:oversecio,項目名稱:oversec_crypto,代碼行數:25,代碼來源:EditTextPasswordWithVisibilityToggle.java

示例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;
        }
    });
}
 
開發者ID:shenhuanet,項目名稱:LoginRegisterFramework,代碼行數:27,代碼來源:LoginActivity.java

示例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);
}
 
開發者ID:moezbhatti,項目名稱:qksms,代碼行數:24,代碼來源:SlideView.java

示例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);
}
 
開發者ID:tyzlmjj,項目名稱:AndroidUI,代碼行數:18,代碼來源:PasswordEditText.java

示例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);
}
 
開發者ID:qbeenslee,項目名稱:Nepenthes-Android,代碼行數:23,代碼來源:PasswordEdt.java

示例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());
            }
    }
}
 
開發者ID:hoang8f,項目名稱:AutoAP,代碼行數:21,代碼來源:MainActivity.java

示例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);
				}
			}
		});
	}
 
開發者ID:simplelifetian,項目名稱:GomeOnline,代碼行數:20,代碼來源:Regist3Activity.java

示例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);
}
 
開發者ID:CommonQ,項目名稱:sms_DualCard,代碼行數:22,代碼來源:SlideView.java

示例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);
}
 
開發者ID:jianjun0425,項目名稱:MultiFuncViewLibrary,代碼行數:39,代碼來源:MultiFuncEditText.java

示例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();
}
 
開發者ID:SShineTeam,項目名稱:Huochexing12306,代碼行數:13,代碼來源:RegisterActivity.java

示例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;
    }
 
開發者ID:HowieTianDev,項目名稱:ChenYan,代碼行數:14,代碼來源:RegisterActivity.java

示例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());
}
 
開發者ID:huang303513,項目名稱:Coding-Android,代碼行數:14,代碼來源:LoginEditText.java

示例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());
            }
        }
    });
}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:30,代碼來源:AccountBindActivity.java

示例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());
            }
        }
    });
}
 
開發者ID:LegendKe,項目名稱:MyTravelingDiary,代碼行數:32,代碼來源:LoginActivity.java


注:本文中的android.text.method.HideReturnsTransformationMethod類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。