diff options
3 files changed, 15 insertions, 15 deletions
diff --git a/app/src/main/res/xml/preferences_playback.xml b/app/src/main/res/xml/preferences_playback.xml index b743bdbaf..44ecf32ec 100644 --- a/app/src/main/res/xml/preferences_playback.xml +++ b/app/src/main/res/xml/preferences_playback.xml @@ -97,11 +97,11 @@ android:summary="@string/pref_queueAddToFront_sum" android:title="@string/pref_queueAddToFront_title"/> <SwitchPreference - android:defaultValue="false" - android:enabled="false" - android:key="prefQueueKeepInProgressAtFront" - android:summary="@string/pref_queueKeepInProgressAtFront_sum" - android:title="@string/pref_queueKeepInProgressAtFront_title"/> + android:defaultValue="false" + android:enabled="false" + android:key="prefQueueKeepInProgressAtFront" + android:summary="@string/pref_queueKeepInProgressAtFront_sum" + android:title="@string/pref_queueKeepInProgressAtFront_title"/> <SwitchPreference android:defaultValue="true" android:enabled="true" diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculator.java b/core/src/main/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculator.java index e69a1adf3..c23c371e3 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculator.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/ItemEnqueuePositionCalculator.java @@ -38,8 +38,8 @@ class ItemEnqueuePositionCalculator { } } - private final @NonNull - Options options; + @NonNull + private final Options options; @VisibleForTesting DownloadStateProvider downloadStateProvider = DownloadRequester.getInstance(); @@ -66,18 +66,18 @@ class ItemEnqueuePositionCalculator { curQueue.get(0).getMedia() != null && curQueue.get(0).getMedia().isInProgress()) { // leave the front in progress item at the front - return getPositionOf1stNonDownloadingItem(positionAmongToAdd + 1, curQueue); + return getPositionOfFirstNonDownloadingItem(positionAmongToAdd + 1, curQueue); } else { // typical case // return NOT 0, so that when a list of items are inserted, the items inserted // keep the same order. Returning 0 will reverse the order - return getPositionOf1stNonDownloadingItem(positionAmongToAdd, curQueue); + return getPositionOfFirstNonDownloadingItem(positionAmongToAdd, curQueue); } } else { return curQueue.size(); } } - private int getPositionOf1stNonDownloadingItem(int startPosition, List<FeedItem> curQueue) { + private int getPositionOfFirstNonDownloadingItem(int startPosition, List<FeedItem> curQueue) { final int curQueueSize = curQueue.size(); for (int i = startPosition; i < curQueueSize; i++) { if (!isItemAtPositionDownloading(i, curQueue)) { @@ -95,9 +95,9 @@ class ItemEnqueuePositionCalculator { curItem = null; } - if (curItem != null && - curItem.getMedia() != null && - downloadStateProvider.isDownloadingFile(curItem.getMedia())) { + if (curItem != null + && curItem.getMedia() != null + && downloadStateProvider.isDownloadingFile(curItem.getMedia())) { return true; } else { return false; 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 424240fa8..c076ec892 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 @@ -26,7 +26,7 @@ import static org.mockito.Mockito.stub; public class ItemEnqueuePositionCalculatorTest { @RunWith(Parameterized.class) - public static class IEPCBasicTest { + public static class BasicTest { @Parameters(name = "{index}: case<{0}>, expected:{1}") public static Iterable<Object[]> data() { Options optDefault = new Options(); @@ -90,7 +90,7 @@ public class ItemEnqueuePositionCalculatorTest { } @RunWith(Parameterized.class) - public static class IEPCKeepInProgressAtFrontTest extends IEPCBasicTest { + public static class KeepInProgressAtFrontTest extends BasicTest { @Parameters(name = "{index}: case<{0}>, expected:{1}") public static Iterable<Object[]> data() { Options optKeepInProgressAtFront = |