Search in sources :

Example 36 with DialogFragment

use of androidx.fragment.app.DialogFragment in project bitcoin-wallet by bitcoin-wallet.

the class EncryptKeysDialogFragment method show.

public static void show(final FragmentManager fm) {
    final DialogFragment newFragment = new EncryptKeysDialogFragment();
    newFragment.show(fm, FRAGMENT_TAG);
}
Also used : DialogFragment(androidx.fragment.app.DialogFragment)

Example 37 with DialogFragment

use of androidx.fragment.app.DialogFragment in project bitcoin-wallet by bitcoin-wallet.

the class HelpDialogFragment method page.

public static void page(final FragmentManager fm, final int messageResId) {
    final DialogFragment newFragment = HelpDialogFragment.instance(messageResId);
    newFragment.show(fm, FRAGMENT_TAG);
}
Also used : DialogFragment(androidx.fragment.app.DialogFragment)

Example 38 with DialogFragment

use of androidx.fragment.app.DialogFragment in project bitcoin-wallet by bitcoin-wallet.

the class EditAddressBookEntryFragment method edit.

private static void edit(final FragmentManager fm, final Address address, @Nullable final String suggestedAddressLabel) {
    final DialogFragment newFragment = EditAddressBookEntryFragment.instance(address, suggestedAddressLabel);
    newFragment.show(fm, FRAGMENT_TAG);
}
Also used : DialogFragment(androidx.fragment.app.DialogFragment)

Example 39 with DialogFragment

use of androidx.fragment.app.DialogFragment in project bitcoin-wallet by bitcoin-wallet.

the class RaiseFeeDialogFragment method show.

public static void show(final FragmentManager fm, final Sha256Hash transactionId) {
    final DialogFragment newFragment = instance(transactionId);
    newFragment.show(fm, FRAGMENT_TAG);
}
Also used : DialogFragment(androidx.fragment.app.DialogFragment)

Example 40 with DialogFragment

use of androidx.fragment.app.DialogFragment in project zype-android by zype.

the class BaseFragment method updateListItem.

protected static void updateListItem(Activity activity, View view, Intent intent, int action, String fileId, VideosCursorAdapter.VideosViewHolder viewHolder) {
    if (TextUtils.equals(fileId, viewHolder.videoId)) {
        String errorMessage;
        int progress;
        switch(action) {
            case DownloadConstants.PROGRESS_CANCELED_AUDIO:
                viewHolder.isAudioDownloaded = false;
                UiUtils.showWarningSnackbar(view, "Audio download has canceled");
                hideProgress(viewHolder);
                break;
            case DownloadConstants.PROGRESS_CANCELED_VIDEO:
                viewHolder.isVideoDownloaded = false;
                UiUtils.showWarningSnackbar(view, "Video Download has canceled");
                hideProgress(viewHolder);
                break;
            case DownloadConstants.PROGRESS_END_AUDIO:
                viewHolder.isAudioDownloaded = true;
                UiUtils.showPositiveSnackbar(view, "Audio was downloaded");
                hideProgress(viewHolder);
                break;
            case DownloadConstants.PROGRESS_END_VIDEO:
                viewHolder.isVideoDownloaded = true;
                UiUtils.showPositiveSnackbar(view, "Video was downloaded");
                hideProgress(viewHolder);
                break;
            case DownloadConstants.PROGRESS_FAIL_AUDIO:
                viewHolder.isAudioDownloaded = false;
                errorMessage = intent.getStringExtra(BundleConstants.PROGRESS_ERROR_MESSAGE);
                UiUtils.showErrorSnackbar(view, errorMessage);
                hideProgress(viewHolder);
                break;
            case DownloadConstants.PROGRESS_FAIL_VIDEO:
                viewHolder.isVideoDownloaded = false;
                errorMessage = intent.getStringExtra(BundleConstants.PROGRESS_ERROR_MESSAGE);
                UiUtils.showErrorSnackbar(view, errorMessage);
                hideProgress(viewHolder);
                break;
            case DownloadConstants.PROGRESS_START_AUDIO:
                viewHolder.isAudioDownloaded = false;
                UiUtils.showPositiveSnackbar(view, "Audio downloading has started");
                updateListView(viewHolder, 0);
                break;
            case DownloadConstants.PROGRESS_START_VIDEO:
                viewHolder.isVideoDownloaded = false;
                UiUtils.showPositiveSnackbar(view, "Video downloading was started");
                updateListView(viewHolder, 0);
                break;
            case DownloadConstants.PROGRESS_UPDATE_AUDIO:
                viewHolder.isAudioDownloaded = false;
                progress = intent.getIntExtra(BundleConstants.PROGRESS, 0);
                updateListView(viewHolder, progress);
                break;
            case DownloadConstants.PROGRESS_UPDATE_VIDEO:
                viewHolder.isVideoDownloaded = false;
                progress = intent.getIntExtra(BundleConstants.PROGRESS, 0);
                updateListView(viewHolder, progress);
                break;
            case DownloadConstants.PROGRESS_FREE_SPACE:
                viewHolder.isVideoDownloaded = false;
                viewHolder.isAudioDownloaded = false;
                hideProgress(viewHolder);
                if (activity instanceof BaseActivity) {
                    int error = intent.getIntExtra(BundleConstants.PROGRESS_ERROR_MESSAGE, -1);
                    if (error == -1) {
                        error = R.string.alert_dialog_message_free_space;
                    }
                    DialogFragment newFragment = CustomAlertDialog.newInstance(R.string.alert_dialog_title_free_space, error);
                    newFragment.show(((BaseActivity) activity).getSupportFragmentManager(), "dialog_free_space");
                } else {
                    UiUtils.showWarningSnackbar(view, activity.getString(R.string.alert_dialog_message_free_space));
                }
                break;
            default:
                throw new IllegalStateException("unknown action=" + action);
        }
    }
}
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