Search in sources :

Example 31 with DialogFragment

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

the class ReactWithAnyEmojiBottomSheetDialogFragment method createForMessageRecord.

public static DialogFragment createForMessageRecord(@NonNull MessageRecord messageRecord, int startingPage) {
    DialogFragment fragment = new ReactWithAnyEmojiBottomSheetDialogFragment();
    Bundle args = new Bundle();
    args.putLong(ARG_MESSAGE_ID, messageRecord.getId());
    args.putBoolean(ARG_IS_MMS, messageRecord.isMms());
    args.putInt(ARG_START_PAGE, startingPage);
    args.putString(ARG_RECENT_KEY, REACTION_STORAGE_KEY);
    args.putBoolean(ARG_EDIT, true);
    fragment.setArguments(args);
    return fragment;
}
Also used : Bundle(android.os.Bundle) BottomSheetDialogFragment(com.google.android.material.bottomsheet.BottomSheetDialogFragment) DialogFragment(androidx.fragment.app.DialogFragment)

Example 32 with DialogFragment

use of androidx.fragment.app.DialogFragment in project Gadgetbridge by Freeyourgadget.

the class DeviceSpecificSettingsFragment method onDisplayPreferenceDialog.

@Override
public void onDisplayPreferenceDialog(Preference preference) {
    DialogFragment dialogFragment;
    if (preference instanceof XTimePreference) {
        dialogFragment = new XTimePreferenceFragment();
        Bundle bundle = new Bundle(1);
        bundle.putString("key", preference.getKey());
        dialogFragment.setArguments(bundle);
        dialogFragment.setTargetFragment(this, 0);
        if (getFragmentManager() != null) {
            dialogFragment.show(getFragmentManager(), "androidx.preference.PreferenceFragment.DIALOG");
        }
    } else if (preference instanceof DragSortListPreference) {
        dialogFragment = new DragSortListPreferenceFragment();
        Bundle bundle = new Bundle(1);
        bundle.putString("key", preference.getKey());
        dialogFragment.setArguments(bundle);
        dialogFragment.setTargetFragment(this, 0);
        if (getFragmentManager() != null) {
            dialogFragment.show(getFragmentManager(), "androidx.preference.PreferenceFragment.DIALOG");
        }
    } else {
        super.onDisplayPreferenceDialog(preference);
    }
}
Also used : DragSortListPreference(com.mobeta.android.dslv.DragSortListPreference) DragSortListPreferenceFragment(com.mobeta.android.dslv.DragSortListPreferenceFragment) Bundle(android.os.Bundle) DialogFragment(androidx.fragment.app.DialogFragment) XTimePreferenceFragment(nodomain.freeyourgadget.gadgetbridge.util.XTimePreferenceFragment) XTimePreference(nodomain.freeyourgadget.gadgetbridge.util.XTimePreference)

Example 33 with DialogFragment

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

the class MessageDetailsFragment method create.

@NonNull
public static DialogFragment create(@NonNull MessageRecord message, @NonNull RecipientId recipientId) {
    DialogFragment dialogFragment = new MessageDetailsFragment();
    Bundle args = new Bundle();
    args.putLong(MESSAGE_ID_EXTRA, message.getId());
    args.putString(TYPE_EXTRA, message.isMms() ? MmsSmsDatabase.MMS_TRANSPORT : MmsSmsDatabase.SMS_TRANSPORT);
    args.putParcelable(RECIPIENT_EXTRA, recipientId);
    dialogFragment.setArguments(args);
    return dialogFragment;
}
Also used : Bundle(android.os.Bundle) FullScreenDialogFragment(org.thoughtcrime.securesms.components.FullScreenDialogFragment) DialogFragment(androidx.fragment.app.DialogFragment) NonNull(androidx.annotation.NonNull)

Example 34 with DialogFragment

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

the class ReactionsBottomSheetDialogFragment method create.

public static DialogFragment create(long messageId, boolean isMms) {
    Bundle args = new Bundle();
    DialogFragment fragment = new ReactionsBottomSheetDialogFragment();
    args.putLong(ARGS_MESSAGE_ID, messageId);
    args.putBoolean(ARGS_IS_MMS, isMms);
    fragment.setArguments(args);
    return fragment;
}
Also used : Bundle(android.os.Bundle) BottomSheetDialogFragment(com.google.android.material.bottomsheet.BottomSheetDialogFragment) DialogFragment(androidx.fragment.app.DialogFragment)

Example 35 with DialogFragment

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

the class ReactWithAnyEmojiBottomSheetDialogFragment method createForEditReactions.

public static DialogFragment createForEditReactions() {
    DialogFragment fragment = new ReactWithAnyEmojiBottomSheetDialogFragment();
    Bundle args = new Bundle();
    args.putLong(ARG_MESSAGE_ID, -1);
    args.putBoolean(ARG_IS_MMS, false);
    args.putInt(ARG_START_PAGE, -1);
    args.putBoolean(ARG_SHADOWS, false);
    args.putString(ARG_RECENT_KEY, REACTION_STORAGE_KEY);
    fragment.setArguments(args);
    return fragment;
}
Also used : Bundle(android.os.Bundle) BottomSheetDialogFragment(com.google.android.material.bottomsheet.BottomSheetDialogFragment) 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