From 719af170a704e3172d45e4ae952228761b092285 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 2 Feb 2020 17:56:57 +0100 Subject: [PATCH] Enforce SeparatorWrap --- .../de/test/antennapod/EspressoTestUtils.java | 4 +-- .../activity/OnlineFeedViewActivity.java | 10 +++---- .../GpodderPreferencesFragment.java | 15 +++++------ .../activity/CastEnabledActivity.java | 4 +-- config/checkstyle/checkstyle.xml | 27 +++++++++++++++++++ .../antennapod/core/cast/CastManager.java | 13 ++++----- .../ItemEnqueuePositionCalculatorTest.java | 4 +-- 7 files changed, 48 insertions(+), 29 deletions(-) diff --git a/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java b/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java index bbd8a705c..6ae14a58e 100644 --- a/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java @@ -116,8 +116,8 @@ public class EspressoTestUtils { String[] sharedPreferencesFileNames = new File(root, "shared_prefs").list(); for (String fileName : sharedPreferencesFileNames) { System.out.println("Cleared database: " + fileName); - InstrumentationRegistry.getTargetContext(). - getSharedPreferences(fileName.replace(".xml", ""), Context.MODE_PRIVATE).edit().clear().commit(); + InstrumentationRegistry.getTargetContext().getSharedPreferences( + fileName.replace(".xml", ""), Context.MODE_PRIVATE).edit().clear().commit(); } } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java index 07f48f65d..adb127acb 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -126,11 +126,11 @@ public class OnlineFeedViewActivity extends AppCompatActivity { if (feedUrl == null) { Log.e(TAG, "feedUrl is null."); - new AlertDialog.Builder(OnlineFeedViewActivity.this). - setNeutralButton(android.R.string.ok, - (dialog, which) -> finish()). - setTitle(R.string.error_label). - setMessage(R.string.null_value_podcast_error).create().show(); + new AlertDialog.Builder(OnlineFeedViewActivity.this) + .setNeutralButton(android.R.string.ok, (dialog, which) -> finish()) + .setTitle(R.string.error_label) + .setMessage(R.string.null_value_podcast_error) + .show(); } else { Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java index c6ae8e20c..1e51380ca 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/GpodderPreferencesFragment.java @@ -74,16 +74,14 @@ public class GpodderPreferencesFragment extends PreferenceFragmentCompat { dialog.show(); return true; }); - findPreference(PREF_GPODNET_SYNC). - setOnPreferenceClickListener(preference -> { + findPreference(PREF_GPODNET_SYNC).setOnPreferenceClickListener(preference -> { GpodnetSyncService.sendSyncIntent(getActivity().getApplicationContext()); Toast toast = Toast.makeText(getActivity(), R.string.pref_gpodnet_sync_started, Toast.LENGTH_SHORT); toast.show(); return true; }); - findPreference(PREF_GPODNET_FORCE_FULL_SYNC). - setOnPreferenceClickListener(preference -> { + findPreference(PREF_GPODNET_FORCE_FULL_SYNC).setOnPreferenceClickListener(preference -> { GpodnetPreferences.setLastSubscriptionSyncTimestamp(0L); GpodnetPreferences.setLastEpisodeActionsSyncTimestamp(0L); GpodnetPreferences.setLastSyncAttempt(false, 0); @@ -94,17 +92,16 @@ public class GpodderPreferencesFragment extends PreferenceFragmentCompat { toast.show(); return true; }); - findPreference(PREF_GPODNET_LOGOUT).setOnPreferenceClickListener( - preference -> { + findPreference(PREF_GPODNET_LOGOUT).setOnPreferenceClickListener(preference -> { GpodnetPreferences.logout(); Toast toast = Toast.makeText(activity, R.string.pref_gpodnet_logout_toast, Toast.LENGTH_SHORT); toast.show(); updateGpodnetPreferenceScreen(); return true; }); - findPreference(PREF_GPODNET_HOSTNAME).setOnPreferenceClickListener( - preference -> { - GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener(dialog -> updateGpodnetPreferenceScreen()); + findPreference(PREF_GPODNET_HOSTNAME).setOnPreferenceClickListener(preference -> { + GpodnetSetHostnameDialog.createDialog(activity).setOnDismissListener( + dialog -> updateGpodnetPreferenceScreen()); return true; }); } diff --git a/app/src/play/java/de/danoeh/antennapod/activity/CastEnabledActivity.java b/app/src/play/java/de/danoeh/antennapod/activity/CastEnabledActivity.java index 912571a7e..e392a50c6 100644 --- a/app/src/play/java/de/danoeh/antennapod/activity/CastEnabledActivity.java +++ b/app/src/play/java/de/danoeh/antennapod/activity/CastEnabledActivity.java @@ -43,8 +43,8 @@ public abstract class CastEnabledActivity extends AppCompatActivity return; } - PreferenceManager.getDefaultSharedPreferences(getApplicationContext()). - registerOnSharedPreferenceChangeListener(this); + PreferenceManager.getDefaultSharedPreferences(getApplicationContext()) + .registerOnSharedPreferenceChangeListener(this); castConsumer = new DefaultCastConsumer() { @Override diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml index 0772203ef..18978ec49 100644 --- a/config/checkstyle/checkstyle.xml +++ b/config/checkstyle/checkstyle.xml @@ -38,6 +38,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + { - if (!result.getStatus().isSuccess()) { - onFailed(R.string.cast_failed_seek, result.getStatus().getStatusCode()); - } - }); + remoteMediaPlayer.seek(mApiClient, position, RESUME_STATE_UNCHANGED).setResultCallback(result -> { + if (!result.getStatus().isSuccess()) { + onFailed(R.string.cast_failed_seek, result.getStatus().getStatusCode()); + } + }); } /** diff --git a/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java b/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java index 17b88bdd2..275b104ea 100644 --- a/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java +++ b/core/src/test/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculatorTest.java @@ -226,9 +226,7 @@ public class ItemEnqueuePositionCalculatorTest { private static FeedItem setAsDownloading(int id, DownloadStateProvider stubDownloadStateProvider, boolean isDownloading) { FeedItem item = createFeedItem(id); - FeedMedia media = - new FeedMedia(item, "http://download.url.net/" + id - , 100000 + id, "audio/mp3"); + FeedMedia media = new FeedMedia(item, "http://download.url.net/" + id, 100000 + id, "audio/mp3"); media.setId(item.getId()); item.setMedia(media); return setAsDownloading(item, stubDownloadStateProvider, isDownloading);