Search in sources :

Example 11 with DialogFragment

use of androidx.fragment.app.DialogFragment in project Signal-Android by WhisperSystems.

the class GroupLinkShareQrDialogFragment method show.

public static void show(@NonNull FragmentManager manager, @NonNull GroupId.V2 groupId) {
    DialogFragment fragment = new GroupLinkShareQrDialogFragment();
    Bundle args = new Bundle();
    args.putString(ARG_GROUP_ID, groupId.toString());
    fragment.setArguments(args);
    fragment.show(manager, BottomSheetUtil.STANDARD_BOTTOM_SHEET_FRAGMENT_TAG);
}
Also used : Bundle(android.os.Bundle) DialogFragment(androidx.fragment.app.DialogFragment)

Example 12 with DialogFragment

use of androidx.fragment.app.DialogFragment in project Signal-Android by WhisperSystems.

the class LongMessageFragment method create.

public static DialogFragment create(long messageId, boolean isMms) {
    DialogFragment fragment = new LongMessageFragment();
    Bundle args = new Bundle();
    args.putLong(KEY_MESSAGE_ID, messageId);
    args.putBoolean(KEY_IS_MMS, isMms);
    fragment.setArguments(args);
    return fragment;
}
Also used : Bundle(android.os.Bundle) FullScreenDialogFragment(org.thoughtcrime.securesms.components.FullScreenDialogFragment) DialogFragment(androidx.fragment.app.DialogFragment)

Example 13 with DialogFragment

use of androidx.fragment.app.DialogFragment in project android-styled-dialogs by avast.

the class BaseDialogFragment method getDialogListeners.

/**
 * Utility method for acquiring all listeners of some type for current instance of DialogFragment
 *
 * @param listenerInterface Interface of the desired listeners
 * @return Unmodifiable list of listeners
 * @since 2.1.0
 */
@SuppressWarnings("unchecked")
protected <T> List<T> getDialogListeners(Class<T> listenerInterface) {
    final Fragment targetFragment = getTargetFragment();
    List<T> listeners = new ArrayList<T>(2);
    if (targetFragment != null && listenerInterface.isAssignableFrom(targetFragment.getClass())) {
        listeners.add((T) targetFragment);
    }
    if (getActivity() != null && listenerInterface.isAssignableFrom(getActivity().getClass())) {
        listeners.add((T) getActivity());
    }
    return Collections.unmodifiableList(listeners);
}
Also used : ArrayList(java.util.ArrayList) Fragment(androidx.fragment.app.Fragment) DialogFragment(androidx.fragment.app.DialogFragment)

Example 14 with DialogFragment

use of androidx.fragment.app.DialogFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class DefaultAppPickerFragment method onRadioButtonClicked.

@Override
public void onRadioButtonClicked(RadioButtonPreference selected) {
    final String selectedKey = selected.getKey();
    final CharSequence confirmationMessage = getConfirmationMessage(getCandidate(selectedKey));
    final FragmentActivity activity = getActivity();
    if (TextUtils.isEmpty(confirmationMessage)) {
        super.onRadioButtonClicked(selected);
    } else if (activity != null) {
        final DialogFragment fragment = newConfirmationDialogFragment(selectedKey, confirmationMessage);
        fragment.show(activity.getSupportFragmentManager(), ConfirmationDialogFragment.TAG);
    }
}
Also used : FragmentActivity(androidx.fragment.app.FragmentActivity) InstrumentedDialogFragment(com.android.settings.core.instrumentation.InstrumentedDialogFragment) DialogFragment(androidx.fragment.app.DialogFragment)

Example 15 with DialogFragment

use of androidx.fragment.app.DialogFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class InstantAppButtonsPreferenceController method showDialog.

private void showDialog() {
    final DialogFragment newFragment = InstantAppButtonDialogFragment.newInstance(mPackageName);
    newFragment.setTargetFragment(mParent, 0);
    newFragment.show(mParent.getFragmentManager(), KEY_INSTANT_APP_BUTTONS);
}
Also used : DialogFragment(androidx.fragment.app.DialogFragment)

Aggregations

DialogFragment (androidx.fragment.app.DialogFragment)55 Bundle (android.os.Bundle)22 BottomSheetDialogFragment (com.google.android.material.bottomsheet.BottomSheetDialogFragment)8 Intent (android.content.Intent)7 Fragment (androidx.fragment.app.Fragment)4 InstrumentedDialogFragment (com.android.settings.core.instrumentation.InstrumentedDialogFragment)4 Test (org.junit.Test)4 FullScreenDialogFragment (org.thoughtcrime.securesms.components.FullScreenDialogFragment)4 NonNull (androidx.annotation.NonNull)3 FragmentTransaction (androidx.fragment.app.FragmentTransaction)3 ConfirmationDialogFragment (com.fsck.k9.fragment.ConfirmationDialogFragment)3 FileDataStorageManager (com.owncloud.android.datamodel.FileDataStorageManager)3 OCFile (com.owncloud.android.datamodel.OCFile)3 OCUpload (com.owncloud.android.db.OCUpload)3 ScreenshotTest (com.owncloud.android.utils.ScreenshotTest)3 FragmentManager (androidx.fragment.app.FragmentManager)2 AttachmentDownloadDialogFragment (com.fsck.k9.fragment.AttachmentDownloadDialogFragment)2 ArrayList (java.util.ArrayList)2 CustomDefaultPreference (org.thoughtcrime.securesms.components.CustomDefaultPreference)2 ColorPickerPreference (org.thoughtcrime.securesms.preferences.widgets.ColorPickerPreference)2