本文整理了Java中android.app.Dialog.requestWindowFeature()
方法的一些代码示例,展示了Dialog.requestWindowFeature()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Dialog.requestWindowFeature()
方法的具体详情如下:
包路径:android.app.Dialog
类名称:Dialog
方法名:requestWindowFeature
暂无
代码示例来源:origin: stackoverflow.com
Dialog dialog = new Dialog(context);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: stackoverflow.com
public class CustomDialogFragment extends DialogFragment {
/** The system calls this to get the DialogFragment's layout, regardless
of whether it's being displayed as a dialog or an embedded fragment. */
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout to use as dialog or embedded fragment
return inflater.inflate(R.layout.purchase_items, container, false);
}
/** The system calls this only when creating the layout in a dialog. */
@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;
}
}
代码示例来源:origin: aa112901/remusic
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
//设置无标题
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
View view = inflater.inflate(R.layout.loading, container, false);
return view;
}
代码示例来源:origin: wdullaer/MaterialDateTimePicker
@Override @NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
return dialog;
}
代码示例来源:origin: wdullaer/MaterialDateTimePicker
@Override @NonNull
public Dialog onCreateDialog(Bundle savedInstanceState) {
Dialog dialog = super.onCreateDialog(savedInstanceState);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
return dialog;
}
代码示例来源:origin: stackoverflow.com
@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
// the content
final RelativeLayout root = new RelativeLayout(getActivity());
root.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
// creating the fullscreen dialog
final Dialog dialog = new Dialog(getActivity());
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(root);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.YELLOW));
dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
return dialog;
}
代码示例来源:origin: aa112901/remusic
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//设置无标题
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
View view = inflater.inflate(R.layout.fragment_timing, container);
timing10 = (TextView) view.findViewById(R.id.timing_10min);
timing20 = (TextView) view.findViewById(R.id.timing_20min);
timing30 = (TextView) view.findViewById(R.id.timing_30min);
timing45 = (TextView) view.findViewById(R.id.timing_45min);
timing60 = (TextView) view.findViewById(R.id.timing_60min);
timing90 = (TextView) view.findViewById(R.id.timing_90min);
timing10.setOnClickListener(this);
timing20.setOnClickListener(this);
timing30.setOnClickListener(this);
timing45.setOnClickListener(this);
timing60.setOnClickListener(this);
timing90.setOnClickListener(this);
return view;
}
代码示例来源:origin: aa112901/remusic
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//设置无标题
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
//设置从底部弹出
WindowManager.LayoutParams params = getDialog().getWindow()
.getAttributes();
params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setAttributes(params);
if (getArguments() != null) {
musicInfo = getArguments().getParcelable("musicinfo");
}
View view = inflater.inflate(R.layout.fragment_music_detail, container);
title = (TextView) view.findViewById(R.id.music_detail_title);
name = (TextView) view.findViewById(R.id.music_detail_name);
time = (TextView) view.findViewById(R.id.music_detail_time);
//qua = (TextView) view.findViewById(R.id.music_detail_quater);
size = (TextView) view.findViewById(R.id.music_detail_size);
path = (TextView) view.findViewById(R.id.music_detail_path);
title.setText(musicInfo.musicName);
name.setText(musicInfo.artist + "-" + musicInfo.musicName);
time.setText(MusicUtils.makeShortTimeString(mContext, musicInfo.duration / 1000));
size.setText(musicInfo.size / 1000000 + "m");
path.setText(musicInfo.data);
return view;
}
代码示例来源:origin: MindorksOpenSource/android-mvp-architecture
@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;
}
代码示例来源:origin: Rukey7/MvpApp
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
Window window = getDialog().getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
代码示例来源:origin: aa112901/remusic
Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: aa112901/remusic
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
//设置无标题
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
//设置从底部弹出
WindowManager.LayoutParams params = getDialog().getWindow()
.getAttributes();
params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setAttributes(params);
if (getArguments() != null) {
args = getArguments().getLong("id");
}
//布局
View view = inflater.inflate(R.layout.more_fragment, container);
topTitle = (TextView) view.findViewById(R.id.pop_list_title);
recyclerView = (RecyclerView) view.findViewById(R.id.pop_list);
layoutManager = new LinearLayoutManager(mContext);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(layoutManager);
getList();
setClick();
setItemDecoration();
return view;
}
代码示例来源:origin: aa112901/remusic
Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: aa112901/remusic
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: aa112901/remusic
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: aa112901/remusic
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: iSoron/uhabits
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: aa112901/remusic
@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: aa112901/remusic
@Override
public View onCreateView(LayoutInflater inflater, final ViewGroup container, Bundle savedInstanceState) {
getDialog().requestWindowFeature(Window.FEATURE_NO_TITLE);
代码示例来源:origin: stackoverflow.com
/** The system calls this only when creating the layout in a dialog. */
@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);
dialog.setCanceledOnTouchOutside(true);
return dialog;
}
内容来源于网络,如有侵权,请联系作者删除!