예제 #1
1
  private void initViews() {
    body = (RelativeLayout) findViewById(R.id.body);
    loadingoverlay = (LoadingOverlay) findViewById(R.id.loadingoverlay);

    registerTV = (TextView) findViewById(R.id.registerTV);
    findpwdTV = (TextView) findViewById(R.id.findpwdTV);

    userNameET = (ExEditText) findViewById(R.id.userNameET);
    passwordET = (ExEditText) findViewById(R.id.passwordET);
    loginButton = (Button) findViewById(R.id.loginButton);

    EditText pwdinneret = passwordET.getEditText();
    int pl = pwdinneret.getPaddingLeft();
    pwdinneret.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
    pwdinneret.setBackgroundDrawable(getResources().getDrawable(R.drawable.blue_input_bg));
    pwdinneret.setPadding(pl, 0, 0, 0); // 如果同时用,setPadding 将不会起作用,用的是
    // drawable里面自带的padding。setPadding要在setBackgroundDrawable之后执行才能生效
    pwdinneret.setFilters(new InputFilter[] {new InputFilter.LengthFilter(20)});

    EditText usernameinneret = userNameET.getEditText();
    pl = usernameinneret.getPaddingLeft();
    usernameinneret.setBackgroundDrawable(getResources().getDrawable(R.drawable.blue_input_bg));
    usernameinneret.setPadding(pl, 0, 0, 0);
    usernameinneret.setFilters(new InputFilter[] {new InputFilter.LengthFilter(20)});
  }
  private void initViews() {
    loadingoverlay = (LoadingOverlay) findViewById(R.id.loadingoverlay);
    findpwd_pwd_ET = (ExEditText) findViewById(R.id.findpwd_pwd_ET);
    findpwd_pwd1_ET = (ExEditText) findViewById(R.id.findpwd_pwd1_ET);
    btn_title_left = (Button) findViewById(R.id.btn_title_left);
    tv_top_title = (TextView) findViewById(R.id.tv_top_title);
    btn_title_right = (Button) findViewById(R.id.btn_title_right);

    btn_title_right.setText(R.string.next);
    tv_top_title.setText(R.string.findpwdtitle);

    EditText pwd1inneret = findpwd_pwd1_ET.getEditText();

    pwd1inneret.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);

    pwd1inneret.setFilters(new InputFilter[] {new InputFilter.LengthFilter(20)});

    EditText pwdinneret = findpwd_pwd_ET.getEditText();
    pwdinneret.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);

    pwdinneret.setFilters(new InputFilter[] {new InputFilter.LengthFilter(20)});
  }