mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Hide internet helper preferences in builds with direct internet access
This commit is contained in:
committed by
Arjan Schrijver
parent
d51820019d
commit
1053767ec8
-2
@@ -38,8 +38,6 @@ class InternetHelperPreferencesActivity : AbstractSettingsActivityV2() {
|
||||
rootKey: String?
|
||||
) {
|
||||
setPreferencesFromResource(R.xml.internethelper_preferences, rootKey)
|
||||
val unusedWarning = findPreference<Preference>("pref_key_internethelper_unused")
|
||||
unusedWarning?.isVisible = GBApplication.hasDirectInternetAccess();
|
||||
val installWarning =
|
||||
findPreference<Preference>("pref_key_internethelper_not_installed")
|
||||
if (AndroidUtils.isPackageInstalled(PACKAGE_INTERNET_HELPER)) {
|
||||
|
||||
+9
-5
@@ -364,11 +364,15 @@ public class SettingsActivity extends AbstractSettingsActivityV2 {
|
||||
|
||||
pref = findPreference("pref_category_internethelper");
|
||||
if (pref != null) {
|
||||
pref.setOnPreferenceClickListener(preference -> {
|
||||
Intent enableIntent = new Intent(requireContext(), InternetHelperPreferencesActivity.class);
|
||||
startActivity(enableIntent);
|
||||
return true;
|
||||
});
|
||||
if (GBApplication.hasDirectInternetAccess()) {
|
||||
pref.setVisible(false);
|
||||
} else {
|
||||
pref.setOnPreferenceClickListener(preference -> {
|
||||
Intent enableIntent = new Intent(requireContext(), InternetHelperPreferencesActivity.class);
|
||||
startActivity(enableIntent);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
pref = findPreference("pref_category_notifications");
|
||||
|
||||
@@ -4471,8 +4471,6 @@
|
||||
<string name="rebble_appstore_fetching_download_file_failed">Fetching download file failed: %1$s</string>
|
||||
<string name="internet_helper_permission_title">Internet helper add-on</string>
|
||||
<string name="internet_helper_permission_summary">Permit access to the Gadgetbridge-internethelper add-on app</string>
|
||||
<string name="internet_helper_pref_unused_settings_title">Unused settings</string>
|
||||
<string name="internet_helper_pref_unused_settings_summary">The settings below are not used because direct internet access is available.</string>
|
||||
<string name="notification_channel_pebble_js_runner">Pebble JS runner</string>
|
||||
<string name="notification_pebble_js_service_title">Pebble JavaScript service</string>
|
||||
<string name="notification_pebble_js_service_text">Running Pebble app/watchface JavaScript</string>
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
<PreferenceScreen
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
<Preference
|
||||
android:icon="@drawable/ic_warning"
|
||||
android:key="pref_key_internethelper_unused"
|
||||
android:title="@string/internet_helper_pref_unused_settings_title"
|
||||
android:summary="@string/internet_helper_pref_unused_settings_summary" />
|
||||
<Preference
|
||||
android:icon="@drawable/ic_warning"
|
||||
android:key="pref_key_internethelper_not_installed"
|
||||
|
||||
Reference in New Issue
Block a user