use of com.taobao.weex.ui.view.WXEditText in project weex-example by KalicyZhou.
the class EditComponentTest method testEvent.
@Test
public void testEvent() throws Exception {
WXEditText view = component.getHostView();
view.performClick();
view.setText("");
view.requestFocus();
view.setText("hello");
view.clearFocus();
view.setText(null);
}
use of com.taobao.weex.ui.view.WXEditText in project weex-example by KalicyZhou.
the class AbstractEditComponent method initComponentHostView.
@Override
protected WXEditText initComponentHostView(@NonNull Context context) {
final WXEditText inputView = new WXEditText(context);
appleStyleAfterCreated(inputView);
return inputView;
}
use of com.taobao.weex.ui.view.WXEditText in project weex-example by KalicyZhou.
the class AbstractEditComponent method setValue.
@WXComponentProp(name = Constants.Name.VALUE)
public void setValue(String value) {
WXEditText view;
if ((view = getHostView()) == null) {
return;
}
view.setText(value);
view.setSelection(value == null ? 0 : value.length());
}
use of com.taobao.weex.ui.view.WXEditText in project weex-example by KalicyZhou.
the class AbstractEditComponent method focus.
@JSMethod
public void focus() {
WXEditText host = getHostView();
if (host != null && !host.hasFocus()) {
if (getParent() != null) {
getParent().ignoreFocus();
}
host.requestFocus();
host.setFocusable(true);
host.setFocusableInTouchMode(true);
showSoftKeyboard();
}
}
use of com.taobao.weex.ui.view.WXEditText in project weex-example by KalicyZhou.
the class AbstractEditComponent method blur.
@JSMethod
public void blur() {
WXEditText host = getHostView();
if (host != null && host.hasFocus()) {
if (getParent() != null) {
getParent().interceptFocus();
}
host.clearFocus();
hideSoftKeyboard();
}
}
Aggregations