Search in sources :

Example 36 with EditText

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());
}
Also used : EditText(android.widget.EditText) TextInputLayoutActivity(android.support.design.testapp.TextInputLayoutActivity) Activity(android.app.Activity) UiThreadTest(android.support.test.annotation.UiThreadTest) MediumTest(android.support.test.filters.MediumTest) Test(org.junit.Test)

Example 37 with EditText

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;
        }
    });
}
Also used : EditText(android.widget.EditText) KeyEvent(android.view.KeyEvent) TextView(android.widget.TextView)

Example 38 with EditText

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();
}
Also used : Context(android.content.Context) EditText(android.widget.EditText) AlertDialog(android.app.AlertDialog) TodoItem(com.example.sqlbrite.todo.db.TodoItem) DialogInterface(android.content.DialogInterface) View(android.view.View) RxTextView(com.jakewharton.rxbinding.widget.RxTextView) NonNull(android.support.annotation.NonNull) NonNull(android.support.annotation.NonNull)

Example 39 with EditText

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();
}
Also used : Context(android.content.Context) EditText(android.widget.EditText) AlertDialog(android.app.AlertDialog) DialogInterface(android.content.DialogInterface) View(android.view.View) RxTextView(com.jakewharton.rxbinding.widget.RxTextView) NonNull(android.support.annotation.NonNull) NonNull(android.support.annotation.NonNull)

Example 40 with EditText

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;
}
Also used : EditText(android.widget.EditText)

Aggregations

EditText (android.widget.EditText)655 View (android.view.View)309 TextView (android.widget.TextView)220 DialogInterface (android.content.DialogInterface)143 AlertDialog (android.app.AlertDialog)126 Button (android.widget.Button)126 Intent (android.content.Intent)99 LinearLayout (android.widget.LinearLayout)79 ImageView (android.widget.ImageView)61 AlertDialog (android.support.v7.app.AlertDialog)54 ScrollView (android.widget.ScrollView)52 LayoutInflater (android.view.LayoutInflater)48 AdapterView (android.widget.AdapterView)46 ViewGroup (android.view.ViewGroup)42 Editable (android.text.Editable)41 Context (android.content.Context)40 RecyclerView (android.support.v7.widget.RecyclerView)40 ListView (android.widget.ListView)39 Dialog (android.app.Dialog)36 Bundle (android.os.Bundle)36