Java Code Examples for android.widget.ImageView#postDelayed()
The following examples show how to use
android.widget.ImageView#postDelayed() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CategoryActivity.java From ml-authentication with Apache License 2.0 | 6 votes |
private void animateImage(final ImageView imageView) { imageView.postDelayed(new Runnable() { @Override public void run() { // Play a subtle animation final long duration = 300; final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(imageView, View.SCALE_X, 1f, 1.2f, 1f); scaleXAnimator.setDuration(duration); scaleXAnimator.setRepeatCount(1); final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(imageView, View.SCALE_Y, 1f, 1.2f, 1f); scaleYAnimator.setDuration(duration); scaleYAnimator.setRepeatCount(1); scaleXAnimator.start(); scaleYAnimator.start(); final AnimatorSet animatorSet = new AnimatorSet(); animatorSet.play(scaleXAnimator).with(scaleYAnimator); animatorSet.start(); } }, 400); }
Example 2
Source File: CategoryActivity.java From ml-authentication with Apache License 2.0 | 6 votes |
private void animateImage(final ImageView imageView) { imageView.postDelayed(new Runnable() { @Override public void run() { // Play a subtle animation final long duration = 300; final ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(imageView, View.SCALE_X, 1f, 1.2f, 1f); scaleXAnimator.setDuration(duration); scaleXAnimator.setRepeatCount(1); final ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(imageView, View.SCALE_Y, 1f, 1.2f, 1f); scaleYAnimator.setDuration(duration); scaleYAnimator.setRepeatCount(1); scaleXAnimator.start(); scaleYAnimator.start(); final AnimatorSet animatorSet = new AnimatorSet(); animatorSet.play(scaleXAnimator).with(scaleYAnimator); animatorSet.start(); } }, 400); }
Example 3
Source File: RawDataDiceView.java From bither-android with Apache License 2.0 | 6 votes |
public void removeAllData() { int size = data.size(); data.clear(); for (int i = 0; i < size; i++) { final ImageView iv = (ImageView) ((FrameLayout) getChildAt(i)).getChildAt(0); if (iv.getVisibility() == View.VISIBLE) { ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(300); anim.setFillAfter(true); iv.startAnimation(anim); if (iv.getTag() != null && iv.getTag() instanceof HideIvRunnable) { iv.removeCallbacks((Runnable) iv.getTag()); } HideIvRunnable r = new HideIvRunnable(iv); iv.setTag(r); iv.postDelayed(r, 300); } } }
Example 4
Source File: RawDataDiceView.java From bither-android with Apache License 2.0 | 6 votes |
public void deleteLast() { int size = data.size(); if (size <= 0) { return; } data.remove(size - 1); final ImageView iv = (ImageView) ((FrameLayout) getChildAt(size - 1)).getChildAt(0); if (iv.getVisibility() == View.VISIBLE) { ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(300); anim.setFillAfter(true); iv.startAnimation(anim); if (iv.getTag() != null && iv.getTag() instanceof HideIvRunnable) { iv.removeCallbacks((Runnable) iv.getTag()); } HideIvRunnable r = new HideIvRunnable(iv); iv.setTag(r); iv.postDelayed(r, 300); } }
Example 5
Source File: RawDataBinaryView.java From bither-android with Apache License 2.0 | 6 votes |
public void removeAllData(){ int size = data.size(); data.clear(); for(int i = 0; i < size; i++){ final ImageView iv = (ImageView) ((FrameLayout) getChildAt(i)).getChildAt(0); if(iv.getVisibility() == View.VISIBLE){ ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(300); anim.setFillAfter(true); iv.startAnimation(anim); iv.postDelayed(new Runnable() { @Override public void run() { iv.setVisibility(View.INVISIBLE); } }, 300); } } }
Example 6
Source File: RawDataBinaryView.java From bither-android with Apache License 2.0 | 6 votes |
public void deleteLast(){ int size = data.size(); if(size <= 0){ return; } data.remove(size - 1); final ImageView iv = (ImageView) ((FrameLayout) getChildAt(size - 1)).getChildAt(0); if(iv.getVisibility() == View.VISIBLE){ ScaleAnimation anim = new ScaleAnimation(1, 0, 1, 0, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); anim.setDuration(300); anim.setFillAfter(true); iv.startAnimation(anim); iv.postDelayed(new Runnable() { @Override public void run() { iv.setVisibility(View.INVISIBLE); } }, 300); } }
Example 7
Source File: SplashActivity.java From BBSSDK-for-Android with Apache License 2.0 | 5 votes |
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(ResHelper.getLayoutRes(this, "activity_splash")); ivSplash = (ImageView) findViewById(ResHelper.getIdRes(this, "ivSplash")); ivSplash.postDelayed(new Runnable() { @Override public void run() { startActivity(new Intent(SplashActivity.this, InitActivity.class)); finish(); } }, 1500); }
Example 8
Source File: ImageViewController.java From Carpaccio with Apache License 2.0 | 5 votes |
public void blur(final ImageView imageView, final int radiusString) { imageView.postDelayed(new Runnable() { @Override public void run() { try { Bitmap newBitmap = FastBlurHelper.getBitmapBlurFromView(imageView, radiusString); imageView.setImageBitmap(newBitmap); } catch (Exception e) { Log.e(TAG, e.getMessage(), e); } } }, 10); }
Example 9
Source File: ImageViewController.java From Carpaccio with Apache License 2.0 | 5 votes |
public void greyScale(final ImageView imageView) { imageView.postDelayed(new Runnable() { @Override public void run() { try { Bitmap newBitmap = GrayScaleHelper.getBitmapGreyScaleFromView(imageView); imageView.setImageBitmap(newBitmap); } catch (Exception e) { Log.e(TAG, e.getMessage(), e); } } }, 10); }
Example 10
Source File: MyService.java From Magnet with MIT License | 5 votes |
@Override public void startMagnet() { final ImageView iconView = new ImageView(context); iconView.setImageResource(R.drawable.ic_launcher); if (magnet == null) { magnet = Magnet.newBuilder(context) .setIconView(iconView) .setIconCallback(this) .setHideFactor(0.2f) .setShouldShowRemoveView(true) .setRemoveIconResId(R.drawable.ic_close) .setRemoveIconShadow(R.drawable.bottom_shadow) .setShouldStickToWall(true) .setRemoveIconShouldBeResponsive(true) .setInitialPosition(100, 200) .build(); magnet.show(); iconView.postDelayed(new Runnable() { @Override public void run() { if (magnet != null) { magnet.setPosition(500, 800); iconView.postDelayed(new Runnable() { @Override public void run() { magnet.goToWall(); } }, 500); } } }, 1000); } }