diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2021-01-23 19:44:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-23 19:44:08 +0100 |
commit | b5f547bd9fd312b9609d28965eb2e80513678b3a (patch) | |
tree | ca3e6ec6ecec6a0c27eb74ea107f565fb884dc72 | |
parent | 35d010caa23124d12d8487fefadf6ad64beb50dc (diff) | |
parent | 37b5becd598fae6d761c9c3d1441094871fa30e6 (diff) | |
download | AntennaPod-b5f547bd9fd312b9609d28965eb2e80513678b3a.zip |
Merge pull request #4892 from ByteHamster/every-hours
Added new string for 'every x hours'
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java | 8 | ||||
-rw-r--r-- | core/src/main/res/values/strings.xml | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java index 77f8063f2..3889034fa 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/NetworkPreferencesFragment.java @@ -71,13 +71,13 @@ public class NetworkPreferencesFragment extends PreferenceFragmentCompat { Context context = getActivity().getApplicationContext(); String val; long interval = UserPreferences.getUpdateInterval(); - if(interval > 0) { + if (interval > 0) { int hours = (int) TimeUnit.MILLISECONDS.toHours(interval); - String hoursStr = context.getResources().getQuantityString(R.plurals.time_hours_quantified, hours, hours); - val = String.format(context.getString(R.string.pref_autoUpdateIntervallOrTime_every), hoursStr); + val = context.getResources().getQuantityString( + R.plurals.pref_autoUpdateIntervallOrTime_every_hours, hours, hours); } else { int[] timeOfDay = UserPreferences.getUpdateTimeOfDay(); - if(timeOfDay.length == 2) { + if (timeOfDay.length == 2) { Calendar cal = new GregorianCalendar(); cal.set(Calendar.HOUR_OF_DAY, timeOfDay[0]); cal.set(Calendar.MINUTE, timeOfDay[1]); diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 64554bc38..2f4aa7fac 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -410,8 +410,11 @@ <string name="pref_autoUpdateIntervallOrTime_Disable">Disable</string> <string name="pref_autoUpdateIntervallOrTime_Interval">Set Interval</string> <string name="pref_autoUpdateIntervallOrTime_TimeOfDay">Set Time of Day</string> - <string name="pref_autoUpdateIntervallOrTime_every">every %1$s</string> <string name="pref_autoUpdateIntervallOrTime_at">at %1$s</string> + <plurals name="pref_autoUpdateIntervallOrTime_every_hours"> + <item quantity="one">Every hour</item> + <item quantity="other">Every %d hours</item> + </plurals> <string name="pref_followQueue_title">Continuous Playback</string> <string name="pref_pauseOnHeadsetDisconnect_title">Headphones or Bluetooth disconnect</string> <string name="pref_unpauseOnHeadsetReconnect_title">Headphones Reconnect</string> |