public abstract class SimplePopupWindowEventInterceptor<P extends BasePopupWindow> extends Object implements PopupWindowEventInterceptor<P>
| 构造器和说明 |
|---|
SimplePopupWindowEventInterceptor() |
| 限定符和类型 | 方法和说明 |
|---|---|
Point |
onCalculateOffset(P basePopupWindow,
View anchorView,
int offsetX,
int offsetY)
允许用户拦截BasePopup默认的偏移计算过程
该方法已弃用,且不再回调 |
void |
onCalculateOffsetResult(P basePopupWindow,
View anchorView,
Point calculatedOffset,
int offsetX,
int offsetY)
提供BasePopup偏移量计算结果回调,允许用户在回调中做弹出前最后一次修正
该方法已弃用,且不再回调 |
int |
onKeyboardChangeResult(int keyboardHeight,
boolean isKeyBoardVisible,
int calculatedOffset)
提供BasePopup针对键盘适配的偏移计算结果回调,允许用户在该回调中做偏移修正
|
boolean |
onPreMeasurePopupView(P basePopupWindow,
View contentView,
int width,
int height)
预测量PopupWindow回调,当执行预先测量时,将会回调到该方法,允许用户拦截BasePopup预测量过程,否则按照默认程序进行
|
boolean |
onTryToShowPopup(P basePopupWindow,
PopupWindow popupWindow,
View anchorView,
int gravity,
int offsetX,
int offsetY)
当调用
BasePopupWindow.showPopupWindow()、BasePopupWindow.showPopupWindow(View)、BasePopupWindow.showPopupWindow(int)时,会回调该方法,允许用户拦截BasePopup的show过程,否则按照默认程序进行 |
public boolean onPreMeasurePopupView(P basePopupWindow, View contentView, int width, int height)
PopupWindowEventInterceptoronPreMeasurePopupView 在接口中 PopupWindowEventInterceptor<P extends BasePopupWindow>basePopupWindow - basepopup对象contentView - contentViewwidth - 预设宽度height - 预设高度BasePopupWindow.preMeasurePopupView(int, int)public boolean onTryToShowPopup(P basePopupWindow, PopupWindow popupWindow, View anchorView, int gravity, int offsetX, int offsetY)
PopupWindowEventInterceptorBasePopupWindow.showPopupWindow()、BasePopupWindow.showPopupWindow(View)、BasePopupWindow.showPopupWindow(int)时,会回调该方法,允许用户拦截BasePopup的show过程,否则按照默认程序进行onTryToShowPopup 在接口中 PopupWindowEventInterceptor<P extends BasePopupWindow>basePopupWindow - basePopupWindow对象popupWindow - popupwindow对象anchorView - 锚点Viewgravity - popupwindow gravityoffsetX - 水平偏移offsetY - 垂直偏移BasePopupWindow.tryToShowPopup(View, boolean, boolean)public Point onCalculateOffset(P basePopupWindow, View anchorView, int offsetX, int offsetY)
PopupWindowEventInterceptoronCalculateOffset 在接口中 PopupWindowEventInterceptor<P extends BasePopupWindow>basePopupWindow - basePopupWindow对象anchorView - 锚点ViewoffsetX - 水平偏移offsetY - 垂直偏移BasePopupWindow#calculateOffset(View, boolean)public void onCalculateOffsetResult(P basePopupWindow, View anchorView, Point calculatedOffset, int offsetX, int offsetY)
PopupWindowEventInterceptoronCalculateOffsetResult 在接口中 PopupWindowEventInterceptor<P extends BasePopupWindow>basePopupWindow - basePopupWindow对象anchorView - 锚点ViewcalculatedOffset - 已经经过默认计算的偏移量offsetX - 水平偏移offsetY - 垂直偏移BasePopupWindow.tryToShowPopup(View, boolean, boolean)public int onKeyboardChangeResult(int keyboardHeight,
boolean isKeyBoardVisible,
int calculatedOffset)
PopupWindowEventInterceptoronKeyboardChangeResult 在接口中 PopupWindowEventInterceptor<P extends BasePopupWindow>keyboardHeight - 键盘高度isKeyBoardVisible - 键盘是否已经弹出calculatedOffset - 默认计算的偏移量