TextView setTransformationMethod - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for TextView setTransformationMethod method.

This code example shows how to use the following methods:setSelection, getSelectionEnd, getSelectionStart, setTransformationMethod
    toggleShowPassphrase(passphrase, isChecked);
    toggleShowPassphrase(confirm, isChecked);
  } 
 
  private void toggleShowPassphrase(EditText field, boolean isChecked) {
    int start=field.getSelectionStart();
    int end=field.getSelectionEnd();
 
    if (isChecked) {
      field.setTransformationMethod(null);
    } 
    else { 
      field.setTransformationMethod(new PasswordTransformationMethod());
    } 
 
    field.setSelection(start, end);
  } 
 
  @Override 
  public void onClick(View v) {
    v.setEnabled(false);
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setSelection, getSelectionEnd, getSelectionStart, setTransformationMethod
                                                   .toString());
  } 
 
  @Override 
  public void onCheckedChanged(CompoundButton cb, boolean isChecked) {
    int start=passphrase.getSelectionStart();
    int end=passphrase.getSelectionEnd();
 
    if (isChecked) {
      passphrase.setTransformationMethod(null);
    } 
    else { 
      passphrase.setTransformationMethod(new PasswordTransformationMethod());
    } 
 
    passphrase.setSelection(start, end);
  } 
 
  void populate(int id, String _title, String _passphrase) {
    this.id=id;
    title.setText(_title);
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setKeyListener, setSingleLine, setTransformationMethod
        super.onBindDialogView(view);
         
        final EditText editText = (EditText) view.findViewById(android.R.id.edit);
         
        if (editText != null) {
            editText.setSingleLine(true);
            editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
            editText.setKeyListener(DigitsKeyListener.getInstance());
        } 
    } 
 
    public boolean isDialogOpen() { 
        return mDialogOpen;
    } 
     
    @Override 
    protected void onDialogClosed(boolean positiveResult) {
        super.onDialogClosed(positiveResult);
        mDialogOpen = false;
        if (mPinListener != null) {
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTransformationMethod
		if(enable) {
			mEditText.setTransformationMethod(
					new android.text.method.PasswordTransformationMethod());
		} 
		else { 
			mEditText.setTransformationMethod(
					new android.text.method.SingleLineTransformationMethod());
		} 
	} 
	 
	public void setAllowEmptyText(boolean enable) {
		mAllowEmptyText = enable;
	} 
	 
	public String getText() {
		return mEditText.getText().toString();
	} 
	 
	public void setText(String text) {
		mEditText.setText(text);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTransformationMethod
		if(enable) {
			mEditText.setTransformationMethod(
					new android.text.method.PasswordTransformationMethod());
		} 
		else { 
			mEditText.setTransformationMethod(
					new android.text.method.SingleLineTransformationMethod());
		} 
	} 
	 
	public void setAllowEmptyText(boolean enable) {
		mAllowEmptyText = enable;
	} 
	 
	public String getText() {
		return mEditText.getText().toString();
	} 
	 
	public void setText(String text) {
		mEditText.setText(text);
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setTransformationMethod
		editText.setVisibility(VISIBLE);
	} 
	 
	public void setPassword() 
	{ 
		editText.setTransformationMethod(PasswordTransformationMethod.getInstance());
	} 
 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java

Related TextView setTransformationMethod Questions & Answers:

setTransformationMethod Method Overview
Sets the transformation that is applied to the text that this TextView is displaying.
See Code Examples for other Android TextView Methods: