diff --git a/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt b/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt index b6d51f7..c31ab83 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/MainActivity.kt @@ -344,7 +344,7 @@ class MainActivity : AppCompatActivity(), SharedPreferences.OnSharedPreferenceCh rightSwipeActivity = gestureUtils.getSwipeInfo(launcherApps, "right") } - "battery_enabled" -> { + "batteryEnabled" -> { if (sharedPreferenceManager.isBatteryEnabled()) { registerBatteryReceiver() } else { diff --git a/app/src/main/java/eu/ottop/yamlauncher/SettingsFragment.kt b/app/src/main/java/eu/ottop/yamlauncher/SettingsFragment.kt index 83da0ae..d73b1d6 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/SettingsFragment.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/SettingsFragment.kt @@ -17,12 +17,12 @@ class SettingsFragment : PreferenceFragmentCompat() { sharedPreferenceManager = SharedPreferenceManager(requireContext()) - val gpsLocationPref: SwitchPreference? = findPreference("gps_location") - manualLocationPref = findPreference("manual_location") + val gpsLocationPref: SwitchPreference? = findPreference("gpsLocation") + manualLocationPref = findPreference("manualLocation") val leftSwipePref = findPreference("leftSwipeApp") val rightSwipePref = findPreference("rightSwipeApp") - val aboutPref = findPreference("about_page") - val hiddenPref = findPreference("hidden_apps") + val aboutPref = findPreference("aboutPage") + val hiddenPref = findPreference("hiddenApps") manualLocationPref?.summary = sharedPreferenceManager.getWeatherRegion() leftSwipePref?.summary = sharedPreferenceManager.getGestureName("left") diff --git a/app/src/main/java/eu/ottop/yamlauncher/SharedPreferenceManager.kt b/app/src/main/java/eu/ottop/yamlauncher/SharedPreferenceManager.kt index a7dc30a..aae61b6 100644 --- a/app/src/main/java/eu/ottop/yamlauncher/SharedPreferenceManager.kt +++ b/app/src/main/java/eu/ottop/yamlauncher/SharedPreferenceManager.kt @@ -59,7 +59,7 @@ class SharedPreferenceManager (context: Context) { fun setWeatherLocation(location: String, region: String?) { val editor = preferences.edit() editor.putString("location", location) - editor.putString("location_region", region) + editor.putString("locationRegion", region) editor.apply() } @@ -68,7 +68,7 @@ class SharedPreferenceManager (context: Context) { } fun getWeatherRegion(): String? { - return preferences.getString("location_region", "") + return preferences.getString("locationRegion", "") } fun setGestures(direction: String, appName: String?) { @@ -151,15 +151,15 @@ class SharedPreferenceManager (context: Context) { } fun isWeatherEnabled(): Boolean { - return preferences.getBoolean("weather_enabled", false) + return preferences.getBoolean("weatherEnabled", false) } fun isWeatherGPS(): Boolean { - return preferences.getBoolean("gps_location", false) + return preferences.getBoolean("gpsLocation", false) } fun isBatteryEnabled(): Boolean { - return preferences.getBoolean("battery_enabled", false) + return preferences.getBoolean("batteryEnabled", false) } fun getAnimationSpeed(): Long { diff --git a/app/src/main/res/xml/root_preferences.xml b/app/src/main/res/xml/root_preferences.xml index a224b06..3e15cd3 100644 --- a/app/src/main/res/xml/root_preferences.xml +++ b/app/src/main/res/xml/root_preferences.xml @@ -102,7 +102,7 @@ android:layout_height="wrap_content" android:defaultValue="false" android:title="Battery Indicator" - app:key="battery_enabled" /> + app:key="batteryEnabled" /> + app:key="weatherEnabled" /> + app:dependency="weatherEnabled" + app:key="gpsLocation" /> @@ -247,7 +247,7 @@