use of org.fossasia.openevent.data.Event in project open-event-android by fossasia.
the class MainActivity method downloadFailed.
private void downloadFailed(final DownloadEvent event) {
Snackbar.make(mainFrame, getString(R.string.download_failed), Snackbar.LENGTH_LONG).setAction(R.string.retry_download, view -> {
if (event == null)
StrategyRegistry.getInstance().getEventBusStrategy().postEventOnUIThread(new DataDownloadEvent());
else
StrategyRegistry.getInstance().getEventBusStrategy().postEventOnUIThread(event);
}).show();
SharedPreferencesUtil.putBoolean(ConstantStrings.IS_DOWNLOAD_DONE, false);
}
use of org.fossasia.openevent.data.Event in project open-event-android by fossasia.
the class MainActivity method showNetworkDialog.
@Subscribe
public void showNetworkDialog(ShowNetworkDialogEvent event) {
completeHandler.hide();
if (dialogNetworkNotification == null) {
dialogNetworkNotification = DialogFactory.createCancellableSimpleActionDialog(this, R.string.net_unavailable, R.string.turn_on, R.string.ok, R.string.cancel, (dialogInterface, button) -> {
switch(button) {
case DialogInterface.BUTTON_POSITIVE:
Intent setNetworkIntent = new Intent(Settings.ACTION_SETTINGS);
startActivity(setNetworkIntent);
break;
case DialogInterface.BUTTON_NEGATIVE:
dialogNetworkNotification.dismiss();
return;
default:
}
});
}
dialogNetworkNotification.show();
}
Aggregations