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


Java Dialog.requestWindowFeature方法代码示例

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


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

示例1: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    Dialog dialog = new Dialog(getActivity());
    dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

    dialog.setCancelable(false);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setOnDismissListener(this);


    dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
    return dialog;
}
 
开发者ID:nidhinvv,项目名称:BubbleAlert,代码行数:17,代码来源:BblDialogFragmentBase.java

示例2: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final RelativeLayout root = new RelativeLayout(getActivity());
    root.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));
    // creating the fullscreen dialog
    final Dialog dialog = new Dialog(getContext());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(root);
    if (dialog.getWindow() != null) {
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        dialog.getWindow().setLayout(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
    }
    dialog.setCanceledOnTouchOutside(false);
    return dialog;
}
 
开发者ID:graviton57,项目名称:DOUSalaries,代码行数:21,代码来源:BaseDialog.java

示例3: createDialog

import android.app.Dialog; //导入方法依赖的package包/类
private void createDialog(String title, String text, int dialogType, int action) {
    dialogQuestion = new Dialog(this);
    dialogQuestion.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialogQuestion.setContentView(R.layout.dialog_message);

    Button btnOkay = (Button) dialogQuestion.findViewById(R.id.msgButtonOk);
    Button btnCancel = (Button) dialogQuestion.findViewById(R.id.msgButtonCancel);
    TextView msgTitle = (TextView) dialogQuestion.findViewById(R.id.msgTitle);
    TextView msgBody = (TextView) dialogQuestion.findViewById(R.id.msgBody);

    if (dialogType == Const.DIALOG.DIALOG_OK) {
        btnCancel.setVisibility(View.GONE);
    }

    btnOkay.setOnClickListener(this);

    msgTitle.setText(title);
    msgBody.setText(text);
    dialogAction = action;

    dialogQuestion.show();
}
 
开发者ID:ZetsPsych,项目名称:kibou-game-library,代码行数:23,代码来源:MainActivity.java

示例4: showLoading

import android.app.Dialog; //导入方法依赖的package包/类
public LoadingView showLoading(CharSequence msg, boolean cancleabl) {

        mDialog = new Dialog(mContext);// TODO: 2017/8/28 内存泄露时这里也修改为弱引用
        mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);

        rootView = View.inflate(mContext, R.layout.dialogui_loading_horizontal, null);
        mLinearLayout = (LinearLayout) rootView.findViewById(R.id.dialogui_ll_bg);
        mProgressBar = (ProgressBar) rootView.findViewById(R.id.pb_bg);
        mTextView = (TextView) rootView.findViewById(R.id.dialogui_tv_msg);
        mTextView.setText(msg);
        mLinearLayout.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
        mProgressBar.setIndeterminateDrawable(mContext.getResources().getDrawable(R.drawable.dialogui_shape_progress));
        mTextView.setTextColor(mContext.getResources().getColor(R.color.text_black));
        mDialog.setContentView(rootView);

        if (mDialog != null) {
            if (mDialog.isShowing()) {
                mDialog.dismiss();
            }
            mDialog.setCancelable(cancleabl);
            mDialog.setOnCancelListener(this);
            mDialog.show();
        }
        return this;
    }
 
开发者ID:devzwy,项目名称:NeiHanDuanZiTV,代码行数:26,代码来源:LoadingView.java

示例5: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    // the content
    final RelativeLayout root = new RelativeLayout(getActivity());
    root.setLayoutParams(new ViewGroup.LayoutParams(
            ViewGroup.LayoutParams.MATCH_PARENT,
            ViewGroup.LayoutParams.WRAP_CONTENT));

    // creating the fullscreen dialog
    final Dialog dialog = new Dialog(getContext());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(root);
    if (dialog.getWindow() != null) {
        dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
        dialog.getWindow().setLayout(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
    }
    dialog.setCanceledOnTouchOutside(false);

    return dialog;
}
 
开发者ID:mithrilcoin-io,项目名称:EosCommander,代码行数:24,代码来源:BaseDialog.java

示例6: buildLoadingVertical

import android.app.Dialog; //导入方法依赖的package包/类
protected BuildBean buildLoadingVertical(BuildBean bean) {
    Dialog dialog = new Dialog(bean.mContext);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    bean.dialog = dialog;

    View root = View.inflate(bean.mContext, R.layout.dialogui_loading_vertical, null);
    View llBg = (View) root.findViewById(R.id.dialogui_ll_bg);
    ProgressBar pbBg = (ProgressBar) root.findViewById(R.id.pb_bg);
    TextView tvMsg = (TextView) root.findViewById(R.id.dialogui_tv_msg);
    tvMsg.setText(bean.msg);
    if (bean.isWhiteBg) {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_wihte_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_rotate_mum));
        tvMsg.setTextColor(bean.mContext.getResources().getColor(R.color.text_black));
    } else {
        llBg.setBackgroundResource(R.drawable.dialogui_shape_gray_round_corner);
        pbBg.setIndeterminateDrawable(bean.mContext.getResources().getDrawable(R.drawable.dialogui_rotate_mum_light));
        tvMsg.setTextColor(Color.WHITE);
    }
    bean.dialog.setContentView(root);
    return bean;
}
 
开发者ID:devzwy,项目名称:KUtils,代码行数:23,代码来源:Buildable.java

示例7: showDialogForView

import android.app.Dialog; //导入方法依赖的package包/类
private void showDialogForView(View view) {
    mDialog = new Dialog(mActivity) {
        @Override
        public void onWindowFocusChanged(boolean hasFocus) {
            super.onWindowFocusChanged(hasFocus);
            if (!hasFocus) super.dismiss();
        }
    };
    mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    mDialog.setCanceledOnTouchOutside(true);
    mDialog.addContentView(view,
            new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                                          LinearLayout.LayoutParams.MATCH_PARENT));
    mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
        @Override
        public void onDismiss(DialogInterface dialog) {
            mItemSelectedCallback.onItemSelected("");
        }
    });

    Window window = mDialog.getWindow();
    if (!DeviceFormFactor.isTablet(mActivity)) {
        // On smaller screens, make the dialog fill the width of the screen,
        // and appear at the top.
        window.setBackgroundDrawable(new ColorDrawable(Color.WHITE));
        window.setGravity(Gravity.TOP);
        window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
                         ViewGroup.LayoutParams.WRAP_CONTENT);
    }

    mDialog.show();
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:33,代码来源:ItemChooserDialog.java

示例8: init

import android.app.Dialog; //导入方法依赖的package包/类
private void init(Context context) {
    dialog = new Dialog(context, R.style.BottomDialogTheme);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.layout_bottomdialog);
    dialog.getWindow().setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
    dialog.getWindow().setGravity(Gravity.BOTTOM);

    titleTextView = (TextView) dialog.findViewById(R.id.dialogTitle);
    messageTextView = (TextView) dialog.findViewById(R.id.dialogMessage);
    iconImageView = (ImageView) dialog.findViewById(R.id.dialogIcon);
    positiveButton = (Button) dialog.findViewById(R.id.buttonPositive);
    negativeButton = (Button) dialog.findViewById(R.id.buttonNegative);
    textContainer = (RelativeLayout) dialog.findViewById(R.id.textContainer);
    messageContainer = (LinearLayout) dialog.findViewById(R.id.messageContainer);
}
 
开发者ID:marcoscgdev,项目名称:DialogSheet,代码行数:16,代码来源:DialogSheet.java

示例9: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    // The only reason you might override this method when using onCreateView() is
    // to modify any dialog characteristics. For example, the dialog includes a
    // title by default, but your custom layout might not need it. So here you can
    // remove the dialog title, but you must call the superclass to get the Dialog.
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    return dialog;
}
 
开发者ID:TaRGroup,项目名称:IFWManager,代码行数:11,代码来源:RuleDetailFragment.java

示例10: showIngredients

import android.app.Dialog; //导入方法依赖的package包/类
@Override
public void showIngredients(List<String> ingredients) {

    LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = layoutInflater.inflate(R.layout.ingredients_dialog_view, null, false);
    ((TextView) view.findViewById(R.id.title)).setText(R.string.ingredients);
    ListView listView = (ListView) view.findViewById(R.id.ingredients_list);
    listView.setAdapter(new ArrayAdapter<>(getActivity(), R.layout.ingredients_list_item, ingredients));

    Dialog dialog = new Dialog(getActivity());
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(view);
    dialog.getWindow().getAttributes().windowAnimations = R.style.DialogTheme;
    dialog.show();
}
 
开发者ID:vicky7230,项目名称:Paprika,代码行数:16,代码来源:RecipesFragment.java

示例11: showFullScreenDialog

import android.app.Dialog; //导入方法依赖的package包/类
private void showFullScreenDialog() {
  Dialog dialog = new Dialog(getActivity(), R.style.mydialog);
  dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
  dialog.setContentView(R.layout.module_ui_dialog_station_fee);
  dialog.getWindow()
      .setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
  dialog.show();
}
 
开发者ID:liuguoquan727,项目名称:android-study,代码行数:9,代码来源:DialogUI.java

示例12: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
	Dialog d = super.onCreateDialog(savedInstanceState);
	
	
	d.requestWindowFeature(Window.FEATURE_NO_TITLE);
	d.getWindow().setLayout(ViewGroup.LayoutParams.WRAP_CONTENT, 
			ViewGroup.LayoutParams.WRAP_CONTENT);
	
	return d;
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:12,代码来源:ColorPickerDialogFragment.java

示例13: onCreateDialog

import android.app.Dialog; //导入方法依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    Window window = dialog.getWindow();
    if (window == null) {
        Log.wtf(TAG, "getWindow() should not be null ever");
        return dialog;
    }
    window.getAttributes().windowAnimations = R.style.coach_mark_dialog_animation;
    window.setBackgroundDrawable(new ColorDrawable(ContextCompat.getColor(getContext(),
            R.color.coach_mark_transparent_color)));
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    return dialog;
}
 
开发者ID:myntra,项目名称:CoachMarks,代码行数:16,代码来源:PopUpCoachMark.java

示例14: createDialogs

import android.app.Dialog; //导入方法依赖的package包/类
private void createDialogs() {
    dialogMenu = new Dialog(this);
    dialogMenu.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialogMenu.setContentView(R.layout.dialog_main_menu);

    addGame = (Button) dialogMenu.findViewById(R.id.btnDialogAddGame);
    about = (Button) dialogMenu.findViewById(R.id.btnDialogAbout);
    settings = (Button) dialogMenu.findViewById(R.id.btnDialogSettings);

    addGame.setOnClickListener(this);
    about.setOnClickListener(this);
    settings.setOnClickListener(this);
}
 
开发者ID:ZetsPsych,项目名称:kibou-game-library,代码行数:14,代码来源:MainActivity.java

示例15: setupDialog

import android.app.Dialog; //导入方法依赖的package包/类
public void setupDialog(Dialog dialog, int style) {
    switch (style) {
        case 1:
        case 2:
            break;
        case 3:
            dialog.getWindow().addFlags(24);
            break;
        default:
            return;
    }
    dialog.requestWindowFeature(1);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:14,代码来源:DialogFragment.java


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