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


Java EditText.setTransformationMethod方法代碼示例

本文整理匯總了Java中android.widget.EditText.setTransformationMethod方法的典型用法代碼示例。如果您正苦於以下問題:Java EditText.setTransformationMethod方法的具體用法?Java EditText.setTransformationMethod怎麽用?Java EditText.setTransformationMethod使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.EditText的用法示例。


在下文中一共展示了EditText.setTransformationMethod方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initializeViewComponents

import android.widget.EditText; //導入方法依賴的package包/類
private void initializeViewComponents() {
    logInGoogleBtn = (Button) findViewById(R.id.log_in_google_btn);
    logInDefaultBtn = (Button) findViewById(R.id.log_in_default_btn);
    registerBtn = (TextView) findViewById(R.id.register_btn);
    forgotPasswordBtn = (TextView) findViewById(R.id.forgot_password_btn);
    regulations = (TextView) findViewById(R.id.regulations_btn);

    emailText = (EditText) findViewById(R.id.email_login_text);
    emailText.setSelected(false);

    updateRememberedEmail();

    passwordText = (EditText) findViewById(R.id.password_login_text);
    passwordText.setTypeface(Typeface.DEFAULT);
    passwordText.setTransformationMethod(new PasswordTransformationMethod());
    passwordText.setSelected(false);
}
 
開發者ID:lmnpWmi,項目名稱:wirtualnaApteczka,代碼行數:18,代碼來源:LogInActivity.java

示例2: onCreate

import android.widget.EditText; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_registration);

    registerRegulationsBtn = (TextView) findViewById(R.id.register_regulations_btn);
    registerRegulationsBtn.setOnClickListener(new RegulationsOnClickListener());

    registerNewUserBtn = (Button) findViewById(R.id.register_new_user_btn);
    registerNewUserBtn.setOnClickListener(new RegisterNewUserOnClickListener());

    passwordEditText = (EditText) findViewById(R.id.register_password_text);
    passwordEditText.setTypeface(Typeface.DEFAULT);
    passwordEditText.setTransformationMethod(new PasswordTransformationMethod());

    repeatPasswordEditText = (EditText) findViewById(R.id.register_password_repeat_text);
    repeatPasswordEditText.setTypeface(Typeface.DEFAULT);
    repeatPasswordEditText.setTransformationMethod(new PasswordTransformationMethod());
}
 
開發者ID:lmnpWmi,項目名稱:wirtualnaApteczka,代碼行數:20,代碼來源:RegistrationActivity.java

示例3: onCheckedChanged

import android.widget.EditText; //導入方法依賴的package包/類
@Override
public void onCheckedChanged(final CompoundButton buttonView, final boolean isChecked) {
    final TransformationMethod transformationMethod = isChecked ? null : PasswordTransformationMethod.getInstance();

    for (final EditText passwordView : passwordViews)
        passwordView.setTransformationMethod(transformationMethod);
}
 
開發者ID:guodroid,項目名稱:okwallet,代碼行數:8,代碼來源:ShowPasswordCheckListener.java

示例4: setupEditText

import android.widget.EditText; //導入方法依賴的package包/類
protected void setupEditText(EditText editText) {
	editText.setInputType(InputType.TYPE_NULL);
	editText.setFilters(filters);
	editText.setOnTouchListener(touchListener);
	editText.setTransformationMethod(PasswordTransformationMethod
			.getInstance());
}
 
開發者ID:sdrausty,項目名稱:buildAPKsApps,代碼行數:8,代碼來源:AppLockActivity.java

示例5: showDialog

import android.widget.EditText; //導入方法依賴的package包/類
private void showDialog(List<EncdroidProviderParameter> questions){
	
	if (questions==null || questions.size()==0) {
       	//if (activity instanceof Fillable){
       		try {
       			//this.init("/");*
       			finishFileProviderInit();
       		} catch (Exception e){
       			e.printStackTrace();
       			String exceptionLabel = e.getMessage();
       			if (exceptionLabel==null) exceptionLabel=e.toString();
       			Toast.makeText(this.getApplicationContext(),exceptionLabel, Toast.LENGTH_LONG).show();
       			//ask again parameters question to the user
       			if (instance.getParamsToAsk()!=null && instance.getParamsToAsk().size()>0){
       				this.showDialog( instance.getParamsToAsk());
       			}
       			return;
       		}
       	//}			
   		//this.ready=true;
  			//((Fillable)activity).launchFillTask();			
		return;
	}
	
    AlertDialog.Builder alert = new AlertDialog.Builder(this);                 
    alert.setTitle(questions.get(0).getTitle());  
    alert.setMessage(questions.get(0).getLabel());
     

     // Set an EditText view to get user input   
     final EditText input = new EditText(this);
     if (questions.get(0).isPassword()) {
    	 input.setTransformationMethod(PasswordTransformationMethod.getInstance());
    	 input.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); 
     }
     alert.setView(input);
        alert.setPositiveButton("Ok", new ClickListener(this,instance,input,questions));  
        alert.show();
}
 
開發者ID:starn,項目名稱:encdroidMC,代碼行數:40,代碼來源:FileProviderActivity.java

示例6: onCreate

import android.widget.EditText; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.activity_config_sync);
	

	
	volumeName = (EditText) findViewById(R.id.volumeName);
	//volumeName.setFocusable(false);
	
	volumePath = (EditText) findViewById(R.id.volumePath);
	//volumePath.setFocusable(false);
	
	password = (EditText) findViewById(R.id.volumePassword);
	password.setTransformationMethod(PasswordTransformationMethod.getInstance());
	password.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); 
	
	onlyWifiCheckBox = ((CheckBox) findViewById(R.id.onlyWifi));
	removeAfterCheckBox = ((CheckBox) findViewById(R.id.removeAfter));
	localFolder = ((EditText) findViewById(R.id.localFolder));
	syncID = ((EditText) findViewById(R.id.syncID));
	syncID.setFocusable(false);
	
	
	spin1=(Spinner) findViewById(R.id.selectedRule);
	ArrayAdapter<String> adapter=new ArrayAdapter<String>(ConfigSyncActivity.this, android.R.layout.simple_spinner_item, rules);
	adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
	spin1.setAdapter(adapter);
	spin1.setOnTouchListener(this);
	spin1.setOnItemSelectedListener((OnItemSelectedListener) this);
	
	refresh(null);

	
}
 
開發者ID:starn,項目名稱:encdroidMC,代碼行數:36,代碼來源:ConfigSyncActivity.java

示例7: onCreate

import android.widget.EditText; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_login);

    final EditText usernameEditText = (EditText) findViewById(R.id.editText_username);
    final EditText passwordEditText = (EditText) findViewById(R.id.editText_password);
    passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());

    findViewById(R.id.button_login).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View v) {
            String username = usernameEditText.getText().toString();
            String password = passwordEditText.getText().toString();
            LoginRequest loginRequest = new LoginRequest(username, password);

            Atom.with(LoginActivity.this)
                    .load("https://reqres.in/api/login")
                    .setJsonPojoBody(loginRequest)
                    .as(LoginResponse.class)
                    .setCallback(new FutureCallback<LoginResponse>() {
                        @Override
                        public void onCompleted(Exception e, LoginResponse result) {
                            if (e != null) {
                                e.printStackTrace();
                            } else if (result.token != null) {
                                Snackbar.make(v, "Pass : " + result.token, Snackbar.LENGTH_LONG).show();
                            } else if (result.error != null) {
                                Snackbar.make(v, "Fail : " + result.error, Snackbar.LENGTH_LONG).show();
                            }
                        }
                    });



        }
    });


}
 
開發者ID:shiburagi,項目名稱:Atomic,代碼行數:41,代碼來源:LoginActivity.java


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