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());
}
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());
}
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());
}
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;
});
}
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);
}
Aggregations