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

x33g5p2x  于2022-01-29 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(256)

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

TextView.postDelayed介绍

暂无

代码示例

代码示例来源:origin: smuyyh/BookReader

public void hideTipView(long delayMillis) {
  tipView.postDelayed(new Runnable() {
    @Override
    public void run() {
      Animation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
          0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
          Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
          -1.0f);
      mHiddenAction.setDuration(500);
      tipView.startAnimation(mHiddenAction);
      tipView.setVisibility(View.GONE);
    }
  }, delayMillis);
}

代码示例来源:origin: google/ExoPlayer

@SuppressLint("SetTextI18n")
protected final void updateAndPost() {
 textView.setText(getDebugString());
 textView.removeCallbacks(this);
 textView.postDelayed(this, REFRESH_INTERVAL_MS);
}

代码示例来源:origin: smuyyh/BookReader

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_splash);
  ButterKnife.bind(this);
  runnable = new Runnable() {
    @Override
    public void run() {
      goHome();
    }
  };
  tvSkip.postDelayed(runnable, 2000);
  tvSkip.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
      goHome();
    }
  });
}

代码示例来源:origin: smuyyh/BookReader

public void showTipViewAndDelayClose(String tip) {
  tipView.setText(tip);
  Animation mShowAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
      Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
      -1.0f, Animation.RELATIVE_TO_SELF, 0.0f);
  mShowAction.setDuration(500);
  tipView.startAnimation(mShowAction);
  tipView.setVisibility(View.VISIBLE);
  tipView.postDelayed(new Runnable() {
    @Override
    public void run() {
      Animation mHiddenAction = new TranslateAnimation(Animation.RELATIVE_TO_SELF,
          0.0f, Animation.RELATIVE_TO_SELF, 0.0f,
          Animation.RELATIVE_TO_SELF, 0.0f, Animation.RELATIVE_TO_SELF,
          -1.0f);
      mHiddenAction.setDuration(500);
      tipView.startAnimation(mHiddenAction);
      tipView.setVisibility(View.GONE);
    }
  }, 2200);
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public void run() {
  if (fadingOut) {
   fadee.animate().alpha(0).setDuration(PERIOD);
   fadee.setText(R.string.fading_out);
  }
  else {
   fadee.animate().alpha(1).setDuration(PERIOD);
   fadee.setText(R.string.coming_back);
  }
  
  fadingOut=!fadingOut;
  
  fadee.postDelayed(this, PERIOD);
 }
}

代码示例来源:origin: smuyyh/BookReader

@Subscribe(threadMode = ThreadMode.MAIN)
public void downloadMessage(final DownloadMessage msg) {
  if (isVisible(mLlBookReadBottom)) { // 如果工具栏显示,则进度条也显示
    if (bookId.equals(msg.bookId)) {
      visible(mTvDownloadProgress);
      mTvDownloadProgress.setText(msg.message);
      if (msg.isComplete) {
        mTvDownloadProgress.postDelayed(new Runnable() {
          @Override
          public void run() {
            gone(mTvDownloadProgress);
          }
        }, 2500);
      }
    }
  }
}

代码示例来源:origin: commonsguy/cw-omnibus

@Override
 public void run() {
  if (fadingOut) {
   animate(fadee).alpha(0).setDuration(PERIOD);
   fadee.setText(R.string.fading_out);
  }
  else {
   animate(fadee).alpha(1).setDuration(PERIOD);
   fadee.setText(R.string.coming_back);
  }

  fadingOut=!fadingOut;

  fadee.postDelayed(this, PERIOD);
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

private void pause() {
 logToTranscript(getActivity().getString(R.string.pause_requested));
 PauseCallback pauseCB=new PauseCallback();
 client.pause(null, pauseCB);
 transcript.postDelayed(pauseCB, 1000);
}

代码示例来源:origin: commonsguy/cw-omnibus

private void stop() {
 logToTranscript(getActivity().getString(R.string.stop_requested));
 StopCallback stopCB=new StopCallback();
 client.stop(null, stopCB);
 transcript.postDelayed(stopCB, 1000);
}

代码示例来源:origin: commonsguy/cw-omnibus

private void stop() {
 logToTranscript(getActivity().getString(R.string.stop_requested));
 StopCallback stopCB=new StopCallback();
 client.stop(null, stopCB);
 transcript.postDelayed(stopCB, 1000);
}

代码示例来源:origin: commonsguy/cw-omnibus

private void resume() {
 logToTranscript(getActivity().getString(R.string.resume_requested));
 ResumeCallback resumeCB=new ResumeCallback();
 client.resume(null, resumeCB);
 transcript.postDelayed(resumeCB, 1000);
}

代码示例来源:origin: commonsguy/cw-omnibus

private void pause() {
 logToTranscript(getActivity().getString(R.string.pause_requested));
 PauseCallback pauseCB=new PauseCallback();
 client.pause(null, pauseCB);
 transcript.postDelayed(pauseCB, 1000);
}

代码示例来源:origin: commonsguy/cw-omnibus

private void resume() {
 logToTranscript(getActivity().getString(R.string.resume_requested));
 ResumeCallback resumeCB=new ResumeCallback();
 client.resume(null, resumeCB);
 transcript.postDelayed(resumeCB, 1000);
}

代码示例来源:origin: commonsguy/cw-omnibus

private void disconnect() {
 isPlaying=false;
 isPaused=false;
 if (client != null) {
  logToTranscript(getActivity().getString(R.string.session_ending));
  EndSessionCallback endCB=new EndSessionCallback();
  if (client.isSessionManagementSupported()) {
   client.endSession(null, endCB);
  }
  transcript.postDelayed(endCB, 1000);
 }
}

代码示例来源:origin: commonsguy/cw-omnibus

private void disconnect() {
 isPlaying=false;
 isPaused=false;
 if (client != null) {
  logToTranscript(getActivity().getString(R.string.session_ending));
  EndSessionCallback endCB=new EndSessionCallback();
  if (client.isSessionManagementSupported()) {
   client.endSession(null, endCB);
  }
  transcript.postDelayed(endCB, 1000);
 }
}

代码示例来源:origin: omadahealth/LolliPin

/**
 * Show an error on the UI using {@link #mIcon} and {@link #mErrorTextView}
 */
private void showError(CharSequence error) {
  mIcon.setImageResource(R.drawable.ic_fingerprint_error);
  mErrorTextView.setText(error);
  mErrorTextView.setTextColor(
      mErrorTextView.getResources().getColor(R.color.warning_color, null));
  mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
  mErrorTextView.postDelayed(mResetErrorTextRunnable, ERROR_TIMEOUT_MILLIS);
}

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

private void showError(CharSequence error) {
  mIcon.setImageResource(R.drawable.ic_fingerprint_error);
  mErrorTextView.setText(error);
  mErrorTextView.setTextColor(
      mErrorTextView.getResources().getColor(R.color.warning_color, null));
  mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
  mErrorTextView.postDelayed(mResetErrorTextRunnable, ERROR_TIMEOUT_MILLIS);
}

代码示例来源:origin: mayubao/KuaiChuan

@Override
  public void onWifiApEnabled() {
    Log.i(TAG, "======>>>onWifiApEnabled !!!");
    if(!mIsInitialized){
      mUdpServerRuannable = createSendMsgToFileSenderRunnable();
      AppContext.MAIN_EXECUTOR.execute(mUdpServerRuannable);
      mIsInitialized = true;
      tv_desc.setText(getResources().getString(R.string.tip_now_init_is_finish));
      tv_desc.postDelayed(new Runnable() {
        @Override
        public void run() {
          tv_desc.setText(getResources().getString(R.string.tip_is_waitting_connect));
        }
      }, 2*1000);
    }
  }
};

代码示例来源:origin: yuliskov/SmartYouTubeTV

@SuppressLint("SetTextI18n")
private void updateAndPost() {
  textView.setText(getPlayerStateString() + getPlayerWindowIndexString() + getPreferredDisplayModeId()
      + getVideoString()
      + getAudioString());
  textView.removeCallbacks(this);
  textView.postDelayed(this, REFRESH_INTERVAL_MS);
}

代码示例来源:origin: crazysunj/MultiTypeRecyclerViewAdapter

public void click4(View view) {

    textView4.postDelayed(() -> {
      List<MultiHeaderEntity> list = new ArrayList<>();
      for (int i = 0, size = 6; i < size; i++) {
        list.add(new FourthItem(String.format(Locale.getDefault(),"我是第四种类型%d", i), 18 + i));
      }
      textView4.setText(String.format(Locale.getDefault(),"类型4的数量:%d", list.size()));
      String title = String.format(Locale.getDefault(), "我是第四种类型的头,点击次数:%d", refreshFouthCount++);
      helper.notifyModuleDataAndHeaderChanged(list, new HeaderFourthItem(title, title.hashCode()), SimpleHelper.LEVEL_FOURTH);
    }, 0);
  }
}

相关文章

TextView类方法