當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。