public interface PopupWindowEventInterceptor<P extends BasePopupWindow>
BasePopupWindow各个事件的拦截器
| 限定符和类型 | 方法和说明 |
|---|---|
Point |
onCalculateOffset(P basePopupWindow,
View anchorView,
int offsetX,
int offsetY)
已过时。
|
void |
onCalculateOffsetResult(P basePopupWindow,
View anchorView,
Point offsetResult,
int offsetX,
int offsetY)
已过时。
|
int |
onKeyboardChangeResult(int keyboardHeight,
boolean isKeyBoardVisible,
int offsetResult)
提供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过程,否则按照默认程序进行 |
boolean onPreMeasurePopupView(P basePopupWindow, View contentView, int width, int height)
basePopupWindow - basepopup对象contentView - contentViewwidth - 预设宽度height - 预设高度BasePopupWindow.preMeasurePopupView(int, int)boolean onTryToShowPopup(P basePopupWindow, PopupWindow popupWindow, View anchorView, int gravity, int offsetX, int offsetY)
BasePopupWindow.showPopupWindow()、BasePopupWindow.showPopupWindow(View)、BasePopupWindow.showPopupWindow(int)时,会回调该方法,允许用户拦截BasePopup的show过程,否则按照默认程序进行basePopupWindow - basePopupWindow对象popupWindow - popupwindow对象anchorView - 锚点Viewgravity - popupwindow gravityoffsetX - 水平偏移offsetY - 垂直偏移BasePopupWindow.tryToShowPopup(View, boolean, boolean)@Deprecated Point onCalculateOffset(P basePopupWindow, View anchorView, int offsetX, int offsetY)
basePopupWindow - basePopupWindow对象anchorView - 锚点ViewoffsetX - 水平偏移offsetY - 垂直偏移BasePopupWindow#calculateOffset(View, boolean)@Deprecated void onCalculateOffsetResult(P basePopupWindow, View anchorView, Point offsetResult, int offsetX, int offsetY)
basePopupWindow - basePopupWindow对象anchorView - 锚点ViewoffsetX - 水平偏移offsetResult - 已经经过默认计算的偏移量offsetY - 垂直偏移BasePopupWindow.tryToShowPopup(View, boolean, boolean)int onKeyboardChangeResult(int keyboardHeight,
boolean isKeyBoardVisible,
int offsetResult)
keyboardHeight - 键盘高度isKeyBoardVisible - 键盘是否已经弹出offsetResult - 默认计算的偏移量