private void initPop() {
View inflate = LayoutInflater.from(this).inflate(R.layout.pop_item, null);
PopupWindow popupWindow = new PopupWindow(inflate, 400, 400);
popupWindow.setBackgroundDrawable(new ColorDrawable ());
popupWindow.setFocusable(true);
popupWindow.setOutsideTouchable(true);
setBackAphla(0.5f);
popupWindow.showAtLocation(mButton1, Gravity.CENTER,ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
@Override
public void onDismiss() {
setBackAphla(1f);
}
});
}
public void setBackAphla(float alpha){
WindowManager.LayoutParams attributes = getWindow().getAttributes();
attributes.alpha=alpha;
getWindow().setAttributes(attributes);
}