From 4a3db25876b8134b8bd706f7347647b62a4b4961 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Fri, 22 Nov 2019 19:29:17 +0100 Subject: [PATCH] Fixed some lint errors --- .../de/test/antennapod/gpodnet/GPodnetServiceTest.java | 2 +- .../java/de/test/antennapod/storage/AutoDownloadTest.java | 5 ++--- .../java/de/test/antennapod/storage/DBWriterTest.java | 8 -------- .../java/de/danoeh/antennapod/activity/MainActivity.java | 3 +-- .../antennapod/fragment/ItemDescriptionFragment.java | 1 - .../de/danoeh/antennapod/view/AspectRatioVideoView.java | 2 +- app/src/main/res/layout/fragment_itunes_search.xml | 2 +- .../antennapod/core/preferences/UserPreferences.java | 8 +++----- .../java/de/danoeh/antennapod/core/util/SortOrder.java | 2 +- 9 files changed, 10 insertions(+), 23 deletions(-) diff --git a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java b/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java index cd3847f17..161393b8a 100644 --- a/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java +++ b/app/src/androidTest/java/de/test/antennapod/gpodnet/GPodnetServiceTest.java @@ -29,7 +29,7 @@ public class GPodnetServiceTest { private static final String PW = ""; @Before - protected void setUp() { + public void setUp() { service = new GpodnetService(); } diff --git a/app/src/androidTest/java/de/test/antennapod/storage/AutoDownloadTest.java b/app/src/androidTest/java/de/test/antennapod/storage/AutoDownloadTest.java index 70aec1580..00eef5c8d 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/AutoDownloadTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/AutoDownloadTest.java @@ -44,7 +44,7 @@ public class AutoDownloadTest { public void setUp() throws Exception { context = ApplicationProvider.getApplicationContext(); - stubFeedsServer = new UITestUtils(context);; + stubFeedsServer = new UITestUtils(context); stubFeedsServer.setup(); dbTasksCallbacksOrig = ClientConfig.dbTasksCallbacks; @@ -130,7 +130,7 @@ public class AutoDownloadTest { } private void useDownloadAlgorithm(final AutomaticDownloadAlgorithm downloadAlgorithm) { - DBTasksCallbacks dbTasksCallbacksStub = new DBTasksCallbacks() { + ClientConfig.dbTasksCallbacks = new DBTasksCallbacks() { @Override public AutomaticDownloadAlgorithm getAutomaticDownloadAlgorithm() { return downloadAlgorithm; @@ -141,7 +141,6 @@ public class AutoDownloadTest { return dbTasksCallbacksOrig.getEpisodeCacheCleanupAlgorithm(); } }; - ClientConfig.dbTasksCallbacks = dbTasksCallbacksStub; } private class StubDownloadAlgorithm implements AutomaticDownloadAlgorithm { diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java index 1e13bd5c3..10ca281cb 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/DBWriterTest.java @@ -322,15 +322,11 @@ public class DBWriterTest { feed.setImageUrl("url"); - List itemFiles = new ArrayList<>(); // create items with downloaded media files for (int i = 0; i < 10; i++) { FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), FeedItem.PLAYED, feed); feed.getItems().add(item); - File enc = new File(destFolder, "file " + i); - itemFiles.add(enc); - FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", false, null, 0, 0); item.setMedia(media); } @@ -387,15 +383,11 @@ public class DBWriterTest { feed.setImageUrl("url"); - List itemFiles = new ArrayList<>(); // create items with downloaded media files for (int i = 0; i < 10; i++) { FeedItem item = new FeedItem(0, "Item " + i, "Item" + i, "url", new Date(), FeedItem.PLAYED, feed); feed.getItems().add(item); - File enc = new File(destFolder, "file " + i); - itemFiles.add(enc); - FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", enc.getAbsolutePath(), "download_url", false, null, 0, 0); item.setMedia(media); } diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 31b708443..0023e6d7f 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -317,8 +317,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi fragment = new AddFeedFragment(); break; case SubscriptionFragment.TAG: - SubscriptionFragment subscriptionFragment = new SubscriptionFragment(); - fragment = subscriptionFragment; + fragment = new SubscriptionFragment(); break; default: // default to the queue diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index a97d60099..85978b761 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -144,7 +144,6 @@ public class ItemDescriptionFragment extends Fragment { } }; - @SuppressWarnings("deprecation") @SuppressLint("NewApi") @Override public boolean onContextItemSelected(MenuItem item) { diff --git a/app/src/main/java/de/danoeh/antennapod/view/AspectRatioVideoView.java b/app/src/main/java/de/danoeh/antennapod/view/AspectRatioVideoView.java index e79389fb3..4c116fa2d 100644 --- a/app/src/main/java/de/danoeh/antennapod/view/AspectRatioVideoView.java +++ b/app/src/main/java/de/danoeh/antennapod/view/AspectRatioVideoView.java @@ -88,7 +88,7 @@ public class AspectRatioVideoView extends VideoView { mVideoWidth = videoWidth; mVideoHeight = videoHeight; - /** + /* * If this isn't set the video is stretched across the * SurfaceHolders display surface (i.e. the SurfaceHolder * as the same size and the video is drawn to fit this diff --git a/app/src/main/res/layout/fragment_itunes_search.xml b/app/src/main/res/layout/fragment_itunes_search.xml index 0cc13f74c..211f6c9ef 100644 --- a/app/src/main/res/layout/fragment_itunes_search.xml +++ b/app/src/main/res/layout/fragment_itunes_search.xml @@ -20,7 +20,7 @@ tools:listitem="@layout/gpodnet_podcast_listitem" />