Java Code Examples for android.support.v7.app.AlertDialog#getWindow()
The following examples show how to use
android.support.v7.app.AlertDialog#getWindow() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Buildable.java From KUtils with Apache License 2.0 | 5 votes |
protected BuildBean buildCenterSheet(BuildBean bean) { AlertDialog.Builder builder = new AlertDialog.Builder(bean.mContext); SheetHolder holder = new SheetHolder(bean.mContext); builder.setView(holder.rootView); AlertDialog dialog = builder.create(); bean.alertDialog = dialog; if (bean.isVertical && !TextUtils.isEmpty(bean.bottomTxt)) { Window window = dialog.getWindow(); window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); } holder.assingDatasAndEvents(bean.mContext, bean); return bean; }
Example 2
Source File: Buildable.java From KUtils-master with Apache License 2.0 | 5 votes |
protected BuildBean buildCenterSheet(BuildBean bean) { AlertDialog.Builder builder = new AlertDialog.Builder(bean.mContext); SheetHolder holder = new SheetHolder(bean.mContext); builder.setView(holder.rootView); AlertDialog dialog = builder.create(); bean.alertDialog = dialog; if (bean.isVertical && !TextUtils.isEmpty(bean.bottomTxt)) { Window window = dialog.getWindow(); window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); } holder.assingDatasAndEvents(bean.mContext, bean); return bean; }
Example 3
Source File: ActivityUtils.java From memetastic with GNU General Public License v3.0 | 5 votes |
/** * Show dialog in full width / show keyboard * * @param dialog Get via dialog.show() */ public void dialogFullWidth(AlertDialog dialog, boolean fullWidth, boolean showKeyboard) { try { Window w; if (dialog != null && (w = dialog.getWindow()) != null) { if (fullWidth) { w.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT); } if (showKeyboard) { w.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); } } } catch (Exception ignored) { } }
Example 4
Source File: ActivityUtils.java From openlauncher with Apache License 2.0 | 5 votes |
/** * Show dialog in full width / show keyboard * * @param dialog Get via dialog.show() */ public void dialogFullWidth(AlertDialog dialog, boolean fullWidth, boolean showKeyboard) { try { Window w; if (dialog != null && (w = dialog.getWindow()) != null) { if (fullWidth) { w.setLayout(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT); } if (showKeyboard) { w.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); } } } catch (Exception ignored) { } }
Example 5
Source File: InsertHelper.java From ForPDA with GNU General Public License v3.0 | 5 votes |
public void show() { AlertDialog alertDialog = new AlertDialog.Builder(context) .setView(layoutContainer) .setPositiveButton(R.string.insert, (dialog, which) -> { if (insertListener != null) { ArrayList<Pair<String, String>> resultHeaders = new ArrayList<>(); for (int i = 0; i < headers.size(); i++) { String value = null; Editable editable = headersLayout.get(i).getText(); if (editable != null) { value = editable.toString(); if (value.length() == 0) { value = null; } } resultHeaders.add(new Pair<>(headers.get(i).second, value)); } if (bodyLayout != null) { insertListener.onInsert(resultHeaders, bodyLayout.getText().toString()); } else { insertListener.onInsert(resultHeaders, null); } } }) .setNegativeButton(R.string.cancel, null) .show(); if (alertDialog.getWindow() != null) alertDialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); }
Example 6
Source File: PaginationHelper.java From ForPDA with GNU General Public License v3.0 | 5 votes |
public void selectPageDialog() { if (context == null) context = App.getActivity(); final int[] pages = new int[pagination.getAll()]; for (int i = 0; i < pagination.getAll(); i++) pages[i] = i + 1; final ListView listView = new ListView(context); listView.setDivider(null); listView.setDividerHeight(0); listView.setFastScrollEnabled(true); listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE); listView.setAdapter(new PaginationAdapter(context, pages)); listView.setItemChecked(pagination.getCurrent() - 1, true); listView.setSelection(pagination.getCurrent() - 1); AlertDialog dialog = new AlertDialog.Builder(context) .setView(listView) .show(); if (dialog.getWindow() != null) dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); listView.setOnItemClickListener((adapterView, view1, i2, l) -> { if (listView.getTag() != null && !((Boolean) listView.getTag())) { return; } selectPage(i2 * pagination.getPerPage()); dialog.cancel(); }); }
Example 7
Source File: CustomDialogFragment.java From Simple-Solitaire with GNU General Public License v3.0 | 5 votes |
protected AlertDialog applyFlags(AlertDialog dialog) { if (prefs.getSavedImmersiveMode()) { Window window = dialog.getWindow(); if (window != null) { window.setFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE, WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE); } if (dialog.getListView() != null) { dialog.getListView().setScrollbarFadingEnabled(false); } } return dialog; }
Example 8
Source File: MainActivity.java From DialogUtils with Apache License 2.0 | 5 votes |
private void showcenterDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setView(R.layout.dialog_ios_alert); AlertDialog dialog = builder.create(); Window window = dialog.getWindow(); // window.setWindowAnimations(R.style.mystyle); window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));//round corner builder.show(); }