diff options
author | Domingos Lopes <domingos86lopes+github@gmail.com> | 2016-07-17 14:10:58 -0400 |
---|---|---|
committer | Domingos Lopes <domingos86lopes+github@gmail.com> | 2016-07-17 14:10:58 -0400 |
commit | 91f12080ef02dd66da6c378f0b25058fac41aea0 (patch) | |
tree | f45425f1b5c91ae82b3e8c911370227ef51936a3 /app | |
parent | cf035bc74829858880f9118d74003eb47110b33b (diff) | |
download | AntennaPod-91f12080ef02dd66da6c378f0b25058fac41aea0.zip |
include gpodnet last sync report on Sync pref summary
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java | 29 | ||||
-rw-r--r-- | app/src/main/res/xml/preferences.xml | 4 |
2 files changed, 12 insertions, 21 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index 569390e65..19b8361e6 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -91,7 +91,6 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc public static final String PREF_GPODNET_LOGOUT = "pref_gpodnet_logout"; public static final String PREF_GPODNET_HOSTNAME = "pref_gpodnet_hostname"; public static final String PREF_GPODNET_NOTIFICATIONS = "pref_gpodnet_notifications"; - public static final String PREF_GPODNET_SYNC_REPORT = "pref_gpodnet_sync_report"; public static final String PREF_EXPANDED_NOTIFICATION = "prefExpandNotify"; public static final String PREF_PROXY = "prefProxy"; public static final String PREF_KNOWN_ISSUES = "prefKnownIssues"; @@ -510,24 +509,20 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc } private void updateLastGpodnetSyncReport(boolean successful, long lastTime) { - Preference syncReport = ui.findPreference(PREF_GPODNET_SYNC_REPORT); + Preference sync = ui.findPreference(PREF_GPODNET_SYNC); if (lastTime != 0) { - syncReport.setTitle(ui.getActivity().getString(R.string.pref_gpodnet_last_sync_title, - ui.getActivity().getString(successful ? - R.string.gpodnetsync_pref_report_successful : - R.string.gpodnetsync_pref_report_failed))); - syncReport.setSummary(DateUtils.getRelativeDateTimeString( - ui.getActivity(), - lastTime, - DateUtils.MINUTE_IN_MILLIS, - DateUtils.WEEK_IN_MILLIS, - DateUtils.FORMAT_SHOW_TIME)); - syncReport.setEnabled(true); + sync.setSummary(ui.getActivity().getString(R.string.pref_gpodnet_sync_sum) + "\n" + + ui.getActivity().getString(R.string.pref_gpodnet_sync_sum_last_sync_line, + ui.getActivity().getString(successful ? + R.string.gpodnetsync_pref_report_successful : + R.string.gpodnetsync_pref_report_failed), + DateUtils.getRelativeDateTimeString(ui.getActivity(), + lastTime, + DateUtils.MINUTE_IN_MILLIS, + DateUtils.WEEK_IN_MILLIS, + DateUtils.FORMAT_SHOW_TIME))); } else { - syncReport.setTitle(ui.getActivity().getString(R.string.pref_gpodnet_last_sync_title, - ui.getActivity().getString(R.string.gpodnetsync_pref_report_undetermined))); - syncReport.setSummary(null); - syncReport.setEnabled(false); + sync.setSummary(ui.getActivity().getString(R.string.pref_gpodnet_sync_sum)); } } diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml index dca019bf6..d907cee12 100644 --- a/app/src/main/res/xml/preferences.xml +++ b/app/src/main/res/xml/preferences.xml @@ -249,10 +249,6 @@ android:key="pref_gpodnet_sync" android:title="@string/pref_gpodnet_sync_title" android:summary="@string/pref_gpodnet_sync_sum"/> - <Preference android:key="pref_gpodnet_sync_report" - android:title="@string/pref_gpodnet_last_sync_title" - android:enabled="false" - android:shouldDisableView="true"/> <Preference android:key="pref_gpodnet_logout" android:title="@string/pref_gpodnet_logout_title"/> |