android.widget.EditText.postDelayed()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(7.6k)|赞(0)|评价(0)|浏览(233)

本文整理了Java中android.widget.EditText.postDelayed()方法的一些代码示例,展示了EditText.postDelayed()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。EditText.postDelayed()方法的具体详情如下:
包路径:android.widget.EditText
类名称:EditText
方法名:postDelayed

EditText.postDelayed介绍

暂无

代码示例

代码示例来源:origin: wangdan/AisenWeiBo

private void hideEmotionView(boolean showKeyBoard) {
  if (layEmotion.isShown()) {
    if (showKeyBoard) {
      LinearLayout.LayoutParams localLayoutParams = (LinearLayout.LayoutParams) layContainer.getLayoutParams();
      localLayoutParams.height = layEmotion.getTop();
      localLayoutParams.weight = 0.0F;
      layEmotion.setVisibility(View.GONE);
      getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
      SystemUtils.showKeyBoard(getActivity(), editContent);
      editContent.postDelayed(new Runnable() {
        @Override
          public void run() {
            unlockContainerHeightDelayed();
          }
      }, 200L);
    } else {
      layEmotion.setVisibility(View.GONE);
      getActivity().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
      unlockContainerHeightDelayed();
    }
  }
}

代码示例来源:origin: weexteam/weex-hackernews

@Override
 public boolean postDelayed(Runnable action, long delayMillis) {
  return super.postDelayed(WXThread.secure(action), delayMillis);
 }
}

代码示例来源:origin: googlesamples/android-FingerprintDialog

/**
 * Switches to backup (password) screen. This either can happen when fingerprint is not
 * available or the user chooses to use the password authentication method by pressing the
 * button. This can also happen when the user had too many fingerprint attempts.
 */
private void goToBackup() {
  mStage = Stage.PASSWORD;
  updateStage();
  mPassword.requestFocus();
  // Show the keyboard.
  mPassword.postDelayed(mShowKeyboardRunnable, 500);
  // Fingerprint is not used anymore. Stop listening for it.
  mFingerprintUiHelper.stopListening();
}

代码示例来源:origin: florent37/MaterialTextField

public void setHasFocus(boolean hasFocus) {
  this.hasFocus = hasFocus;
  if (hasFocus) {
    expand();
    editText.postDelayed(new Runnable() {
      public void run() {
        editText.requestFocusFromTouch();
        inputMethodManager.showSoftInput(editText, 0);
      }
    }, 300);
  } else {
    reduce();
  }
}

代码示例来源:origin: scola/Qart

Log.d(TAG, "REQUEST_SEND_QR_TEXT");
final String text = data.getExtras().getString("import");
mEditTextView.postDelayed(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: dss886/Android-EmotionInputDetector

private void unlockContentHeightDelayed() {
  mEditText.postDelayed(new Runnable() {
    @Override
    public void run() {
      ((LinearLayout.LayoutParams) mContentView.getLayoutParams()).weight = 1.0F;
    }
  }, 200L);
}

代码示例来源:origin: huangfangyi/YiChat

private void unlockContentHeightDelayed() {
  et_sendmessage.postDelayed(new Runnable() {
    @Override
    public void run() {
      ((LinearLayout.LayoutParams) mContentView.getLayoutParams()).weight = 1.0F;
    }
  }, 200L);
}

代码示例来源:origin: quaap/LaunchTime

@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
  mTextHolder.postDelayed(new Runnable() {
    @Override
    public void run() {
      refreshCursor();
    }
  },10);
}

代码示例来源:origin: shinezejian/emotionkeyboard

/**
 * 释放被锁定的内容高度
 */
private void unlockContentHeightDelayed() {
  mEditText.postDelayed(new Runnable() {
    @Override
    public void run() {
      ((LinearLayout.LayoutParams) mContentView.getLayoutParams()).weight = 1.0F;
    }
  }, 200L);
}

代码示例来源:origin: YiChat/android_YiChat_Lite

private void unlockContentHeightDelayed() {
  et_sendmessage.postDelayed(new Runnable() {
    @Override
    public void run() {
      ((LayoutParams) mContentView.getLayoutParams()).weight = 1.0F;
    }
  }, 200L);
}

代码示例来源:origin: SamuelGjk/GComic

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

代码示例来源:origin: balrampandey19/AppLocker

private void clearFields() {
    codeField1.setText("");
    codeField2.setText("");
    codeField3.setText("");
    codeField4.setText("");

    codeField1.postDelayed(new Runnable() {

      @Override
      public void run() {
        codeField1.requestFocus();
      }
    }, 200);
  }
}

代码示例来源:origin: com.albedinsky.android/ui-widget-input

/**
   */
  @Override
  public void afterTextChanged(final Editable s) {
    // Workaround to handle empty text changes even when there should be some text presented
    // within EditText widget. There seams to be a problem when deleting text within EditText
    // which contains some whitespace. In such a case EditText fires this callback with an
    // empty text and right after that with text that is really presented within EditText.
    mEditText.removeCallbacks(EDITABLE_CHANGE);
    mEditText.postDelayed(EDITABLE_CHANGE, EDITABLE_CHANGE_DELAY);
  }
};

代码示例来源:origin: com.albedinsky.android/ui

/**
   */
  @Override
  public void afterTextChanged(final Editable s) {
    // Workaround to handle empty text changes even when there should be some text presented
    // within EditText widget. There seams to be a problem when deleting text within EditText
    // which contains some whitespace. In such a case EditText fires this callback with an
    // empty text and right after that with text that is really presented within EditText.
    mEditText.removeCallbacks(EDITABLE_CHANGE);
    mEditText.postDelayed(EDITABLE_CHANGE, EDITABLE_CHANGE_DELAY);
  }
};

代码示例来源:origin: dss886/Android-EmotionInputDetector

@Override
  public boolean onTouch(View v, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_UP && mEmotionLayout.isShown()) {
      lockContentHeight();
      hideEmotionLayout(true);
      mEditText.postDelayed(new Runnable() {
        @Override
        public void run() {
          unlockContentHeightDelayed();
        }
      }, 200L);
    }
    return false;
  }
});

代码示例来源:origin: shinezejian/emotionkeyboard

@Override
  public boolean onTouch(View v, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_UP && mEmotionLayout.isShown()) {
      lockContentHeight();//显示软件盘时,锁定内容高度,防止跳闪。
      hideEmotionLayout(true);//隐藏表情布局,显示软件盘
      //软件盘显示后,释放内容高度
      mEditText.postDelayed(new Runnable() {
        @Override
        public void run() {
          unlockContentHeightDelayed();
        }
      }, 200L);
    }
    return false;
  }
});

代码示例来源:origin: advanced-android-book/samples

/**
 * パスワード認証スクリーンに切り替えます。
 */
private void goToBackup() {
  mStage = Stage.PASSWORD;
  updateStage();
  mPassword.requestFocus();
  // キーボードを表示します。
  mPassword.postDelayed(mShowKeyboardRunnable, 500);
  // 指紋認証の待受を止めます。
  mFingerprintUiHelper.stopListening();
}

代码示例来源:origin: aitorvs/fingerlock

/**
 * Switches to backup (password) screen. This either can happen when fingerprint is not
 * available or the user chooses to use the password authentication method by pressing the
 * button. This can also happen when the user had too many fingerprint attempts.
 */
private void goToBackup(MaterialDialog dialog) {
  mStage = Stage.PASSWORD;
  updateStage(dialog);
  mPassword.requestFocus();
  // Show the keyboard.
  mPassword.postDelayed(mShowKeyboardRunnable, 500);
  // Fingerprint is not used anymore. Stop listening for it.
  mFingerLock.stop();
}

代码示例来源:origin: huangfangyi/YiChat

@Override
  public boolean onTouch(View v, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_UP) {
      if (!btn_emoticons_normal.isShown()) {
        btn_emoticons_checked.setVisibility(GONE);
        btn_emoticons_normal.setVisibility(VISIBLE);
      }
      if (ll_more.isShown()) {
        lockContentHeight();
        hideEmotionLayout(true);
        et_sendmessage.postDelayed(new Runnable() {
          @Override
          public void run() {
            unlockContentHeightDelayed();
          }
        }, 200L);
        inputViewLisenter.onEditTextUp();
        return false;
      }
      if (!isSoftInputShown()) {
        inputViewLisenter.onEditTextUp();
      }
    }
    return false;
  }
});

代码示例来源:origin: YiChat/android_YiChat_Lite

@Override
  public boolean onTouch(View v, MotionEvent event) {
    if (event.getAction() == MotionEvent.ACTION_UP) {
      if (!btn_emoticons_normal.isShown()) {
        btn_emoticons_checked.setVisibility(GONE);
        btn_emoticons_normal.setVisibility(VISIBLE);
      }
      if (ll_more.isShown()) {
        lockContentHeight();
        hideEmotionLayout(true);
        et_sendmessage.postDelayed(new Runnable() {
          @Override
          public void run() {
            unlockContentHeightDelayed();
          }
        }, 200L);
        inputViewLisenter.onEditTextUp();
        return false;
      }
      if (!isSoftInputShown()) {
        inputViewLisenter.onEditTextUp();
      }
    }
    return false;
  }
});

相关文章

微信公众号

最新文章

更多

EditText类方法