Example usage for android.text.method PasswordTransformationMethod PasswordTransformationMethod

List of usage examples for android.text.method PasswordTransformationMethod PasswordTransformationMethod

Introduction

In this page you can find the example usage for android.text.method PasswordTransformationMethod PasswordTransformationMethod.

Prototype

PasswordTransformationMethod

Source Link

Usage

From source file:Main.java

public static void setPasswordType(EditText paramEditText, boolean paramBoolean) {
    if (!paramBoolean)
        return;/* www . j  a va2s.  co  m*/
    PasswordTransformationMethod localPasswordTransformationMethod = new PasswordTransformationMethod();
    paramEditText.setTransformationMethod(localPasswordTransformationMethod);
}

From source file:com.bobomee.android.common.util.EditUtil.java

/**
 * ??EditTextView/*from ww w  . ja  v a 2  s. co m*/
 */
public static void passEditText(EditText password) {
    password.setTypeface(Typeface.DEFAULT);
    password.setTransformationMethod(new PasswordTransformationMethod());
}

From source file:cm.aptoide.pt.webservices.login.CreateUser.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    AptoideThemePicker.setAptoideTheme(this);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.form_create_user);
    //      getSupportActionBar().setIcon(R.drawable.brand_padding);
    //      getSupportActionBar().setTitle(getString(R.string.registration));
    //      getSupportActionBar().setHomeButtonEnabled(true);
    //      getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    context = this;
    username_box = (EditText) findViewById(R.id.email_box);
    password_box = (EditText) findViewById(R.id.password_box);
    checkShowPass = (CheckBox) findViewById(R.id.show_create_passwd);
    checkShowPass.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            if (isChecked) {
                password_box.setTransformationMethod(null);
            } else {
                password_box.setTransformationMethod(new PasswordTransformationMethod());
            }//from w  ww . j  a v  a 2  s  .  co m
        }
    });
    checkShowPass.setEnabled(true);
}

From source file:com.miz.mizuu.AddNetworkFilesourceDialog.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

    setContentView(R.layout.addnetwork);

    server = (EditText) findViewById(R.id.server);
    domain = (EditText) findViewById(R.id.domain);
    username = (EditText) findViewById(R.id.username);
    password = (EditText) findViewById(R.id.password);
    password.setTypeface(Typeface.DEFAULT);
    password.setTransformationMethod(new PasswordTransformationMethod());
    anonymous = (CheckBox) findViewById(R.id.checkBox);
    guest = (CheckBox) findViewById(R.id.checkBox2);

    guest.setOnCheckedChangeListener(changeListener);
    anonymous.setOnCheckedChangeListener(changeListener);

    isMovie = getIntent().getExtras().getString("type").equals("movie");

    LocalBroadcastManager.getInstance(this).registerReceiver(mMessageReceiver,
            new IntentFilter("mizuu-network-search"));
}

From source file:com.miz.mizuu.fragments.AccountsFragment.java

@Override
public void onViewCreated(View v, Bundle savedInstanceState) {
    super.onViewCreated(v, savedInstanceState);

    traktUser = (EditText) v.findViewById(R.id.traktUsername);
    traktUser.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);

    traktPass = (EditText) v.findViewById(R.id.traktPassword);
    traktPass.setTypeface(Typeface.DEFAULT);
    traktPass.setTransformationMethod(new PasswordTransformationMethod());

    traktLogIn = (Button) v.findViewById(R.id.traktLogIn);
    traktLogIn.setOnClickListener(new OnClickListener() {
        @Override/* ww w. java 2 s.  c o  m*/
        public void onClick(View v) {
            new TraktLogin().execute();
        }
    });
    traktRemoveAccount = (Button) v.findViewById(R.id.traktRemoveAccount);
    traktRemoveAccount.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            traktRemove();
        }
    });
    traktSyncNow = (Button) v.findViewById(R.id.traktSyncNow);
    traktSyncNow.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            getActivity().startService(new Intent(getActivity(), TraktMoviesSyncService.class));
            getActivity().startService(new Intent(getActivity(), TraktTvShowsSyncService.class));
        }
    });

    syncTrakt = (CheckBox) v.findViewById(R.id.syncTrakt);
    syncTrakt.setChecked(settings.getBoolean(SYNC_WITH_TRAKT, true));
    syncTrakt.setOnCheckedChangeListener(new OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            Editor editor = settings.edit();
            editor.putBoolean(SYNC_WITH_TRAKT, isChecked);
            editor.apply();
        }
    });

    traktUser.setText(settings.getString(TRAKT_USERNAME, ""));
    if (TextUtils.isEmpty(settings.getString(TRAKT_PASSWORD, ""))) {
        traktPass.setText("");
        traktUser.setEnabled(true);
        traktPass.setEnabled(true);
        traktLogIn.setVisibility(View.VISIBLE);
        traktSyncNow.setVisibility(View.GONE);
        traktRemoveAccount.setVisibility(View.GONE);
        syncTrakt.setVisibility(View.GONE);
        syncTrakt.setChecked(false);
    } else {
        traktPass.setText("password");
        traktUser.setEnabled(false);
        traktPass.setEnabled(false);
        traktLogIn.setVisibility(View.GONE);
        traktSyncNow.setVisibility(View.VISIBLE);
        traktRemoveAccount.setVisibility(View.VISIBLE);
        syncTrakt.setVisibility(View.VISIBLE);
        ;
    }
}

From source file:com.undatech.opaque.dialogs.GetTextFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    android.util.Log.e(TAG, "onCreateView called");

    // Set title for this dialog
    getDialog().setTitle(title);//from w w  w . ja va 2s  .c om

    View v = inflater.inflate(R.layout.get_text, container, false);
    textBox = (EditText) v.findViewById(R.id.textBox);
    if (password) {
        textBox.setTransformationMethod(new PasswordTransformationMethod());
        textBox.setOnEditorActionListener(new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                boolean consumed = false;
                if (actionId == EditorInfo.IME_NULL) {
                    getDialog().dismiss();
                    consumed = true;
                }
                return consumed;
            }
        });
    }

    return v;
}

From source file:be.vbsteven.bmtodesk.RegistrationActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(android.R.style.Theme_Light_NoTitleBar);
    super.onCreate(savedInstanceState);
    setContentView(R.layout.registration);

    handler = new Handler();

    button = (Button) findViewById(R.id.but_create);
    button.setOnClickListener(new OnClickListener() {

        @Override/*from  ww  w  . ja  v a  2s . c om*/
        public void onClick(View v) {
            register();
        }

    });

    button = (Button) findViewById(R.id.but_login);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            checkLogin();
        }

    });

    CheckBox cb = (CheckBox) findViewById(R.id.cb_password);
    cb.setOnCheckedChangeListener(new OnCheckedChangeListener() {

        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            EditText password = (EditText) findViewById(R.id.et_password);
            if (isChecked) {
                password.setTransformationMethod(null);
            } else {
                password.setTransformationMethod(new PasswordTransformationMethod());
            }
        }
    });
}

From source file:pt.hive.cameo.activities.LoginActivity.java

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // saves a reference to the current instance under the self variable
    // so that it may be used by any clojure method
    final LoginActivity self = this;

    // tries to retrieve the extras set of parameters from the intent
    // and in case they exist, tries to retrieve the login path (parameter)
    Bundle extras = this.getIntent().getExtras();
    if (extras != null) {
        this.loginPath = extras.getString("LOGIN_PATH");
        this.logoId = extras.getInt("LOGO_ID");
    }/*w ww .  j  a v  a  2 s  .  c om*/

    // removes the title bar from the window (improves readability)
    // and then sets the login layout on it (starts the layout)
    this.requestWindowFeature(Window.FEATURE_NO_TITLE);
    this.setContentView(R.layout.login);

    // in case we've received a valid logo identifier the logo image must be
    // updated with the associated resource (customized view)
    if (this.logoId != 0) {
        Drawable logoResource = this.getResources().getDrawable(this.logoId);
        ImageView logo = (ImageView) this.findViewById(R.id.logo);
        logo.setImageDrawable(logoResource);
    }

    // retrieves the password edit text field and updates it to the
    // sans serif typeface and then updates the transformation method
    EditText password = (EditText) this.findViewById(R.id.password);
    password.setTypeface(Typeface.SANS_SERIF);
    password.setTransformationMethod(new PasswordTransformationMethod());
    password.setOnKeyListener(new OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if ((event.getAction() == KeyEvent.ACTION_DOWN) && (keyCode == KeyEvent.KEYCODE_ENTER)) {
                self.login();
            }
            return false;
        }
    });

    // retrieves the reference to the various button in the current activity
    // and registers the current instance as the click listener
    Button signIn = (Button) findViewById(R.id.sign_in);
    signIn.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View view) {
            self.login();
        }
    });
}

From source file:org.tomahawk.tomahawk_android.dialogs.RegisterConfigDialog.java

/**
 * Called when this {@link android.support.v4.app.DialogFragment} is being created
 */// ww w . j  a v  a  2  s.  com
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    String username = "";
    String password = "";
    if (getArguments() != null) {
        if (getArguments().containsKey(TomahawkFragment.PREFERENCEID)) {
            String authenticatorId = getArguments().getString(TomahawkFragment.PREFERENCEID);
            mAuthenticatorUtils = AuthenticatorManager.getInstance().getAuthenticatorUtils(authenticatorId);
        }
        if (getArguments().containsKey(TomahawkFragment.USERNAME_STRING)) {
            username = getArguments().getString(TomahawkFragment.USERNAME_STRING);
        }
        if (getArguments().containsKey(TomahawkFragment.PASSWORD_STRING)) {
            password = getArguments().getString(TomahawkFragment.PASSWORD_STRING);
        }
    }

    TextView headerTextView = (TextView) addScrollingViewToFrame(R.layout.config_textview);
    headerTextView.setText(mAuthenticatorUtils.getDescription());
    mUsernameEditText = (ConfigEdittext) addScrollingViewToFrame(R.layout.config_edittext);
    mUsernameEditText.setHint(mAuthenticatorUtils.getUserIdEditTextHintResId());
    mUsernameEditText.setText(username);
    mPasswordEditText = (ConfigEdittext) addScrollingViewToFrame(R.layout.config_edittext);
    mPasswordEditText.setHint(R.string.login_password);
    mPasswordEditText.setTypeface(Typeface.DEFAULT);
    mPasswordEditText.setInputType(InputType.TYPE_TEXT_VARIATION_PASSWORD);
    mPasswordEditText.setTransformationMethod(new PasswordTransformationMethod());
    mPasswordEditText.setText(password);
    mPasswordConfirmationEditText = (ConfigEdittext) addScrollingViewToFrame(R.layout.config_edittext);
    mPasswordConfirmationEditText.setHint(R.string.login_password_confirmation);
    mPasswordConfirmationEditText.setTypeface(Typeface.DEFAULT);
    mPasswordConfirmationEditText.setTransformationMethod(new PasswordTransformationMethod());
    mMailEditText = (ConfigEdittext) addScrollingViewToFrame(R.layout.config_edittext);
    mMailEditText.setHint(R.string.account_email_label);
    mMailEditText.setOnEditorActionListener(mOnKeyboardEnterListener);

    showSoftKeyboard(mUsernameEditText);

    setDialogTitle(mAuthenticatorUtils.getPrettyName() + ": " + getString(R.string.register));
    setStatus(new HatchetStubResolver(HatchetAuthenticatorUtils.HATCHET_PRETTY_NAME, null));
    setPositiveButtonText(R.string.register);
    setNegativeButtonText(R.string.cancel);
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(getDialogView());
    return builder.create();
}