本文整理了Java中android.app.Dialog.onWindowAttributesChanged()
方法的一些代码示例,展示了Dialog.onWindowAttributesChanged()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialog.onWindowAttributesChanged()
方法的具体详情如下:
包路径:android.app.Dialog
类名称:Dialog
方法名:onWindowAttributesChanged
暂无
代码示例来源:origin: facebook/facebook-android-sdk
@Override
public void onWindowAttributesChanged(WindowManager.LayoutParams params) {
if (params.token == null) {
// Always store the last params, so the token can be updated when the dialog is
// attached to the window.
windowParams = params;
}
super.onWindowAttributesChanged(params);
}
代码示例来源:origin: yanjiabin/ExtendDialog
/**
* 全屏显示
*/
public ExtendsDialog fullScreen() {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: luoshihai/XXDialog
/**
* 全屏显示
*/
public XXDialog fullScreen() {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: yanjiabin/ExtendDialog
/**
* 全屏宽度
*/
public ExtendsDialog fullWidth() {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: yanjiabin/ExtendDialog
/**
* 全屏高度
*/
public ExtendsDialog fullHeight() {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: luoshihai/XXDialog
/**
* 全屏宽度
*/
public XXDialog fullWidth() {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: luoshihai/XXDialog
/**
* 全屏高度
*/
public XXDialog fullHeight() {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: yanjiabin/ExtendDialog
/**
*
* @param width 自定义的宽度
* @param height 自定义的高度
* @return
*/
public ExtendsDialog setWidthAndHeight(int width, int height) {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.width = width;
wl.height = height;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: luoshihai/XXDialog
/**
*
* @param width 自定义的宽度
* @param height 自定义的高度
* @return
*/
public XXDialog setWidthAndHeight(int width, int height) {
WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
wl.width = width;
wl.height = height;
mDialog.onWindowAttributesChanged(wl);
return this;
}
代码示例来源:origin: dongorigin/AndroidDemo
public static void popUpMenu(View view, Activity activityContext,
DialogInterface.OnDismissListener listener) {
menuDialog = new Dialog(activityContext, R.style.transparentFrameWindowStyle);
menuDialog.setContentView(view, new RelativeLayout.LayoutParams(activityContext
.getWindowManager().getDefaultDisplay().getWidth(),
RelativeLayout.LayoutParams.WRAP_CONTENT));
Window window = menuDialog.getWindow();
// 设置显示动画
// window.setWindowAnimations(R.style.main_menu_animstyle);
WindowManager.LayoutParams wl = window.getAttributes();
wl.x = 0;
// wl.y = (int) (activityContext.getWindowManager().getDefaultDisplay().getHeight() * 0.5);
wl.y = 0;
wl.width = 300;
wl.height = 300;
// window.setAttributes(wl);
// 设置显示位置
menuDialog.onWindowAttributesChanged(wl);
// 设置点击外围解散
menuDialog.setCanceledOnTouchOutside(true);
menuDialog.show();
menuDialog.setOnDismissListener(listener);
// Display display = activityContext.getWindowManager().getDefaultDisplay();
// WindowManager.LayoutParams lp = menuDialog.getWindow().getAttributes();
// lp.width = (int) (display.getWidth()); // 设置宽度
// menuDialog.getWindow().setAttributes(lp);
}
代码示例来源:origin: jjdxmashl/jjdxm_dialogui
dialog.onWindowAttributesChanged(wl);
内容来源于网络,如有侵权,请联系作者删除!