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

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

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

ImageView.getWindowToken介绍

暂无

代码示例

代码示例来源: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

static ImageView mockFitImageViewTarget(boolean alive) {
 ViewTreeObserver observer = mock(ViewTreeObserver.class);
 when(observer.isAlive()).thenReturn(alive);
 ImageView mock = mock(ImageView.class);
 when(mock.getWindowToken()).thenReturn(mock(IBinder.class));
 when(mock.getViewTreeObserver()).thenReturn(observer);
 return mock;
}

代码示例来源: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: lytsing/weibo

private void showOrHideIMM() {

    if (mAq.id(R.id.ib_face_keyboard).getTag() == null) {
      ImageView faceOrKeyboard = (ImageView) findViewById(R.id.ib_face_keyboard);
      imm.hideSoftInputFromWindow(faceOrKeyboard.getWindowToken(), 0);
      showFace();
    } else {
      imm.showSoftInput(mEdit, 0);
      hideFace();
    }
  }
}

相关文章

ImageView类方法