public class CustomPopupWindow
extends android.widget.PopupWindow
PopupWindow ,所以它本身就是一个 PopupWindow
因此如果此类里封装的功能并不能满足您的需求(不想过多封装 UI 的东西,这里只提供思想,觉得不满足需求可以自己仿照着封装)
您可以直接调用 PopupWindow 的 Api 满足需求| Modifier and Type | Class and Description |
|---|---|
static class |
CustomPopupWindow.Builder |
static interface |
CustomPopupWindow.CustomPopupWindowListener |
| Modifier and Type | Method and Description |
|---|---|
static CustomPopupWindow.Builder |
builder() |
android.view.View |
getContentView()
获得用于展示popup内容的view
|
static android.view.View |
inflateView(android.view.ContextThemeWrapper context,
int layoutId)
用于填充contentView,必须传ContextThemeWrapper(比如activity)不然popupwindow要报错
|
void |
show() |
dismiss, getAnimationStyle, getBackground, getElevation, getEnterTransition, getExitTransition, getHeight, getInputMethodMode, getMaxAvailableHeight, getMaxAvailableHeight, getMaxAvailableHeight, getOverlapAnchor, getSoftInputMode, getWidth, getWindowLayoutType, isAboveAnchor, isAttachedInDecor, isClippingEnabled, isFocusable, isOutsideTouchable, isShowing, isSplitTouchEnabled, isTouchable, setAnimationStyle, setAttachedInDecor, setBackgroundDrawable, setClippingEnabled, setContentView, setElevation, setEnterTransition, setExitTransition, setFocusable, setHeight, setIgnoreCheekPress, setInputMethodMode, setOnDismissListener, setOutsideTouchable, setOverlapAnchor, setSoftInputMode, setSplitTouchEnabled, setTouchable, setTouchInterceptor, setWidth, setWindowLayoutMode, setWindowLayoutType, showAsDropDown, showAsDropDown, showAsDropDown, showAtLocation, update, update, update, update, update, updatepublic static CustomPopupWindow.Builder builder()
public android.view.View getContentView()
getContentView in class android.widget.PopupWindowpublic static android.view.View inflateView(android.view.ContextThemeWrapper context,
int layoutId)
context - layoutId - public void show()