use of android.widget.EditText in project material-components-android by material-components.
the class TextInputLayoutTest method testPasswordToggleDisable.
@Test
public void testPasswordToggleDisable() {
final Activity activity = activityTestRule.getActivity();
final EditText textInput = (EditText) activity.findViewById(R.id.textinput_edittext_pwd);
// Set some text on the EditText
onView(withId(R.id.textinput_edittext_pwd)).perform(typeText(INPUT_TEXT));
// Assert that the password is disguised
assertNotEquals(INPUT_TEXT, textInput.getLayout().getText().toString());
// Disable the password toggle
onView(withId(R.id.textinput_password)).perform(setPasswordVisibilityToggleEnabled(false));
// Check that the password toggle view is not visible
onView(withId(R.id.text_input_password_toggle)).check(matches(not(isDisplayed())));
// ...and that the password is disguised still
assertNotEquals(INPUT_TEXT, textInput.getLayout().getText().toString());
}
use of android.widget.EditText in project flow by square.
the class WelcomeView method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
EditText nameView = (EditText) findViewById(R.id.welcome_screen_name);
nameView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
Flow.get(view).set(new HelloScreen(view.getText().toString()));
return true;
}
});
}
use of android.widget.EditText in project sqlbrite by square.
the class NewItemFragment method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Context context = getActivity();
View view = LayoutInflater.from(context).inflate(R.layout.new_item, null);
EditText name = findById(view, android.R.id.input);
Observable.combineLatest(createClicked, RxTextView.textChanges(name), new Func2<String, CharSequence, String>() {
@Override
public String call(String ignored, CharSequence text) {
return text.toString();
}
}).observeOn(Schedulers.io()).subscribe(new Action1<String>() {
@Override
public void call(String description) {
db.insert(TodoItem.TABLE, new TodoItem.Builder().listId(getListId()).description(description).build());
}
});
return //
new AlertDialog.Builder(context).setTitle(R.string.new_item).setView(view).setPositiveButton(R.string.create, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
createClicked.onNext("clicked");
}
}).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
}
}).create();
}
use of android.widget.EditText in project sqlbrite by square.
the class NewListFragment method onCreateDialog.
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Context context = getActivity();
View view = LayoutInflater.from(context).inflate(R.layout.new_list, null);
EditText name = findById(view, android.R.id.input);
Observable.combineLatest(createClicked, RxTextView.textChanges(name), new Func2<String, CharSequence, String>() {
@Override
public String call(String ignored, CharSequence text) {
return text.toString();
}
}).observeOn(Schedulers.io()).subscribe(new Action1<String>() {
@Override
public void call(String name) {
db.insert(TodoList.TABLE, new TodoList.Builder().name(name).build());
}
});
return //
new AlertDialog.Builder(context).setTitle(R.string.new_list).setView(view).setPositiveButton(R.string.create, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
createClicked.onNext("clicked");
}
}).setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
@Override
public void onClick(@NonNull DialogInterface dialog, int which) {
}
}).create();
}
use of android.widget.EditText in project xabber-android by redsolution.
the class AccountInfoEditorFragment method setUpInputField.
private EditText setUpInputField(View rootView, int resourceId) {
EditText inputField = (EditText) rootView.findViewById(resourceId);
inputField.addTextChangedListener(this);
return inputField;
}
Aggregations