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

x33g5p2x  于2022-01-20 转载在 其他  
字(8.4k)|赞(0)|评价(0)|浏览(183)

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

ImageView.postDelayed介绍

暂无

代码示例

代码示例来源:origin: seven332/EhViewer

@Override
  public void onAuthenticationSucceeded(
      FingerprintManager.AuthenticationResult result) {
    mFingerprintIcon.setImageResource(R.drawable.fingerprint_success);
    mFingerprintIcon.postDelayed(new Runnable() {
      @Override
      public void run() {
        startSceneForCheckStep(CHECK_STEP_SECURITY, getArguments());
        finish();
      }
    }, SUCCESS_DELAY_MILLIS);
  }
}, null);

代码示例来源:origin: siyamed/android-shape-imageview

@Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(layout, container, false);
    final ImageView imageView = (ImageView) view.findViewById(R.id.relative_test_img_1);
    if(imageView != null) {
      imageView.postDelayed(new Runnable() {
        @Override
        public void run() {
          Picasso.with(getActivity()).load(Constants.IMAGES[0][0]).into(imageView);
        }
      }, 3000);
    }

    return view;
  }
}

代码示例来源:origin: seven332/EhViewer

private void fingerprintError(boolean unrecoverable) {
    // Do not decrease mRetryTimes here since Android system will handle it :)
    mFingerprintIcon.setImageResource(R.drawable.fingerprint_error);
    mFingerprintIcon.removeCallbacks(mResetFingerprintRunnable);
    if (unrecoverable) {
      mFingerprintIcon.postDelayed(new Runnable() {
        @Override
        public void run() {
          mFingerprintIcon.setVisibility(View.INVISIBLE);
        }
      }, ERROR_TIMEOUT_MILLIS);
    } else {
      mFingerprintIcon.postDelayed(mResetFingerprintRunnable, ERROR_TIMEOUT_MILLIS);
    }
  }
}

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

private void onHover(MotionEvent event, @StringRes final int message,
           final View anchor) {
 Runnable hover=hoverTimers.get(anchor.getId());
 if (hover==null &&
  (event.getAction()==MotionEvent.ACTION_HOVER_ENTER ||
  event.getAction()==MotionEvent.ACTION_HOVER_MOVE)) {
  hover=new Runnable() {
   @Override
   public void run() {
    showTooltip(message);
   }
  };
  hoverTimers.put(anchor.getId(), hover);
  thumbnailLarge.postDelayed(hover, TOOLTIP_DELAY);
 }
 else if (hover!=null &&
  event.getAction()==MotionEvent.ACTION_HOVER_EXIT) {
  thumbnailLarge.removeCallbacks(hover);
  hoverTimers.remove(anchor.getId());
 }
}

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

private void scale(View v, boolean isDown) {
  if (v.getId() == qq.getId() || v.getId() == weibo.getId() || v.getId() == wechat.getId()) {
    if (isDown) {
      Animation testAnim = AnimationUtils.loadAnimation(mActivity, R.anim.scale_down);
      v.startAnimation(testAnim);
    } else {
      Animation testAnim = AnimationUtils.loadAnimation(mActivity, R.anim.scale_up);
      v.startAnimation(testAnim);
    }
  }
  if (!isDown && listener!=null) {
    switch (v.getId()) {
      case R.id.ivQQ:
        listener.onLogin(qq, "QQ");
        break;
    }
    qq.postDelayed(new Runnable() {
      @Override
      public void run() {
        dismiss();
      }
    }, 500);
  }
}

代码示例来源:origin: huazhiyuan2008/RecyclerViewCardGallery

private void notifyBackgroundChange() {
  if (mLastPos == mCardScaleHelper.getCurrentItemPos()) return;
  mLastPos = mCardScaleHelper.getCurrentItemPos();
  final int resId = mList.get(mCardScaleHelper.getCurrentItemPos());
  mBlurView.removeCallbacks(mBlurRunnable);
  mBlurRunnable = new Runnable() {
    @Override
    public void run() {
      Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resId);
      ViewSwitchUtils.startSwitchBackgroundAnim(mBlurView, BlurBitmapUtils.getBlurBitmap(mBlurView.getContext(), bitmap, 15));
    }
  };
  mBlurView.postDelayed(mBlurRunnable, 500);
}

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

@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
  if (!mSelfCancelled) {
    showError(errString);
    mIcon.postDelayed(new Runnable() {
      @Override
      public void run() {
        mCallback.onError();
      }
    }, ERROR_TIMEOUT_MILLIS);
  }
}

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

/**
 * Called by {@link FingerprintManager} if the authentication threw an error.
 */
@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
  if (!mSelfCancelled) {
    showError(errString);
    mIcon.postDelayed(new Runnable() {
      @Override
      public void run() {
        mCallback.onError();
      }
    }, ERROR_TIMEOUT_MILLIS);
  }
}

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

@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
  mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
  mIcon.setImageResource(R.drawable.ic_fingerprint_success);
  mErrorTextView.setTextColor(
      mErrorTextView.getResources().getColor(R.color.success_color, null));
  mErrorTextView.setText(
      mErrorTextView.getResources().getString(R.string.fingerprint_success));
  mIcon.postDelayed(new Runnable() {
    @Override
    public void run() {
      mCallback.onAuthenticated();
    }
  }, SUCCESS_DELAY_MILLIS);
}

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

/**
 * Called by {@link FingerprintManager} if the authentication succeeded.
 */
@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
  mErrorTextView.removeCallbacks(mResetErrorTextRunnable);
  mIcon.setImageResource(R.drawable.ic_fingerprint_success);
  mErrorTextView.setTextColor(
      mErrorTextView.getResources().getColor(R.color.success_color, null));
  mErrorTextView.setText(
      mErrorTextView.getResources().getString(R.string.pin_code_fingerprint_success));
  mIcon.postDelayed(new Runnable() {
    @Override
    public void run() {
      mCallback.onAuthenticated();
    }
  }, SUCCESS_DELAY_MILLIS);
}

代码示例来源:origin: freedom10086/Ruisi

@Override
  public void onSuccess(byte[] response) {
    String res = new String(response);
    if (res.contains("成功") || res.contains("您已收藏")) {
      showToast("收藏成功");
      if (v != null) {
        final ImageView mv = (ImageView) v;
        mv.postDelayed(() -> mv.setImageResource(R.drawable.ic_star_32dp_yes), 300);
      }
    }
  }
});

代码示例来源:origin: premnirmal/Magnet

@Override public void run() {
  if (magnet != null) {
   magnet.setPosition(500, 800);
   iconView.postDelayed(new Runnable() {
    @Override public void run() {
     magnet.goToWall();
    }
   }, 500);
  }
 }
}, 1000);

代码示例来源:origin: stewForAni/Lamp

@Override
  public void run() {
    ControlLight.sendOrder(currentOrder);
    lightOff.postDelayed(new Runnable() {
      @Override
      public void run() {
        if (!shouldSendSpeed) {
          ControlLight.sendOrder(currentSpeed);
        }
      }
    }, 1000);
  }
}, 1000);

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

@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
  if (!mSelfCancelled) {
    showError(errString);
    mIcon.postDelayed(new Runnable() {
      @Override
      public void run() {
        mCallback.onError();
      }
    }, ERROR_TIMEOUT_MILLIS);
  }
}

代码示例来源:origin: thealeksandr/PFLockScreen-Android

@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
  if (!mSelfCancelled) {
    showError(errString);
    mIcon.postDelayed(new Runnable() {
      @Override
      public void run() {
        mCallback.onError();
      }
    }, ERROR_TIMEOUT_MILLIS);
  }
}

代码示例来源:origin: sorz/TinyKeePass

@Override
public void onAuthenticationError(int errMsgId, CharSequence errString) {
  showError(errString);
  if (!cancellationSignal.isCanceled())
    imageFingerprintIcon.postDelayed(authenticationErrorRunnable, ERROR_TIMEOUT_MILLIS);
}

代码示例来源:origin: sorz/TinyKeePass

@Override
public void onAuthenticationSucceeded(FingerprintManager.AuthenticationResult result) {
  textFingerprintStatus.removeCallbacks(resetErrorTextRunnable);
  imageFingerprintIcon.setImageResource(R.drawable.ic_fingerprint_success);
  textFingerprintStatus.setText(R.string.fingerprint_success);
  textFingerprintStatus.setTextColor(context.getColor(R.color.success));
  imageFingerprintIcon.postDelayed(() ->
      finishHandler.accept(result.getCryptoObject().getCipher()), SUCCESS_TIMEOUT_MILLIS);
}

代码示例来源:origin: benoberkfell/android-fingerprint-demo

@Override
public void onError(String errorString, boolean isHardError) {
  fingerprintIconImageView.removeCallbacks(resetFingerprintHint);
  fingerprintStatusTextView.setTextColor(ContextCompat.getColor(getActivity(),R.color.warning_color));
  fingerprintStatusTextView.setText(errorString);
  fingerprintIconImageView.setImageDrawable(ContextCompat.getDrawable(getActivity(), R.drawable.ic_fingerprint_error));
  if (!isHardError) {
    fingerprintIconImageView.postDelayed(resetFingerprintHint, ERROR_TIMEOUT_MS);
  }
}

代码示例来源:origin: HpWens/MeiWidgetView

@Override
public void onSupportVisible() {
  super.onSupportVisible();
  mVideoPlayer.setPlayWhenReady(true);
  mIvBg.postDelayed(new Runnable() {
    @Override
    public void run() {
      mIvBg.setVisibility(View.GONE);
    }
  }, mDragLayout.getDuration());
}

代码示例来源:origin: codeestX/ECardFlow

private void switchBgToNext(final int targetPosition) {
  if (isSwitching) {
    return;
  }
  isSwitching = true;
  startTrans(targetPosition + 1, mBgImage, curBp, nextBp);
  if (mBlurImage != null) {
    startTrans(targetPosition + 1, mBlurImage, new RecyclingBitmapDrawable(getResources(), curBlurBp), new RecyclingBitmapDrawable(getResources(), nextBlurBp));
  }
  mNotifyRunnable.setTarget(targetPosition, true);
  mBgImage.postDelayed(mNotifyRunnable, mSwitchAnimTime);
}

相关文章

ImageView类方法