android.widget.PopupWindow.isAboveAnchor()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(219)

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

PopupWindow.isAboveAnchor介绍

暂无

代码示例

代码示例来源:origin: square/assertj-android

public PopupWindowAssert isAboveAnchor() {
 isNotNull();
 assertThat(actual.isAboveAnchor()) //
   .overridingErrorMessage("Expected to be above anchor but was not.") //
   .isTrue();
 return this;
}

代码示例来源:origin: square/assertj-android

public PopupWindowAssert isNotAboveAnchor() {
 isNotNull();
 assertThat(actual.isAboveAnchor()) //
   .overridingErrorMessage("Expected to not be above anchor but was.") //
   .isFalse();
 return this;
}

代码示例来源:origin: facebook/facebook-android-sdk

@Override
  public void onScrollChanged() {
    if (mAnchorViewRef.get() != null && 
        mPopupWindow != null && 
        mPopupWindow.isShowing()) {
      if (mPopupWindow.isAboveAnchor()) {
        mPopupContent.showBottomArrow();
      } else {
        mPopupContent.showTopArrow();
      }
    }
  }
};

代码示例来源:origin: facebook/facebook-android-sdk

private void updateArrows() {
  if (mPopupWindow != null && mPopupWindow.isShowing()) {
    if (mPopupWindow.isAboveAnchor()) {
      mPopupContent.showBottomArrow();
    } else {
      mPopupContent.showTopArrow();
    }
  }
}

代码示例来源:origin: PopFisher/SmartPopupWindow

private void autoAdjustArrowPos(PopupWindow popupWindow, View contentView, View anchorView) {
  View upArrow = contentView.findViewById(R.id.up_arrow);
  View downArrow = contentView.findViewById(R.id.down_arrow);
  int pos[] = new int[2];
  contentView.getLocationOnScreen(pos);
  int popLeftPos = pos[0];
  anchorView.getLocationOnScreen(pos);
  int anchorLeftPos = pos[0];
  int arrowLeftMargin = anchorLeftPos - popLeftPos + anchorView.getWidth() / 2 - upArrow.getWidth() / 2;
  upArrow.setVisibility(popupWindow.isAboveAnchor() ? View.INVISIBLE : View.VISIBLE);
  downArrow.setVisibility(popupWindow.isAboveAnchor() ? View.VISIBLE : View.INVISIBLE);
  RelativeLayout.LayoutParams upArrowParams = (RelativeLayout.LayoutParams) upArrow.getLayoutParams();
  upArrowParams.leftMargin = arrowLeftMargin;
  RelativeLayout.LayoutParams downArrowParams = (RelativeLayout.LayoutParams) downArrow.getLayoutParams();
  downArrowParams.leftMargin = arrowLeftMargin;
}

代码示例来源:origin: com.squareup.assertj/assertj-android

public PopupWindowAssert isNotAboveAnchor() {
 isNotNull();
 assertThat(actual.isAboveAnchor()) //
   .overridingErrorMessage("Expected to not be above anchor but was.") //
   .isFalse();
 return this;
}

代码示例来源:origin: com.squareup.assertj/assertj-android

public PopupWindowAssert isAboveAnchor() {
 isNotNull();
 assertThat(actual.isAboveAnchor()) //
   .overridingErrorMessage("Expected to be above anchor but was not.") //
   .isTrue();
 return this;
}

代码示例来源:origin: fr.avianey/facebook-android-api

@Override
  public void onScrollChanged() {
    if (mAnchorViewRef.get() != null && 
        mPopupWindow != null && 
        mPopupWindow.isShowing()) {
      if (mPopupWindow.isAboveAnchor()) {
        mPopupContent.showBottomArrow();
      } else {
        mPopupContent.showTopArrow();
      }
    }
  }
};

代码示例来源:origin: fr.avianey/facebook-android-api

private void updateArrows() {
  if (mPopupWindow != null && mPopupWindow.isShowing()) {
    if (mPopupWindow.isAboveAnchor()) {
      mPopupContent.showBottomArrow();
    } else {
      mPopupContent.showTopArrow();
    }
  }
}

相关文章