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

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

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

ImageView.addOnAttachStateChangeListener介绍

暂无

代码示例

代码示例来源:origin: square/picasso

DeferredRequestCreator(RequestCreator creator, ImageView target, @Nullable Callback callback) {
 this.creator = creator;
 this.target = target;
 this.callback = callback;
 target.addOnAttachStateChangeListener(this);
 // Only add the pre-draw listener if the view is already attached.
 // See: https://github.com/square/picasso/issues/1321
 if (target.getWindowToken() != null) {
  onViewAttachedToWindow(target);
 }
}

代码示例来源:origin: square/picasso

@Test public void cancelWhileAttachedRemovesAttachListener() {
 ImageView target = mockFitImageViewTarget(true);
 DeferredRequestCreator request = new DeferredRequestCreator(mock(RequestCreator.class), target, null);
 verify(target).addOnAttachStateChangeListener(request);
 request.cancel();
 verify(target).removeOnAttachStateChangeListener(request);
}

代码示例来源:origin: square/picasso

@Test public void initWhileDetachedAddsAttachListenerWhichDefersPreDrawListener() {
 ImageView target = mockFitImageViewTarget(true);
 when(target.getWindowToken()).thenReturn(null);
 ViewTreeObserver observer = target.getViewTreeObserver();
 DeferredRequestCreator request =
   new DeferredRequestCreator(mock(RequestCreator.class), target, null);
 verify(target).addOnAttachStateChangeListener(request);
 verifyNoMoreInteractions(observer);
 // Attach and ensure we defer to the pre-draw listener.
 request.onViewAttachedToWindow(target);
 verify(observer).addOnPreDrawListener(request);
 // Detach and ensure we remove the pre-draw listener from the original VTO.
 request.onViewDetachedFromWindow(target);
 verify(observer).removeOnPreDrawListener(request);
}

代码示例来源:origin: iielse/ImageWatcher

imageView.animate().alpha(1).start();
imageView.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
  @Override
  public void onViewAttachedToWindow(View v) {

代码示例来源:origin: iielse/ImageWatcher

imageView.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
  @Override
  public void onViewAttachedToWindow(View v) {

代码示例来源:origin: byc4426/ImageWatcher

imageView.addOnAttachStateChangeListener(new OnAttachStateChangeListener() {
  @Override
  public void onViewAttachedToWindow(View v) {

相关文章

ImageView类方法