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);
}
});
}
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());
}
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());
}
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());
}
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());
}
Aggregations