@Override public boolean onItemClick(EasyRecyclerView easyRecyclerView, View view, int position, long id) { Pair<String, String> pair = data.get(position); Bundle args = new Bundle(); args.putString(KEY_HOST, pair.first); args.putString(KEY_IP, pair.second); DialogFragment fragment = new EditHostDialogFragment(); fragment.setArguments(args); fragment.show(getSupportFragmentManager(), DIALOG_TAG_EDIT_HOST); return true; }
private void showPreferences() { Bundle args = new Bundle(); args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options); args.putInt(PopupSettingsFragment.EXTRA_SUMMARY, R.string.pull_up_hint); args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[]{ R.xml.preferences_font, R.xml.preferences_comments}); ((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args)) .show(getFragmentManager(), PopupSettingsFragment.class.getName()); }
private void showPreferences() { Bundle args = new Bundle(); args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.list_display_options); args.putInt(PopupSettingsFragment.EXTRA_SUMMARY, R.string.pull_up_hint); args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[]{ R.xml.preferences_font, R.xml.preferences_list}); ((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args)) .show(getFragmentManager(), PopupSettingsFragment.class.getName()); }
private void showPreferences() { Bundle args = new Bundle(); args.putInt(PopupSettingsFragment.EXTRA_TITLE, R.string.font_options); args.putIntArray(PopupSettingsFragment.EXTRA_XML_PREFERENCES, new int[]{R.xml.preferences_readability}); ((DialogFragment) Fragment.instantiate(getActivity(), PopupSettingsFragment.class.getName(), args)) .show(getFragmentManager(), PopupSettingsFragment.class.getName()); }
@Override public void show(FragmentManager manager, String tag) { if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) { if (manager.isDestroyed()) { return; } } try { super.show(manager, tag); } catch (Exception e) { ExceptionHandler exceptionHandler = ExceptionHandlerHelper.getInstance(); if (exceptionHandler != null) { exceptionHandler.onException(e); } } }
fragment.show(getFragmentManager(), getDialogTag(dialogId));
private void showDialog(int dialogId) { DialogFragment fragment; if (dialogId == R.id.dialog_confirm_delete) { String title = getString(R.string.dialog_confirm_delete_title); String message = getString(R.string.dialog_confirm_delete_message); String confirmText = getString(R.string.dialog_confirm_delete_confirm_button); String cancelText = getString(R.string.dialog_confirm_delete_cancel_button); fragment = ConfirmationDialogFragment.newInstance(dialogId, title, message, confirmText, cancelText); } else if (dialogId == R.id.dialog_confirm_spam) { String title = getString(R.string.dialog_confirm_spam_title); String message = getResources().getQuantityString(R.plurals.dialog_confirm_spam_message, 1); String confirmText = getString(R.string.dialog_confirm_spam_confirm_button); String cancelText = getString(R.string.dialog_confirm_spam_cancel_button); fragment = ConfirmationDialogFragment.newInstance(dialogId, title, message, confirmText, cancelText); } else if (dialogId == R.id.dialog_attachment_progress) { String message = getString(R.string.dialog_attachment_progress_title); long size = currentAttachmentViewInfo.size; fragment = AttachmentDownloadDialogFragment.newInstance(size, message); } else { throw new RuntimeException("Called showDialog(int) with unknown dialog id."); } fragment.setTargetFragment(this, dialogId); fragment.show(getFragmentManager(), getDialogTag(dialogId)); }
private void checkAccounts() { Account[] accounts = accountManager.getAccountsByType(GOOGLE_TYPE); if (accounts == null || accounts.length == 0) { Log.d(TAG, "no google accounts found on this device, using standard auth"); setResult(RESULT_OK, new Intent(ACTION_FALLBACK_AUTH)); finish(); } else { Bundle args = new BundleBuilder().putParcelableArray(ACCOUNTS, accounts).build(); ((DialogFragment)Fragment.instantiate(this, AccountDialogs.class.getName(), args)) .show(getSupportFragmentManager(), null); } }
private void edit() { CharSequence text = topText.getText(); AdvancedOptionsDialogFragment.newInstance(text) .show(getSupportFragmentManager(), AdvancedOptionsDialogFragment.TAG); }
private void setupDateDialog(){ DialogFragment newFragment = new DatePickerFragment(); newFragment.show(getActivity().getSupportFragmentManager(), "datePicker"); }
public void showListDialog() { // Create an instance of the dialog fragment and show it DialogFragment dialog = new ListDialog(); dialog.show(getSupportFragmentManager(), "ListDialogFragment"); }
public void initiateChatClick(View v) { FragmentManager supportFragmentManager = getSupportFragmentManager(); DialogFragment fragment = new InitiateDialogFragment(); FragmentTransaction fragmentTransaction = supportFragmentManager .beginTransaction(); Fragment prev = getSupportFragmentManager().findFragmentByTag("InitiateDialogFragment"); if (prev != null) { fragmentTransaction.remove(prev); } fragmentTransaction.addToBackStack(null); fragment.show(fragmentTransaction, "InitiateDialogFragment"); }
@Override public void onTrashCanClicked(final MoPubSampleAdUnit adUnit) { final DialogFragment deleteConfirmation = DeleteDialogFragment.newInstance(adUnit); deleteConfirmation.setTargetFragment(this, 0); deleteConfirmation.show(getActivity().getSupportFragmentManager(), "delete"); }
public void showDialogFragment(final @NonNull XpPreferenceFragment fragment) { final FragmentManager fm = fragment.getFragmentManager(); assert fm != null; if (fm.findFragmentByTag(XpPreferenceFragment.DIALOG_FRAGMENT_TAG) == null) { DialogFragment f = XpRingtonePreferenceDialogFragment.newInstance(getKey()); f.setTargetFragment(fragment, 0); f.show(fm, XpPreferenceFragment.DIALOG_FRAGMENT_TAG); } }
private void createToAccountAndProceed() { if (destinationType == null) { Toast.makeText(getActivity(), R.string.error_generic, Toast.LENGTH_SHORT).show(); return; } ConfirmAddCoinUnlockWalletDialog.getInstance(destinationType, wallet.isEncrypted()) .show(getFragmentManager(), ADD_COIN_DIALOG_TAG); }
@Override public void onClick(View v) { DialogFragment dialog = SkipPasswordDialogFragment.newInstance(getArguments()); dialog.show(getFragmentManager(), null); } });
public void showDialog(DialogFragment dialogFragment, DialogAnimation animation) { animation.applyBeforeShowing(dialogFragment); dialogFragment.show(mFragmentManager, TAG); mFragmentManager.executePendingTransactions(); animation.applyAfterShowing(dialogFragment); }
private void showAddCoinDialog() { Dialogs.dismissAllowingStateLoss(getFM(), ADD_COIN_DIALOG_TAG); ConfirmAddCoinUnlockWalletDialog.getInstance(selectedCoin, wallet.isEncrypted()) .show(getFM(), ADD_COIN_DIALOG_TAG); }
@Override public void onDisplayPreferenceDialog(Preference preference) { if (preference instanceof ShaderListPreference) { DialogFragment f = ShaderListPreferenceDialogFragment .newInstance(preference.getKey()); f.setTargetFragment(this, 0); f.show(getFragmentManager(), "ShaderListPreferenceDialogFragment"); return; } super.onDisplayPreferenceDialog(preference); }
private void showNewAddressDialog() { if (!isVisible() || !isResumed()) return; Dialogs.dismissAllowingStateLoss(getFragmentManager(), NEW_ADDRESS_TAG); DialogFragment dialog = CreateNewAddressDialog.getInstance(account); dialog.show(getFragmentManager(), NEW_ADDRESS_TAG); }