public abstract class BaseDialog
extends AppCompatDialog
| Constructor and Description |
|---|
BaseDialog(android.content.Context context) |
BaseDialog(android.content.Context context,
int layoutId) |
BaseDialog(android.content.Context context,
int theme,
int layoutId) |
BaseDialog(android.content.Context context,
int theme,
android.view.View contentView) |
BaseDialog(android.content.Context context,
android.view.View contentView) |
| Modifier and Type | Method and Description |
|---|---|
<T extends android.view.View> |
findViewById(int id) |
protected android.graphics.drawable.Drawable |
getDrawable(int resId) |
static int |
getNavigationBarHeight(android.content.Context context)
获取系统底部导航栏的高度
|
protected java.lang.String |
getString(int resId) |
protected abstract void |
initListeners()
初始化监听器
|
protected abstract void |
initViews()
初始化控件
|
static boolean |
isShouldHideInput(android.view.Window window,
android.view.MotionEvent event)
根据用户点击的坐标获取用户在窗口上触摸到的View,判断这个View是否是EditText来判断是否需要隐藏键盘
|
static boolean |
isSoftInputShow(android.view.ViewGroup rootView)
输入键盘是否在显示
|
static boolean |
isSoftInputShow(android.view.Window window)
输入键盘是否在显示
|
boolean |
onTouchEvent(android.view.MotionEvent ev) |
protected BaseDialog |
setDialogSize(int width,
int height)
设置弹窗的宽和高
|
public BaseDialog(android.content.Context context,
int layoutId)
public BaseDialog(android.content.Context context,
android.view.View contentView)
public BaseDialog(android.content.Context context)
public BaseDialog(android.content.Context context,
int theme,
int layoutId)
public BaseDialog(android.content.Context context,
int theme,
android.view.View contentView)
public <T extends android.view.View> T findViewById(int id)
protected abstract void initViews()
protected abstract void initListeners()
protected BaseDialog setDialogSize(int width, int height)
width - height - protected java.lang.String getString(int resId)
protected android.graphics.drawable.Drawable getDrawable(int resId)
public boolean onTouchEvent(android.view.MotionEvent ev)
public static boolean isShouldHideInput(android.view.Window window,
android.view.MotionEvent event)
window - 窗口event - 用户点击事件public static boolean isSoftInputShow(android.view.Window window)
window - 应用窗口public static boolean isSoftInputShow(android.view.ViewGroup rootView)
rootView - 根布局public static int getNavigationBarHeight(android.content.Context context)
context - 上下文