当前位置: 首页>>代码示例>>Java>>正文


Java Window.setDimAmount方法代码示例

本文整理汇总了Java中android.view.Window.setDimAmount方法的典型用法代码示例。如果您正苦于以下问题:Java Window.setDimAmount方法的具体用法?Java Window.setDimAmount怎么用?Java Window.setDimAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.Window的用法示例。


在下文中一共展示了Window.setDimAmount方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: show

import android.view.Window; //导入方法依赖的package包/类
/**
 * DialogLoading loading = new DialogLoading(context)
 * loading.show("123")
 *
 * @param msg 消息
 */
public AlertDialog show(String msg) {
    alertDialog = new AlertDialog.Builder(mContext).create();
    alertDialog.show();
    Window window = alertDialog.getWindow();
    window.setContentView(R.layout.dialog_loading);
    window.setGravity(Gravity.CENTER);// 此处可以设置dialog显示的位置
    //window.setWindowAnimations(R.style.DialogAnimation);
    window.setBackgroundDrawableResource(R.color.transparent);
    window.setDimAmount(0f);//覆盖成透明度

    this.msg = (TextView) window.findViewById(R.id.textView1);
    this.msg.setText(msg);
    //alertDialog.setCancelable(false);// 点击退出
    return alertDialog;
}
 
开发者ID:abook23,项目名称:godlibrary,代码行数:22,代码来源:DialogLoading.java

示例2: onStart

import android.view.Window; //导入方法依赖的package包/类
@Override
public void onStart() {
    super.onStart();
    final Window window = getDialog().getWindow();
    if (window != null) {
        window.setBackgroundDrawableResource(android.R.color.transparent);
        window.setDimAmount(0f);
        window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    }
}
 
开发者ID:Popalay,项目名称:Tutors,代码行数:11,代码来源:Tutors.java

示例3: initDialogWidth

import android.view.Window; //导入方法依赖的package包/类
private void initDialogWidth() {
    Window window = getWindow();
    if (window == null) {
        return;
    }
    window.setDimAmount(0.6f); // 部分刷机会导致背景透明,这里保证一次
    WindowManager.LayoutParams wmlp = window.getAttributes();
    wmlp.width = ViewGroup.LayoutParams.MATCH_PARENT;
    window.setAttributes(wmlp);
}
 
开发者ID:coopese,项目名称:qmui,代码行数:11,代码来源:QMUIDialog.java

示例4: setTransParentBackground

import android.view.Window; //导入方法依赖的package包/类
/**
 * 背景全透明
 */
public <T extends BubbleDialog> T setTransParentBackground()
{
    Window window = getWindow();
    if (window == null) return (T) this;
    window.setDimAmount(0);
    return (T) this;
}
 
开发者ID:xujiaji,项目名称:HappyBubble,代码行数:11,代码来源:BubbleDialog.java

示例5: onCreateDialog

import android.view.Window; //导入方法依赖的package包/类
@NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.setCancelable(false);
    setCancelable(false);
    Window window = dialog.getWindow();
    if (window != null) {
        window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        window.setDimAmount(0);
    }
    return dialog;
}
 
开发者ID:duyp,项目名称:mvvm-template,代码行数:12,代码来源:ProgressDialogFragment.java

示例6: BaseMessageDialog

import android.view.Window; //导入方法依赖的package包/类
protected BaseMessageDialog(Activity activity, boolean fullscreen, BaseMessageOptions options,
    WebInterstitialOptions webOptions, HTMLOptions htmlOptions) {
  super(activity, getTheme(activity));

  SizeUtil.init(activity);
  this.activity = activity;
  this.options = options;
  this.webOptions = webOptions;
  this.htmlOptions = htmlOptions;
  if (webOptions != null) {
    isWeb = true;
  }
  if (htmlOptions != null) {
    isHtml = true;
  }
  dialogView = new RelativeLayout(activity);
  RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
      LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
  dialogView.setBackgroundColor(Color.TRANSPARENT);
  dialogView.setLayoutParams(layoutParams);

  RelativeLayout view = createContainerView(activity, fullscreen);
  view.setId(108);
  dialogView.addView(view, view.getLayoutParams());

  if ((!isWeb || (webOptions != null && webOptions.hasDismissButton())) && !isHtml) {
    CloseButton closeButton = createCloseButton(activity, fullscreen, view);
    dialogView.addView(closeButton, closeButton.getLayoutParams());
  }

  setContentView(dialogView, dialogView.getLayoutParams());

  dialogView.setAnimation(createFadeInAnimation());

  if (!fullscreen) {
    Window window = getWindow();
    if (window == null) {
      return;
    }
    if (!isHtml) {
      window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
      if (Build.VERSION.SDK_INT >= 14) {
        window.setDimAmount(0.7f);
      }
    } else {
      window.clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
      window.setFlags(WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL,
          WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL);
      if (htmlOptions != null &&
          MessageTemplates.Args.HTML_ALIGN_BOTTOM.equals(htmlOptions.getHtmlAlign())) {
        dialogView.setGravity(Gravity.BOTTOM);
      }
    }
  }
}
 
开发者ID:Leanplum,项目名称:Leanplum-Android-SDK,代码行数:56,代码来源:BaseMessageDialog.java


注:本文中的android.view.Window.setDimAmount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。