diff options
author | ByteHamster <info@bytehamster.com> | 2023-12-06 21:02:53 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2023-12-06 21:02:53 +0100 |
commit | ae4205c6d337644ebead973e9f091fe2498b8450 (patch) | |
tree | a33b2ecab676cbf72db5cfe83d52986d01ea089f /core/src | |
parent | 2e76dc8d0c950090acd95d1e8c9d6c7be314d9a6 (diff) | |
parent | 58081fe5bf7d9ad28f089cf10b2c17bfcfc8bbc7 (diff) | |
download | AntennaPod-ae4205c6d337644ebead973e9f091fe2498b8450.zip |
Merge branch 'master' into develop
Diffstat (limited to 'core/src')
6 files changed, 62 insertions, 8 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java index e7d7d10c9..69c632c4f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java @@ -345,7 +345,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer { if (t >= getDuration()) { Log.d(TAG, "Seek reached end of file, skipping to next episode"); - skip(); + endPlayback(true, true, true, true); return; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java index 1b1027c49..492dff759 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java @@ -811,6 +811,17 @@ public final class DBReader { return result; } + public static long getTimeBetweenReleaseAndPlayback(long timeFilterFrom, long timeFilterTo) { + PodDBAdapter adapter = PodDBAdapter.getInstance(); + adapter.open(); + try (Cursor cursor = adapter.getTimeBetweenReleaseAndPlayback(timeFilterFrom, timeFilterTo)) { + cursor.moveToFirst(); + long result = Long.parseLong(cursor.getString(0)); + adapter.close(); + return result; + } + } + /** * Returns data necessary for displaying the navigation drawer. This includes * the list of subscriptions, the number of items in the queue and the number of unread diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java index 4014937bd..d9c4a5098 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java @@ -2,6 +2,7 @@ package de.danoeh.antennapod.core.util; import android.content.Context; +import android.content.res.Resources; import java.util.Locale; import de.danoeh.antennapod.core.R; @@ -82,17 +83,31 @@ public final class Converter { * Converts milliseconds to a localized string containing hours and minutes. */ public static String getDurationStringLocalized(Context context, long duration) { - int h = (int) (duration / HOURS_MIL); - int rest = (int) (duration - h * HOURS_MIL); - int m = rest / MINUTES_MIL; + return getDurationStringLocalized(context.getResources(), duration); + } + public static String getDurationStringLocalized(Resources resources, long duration) { String result = ""; + int h = (int) (duration / HOURS_MIL); + int d = h / 24; + if (d > 0) { + String days = resources.getQuantityString(R.plurals.time_days_quantified, d, d); + result += days.replace(" ", "\u00A0") + " "; + h -= d * 24; + } + int rest = (int) (duration - (d * 24 + h) * HOURS_MIL); + int m = rest / MINUTES_MIL; if (h > 0) { - String hours = context.getResources().getQuantityString(R.plurals.time_hours_quantified, h, h); - result += hours + " "; + String hours = resources.getQuantityString(R.plurals.time_hours_quantified, h, h); + result += hours.replace(" ", "\u00A0"); + if (d == 0) { + result += " "; + } + } + if (d == 0) { + String minutes = resources.getQuantityString(R.plurals.time_minutes_quantified, m, m); + result += minutes.replace(" ", "\u00A0"); } - String minutes = context.getResources().getQuantityString(R.plurals.time_minutes_quantified, m, m); - result += minutes; return result; } diff --git a/core/src/main/res/drawable/bg_blue_gradient.xml b/core/src/main/res/drawable/bg_blue_gradient.xml new file mode 100644 index 000000000..8ae045b6d --- /dev/null +++ b/core/src/main/res/drawable/bg_blue_gradient.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8"?> +<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > + <gradient + android:angle="90" + android:endColor="@color/gradient_025" + android:startColor="@color/gradient_075" + android:type="linear" /> + <corners + android:radius="0dp"/> +</shape> diff --git a/core/src/main/res/drawable/ic_arrow_right_white.xml b/core/src/main/res/drawable/ic_arrow_right_white.xml new file mode 100644 index 000000000..4f33bed08 --- /dev/null +++ b/core/src/main/res/drawable/ic_arrow_right_white.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector + xmlns:android="http://schemas.android.com/apk/res/android" + android:height="24dp" + android:width="24dp" + android:viewportWidth="24" + android:viewportHeight="24"> + + <path + android:fillColor="#ffffff" + android:pathData="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" /> + +</vector> diff --git a/core/src/main/res/values/colors.xml b/core/src/main/res/values/colors.xml index 553da121a..ad835faf4 100644 --- a/core/src/main/res/values/colors.xml +++ b/core/src/main/res/values/colors.xml @@ -23,4 +23,9 @@ <color name="accent_light">#0078C2</color> <color name="accent_dark">#3D8BFF</color> + + <color name="gradient_000">#364ff3</color> + <color name="gradient_025">#2E6FF6</color> + <color name="gradient_075">#1EB0FC</color> + <color name="gradient_100">#16d0ff</color> </resources> |