use of org.edx.mobile.view.dialog.IDialogCallback in project edx-app-android by edx.
the class SettingsFragment method showWifiDialog.
protected void showWifiDialog() {
final NetworkCheckDialogFragment newFragment = NetworkCheckDialogFragment.newInstance(getString(R.string.wifi_dialog_title_help), getString(R.string.wifi_dialog_message_help), new IDialogCallback() {
@Override
public void onPositiveClicked() {
try {
PrefManager wifiPrefManager = new PrefManager(getActivity().getBaseContext(), PrefManager.Pref.WIFI);
wifiPrefManager.put(PrefManager.Key.DOWNLOAD_ONLY_ON_WIFI, false);
updateWifiSwitch();
} catch (Exception ex) {
logger.error(ex);
}
}
@Override
public void onNegativeClicked() {
try {
PrefManager wifiPrefManager = new PrefManager(getActivity().getBaseContext(), PrefManager.Pref.WIFI);
wifiPrefManager.put(PrefManager.Key.DOWNLOAD_ONLY_ON_WIFI, true);
wifiPrefManager.put(PrefManager.Key.DOWNLOAD_OFF_WIFI_SHOW_DIALOG_FLAG, true);
updateWifiSwitch();
} catch (Exception ex) {
logger.error(ex);
}
}
});
newFragment.setCancelable(false);
newFragment.show(getActivity().getSupportFragmentManager(), "dialog");
}
Aggregations