Search in sources :

Example 1 with YesNoDialog

use of com.frostwire.android.gui.dialogs.YesNoDialog in project frostwire by frostwire.

the class MainActivity method showShutdownDialog.

public void showShutdownDialog() {
    UXStats.instance().flush();
    YesNoDialog dlg = YesNoDialog.newInstance(SHUTDOWN_DIALOG_ID, R.string.app_shutdown_dlg_title, R.string.app_shutdown_dlg_message, YesNoDialog.FLAG_DISMISS_ON_OK_BEFORE_PERFORM_DIALOG_CLICK);
    // see onDialogClick
    dlg.show(getFragmentManager());
}
Also used : YesNoDialog(com.frostwire.android.gui.dialogs.YesNoDialog)

Example 2 with YesNoDialog

use of com.frostwire.android.gui.dialogs.YesNoDialog in project frostwire by frostwire.

the class ResumeDownloadMenuAction method showBittorrentDisconnectedDialog.

private void showBittorrentDisconnectedDialog() {
    YesNoDialog dlg = YesNoDialog.newInstance(DLG_TURN_BITTORRENT_BACK_ON, R.string.bittorrent_off, R.string.bittorrent_is_currently_disconnected_would_you_like_me_to_start_it_for_you, YesNoDialog.FLAG_DISMISS_ON_OK_BEFORE_PERFORM_DIALOG_CLICK);
    dlg.setOnDialogClickListener(this);
    dlg.show(((Activity) getContext()).getFragmentManager());
}
Also used : YesNoDialog(com.frostwire.android.gui.dialogs.YesNoDialog)

Example 3 with YesNoDialog

use of com.frostwire.android.gui.dialogs.YesNoDialog in project frostwire by frostwire.

the class SeedAction method showBittorrentDisconnectedDialog.

private void showBittorrentDisconnectedDialog() {
    YesNoDialog dlg = YesNoDialog.newInstance(DLG_TURN_BITTORRENT_BACK_ON, R.string.bittorrent_off, R.string.bittorrent_is_currently_disconnected_would_you_like_me_to_start_it_for_you, YesNoDialog.FLAG_DISMISS_ON_OK_BEFORE_PERFORM_DIALOG_CLICK);
    dlg.setOnDialogClickListener(this);
    dlg.show(((Activity) getContext()).getFragmentManager());
}
Also used : YesNoDialog(com.frostwire.android.gui.dialogs.YesNoDialog)

Example 4 with YesNoDialog

use of com.frostwire.android.gui.dialogs.YesNoDialog in project frostwire by frostwire.

the class ApplicationFragment method setupDataSaving.

private void setupDataSaving() {
    SwitchPreferenceCompat preference = findPreference(Constants.PREF_KEY_NETWORK_USE_WIFI_ONLY);
    preference.setOnPreferenceChangeListener((preference1, newValue) -> {
        boolean newVal = (Boolean) newValue;
        if (newVal && !NetworkManager.instance().isDataWIFIUp()) {
            if (TransferManager.instance().isHttpDownloadInProgress()) {
                YesNoDialog dlg = YesNoDialog.newInstance(CONFIRM_STOP_HTTP_IN_PROGRESS_DIALOG_TAG, R.string.data_saving_kill_http_warning_title, R.string.data_saving_kill_http_warning, YesNoDialog.FLAG_DISMISS_ON_OK_BEFORE_PERFORM_DIALOG_CLICK);
                dlg.setTargetFragment(ApplicationFragment.this, 0);
                dlg.show(getFragmentManager(), CONFIRM_STOP_HTTP_IN_PROGRESS_DIALOG_TAG);
                return false;
            }
            turnOffTransfers();
        }
        return true;
    });
}
Also used : SwitchPreferenceCompat(android.support.v7.preference.SwitchPreferenceCompat) YesNoDialog(com.frostwire.android.gui.dialogs.YesNoDialog)

Example 5 with YesNoDialog

use of com.frostwire.android.gui.dialogs.YesNoDialog in project frostwire by frostwire.

the class UIUtils method showYesNoDialog.

public static void showYesNoDialog(FragmentManager fragmentManager, String message, int titleId, OnClickListener positiveListener, OnClickListener negativeListener) {
    YesNoDialog yesNoDialog = YesNoDialog.newInstance(message, titleId, message, (byte) 0);
    yesNoDialog.setOnDialogClickListener((tag, which) -> {
        if (which == Dialog.BUTTON_POSITIVE && positiveListener != null) {
            positiveListener.onClick(yesNoDialog.getDialog(), which);
        } else if (which == Dialog.BUTTON_NEGATIVE && negativeListener != null) {
            negativeListener.onClick(yesNoDialog.getDialog(), which);
        }
        yesNoDialog.dismiss();
    });
    yesNoDialog.show(fragmentManager);
}
Also used : YesNoDialog(com.frostwire.android.gui.dialogs.YesNoDialog)

Aggregations

YesNoDialog (com.frostwire.android.gui.dialogs.YesNoDialog)7 SwitchPreferenceCompat (android.support.v7.preference.SwitchPreferenceCompat)1