本文整理匯總了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);
}
示例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());
}
示例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);
}
示例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());
}
示例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();
}
示例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);
}
示例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();
}
}
});
}
});
}