android.app.Dialog.onWindowAttributesChanged()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(281)

本文整理了Java中android.app.Dialog.onWindowAttributesChanged()方法的一些代码示例,展示了Dialog.onWindowAttributesChanged()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialog.onWindowAttributesChanged()方法的具体详情如下:
包路径:android.app.Dialog
类名称:Dialog
方法名:onWindowAttributesChanged

Dialog.onWindowAttributesChanged介绍

暂无

代码示例

代码示例来源:origin: facebook/facebook-android-sdk

  1. @Override
  2. public void onWindowAttributesChanged(WindowManager.LayoutParams params) {
  3. if (params.token == null) {
  4. // Always store the last params, so the token can be updated when the dialog is
  5. // attached to the window.
  6. windowParams = params;
  7. }
  8. super.onWindowAttributesChanged(params);
  9. }

代码示例来源:origin: yanjiabin/ExtendDialog

  1. /**
  2. * 全屏显示
  3. */
  4. public ExtendsDialog fullScreen() {
  5. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  6. wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
  7. wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
  8. mDialog.onWindowAttributesChanged(wl);
  9. return this;
  10. }

代码示例来源:origin: luoshihai/XXDialog

  1. /**
  2. * 全屏显示
  3. */
  4. public XXDialog fullScreen() {
  5. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  6. wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
  7. wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
  8. mDialog.onWindowAttributesChanged(wl);
  9. return this;
  10. }

代码示例来源:origin: yanjiabin/ExtendDialog

  1. /**
  2. * 全屏宽度
  3. */
  4. public ExtendsDialog fullWidth() {
  5. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  6. wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
  7. mDialog.onWindowAttributesChanged(wl);
  8. return this;
  9. }

代码示例来源:origin: yanjiabin/ExtendDialog

  1. /**
  2. * 全屏高度
  3. */
  4. public ExtendsDialog fullHeight() {
  5. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  6. wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
  7. mDialog.onWindowAttributesChanged(wl);
  8. return this;
  9. }

代码示例来源:origin: luoshihai/XXDialog

  1. /**
  2. * 全屏宽度
  3. */
  4. public XXDialog fullWidth() {
  5. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  6. wl.width = ViewGroup.LayoutParams.MATCH_PARENT;
  7. mDialog.onWindowAttributesChanged(wl);
  8. return this;
  9. }

代码示例来源:origin: luoshihai/XXDialog

  1. /**
  2. * 全屏高度
  3. */
  4. public XXDialog fullHeight() {
  5. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  6. wl.height = ViewGroup.LayoutParams.MATCH_PARENT;
  7. mDialog.onWindowAttributesChanged(wl);
  8. return this;
  9. }

代码示例来源:origin: yanjiabin/ExtendDialog

  1. /**
  2. *
  3. * @param width 自定义的宽度
  4. * @param height 自定义的高度
  5. * @return
  6. */
  7. public ExtendsDialog setWidthAndHeight(int width, int height) {
  8. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  9. wl.width = width;
  10. wl.height = height;
  11. mDialog.onWindowAttributesChanged(wl);
  12. return this;
  13. }

代码示例来源:origin: luoshihai/XXDialog

  1. /**
  2. *
  3. * @param width 自定义的宽度
  4. * @param height 自定义的高度
  5. * @return
  6. */
  7. public XXDialog setWidthAndHeight(int width, int height) {
  8. WindowManager.LayoutParams wl = mDialogWindow.getAttributes();
  9. wl.width = width;
  10. wl.height = height;
  11. mDialog.onWindowAttributesChanged(wl);
  12. return this;
  13. }

代码示例来源:origin: dongorigin/AndroidDemo

  1. public static void popUpMenu(View view, Activity activityContext,
  2. DialogInterface.OnDismissListener listener) {
  3. menuDialog = new Dialog(activityContext, R.style.transparentFrameWindowStyle);
  4. menuDialog.setContentView(view, new RelativeLayout.LayoutParams(activityContext
  5. .getWindowManager().getDefaultDisplay().getWidth(),
  6. RelativeLayout.LayoutParams.WRAP_CONTENT));
  7. Window window = menuDialog.getWindow();
  8. // 设置显示动画
  9. // window.setWindowAnimations(R.style.main_menu_animstyle);
  10. WindowManager.LayoutParams wl = window.getAttributes();
  11. wl.x = 0;
  12. // wl.y = (int) (activityContext.getWindowManager().getDefaultDisplay().getHeight() * 0.5);
  13. wl.y = 0;
  14. wl.width = 300;
  15. wl.height = 300;
  16. // window.setAttributes(wl);
  17. // 设置显示位置
  18. menuDialog.onWindowAttributesChanged(wl);
  19. // 设置点击外围解散
  20. menuDialog.setCanceledOnTouchOutside(true);
  21. menuDialog.show();
  22. menuDialog.setOnDismissListener(listener);
  23. // Display display = activityContext.getWindowManager().getDefaultDisplay();
  24. // WindowManager.LayoutParams lp = menuDialog.getWindow().getAttributes();
  25. // lp.width = (int) (display.getWidth()); // 设置宽度
  26. // menuDialog.getWindow().setAttributes(lp);
  27. }

代码示例来源:origin: jjdxmashl/jjdxm_dialogui

  1. dialog.onWindowAttributesChanged(wl);

相关文章