Search in sources :

Example 66 with EditText

use of android.widget.EditText in project StandOut by pingpongboss.

the class WidgetsWindow method createAndAttachView.

@Override
public void createAndAttachView(final int id, FrameLayout frame) {
    LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.widgets, frame, true);
    final TextView status = (TextView) view.findViewById(R.id.status);
    final EditText edit = (EditText) view.findViewById(R.id.edit);
    final EditText edit2 = (EditText) view.findViewById(R.id.edit2);
    Button button = (Button) view.findViewById(R.id.button);
    button.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            String text = edit.getText().toString();
            String text2 = edit2.getText().toString();
            String changedText = "Entered: " + text + (text.length() == 0 || text2.length() == 0 ? "" : " and ") + text2;
            status.setText(changedText);
            edit.setText("");
            edit2.setText("");
            // update MultiWindow:0 when button is pressed
            // to show off the data sending framework
            Bundle data = new Bundle();
            data.putString("changedText", changedText);
            sendData(id, MultiWindow.class, DEFAULT_ID, DATA_CHANGED_TEXT, data);
        }
    });
}
Also used : EditText(android.widget.EditText) Button(android.widget.Button) Bundle(android.os.Bundle) LayoutInflater(android.view.LayoutInflater) OnClickListener(android.view.View.OnClickListener) TextView(android.widget.TextView) TextView(android.widget.TextView) View(android.view.View)

Example 67 with EditText

use of android.widget.EditText in project PocketHub by pockethub.

the class CreateCommentActivityTest method testEmptyCommentIsProhibited.

/**
     * Verify empty comment can't be created
     *
     * @throws Throwable
     */
public void testEmptyCommentIsProhibited() throws Throwable {
    View createMenu = view(id.m_apply);
    assertFalse(createMenu.isEnabled());
    final EditText comment = editText(id.et_comment);
    focus(comment);
    send("a");
    assertTrue(createMenu.isEnabled());
    sendKeys(KEYCODE_DEL);
    assertFalse(createMenu.isEnabled());
}
Also used : EditText(android.widget.EditText) View(android.view.View)

Example 68 with EditText

use of android.widget.EditText in project PocketHub by pockethub.

the class CreateGistActivityTest method testCreateWithNoInitialText.

/**
     * Create Gist with no initial text
     *
     * @throws Throwable
     */
public void testCreateWithNoInitialText() throws Throwable {
    View createMenu = view(id.m_apply);
    assertFalse(createMenu.isEnabled());
    EditText content = editText(id.et_gist_content);
    focus(content);
    send("gist content");
    assertTrue(createMenu.isEnabled());
}
Also used : EditText(android.widget.EditText) View(android.view.View)

Example 69 with EditText

use of android.widget.EditText in project PocketHub by pockethub.

the class CreateCommentActivityTest method testEmptyCommentIsProhitibed.

/**
     * Verify empty comment can't be created
     *
     * @throws Throwable
     */
public void testEmptyCommentIsProhitibed() throws Throwable {
    View createMenu = view(id.m_apply);
    assertFalse(createMenu.isEnabled());
    final EditText comment = editText(id.et_comment);
    focus(comment);
    send("a");
    assertTrue(createMenu.isEnabled());
    sendKeys(KEYCODE_DEL);
    assertFalse(createMenu.isEnabled());
}
Also used : EditText(android.widget.EditText) View(android.view.View)

Example 70 with EditText

use of android.widget.EditText in project PocketHub by pockethub.

the class EditIssueActivityTest method testSaveMenuEnabled.

/**
     * Verify save menu is properly enabled/disable depending on the issue have
     * a non-empty title
     *
     * @throws Throwable
     */
public void testSaveMenuEnabled() throws Throwable {
    View saveMenu = view(id.m_apply);
    assertFalse(saveMenu.isEnabled());
    EditText title = editText(id.et_issue_title);
    focus(title);
    send("a");
    assertTrue(saveMenu.isEnabled());
    sendKeys(KEYCODE_DEL);
    assertFalse(saveMenu.isEnabled());
}
Also used : EditText(android.widget.EditText) View(android.view.View)

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