diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2024-03-25 21:45:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 21:45:43 +0100 |
commit | 69b24699a36bc9c4ffc6200fbcf8069f7a94c1ab (patch) | |
tree | 5bfb94e00ff3d296412bc2624fbb43fc455d1471 /app/src/main/java/de/danoeh/antennapod/dialog | |
parent | 15eab50223e7789c15e40f956ee1ba166209b11d (diff) | |
download | AntennaPod-69b24699a36bc9c4ffc6200fbcf8069f7a94c1ab.zip |
Move DBReader to :storage:database (#7027)
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/dialog')
5 files changed, 12 insertions, 9 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java index 6a6ba4339..82e32aed3 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/DownloadLogDetailsDialog.java @@ -11,7 +11,7 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder; import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.util.DownloadErrorLabel; import de.danoeh.antennapod.model.download.DownloadResult; -import de.danoeh.antennapod.core.storage.DBReader; +import de.danoeh.antennapod.storage.database.DBReader; import de.danoeh.antennapod.event.MessageEvent; import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.model.feed.FeedMedia; diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java index da29a06cd..daa00b8a3 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/FeedSortDialog.java @@ -4,6 +4,7 @@ import android.content.Context; import com.google.android.material.dialog.MaterialAlertDialogBuilder; +import de.danoeh.antennapod.model.feed.FeedOrder; import org.greenrobot.eventbus.EventBus; import java.util.Arrays; @@ -19,7 +20,7 @@ public class FeedSortDialog { dialog.setTitle(context.getString(R.string.pref_nav_drawer_feed_order_title)); dialog.setNegativeButton(android.R.string.cancel, (d, listener) -> d.dismiss()); - int selected = UserPreferences.getFeedOrder(); + int selected = UserPreferences.getFeedOrder().id; List<String> entryValues = Arrays.asList(context.getResources().getStringArray(R.array.nav_drawer_feed_order_values)); final int selectedIndex = entryValues.indexOf("" + selected); @@ -27,7 +28,7 @@ public class FeedSortDialog { String[] items = context.getResources().getStringArray(R.array.nav_drawer_feed_order_options); dialog.setSingleChoiceItems(items, selectedIndex, (d, which) -> { if (selectedIndex != which) { - UserPreferences.setFeedOrder(entryValues.get(which)); + UserPreferences.setFeedOrder(FeedOrder.fromOrdinal(Integer.parseInt(entryValues.get(which)))); //Update subscriptions EventBus.getDefault().post(new UnreadItemsUpdateEvent()); } diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java index e6c5808f8..fd1403313 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/RenameItemDialog.java @@ -10,7 +10,7 @@ import android.view.LayoutInflater; import androidx.appcompat.app.AlertDialog; import com.google.android.material.dialog.MaterialAlertDialogBuilder; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.core.storage.NavDrawerData; +import de.danoeh.antennapod.storage.database.NavDrawerData; import de.danoeh.antennapod.model.feed.Feed; import de.danoeh.antennapod.core.storage.DBWriter; import de.danoeh.antennapod.databinding.EditTextDialogBinding; diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java index 64bb32897..4b3ed7db7 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/TagSettingsDialog.java @@ -22,10 +22,12 @@ import java.util.Set; import de.danoeh.antennapod.R; import de.danoeh.antennapod.adapter.SimpleChipAdapter; -import de.danoeh.antennapod.core.storage.DBReader; +import de.danoeh.antennapod.storage.database.DBReader; import de.danoeh.antennapod.core.storage.DBWriter; -import de.danoeh.antennapod.core.storage.NavDrawerData; +import de.danoeh.antennapod.storage.database.NavDrawerData; import de.danoeh.antennapod.databinding.EditTagsDialogBinding; +import de.danoeh.antennapod.model.feed.FeedCounter; +import de.danoeh.antennapod.model.feed.FeedOrder; import de.danoeh.antennapod.model.feed.FeedPreferences; import de.danoeh.antennapod.view.ItemOffsetDecoration; import io.reactivex.Observable; @@ -110,7 +112,7 @@ public class TagSettingsDialog extends DialogFragment { private void loadTags() { Observable.fromCallable( () -> { - NavDrawerData data = DBReader.getNavDrawerData(null); + NavDrawerData data = DBReader.getNavDrawerData(null, FeedOrder.ALPHABETICAL, FeedCounter.SHOW_NONE); List<NavDrawerData.DrawerItem> items = data.items; List<String> folders = new ArrayList<String>(); for (NavDrawerData.DrawerItem item : items) { diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/rating/RatingDialogManager.java b/app/src/main/java/de/danoeh/antennapod/dialog/rating/RatingDialogManager.java index ffa67cc2e..53e1c8c72 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/rating/RatingDialogManager.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/rating/RatingDialogManager.java @@ -8,8 +8,8 @@ import java.util.concurrent.TimeUnit; import android.util.Log; import androidx.fragment.app.FragmentActivity; import de.danoeh.antennapod.core.BuildConfig; -import de.danoeh.antennapod.core.storage.DBReader; -import de.danoeh.antennapod.core.storage.StatisticsItem; +import de.danoeh.antennapod.storage.database.DBReader; +import de.danoeh.antennapod.storage.database.StatisticsItem; import io.reactivex.Observable; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; |