Show toast when no updates are available.
Co-authored-by: Stypox <stypox@pm.me>
This commit is contained in:
parent
1d53389ca9
commit
f1b15a95a4
72 changed files with 142 additions and 204 deletions
|
|
@ -16,25 +16,17 @@ public class UpdateSettingsFragment extends BasePreferenceFragment {
|
|||
.apply();
|
||||
|
||||
if (checkForUpdates) {
|
||||
checkNewVersionNow();
|
||||
NewVersionWorker.enqueueNewVersionCheckingWork(requireContext(), true);
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
private final Preference.OnPreferenceClickListener manualUpdateClick = preference -> {
|
||||
Toast.makeText(getContext(), R.string.checking_updates_toast, Toast.LENGTH_SHORT).show();
|
||||
checkNewVersionNow();
|
||||
NewVersionWorker.enqueueNewVersionCheckingWork(requireContext(), true);
|
||||
return true;
|
||||
};
|
||||
|
||||
private void checkNewVersionNow() {
|
||||
// Search for updates immediately when update checks are enabled.
|
||||
// Reset the expire time. This is necessary to check for an update immediately.
|
||||
defaultPreferences.edit()
|
||||
.putLong(getString(R.string.update_expiry_key), 0).apply();
|
||||
NewVersionWorker.enqueueNewVersionCheckingWork(getContext());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreatePreferences(final Bundle savedInstanceState, final String rootKey) {
|
||||
addPreferencesFromResourceRegistry();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue