feat: added setting to disable github check and completely disable/hide when using the degoogled version

This commit is contained in:
eddyizm 2025-11-11 18:06:01 -08:00
parent 2c6287405e
commit 6124ec66f3
No known key found for this signature in database
GPG key ID: CF5F671829E8158A
6 changed files with 34 additions and 4 deletions

View file

@ -438,7 +438,7 @@ public class MainActivity extends BaseActivity {
}
private void checkTempoUpdate() {
if (BuildConfig.FLAVOR.equals("tempus") && Preferences.showTempoUpdateDialog()) {
if (BuildConfig.FLAVOR.equals("tempus") && Preferences.isGithubUpdateEnabled() && Preferences.showTempusUpdateDialog()) {
mainViewModel.checkTempoUpdate().observe(this, latestRelease -> {
if (latestRelease != null && UpdateUtil.showUpdateDialog(latestRelease)) {
GithubTempoUpdateDialog dialog = new GithubTempoUpdateDialog(latestRelease);

View file

@ -55,7 +55,7 @@ public class GithubTempoUpdateDialog extends DialogFragment {
});
alertDialog.getButton(AlertDialog.BUTTON_NEGATIVE).setOnClickListener(v -> {
Preferences.setTempoUpdateReminder();
Preferences.setTempusUpdateReminder();
Objects.requireNonNull(getDialog()).dismiss();
});

View file

@ -29,6 +29,7 @@ import androidx.navigation.NavOptions;
import androidx.navigation.fragment.NavHostFragment;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
import androidx.preference.PreferenceCategory;
import androidx.preference.PreferenceFragmentCompat;
import androidx.preference.SwitchPreference;
@ -77,6 +78,13 @@ public class SettingsFragment extends PreferenceFragmentCompat {
result -> {}
);
if (!BuildConfig.FLAVOR.equals("tempus")) {
PreferenceCategory githubUpdateCategory = findPreference("settings_github_update_category_key");
if (githubUpdateCategory != null) {
getPreferenceScreen().removePreference(githubUpdateCategory);
}
}
directoryPickerLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {