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

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

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

ImageView.post介绍

暂无

代码示例

代码示例来源:origin: chrisbanes/PhotoView

@Override
public void onFling(float startX, float startY, float velocityX, float velocityY) {
  mCurrentFlingRunnable = new FlingRunnable(mImageView.getContext());
  mCurrentFlingRunnable.fling(getImageViewWidth(mImageView),
    getImageViewHeight(mImageView), (int) velocityX, (int) velocityY);
  mImageView.post(mCurrentFlingRunnable);
}

代码示例来源:origin: chrisbanes/PhotoView

public void setScale(float scale, float focalX, float focalY,
  boolean animate) {
  // Check to see if the scale is within bounds
  if (scale < mMinScale || scale > mMaxScale) {
    throw new IllegalArgumentException("Scale must be within the range of minScale and maxScale");
  }
  if (animate) {
    mImageView.post(new AnimatedZoomRunnable(getScale(), scale,
      focalX, focalY));
  } else {
    mSuppMatrix.setScale(scale, scale, focalX, focalY);
    checkAndDisplayMatrix();
  }
}

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

public final void onFling(float startX, float startY, float velocityX, float velocityY) {
  if (DEBUG) {
    Log.d(LOG_TAG, "onFling. sX: " + startX + " sY: " + startY + " Vx: " + velocityX + " Vy: " + velocityY);
  }
  ImageView imageView = getImageView();
  if (hasDrawable(imageView)) {
    mCurrentFlingRunnable = new FlingRunnable(imageView.getContext());
    mCurrentFlingRunnable.fling(imageView.getWidth(), imageView.getHeight(), (int) velocityX, (int) velocityY);
    imageView.post(mCurrentFlingRunnable);
  }
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

@Override
public final void onFling(float startX, float startY, float velocityX,
    float velocityY) {
  if (DEBUG) {
    Log.d(LOG_TAG, "onFling. sX: " + startX + " sY: " + startY
        + " Vx: " + velocityX + " Vy: " + velocityY);
  }
  ImageView imageView = getImageView();
  if (hasDrawable(imageView)) {
    mCurrentFlingRunnable = new FlingRunnable(imageView.getContext());
    mCurrentFlingRunnable.fling(imageView.getWidth(),
        imageView.getHeight(), (int) velocityX, (int) velocityY);
    imageView.post(mCurrentFlingRunnable);
  }
}

代码示例来源:origin: stackoverflow.com

public class ExampleActivty extends AppCompatActivity {

  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ...

    final ImageView imageView = (ImageView) findViewById(R.id.image);
    final Thread thread = new Thread() {

      @Override
      public void run() {
        ...
        final Bitmap image = doStuff();
        imageView.post(new Runnable() {
          @Override
          public void run() {
            imageView.setImageBitmap(image);
          }
        });
      }
    };
    thread.start();
  }
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

@Override
public final void zoomTo(float scale, float focalX, float focalY) {
  ImageView imageView = getImageView();
  if (null != imageView) {
    imageView.post(new AnimatedZoomRunnable(getScale(), scale, focalX,
        focalY));
  }
}

代码示例来源:origin: stackoverflow.com

//...
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_main);

  final ImageView animImageView = (ImageView) findViewById(R.id.iv_animation);
  animImageView.setBackgroundResource(R.drawable.anim);
  animImageView.post(new Runnable() {
    @Override
    public void run() {
      AnimationDrawable frameAnimation =
        (AnimationDrawable) animImageView.getBackground();
      frameAnimation.start();
    }
  });
  // ... other code ... 
}
// ...

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

public final void zoomTo(float scale, float focalX, float focalY) {
  ImageView imageView = getImageView();
  if (null != imageView) {
    imageView.post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY));
  }
}

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

public final void zoomTo(float scale, float focalX, float focalY) {
  ImageView imageView = getImageView();
  if (null != imageView) {
    imageView.post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY));
  }
}

代码示例来源:origin: stackoverflow.com

loadigIcon.post(new Starter());

代码示例来源:origin: ittianyu/BottomNavigationViewEx

mIcon.post(new Runnable() {
  @Override
  public void run() {

代码示例来源:origin: multidots/android-app-common-tasks

public void run() {
    try {
      final Bitmap bitmap = BitmapFactory
          .decodeStream((InputStream) new URL(imgurl)
              .getContent());
      mImageView.post(new Runnable() {
        @Override
        public void run() {
          if (bitmap != null) {
            mImageView.setImageBitmap(bitmap);
          }
        }
      });
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}).start();

代码示例来源:origin: multidots/android-app-common-tasks

public void run() {
    try {
      final Bitmap bitmap = BitmapFactory
          .decodeStream((InputStream) new URL(imgurl)
              .getContent());
      mImageView.post(new Runnable() {
        @Override
        public void run() {
          if (bitmap != null) {
            mImageView.setImageBitmap(bitmap);
          }
        }
      });
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}).start();

代码示例来源:origin: stackoverflow.com

private AnimationDrawable anim;
private void Animation() {
    ImageView img = (ImageView)findViewById(R.id.simple_anim);
    anim = (AnimationDrawable)img.getDrawable();
    img.post(run);
  }

  Runnable run = new Runnable() {
    @Override
    public void run() {
      anim.start();
    }
  };

代码示例来源:origin: hejunlin2013/TVSample

public static void fixVerPosterRatio(final ImageView image) {
  image.post(new Runnable() {
    @Override
    public void run() {
      int width = image.getWidth();
      int height = Math.round((float) width / VER_POSTER_RATIO);
      image.getLayoutParams().height = height;
      image.setVisibility(View.VISIBLE);
    }
  });
}

代码示例来源:origin: hejunlin2013/TVSample

public static void fixHorPosterRatio(final ImageView image) {
  image.post(new Runnable() {
    @Override
    public void run() {
      int width = image.getWidth();
      int height = Math.round((float) width / HOR_POSTER_RATIO);
      image.getLayoutParams().height = height;
      image.setVisibility(View.VISIBLE);
    }
  });
}

代码示例来源:origin: gearvrf/GearVRf-Demos

public void performClick() {
  mBackButton.post(new Runnable() {
    @Override
    public void run() {
      mBackButton.performClick();
    }
  });
}

代码示例来源:origin: albert-lii/ImageViewer

@Override
public void onFling(float startX, float startY, float velocityX, float velocityY) {
  mCurrentFlingRunnable = new FlingRunnable(mImageView.getContext());
  mCurrentFlingRunnable.fling(getImageViewWidth(mImageView),
    getImageViewHeight(mImageView), (int) velocityX, (int) velocityY);
  mImageView.post(mCurrentFlingRunnable);
}

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

@Override
public final void onFling(float startX, float startY, float velocityX, float velocityY) {
  if (DEBUG) {
    Log.d(LOG_TAG, "onFling. sX: " + startX + " sY: " + startY + " Vx: " + velocityX + " Vy: " + velocityY);
  }
  ImageView imageView = getImageView();
  if (hasDrawable(imageView)) {
    mCurrentFlingRunnable = new FlingRunnable(imageView.getContext());
    mCurrentFlingRunnable.fling(imageView.getWidth(), imageView.getHeight(), (int) velocityX, (int) velocityY);
    imageView.post(mCurrentFlingRunnable);
  }
}

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

@Override
public final void zoomTo(float scale, float focalX, float focalY) {
  ImageView imageView = getImageView();
  if (null != imageView) {
    imageView.post(new AnimatedZoomRunnable(getScale(), scale, focalX, focalY));
  }
}

相关文章

ImageView类方法