diff options
author | ByteHamster <info@bytehamster.com> | 2022-11-06 14:32:47 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-11-06 21:21:28 +0100 |
commit | d8a2dd5f83598fdde289e01994c5d2df1c6577fc (patch) | |
tree | f19ab0c0e798855f9c4f3fe17a85bc1cb3e90750 /app/src/androidTest/java | |
parent | 0101f1244ebe088edbe000b1966a92ca4994023a (diff) | |
download | AntennaPod-d8a2dd5f83598fdde289e01994c5d2df1c6577fc.zip |
Move preferences to a new module
Diffstat (limited to 'app/src/androidTest/java')
7 files changed, 14 insertions, 30 deletions
diff --git a/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java b/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java index 70282a6f3..d65289638 100644 --- a/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java +++ b/app/src/androidTest/java/de/test/antennapod/EspressoTestUtils.java @@ -23,7 +23,7 @@ import junit.framework.AssertionFailedError; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MainActivity; -import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.core.service.playback.PlaybackService; import de.danoeh.antennapod.dialog.RatingDialog; diff --git a/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java b/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java index 65e28c572..bb3c0bf67 100644 --- a/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java +++ b/app/src/androidTest/java/de/test/antennapod/playback/PlaybackTest.java @@ -33,7 +33,7 @@ import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; -import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.core.util.LongList; diff --git a/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java b/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java index d61b46b3c..97499b24a 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/download/DownloadServiceTest.java @@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedMedia; -import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequest; import de.danoeh.antennapod.core.service.download.DownloadService; import de.danoeh.antennapod.model.download.DownloadStatus; diff --git a/app/src/androidTest/java/de/test/antennapod/service/download/HttpDownloaderTest.java b/app/src/androidTest/java/de/test/antennapod/service/download/HttpDownloaderTest.java index fe1b9d59c..f276434f6 100644 --- a/app/src/androidTest/java/de/test/antennapod/service/download/HttpDownloaderTest.java +++ b/app/src/androidTest/java/de/test/antennapod/service/download/HttpDownloaderTest.java @@ -8,7 +8,7 @@ import java.io.File; import java.io.IOException; import de.danoeh.antennapod.model.feed.FeedFile; -import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.net.download.serviceinterface.DownloadRequest; import de.danoeh.antennapod.model.download.DownloadStatus; import de.danoeh.antennapod.core.service.download.Downloader; 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 7723d4941..c08b79ba4 100644 --- a/app/src/androidTest/java/de/test/antennapod/storage/AutoDownloadTest.java +++ b/app/src/androidTest/java/de/test/antennapod/storage/AutoDownloadTest.java @@ -6,7 +6,7 @@ import androidx.test.core.app.ApplicationProvider; import de.danoeh.antennapod.model.feed.FeedItem; import de.danoeh.antennapod.model.feed.FeedMedia; import de.danoeh.antennapod.core.preferences.PlaybackPreferences; -import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.core.storage.AutomaticDownloadAlgorithm; import de.danoeh.antennapod.core.storage.DBReader; import de.danoeh.antennapod.core.storage.DBTasks; diff --git a/app/src/androidTest/java/de/test/antennapod/ui/NavigationDrawerTest.java b/app/src/androidTest/java/de/test/antennapod/ui/NavigationDrawerTest.java index c0e86d046..5ccb35228 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/NavigationDrawerTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/NavigationDrawerTest.java @@ -10,7 +10,7 @@ import de.danoeh.antennapod.activity.MainActivity; import de.danoeh.antennapod.activity.PreferenceActivity; import de.danoeh.antennapod.fragment.CompletedDownloadsFragment; import de.danoeh.antennapod.model.feed.Feed; -import de.danoeh.antennapod.core.preferences.UserPreferences; +import de.danoeh.antennapod.storage.preferences.UserPreferences; import de.danoeh.antennapod.fragment.AllEpisodesFragment; import de.danoeh.antennapod.fragment.NavDrawerFragment; import de.danoeh.antennapod.fragment.PlaybackHistoryFragment; diff --git a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java index 25eb60ff4..a0f2c17ea 100644 --- a/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java +++ b/app/src/androidTest/java/de/test/antennapod/ui/PreferencesTest.java @@ -21,8 +21,8 @@ import java.util.concurrent.TimeUnit; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.PreferenceActivity; -import de.danoeh.antennapod.core.preferences.UserPreferences; -import de.danoeh.antennapod.core.preferences.UserPreferences.EnqueueLocation; +import de.danoeh.antennapod.storage.preferences.UserPreferences; +import de.danoeh.antennapod.storage.preferences.UserPreferences.EnqueueLocation; import de.danoeh.antennapod.core.storage.APCleanupAlgorithm; import de.danoeh.antennapod.core.storage.APNullCleanupAlgorithm; import de.danoeh.antennapod.core.storage.APQueueCleanupAlgorithm; @@ -79,32 +79,16 @@ public class PreferencesTest { @Test public void testSwitchTheme() { - final int theme = UserPreferences.getTheme(); - int otherTheme; - if (theme == de.danoeh.antennapod.core.R.style.Theme_AntennaPod_Light) { - otherTheme = R.string.pref_theme_title_dark; + final UserPreferences.ThemePreference theme = UserPreferences.getTheme(); + int otherThemeText; + if (theme == UserPreferences.ThemePreference.DARK) { + otherThemeText = R.string.pref_theme_title_light; } else { - otherTheme = R.string.pref_theme_title_light; + otherThemeText = R.string.pref_theme_title_dark; } clickPreference(R.string.user_interface_label); clickPreference(R.string.pref_set_theme_title); - onView(withText(otherTheme)).perform(click()); - Awaitility.await().atMost(1000, MILLISECONDS) - .until(() -> UserPreferences.getTheme() != theme); - } - - @Test - public void testSwitchThemeBack() { - final int theme = UserPreferences.getTheme(); - int otherTheme; - if (theme == de.danoeh.antennapod.core.R.style.Theme_AntennaPod_Light) { - otherTheme = R.string.pref_theme_title_dark; - } else { - otherTheme = R.string.pref_theme_title_light; - } - clickPreference(R.string.user_interface_label); - clickPreference(R.string.pref_set_theme_title); - onView(withText(otherTheme)).perform(click()); + onView(withText(otherThemeText)).perform(click()); Awaitility.await().atMost(1000, MILLISECONDS) .until(() -> UserPreferences.getTheme() != theme); } |