1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
public void showBottomPopupWindow(View parent, View contentView, int bgColor, boolean focusable, boolean fullScreen, PopupWindow.OnDismissListener onDismissListener) { hideBottomDialog(); AutoUtils.auto(contentView); popupWindow = new PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, fullScreen ? ViewGroup.LayoutParams.MATCH_PARENT : ViewGroup.LayoutParams.WRAP_CONTENT); popupWindow.setContentView(contentView); popupWindow.setFocusable(focusable); popupWindow.setBackgroundDrawable(new ColorDrawable(bgColor)); if (onDismissListener != null) { popupWindow.setOnDismissListener(onDismissListener); } popupWindow.setAnimationStyle(R.style.ZzAnimationDialog); popupWindow.showAtLocation(parent, Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, 0); }
public void hideBottomDialog() { if (popupWindow != null) { popupWindow.dismiss(); popupWindow = null; } }
|