summaryrefslogtreecommitdiff
path: root/ui/preferences
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-04-05 19:20:27 +0200
committerGitHub <noreply@github.com>2024-04-05 19:20:27 +0200
commit92ab575b150ab49ca85e0ac994558142e49c9e68 (patch)
tree422dcd76895a4ba06ed02723ff61351435c0fe49 /ui/preferences
parent2143ab135182434911d4554a8ef08115eaa0d2d0 (diff)
downloadAntennaPod-92ab575b150ab49ca85e0ac994558142e49c9e68.zip
Delete core module (#7060)
Diffstat (limited to 'ui/preferences')
-rw-r--r--ui/preferences/build.gradle1
-rw-r--r--ui/preferences/src/main/assets/website-languages.txt7
-rw-r--r--ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/AboutFragment.java2
-rw-r--r--ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/LicensesFragment.java2
-rw-r--r--ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/downloads/DataFolderAdapter.java12
-rw-r--r--ui/preferences/src/main/res/values/arrays.xml277
-rw-r--r--ui/preferences/src/main/res/values/keycodes.xml9
7 files changed, 297 insertions, 13 deletions
diff --git a/ui/preferences/build.gradle b/ui/preferences/build.gradle
index a777b4332..eb595da58 100644
--- a/ui/preferences/build.gradle
+++ b/ui/preferences/build.gradle
@@ -23,7 +23,6 @@ android {
}
dependencies {
- implementation project(":core")
implementation project(":event")
implementation project(":net:common")
implementation project(":net:sync:model")
diff --git a/ui/preferences/src/main/assets/website-languages.txt b/ui/preferences/src/main/assets/website-languages.txt
deleted file mode 100644
index 64361314b..000000000
--- a/ui/preferences/src/main/assets/website-languages.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-en
-fr
-nl
-it
-da
-de
-es
diff --git a/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/AboutFragment.java b/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/AboutFragment.java
index ad956ed71..3e30b44dd 100644
--- a/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/AboutFragment.java
+++ b/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/AboutFragment.java
@@ -10,7 +10,7 @@ import android.os.Bundle;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
import com.google.android.material.snackbar.Snackbar;
-import de.danoeh.antennapod.core.util.IntentUtils;
+import de.danoeh.antennapod.ui.common.IntentUtils;
import de.danoeh.antennapod.ui.preferences.BuildConfig;
import de.danoeh.antennapod.ui.preferences.R;
diff --git a/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/LicensesFragment.java b/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/LicensesFragment.java
index 85badcefc..1a60d03ce 100644
--- a/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/LicensesFragment.java
+++ b/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/about/LicensesFragment.java
@@ -9,7 +9,7 @@ import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import androidx.fragment.app.ListFragment;
-import de.danoeh.antennapod.core.util.IntentUtils;
+import de.danoeh.antennapod.ui.common.IntentUtils;
import de.danoeh.antennapod.ui.preferences.R;
import io.reactivex.Single;
import io.reactivex.SingleOnSubscribe;
diff --git a/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/downloads/DataFolderAdapter.java b/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/downloads/DataFolderAdapter.java
index bd6a75503..99f63156c 100644
--- a/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/downloads/DataFolderAdapter.java
+++ b/ui/preferences/src/main/java/de/danoeh/antennapod/ui/preferences/screen/downloads/DataFolderAdapter.java
@@ -1,6 +1,7 @@
package de.danoeh.antennapod.ui.preferences.screen.downloads;
import android.content.Context;
+import android.os.StatFs;
import android.text.format.Formatter;
import android.view.LayoutInflater;
import android.view.View;
@@ -12,7 +13,6 @@ import androidx.annotation.NonNull;
import androidx.core.util.Consumer;
import androidx.recyclerview.widget.RecyclerView;
import de.danoeh.antennapod.storage.preferences.UserPreferences;
-import de.danoeh.antennapod.core.util.StorageUtils;
import de.danoeh.antennapod.ui.preferences.R;
import java.io.File;
@@ -125,11 +125,17 @@ public class DataFolderAdapter extends RecyclerView.Adapter<DataFolderAdapter.Vi
}
long getAvailableSpace() {
- return StorageUtils.getFreeSpaceAvailable(path);
+ StatFs stat = new StatFs(path);
+ long availableBlocks = stat.getAvailableBlocksLong();
+ long blockSize = stat.getBlockSizeLong();
+ return availableBlocks * blockSize;
}
long getTotalSpace() {
- return StorageUtils.getTotalSpaceAvailable(path);
+ StatFs stat = new StatFs(path);
+ long blockCount = stat.getBlockCountLong();
+ long blockSize = stat.getBlockSizeLong();
+ return blockCount * blockSize;
}
int getUsagePercentage() {
diff --git a/ui/preferences/src/main/res/values/arrays.xml b/ui/preferences/src/main/res/values/arrays.xml
new file mode 100644
index 000000000..a4f5d7f38
--- /dev/null
+++ b/ui/preferences/src/main/res/values/arrays.xml
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+
+ <string-array name="spnAutoDeleteItems">
+ <item>@string/global_default</item>
+ <item>@string/feed_auto_download_always</item>
+ <item>@string/feed_auto_download_never</item>
+ </string-array>
+
+ <string-array name="spnAutoDeleteValues">
+ <item>global</item>
+ <item>always</item>
+ <item>never</item>
+ </string-array>
+
+ <string-array name="spnVolumeAdaptationItems">
+ <item>@string/feed_volume_reduction_heavy</item>
+ <item>@string/feed_volume_reduction_light</item>
+ <item>@string/feed_volume_reduction_off</item>
+ <item>@string/feed_volume_boost_light</item>
+ <item>@string/feed_volume_boost_medium</item>
+ <item>@string/feed_volume_boost_heavy</item>
+ </string-array>
+
+ <string-array name="spnVolumeAdaptationValues">
+ <item>heavy</item>
+ <item>light</item>
+ <item>off</item>
+ <item>light_boost</item>
+ <item>medium_boost</item>
+ <item>heavy_boost</item>
+ </string-array>
+
+ <string-array name="feed_refresh_interval_entries">
+ <item>@string/feed_refresh_never</item>
+ <item>@string/feed_every_hour</item>
+ <item>@string/feed_every_2_hours</item>
+ <item>@string/feed_every_4_hours</item>
+ <item>@string/feed_every_8_hours</item>
+ <item>@string/feed_every_12_hours</item>
+ <item>@string/feed_every_24_hours</item>
+ <item>@string/feed_every_72_hours</item>
+ </string-array>
+
+ <string-array name="feed_refresh_interval_values">
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ <item>4</item>
+ <item>8</item>
+ <item>12</item>
+ <item>24</item>
+ <item>72</item>
+ </string-array>
+
+ <string-array name="globalNewEpisodesActionItems">
+ <item>@string/feed_new_episodes_action_add_to_inbox</item>
+ <item>@string/feed_new_episodes_action_add_to_queue</item>
+ <item>@string/feed_new_episodes_action_nothing</item>
+ </string-array>
+
+ <string-array name="globalNewEpisodesActionValues">
+ <item>1</item>
+ <item>3</item>
+ <item>2</item>
+ </string-array>
+
+ <string-array name="feedNewEpisodesActionItems">
+ <item>@string/global_default</item>
+ <item>@string/feed_new_episodes_action_add_to_inbox</item>
+ <item>@string/feed_new_episodes_action_add_to_queue</item>
+ <item>@string/feed_new_episodes_action_nothing</item>
+ </string-array>
+
+ <string-array name="feedNewEpisodesActionValues">
+ <item>0</item>
+ <item>1</item>
+ <item>3</item>
+ <item>2</item>
+ </string-array>
+
+ <string-array name="smart_mark_as_played_values">
+ <item>0</item>
+ <item>15</item>
+ <item>30</item>
+ <item>60</item>
+ <item>120</item>
+ <item>300</item>
+ </string-array>
+
+
+ <integer-array name="seek_delta_values">
+ <item>5</item>
+ <item>10</item>
+ <item>15</item>
+ <item>20</item>
+ <item>30</item>
+ <item>45</item>
+ <item>60</item>
+ </integer-array>
+
+ <string-array name="episode_cache_size_entries">
+ <item>5</item>
+ <item>10</item>
+ <item>25</item>
+ <item>50</item>
+ <item>100</item>
+ <item>500</item>
+ <item>@string/pref_episode_cache_unlimited</item>
+ </string-array>
+
+ <string-array name="episode_cache_size_values">
+ <item>5</item>
+ <item>10</item>
+ <item>25</item>
+ <item>50</item>
+ <item>100</item>
+ <item>500</item>
+ <item>-1</item>
+ </string-array>
+
+ <string-array name="mobile_update_entries">
+ <item>@string/pref_mobileUpdate_refresh</item>
+ <item>@string/pref_mobileUpdate_episode_download</item>
+ <item>@string/pref_mobileUpdate_auto_download</item>
+ <item>@string/pref_mobileUpdate_streaming</item>
+ <item>@string/pref_mobileUpdate_images</item>
+ <item>@string/synchronization_pref</item>
+ </string-array>
+
+ <string-array name="mobile_update_values">
+ <item>feed_refresh</item>
+ <item>episode_download</item>
+ <item>auto_download</item>
+ <item>streaming</item>
+ <item>images</item>
+ <item>sync</item>
+ </string-array>
+
+ <string-array name="mobile_update_default_value">
+ <item>images</item>
+ <item>sync</item>
+ </string-array>
+
+ <string-array name="episode_cleanup_entries">
+ <item>@string/episode_cleanup_except_favorite_removal</item>
+ <item>@string/episode_cleanup_queue_removal</item>
+ <item>0</item>
+ <item>1</item>
+ <item>3</item>
+ <item>5</item>
+ <item>7</item>
+ <item>@string/episode_cleanup_never</item>
+ </string-array>
+
+ <string-array name="button_action_options">
+ <item>@string/button_action_fast_forward</item>
+ <item>@string/button_action_rewind</item>
+ <item>@string/button_action_skip_episode</item>
+ <item>@string/button_action_restart_episode</item>
+ </string-array>
+
+ <string-array name="button_action_values">
+ <item>@string/keycode_media_fast_forward</item>
+ <item>@string/keycode_media_rewind</item>
+ <item>@string/keycode_media_next</item>
+ <item>@string/keycode_media_previous</item>
+ </string-array>
+
+ <string-array name="enqueue_location_options">
+ <item>@string/enqueue_location_back</item>
+ <item>@string/enqueue_location_front</item>
+ <item>@string/enqueue_location_after_current</item>
+ <item>@string/enqueue_location_random</item>
+ </string-array>
+
+ <string-array name="enqueue_location_values">
+ <!-- MUST be the same as UserPreferences.EnqueueLocation enum -->
+ <item>BACK</item>
+ <item>FRONT</item>
+ <item>AFTER_CURRENTLY_PLAYING</item>
+ <item>RANDOM</item>
+ </string-array>
+
+ <string-array name="episode_cleanup_values">
+ <item>-3</item>
+ <item>-1</item>
+ <item>0</item>
+ <item>12</item>
+ <item>24</item>
+ <item>72</item>
+ <item>120</item>
+ <item>168</item>
+ <item>-2</item>
+ </string-array>
+
+ <string-array name="nav_drawer_titles">
+ <item>@string/home_label</item>
+ <item>@string/queue_label</item>
+ <item>@string/inbox_label</item>
+ <item>@string/episodes_label</item>
+ <item>@string/subscriptions_label</item>
+ <item>@string/downloads_label</item>
+ <item>@string/playback_history_label</item>
+ <item>@string/add_feed_label</item>
+ <item>@string/subscriptions_list_label</item>
+ </string-array>
+
+ <string-array name="nav_drawer_feed_order_options">
+ <item>@string/drawer_feed_order_unplayed_episodes</item>
+ <item>@string/drawer_feed_order_alphabetical</item>
+ <item>@string/drawer_feed_order_last_update</item>
+ <item>@string/drawer_feed_order_most_played</item>
+ </string-array>
+ <string-array name="nav_drawer_feed_order_values">
+ <item>0</item>
+ <item>1</item>
+ <item>2</item>
+ <item>3</item>
+ </string-array>
+
+ <string-array name="nav_drawer_feed_counter_options">
+ <item>@string/drawer_feed_counter_inbox</item>
+ <item>@string/drawer_feed_counter_unplayed</item>
+ <item>@string/drawer_feed_counter_downloaded</item>
+ <item>@string/drawer_feed_counter_downloaded_unplayed</item>
+ <item>@string/drawer_feed_counter_none</item>
+ </string-array>
+ <string-array name="nav_drawer_feed_counter_values">
+ <item>1</item>
+ <item>2</item>
+ <item>4</item>
+ <item>5</item>
+ <item>3</item>
+ </string-array>
+
+ <string-array name="home_section_titles">
+ <item>@string/home_continue_title</item>
+ <item>@string/home_new_title</item>
+ <item>@string/home_surprise_title</item>
+ <item>@string/home_classics_title</item>
+ <item>@string/home_downloads_title</item>
+ </string-array>
+
+ <string-array name="home_section_tags">
+ <item>QueueSection</item>
+ <item>InboxSection</item>
+ <item>EpisodesSurpriseSection</item>
+ <item>SubscriptionsSection</item>
+ <item>DownloadsSection</item>
+ </string-array>
+
+ <string-array name="full_notification_buttons_options">
+ <item>@string/skip_episode_label</item>
+ <item>@string/next_chapter</item>
+ <item>@string/playback_speed</item>
+ <item>@string/sleep_timer_label</item>
+ </string-array>
+
+ <string-array name="default_page_values">
+ <item>HomeFragment</item>
+ <item>QueueFragment</item>
+ <item>NewEpisodesFragment</item>
+ <item>EpisodesFragment</item>
+ <item>SubscriptionFragment</item>
+ <item>remember</item>
+ </string-array>
+
+ <string-array name="default_page_titles">
+ <item>@string/home_label</item>
+ <item>@string/queue_label</item>
+ <item>@string/inbox_label</item>
+ <item>@string/episodes_label</item>
+ <item>@string/subscriptions_label</item>
+ <item>@string/remember_last_page</item>
+ </string-array>
+</resources>
diff --git a/ui/preferences/src/main/res/values/keycodes.xml b/ui/preferences/src/main/res/values/keycodes.xml
new file mode 100644
index 000000000..e0d44ce04
--- /dev/null
+++ b/ui/preferences/src/main/res/values/keycodes.xml
@@ -0,0 +1,9 @@
+<resources
+ xmlns:tools="http://schemas.android.com/tools"
+ tools:ignore="MissingTranslation">
+
+ <string name="keycode_media_next">87</string>
+ <string name="keycode_media_previous">88</string>
+ <string name="keycode_media_rewind">89</string>
+ <string name="keycode_media_fast_forward">90</string>
+</resources>