本文整理汇总了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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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();
}
示例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();
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}