Closed ghost closed 7 years ago
It is not possible when using the AppUpdater
builder, but you can use the AppUpdaterUtils
builder instead and show a dialog or snackbar based on the results. For example:
AppUpdaterUtils appUpdaterUtils = new AppUpdaterUtils(this)
//.setUpdateFrom(UpdateFrom.AMAZON)
//.setUpdateFrom(UpdateFrom.GITHUB)
//.setGitHubUserAndRepo("javiersantos", "AppUpdater")
//...
.withListener(new AppUpdaterUtils.UpdateListener() {
@Override
public void onSuccess(Update update, Boolean isUpdateAvailable) {
if (isUpdateAvailable) {
// Show a Dialog
} else {
// Show a Snackbar
}
}
@Override
public void onFailed(AppUpdaterError error) {
Log.d("AppUpdater Error", "Something went wrong");
}
});
appUpdaterUtils.start();
Thanks for the great lib. I was wondering is there a way to separate the Update and No Update portion of the code? I would like to change the No Update notification to a snack bar and leave the Update notification as a dialog. Or just stop the No Update notification.