本文整理匯總了Java中android.widget.EditText.postDelayed方法的典型用法代碼示例。如果您正苦於以下問題:Java EditText.postDelayed方法的具體用法?Java EditText.postDelayed怎麽用?Java EditText.postDelayed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.widget.EditText
的用法示例。
在下文中一共展示了EditText.postDelayed方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setAutofocus
import android.widget.EditText; //導入方法依賴的package包/類
@WXComponentProp(name = Constants.Name.AUTOFOCUS)
public void setAutofocus(boolean autofocus) {
if (getHostView() == null) {
return;
}
mAutoFocus = autofocus;
EditText inputView = getHostView();
if (mAutoFocus) {
inputView.setFocusable(true);
inputView.requestFocus();
inputView.setFocusableInTouchMode(true);
inputView.postDelayed(new Runnable() {
@Override
public void run() {
showSoftKeyboard();
}
}, 16);
} else {
inputView.postDelayed(new Runnable() {
@Override
public void run() {
hideSoftKeyboard();
}
}, 16);
}
}
示例2: showSoftKeyboardDelayed
import android.widget.EditText; //導入方法依賴的package包/類
public static void showSoftKeyboardDelayed(final EditText editText, long delay){
editText.postDelayed(new Runnable() {
@Override
public void run() {
InputMethodManager inputMethodManager = (InputMethodManager) editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.showSoftInput(editText, InputMethodManager.SHOW_IMPLICIT);
}
}, delay);
}
示例3: setNumber
import android.widget.EditText; //導入方法依賴的package包/類
private void setNumber(View row, String number) {
final EditText numberEdit = (EditText) row.findViewById(R.id.edit_number);
numberEdit.setText(number);
if (number == null || number.isEmpty()) {
numberEdit.postDelayed(new Runnable() {
@Override
public void run() {
numberEdit.requestFocus();
}
}, 100);
}
}
示例4: getInputViewLoacation
import android.widget.EditText; //導入方法依賴的package包/類
public static int[] getInputViewLoacation() {
final int[] locations = new int[2];
if (inputDialog != null || inputDialog.isShowing()) {
final EditText inputView = (EditText) inputDialog.getInputView();
inputView.postDelayed(new Runnable() {
@Override
public void run() {
inputView.getLocationInWindow(locations);
}
}, 500);
}
return locations;
}
示例5: showKeyboard
import android.widget.EditText; //導入方法依賴的package包/類
private void showKeyboard(final EditText etSearch) {
etSearch.postDelayed(new Runnable() {
public void run() {
etSearch.requestFocus();
}
}, 300);
}