List of usage examples for android.app Dialog getWindow
public @Nullable Window getWindow()
From source file:com.akhbulatov.wordkeeper.ui.dialog.WordEditorDialog.java
@NonNull @SuppressLint("InflateParams") @Override/*from w w w . j a v a2s.c om*/ public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); LayoutInflater inflater = getActivity().getLayoutInflater(); builder.setView(inflater.inflate(R.layout.dialog_word_editor, null)).setTitle(mTitleId) .setPositiveButton(mPositiveTextId, (dialog, which) -> mListener.onFinishWordEditorDialog(WordEditorDialog.this, mPositiveTextId)) .setNegativeButton(mNegativeTextId, (dialog, which) -> dialog.dismiss()); Dialog dialog = builder.create(); // Shows the soft keyboard automatically dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return dialog; }
From source file:org.mozilla.focus.fragment.AddToHomescreenDialogFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); final Dialog dialog = getDialog(); if (dialog != null) { final Window window = dialog.getWindow(); if (window != null) { window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); }//from ww w . j a v a2s . c o m } }
From source file:cn.stj.fphealth.views.dialog.QrcodeDialog.java
/** * Set the dialog edit text and other attribute *///from w ww . jav a2 s . co m @Override public void onResume() { super.onResume(); Dialog dialog = getDialog(); dialog.setCanceledOnTouchOutside(false); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN); dialog.setCancelable(false); dialog.setOnKeyListener(new QrcodeDialogKeyListener()); }
From source file:com.apptentive.android.sdk.module.messagecenter.view.AttachmentPreviewDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().getAttributes().windowAnimations = R.style.ApptentiveDialogAnimation; dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(dialog.getWindow().getAttributes()); lp.gravity = Gravity.BOTTOM;//from w w w. j ava 2s . c om lp.width = WindowManager.LayoutParams.MATCH_PARENT; lp.height = WindowManager.LayoutParams.MATCH_PARENT; dialog.getWindow().setAttributes(lp); return dialog; }
From source file:com.fjn.magazinereturncandidate.fragments.InputJanCodeFragment.java
@Override public void onStart() { super.onStart(); Dialog dialog = getDialog(); if (dialog != null) { if (dialog.getWindow() != null) { dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); }//from w ww . j ava 2s . c om } }
From source file:org.transdroid.core.gui.navigation.SetTransferRatesDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { if (onRatesPickedListener == null) throw new InvalidParameterException( "Please first set the callback listener using setOnRatesPickedListener before opening the dialog."); final View transferRatesContent = getActivity().getLayoutInflater().inflate(R.layout.dialog_transferrates, null, false);//from w ww . j ava 2 s .com maxSpeedDown = (TextView) transferRatesContent.findViewById(R.id.maxspeeddown_text); maxSpeedUp = (TextView) transferRatesContent.findViewById(R.id.maxspeedup_text); bindButtons(transferRatesContent, maxSpeedDown, R.id.down1Button, R.id.down2Button, R.id.down3Button, R.id.down4Button, R.id.down5Button, R.id.down6Button, R.id.down7Button, R.id.down8Button, R.id.down9Button, R.id.down0Button); bindButtons(transferRatesContent, maxSpeedUp, R.id.up1Button, R.id.up2Button, R.id.up3Button, R.id.up4Button, R.id.up5Button, R.id.up6Button, R.id.up7Button, R.id.up8Button, R.id.up9Button, R.id.up0Button); ((Button) transferRatesContent.findViewById(R.id.ok_button)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { int maxDown = -1, maxUp = -1; try { maxDown = Integer.parseInt(maxSpeedDown.getText().toString()); maxUp = Integer.parseInt(maxSpeedUp.getText().toString()); } catch (NumberFormatException e) { } if (maxDown <= 0 || maxUp <= 0) { onRatesPickedListener.onInvalidNumber(); } onRatesPickedListener.onRatesPicked(maxDown, maxUp); dismiss(); } }); ((Button) transferRatesContent.findViewById(R.id.reset_button)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { onRatesPickedListener.resetRates(); dismiss(); } }); ((Button) transferRatesContent.findViewById(R.id.cancel_button)).setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { dismiss(); } }); Dialog dialog = new Dialog(getActivity()); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(transferRatesContent); return dialog; }
From source file:com.chatwingsdk.fragments.ProfileFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); return dialog; }
From source file:com.mbientlab.metawear.app.popup.DataPlotFragment.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { ///< No title window code from: http://stackoverflow.com/a/15279400 Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); return dialog; }
From source file:com.android.timezonepicker.TimeZonePickerDialog.java
@Override public Dialog onCreateDialog(Bundle savedInstanceState) { Dialog dialog = super.onCreateDialog(savedInstanceState); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); return dialog; }
From source file:com.mbientlab.metawear.app.popup.DataPlotFragment.java
@Override public void onStart() { super.onStart(); ///< used suggestion from http://www.techrepublic.com/article/pro-tip-unravel-the-mystery-of-androids-full-screen-dialog-fragments/ Dialog dialog = getDialog(); if (dialog != null) { dialog.getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); }// w w w .j av a2 s . c o m }