summaryrefslogtreecommitdiff
path: root/core/src/main/java/de
diff options
context:
space:
mode:
authorH. Lehmann <ByteHamster@users.noreply.github.com>2019-09-20 23:06:56 +0200
committerGitHub <noreply@github.com>2019-09-20 23:06:56 +0200
commit46c8679fe254ad23f0d055b3227a1fb2610086ef (patch)
tree4d0d853411847e46d0d273b61786e8861fceaead /core/src/main/java/de
parentc4c1780da4fee4365ea6c72019aba7cfdce6b890 (diff)
parent19fc4c1f0d2af84ba3f663b369d5e8eb7f8ef80e (diff)
downloadAntennaPod-46c8679fe254ad23f0d055b3227a1fb2610086ef.zip
Merge branch 'develop' into follow-system-theme
Diffstat (limited to 'core/src/main/java/de')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java23
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java7
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java17
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java4
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java15
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java9
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java5
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java5
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java13
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java117
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java38
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java15
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java21
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java27
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java2
17 files changed, 32 insertions, 290 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java b/core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java
deleted file mode 100644
index 4a591c996..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/event/FeedMediaEvent.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package de.danoeh.antennapod.core.event;
-
-import de.danoeh.antennapod.core.feed.FeedMedia;
-
-public class FeedMediaEvent {
-
- public enum Action {
- UPDATE
- }
-
- private final Action action;
- private final FeedMedia media;
-
- private FeedMediaEvent(Action action, FeedMedia media) {
- this.action = action;
- this.media = media;
- }
-
- public static FeedMediaEvent update(FeedMedia media) {
- return new FeedMediaEvent(Action.UPDATE, media);
- }
-
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
index 07a72e1c9..a06047229 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java
@@ -896,13 +896,6 @@ public class UserPreferences {
}
/**
- * Reads episode cache size as it is saved in the episode_cache_size_values array.
- */
- public static int readEpisodeCacheSize(String valueFromPrefs) {
- return readEpisodeCacheSizeInternal(valueFromPrefs);
- }
-
- /**
* Evaluates whether Cast support (Chromecast, Audio Cast, etc) is enabled on the preferences.
*/
public static boolean isCastEnabled() {
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java
index 7938e262d..abb1d0c0b 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java
@@ -23,7 +23,9 @@ import com.bumptech.glide.request.RequestOptions;
import java.util.concurrent.TimeUnit;
import de.danoeh.antennapod.core.R;
+import de.danoeh.antennapod.core.feed.MediaType;
import de.danoeh.antennapod.core.glide.ApGlideSettings;
+import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.receiver.MediaButtonReceiver;
import de.danoeh.antennapod.core.receiver.PlayerWidget;
import de.danoeh.antennapod.core.service.playback.PlaybackService;
@@ -69,9 +71,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
}
synchronized (waitUsingService) {
- if (playbackService != null) {
- updateViews();
- }
+ updateViews();
}
if (playbackService != null) {
@@ -145,9 +145,12 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
String progressString;
if (playbackService != null) {
- progressString = getProgressString(playbackService.getCurrentPosition(), playbackService.getDuration());
+ progressString = getProgressString(playbackService.getCurrentPosition(),
+ playbackService.getDuration(), playbackService.getCurrentPlaybackSpeed());
} else {
- progressString = getProgressString(media.getPosition(), media.getDuration());
+ float speed = media.getMediaType() == MediaType.VIDEO ?
+ UserPreferences.getVideoPlaybackSpeed() : UserPreferences.getPlaybackSpeed();
+ progressString = getProgressString(media.getPosition(), media.getDuration(), speed);
}
if (progressString != null) {
@@ -211,9 +214,9 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
return PendingIntent.getBroadcast(this, 0, startingIntent, 0);
}
- private String getProgressString(int position, int duration) {
+ private String getProgressString(int position, int duration, float speed) {
if (position > 0 && duration > 0) {
- TimeSpeedConverter converter = new TimeSpeedConverter(playbackService.getCurrentPlaybackSpeed());
+ TimeSpeedConverter converter = new TimeSpeedConverter(speed);
position = converter.convert(position);
duration = converter.convert(duration);
return Converter.getDurationStringLong(position) + " / "
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
index 787d465d8..e4dedc23b 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadService.java
@@ -546,7 +546,7 @@ public class DownloadService extends Service {
.setContentText(getText(R.string.authentication_notification_msg))
.setStyle(new NotificationCompat.BigTextStyle().bigText(getText(R.string.authentication_notification_msg)
+ ": " + resourceTitle))
- .setSmallIcon(R.drawable.ic_stat_authentication)
+ .setSmallIcon(R.drawable.ic_notification_key)
.setAutoCancel(true)
.setContentIntent(ClientConfig.downloadServiceCallbacks.getAuthentificationNotificationContentIntent(DownloadService.this, downloadRequest));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java
index 5debc6d05..d88eb63f4 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadStatus.java
@@ -193,10 +193,6 @@ public class DownloadStatus {
this.cancelled = true;
}
- public void setCompletionDate(Date completionDate) {
- this.completionDate = (Date) completionDate.clone();
- }
-
public void setId(long id) {
this.id = id;
}
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 3c78a870b..5177fa6be 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
@@ -12,6 +12,7 @@ import android.util.Log;
import android.util.Pair;
import android.view.SurfaceHolder;
+import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
import org.antennapod.audio.MediaPlayer;
import java.io.File;
@@ -705,7 +706,6 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
*/
@Override
public void shutdown() {
- abandonAudioFocus();
executor.shutdown();
if (mediaPlayer != null) {
try {
@@ -839,6 +839,19 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
@Override
public void onAudioFocusChange(final int focusChange) {
+ if (!PlaybackService.isRunning) {
+ abandonAudioFocus();
+ Log.d(TAG, "onAudioFocusChange: PlaybackService is no longer running");
+ if (focusChange == AudioManager.AUDIOFOCUS_GAIN && pausedBecauseOfTransientAudiofocusLoss) {
+ new PlaybackServiceStarter(context, getPlayable())
+ .startWhenPrepared(true)
+ .streamIfLastWasStream()
+ .callEvenIfRunning(false)
+ .start();
+ }
+ return;
+ }
+
executor.submit(() -> {
playerLock.lock();
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
index e479a7711..ace89e40a 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/service/playback/PlaybackService.java
@@ -1086,7 +1086,7 @@ public class PlaybackService extends MediaBrowserServiceCompat {
editor.putInt(
PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus);
- editor.commit();
+ editor.apply();
}
private void writePlayerStatusPlaybackPreferences() {
@@ -1095,11 +1095,8 @@ public class PlaybackService extends MediaBrowserServiceCompat {
SharedPreferences.Editor editor = PreferenceManager
.getDefaultSharedPreferences(getApplicationContext()).edit();
int playerStatus = getCurrentPlayerStatusAsInt(mediaPlayer.getPlayerStatus());
-
- editor.putInt(
- PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus);
-
- editor.commit();
+ editor.putInt(PlaybackPreferences.PREF_CURRENT_PLAYER_STATUS, playerStatus);
+ editor.apply();
}
private void sendNotificationBroadcast(int type, int code) {
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
index e68bff16e..0fb181299 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java
@@ -193,11 +193,6 @@ public final class DBTasks {
}).start();
}
- public static long getLastRefreshAllFeedsTimeMillis(final Context context) {
- SharedPreferences prefs = context.getSharedPreferences(DBTasks.PREF_NAME, MODE_PRIVATE);
- return prefs.getLong(DBTasks.PREF_LAST_REFRESH, 0);
- }
-
/**
* @param context
* @param feedList the list of feeds to refresh
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java
index 892a4675a..9c48f31dd 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DownloadRequester.java
@@ -34,7 +34,6 @@ import de.danoeh.antennapod.core.util.URLChecker;
public class DownloadRequester {
private static final String TAG = "DownloadRequester";
- public static final String IMAGE_DOWNLOADPATH = "images/";
private static final String FEED_DOWNLOADPATH = "cache/";
private static final String MEDIA_DOWNLOADPATH = "media/";
@@ -274,10 +273,6 @@ public class DownloadRequester {
return item.getDownload_url() != null && downloads.containsKey(item.getDownload_url());
}
- public synchronized DownloadRequest getDownload(String downloadUrl) {
- return downloads.get(downloadUrl);
- }
-
/**
* Checks if feedfile with the given download url is in the downloads list
*/
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java
index 13ea9daf0..a3271bcf9 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java
@@ -55,16 +55,10 @@ public class PodDBAdapter {
*/
private static final int IN_OPERATOR_MAXIMUM = 800;
- /**
- * Maximum number of entries per search request.
- */
- public static final int SEARCH_LIMIT = 30;
-
// Key-constants
public static final String KEY_ID = "id";
public static final String KEY_TITLE = "title";
public static final String KEY_CUSTOM_TITLE = "custom_title";
- public static final String KEY_NAME = "name";
public static final String KEY_LINK = "link";
public static final String KEY_DESCRIPTION = "description";
public static final String KEY_FILE_URL = "file_url";
@@ -1400,13 +1394,6 @@ public class PodDBAdapter {
return db.rawQuery(query, null);
}
-
- public static final int IDX_FEEDSTATISTICS_FEED = 0;
- public static final int IDX_FEEDSTATISTICS_NUM_ITEMS = 1;
- public static final int IDX_FEEDSTATISTICS_NEW_ITEMS = 2;
- public static final int IDX_FEEDSTATISTICS_LATEST_EPISODE = 3;
- public static final int IDX_FEEDSTATISTICS_IN_PROGRESS_EPISODES = 4;
-
/**
* Select number of items, new items, the date of the latest episode and the number of episodes in progress. The result
* is sorted by the title of the feed.
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java b/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java
deleted file mode 100644
index 69dc38895..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/DuckType.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Adapted from: http://thinking-in-code.blogspot.com/2008/11/duck-typing-in-java-using-dynamic.html */
-
-package de.danoeh.antennapod.core.util;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import de.danoeh.antennapod.core.BuildConfig;
-
-/**
- * Allows "duck typing" or dynamic invocation based on method signature rather
- * than type hierarchy. In other words, rather than checking whether something
- * IS-a duck, check whether it WALKS-like-a duck or QUACKS-like a duck.
- *
- * To use first use the coerce static method to indicate the object you want to
- * do Duck Typing for, then specify an interface to the to method which you want
- * to coerce the type to, e.g:
- *
- * public interface Foo { void aMethod(); } class Bar { ... public void
- * aMethod() { ... } ... } Bar bar = ...; Foo foo =
- * DuckType.coerce(bar).to(Foo.class); foo.aMethod();
- *
- *
- */
-public class DuckType {
-
- private final Object objectToCoerce;
-
- private DuckType(Object objectToCoerce) {
- this.objectToCoerce = objectToCoerce;
- }
-
- private class CoercedProxy implements InvocationHandler {
- @Override
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- Method delegateMethod = findMethodBySignature(method);
- assert delegateMethod != null;
- return delegateMethod.invoke(DuckType.this.objectToCoerce, args);
- }
- }
-
- /**
- * Specify the duck typed object to coerce.
- *
- * @param object
- * the object to coerce
- * @return
- */
- public static DuckType coerce(Object object) {
- return new DuckType(object);
- }
-
- /**
- * Coerce the Duck Typed object to the given interface providing it
- * implements all the necessary methods.
- *
- * @param
- * @param iface
- * @return an instance of the given interface that wraps the duck typed
- * class
- * @throws ClassCastException
- * if the object being coerced does not implement all the
- * methods in the given interface.
- */
- @SuppressWarnings({ "rawtypes", "unchecked" })
- public <T> T to(Class iface) {
- if (BuildConfig.DEBUG && !iface.isInterface()) throw new AssertionError("cannot coerce object to a class, must be an interface");
- if (isA(iface)) {
- return (T) iface.cast(objectToCoerce);
- }
- if (quacksLikeA(iface)) {
- return generateProxy(iface);
- }
- throw new ClassCastException("Could not coerce object of type " + objectToCoerce.getClass() + " to " + iface);
- }
-
- @SuppressWarnings("rawtypes")
- private boolean isA(Class iface) {
- return objectToCoerce.getClass().isInstance(iface);
- }
-
- /**
- * Determine whether the duck typed object can be used with the given
- * interface.
- *
- * @param Type
- * of the interface to check.
- * @param iface
- * Interface class to check
- * @return true if the object will support all the methods in the interface,
- * false otherwise.
- */
- @SuppressWarnings("rawtypes")
- private boolean quacksLikeA(Class iface) {
- for (Method method : iface.getMethods()) {
- if (findMethodBySignature(method) == null) {
- return false;
- }
- }
- return true;
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- private <T> T generateProxy(Class iface) {
- return (T) Proxy.newProxyInstance(iface.getClassLoader(), new Class[] { iface }, new CoercedProxy());
- }
-
- private Method findMethodBySignature(Method method) {
- try {
- return objectToCoerce.getClass().getMethod(method.getName(), method.getParameterTypes());
- } catch (NoSuchMethodException e) {
- return null;
- }
- }
-
-} \ No newline at end of file
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java
index 826c06822..a8206d3bd 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/FeedItemUtil.java
@@ -7,19 +7,6 @@ import de.danoeh.antennapod.core.feed.FeedItem;
public class FeedItemUtil {
private FeedItemUtil(){}
- public static int indexOfItemWithDownloadUrl(List<FeedItem> items, String downloadUrl) {
- if(items == null) {
- return -1;
- }
- for(int i=0; i < items.size(); i++) {
- FeedItem item = items.get(i);
- if(item.hasMedia() && item.getMedia().getDownload_url().equals(downloadUrl)) {
- return i;
- }
- }
- return -1;
- }
-
public static int indexOfItemWithId(List<FeedItem> items, long id) {
for(int i=0; i < items.size(); i++) {
FeedItem item = items.get(i);
@@ -40,17 +27,6 @@ public class FeedItemUtil {
return -1;
}
- public static long[] getIds(FeedItem... items) {
- if(items == null || items.length == 0) {
- return new long[0];
- }
- long[] result = new long[items.length];
- for(int i=0; i < items.length; i++) {
- result[i] = items[i].getId();
- }
- return result;
- }
-
public static long[] getIds(List<FeedItem> items) {
if(items == null || items.size() == 0) {
return new long[0];
@@ -62,20 +38,6 @@ public class FeedItemUtil {
return result;
}
- public static boolean containsAnyId(List<FeedItem> items, long[] ids) {
- if(items == null || items.size() == 0) {
- return false;
- }
- for(FeedItem item : items) {
- for(long id : ids) {
- if(item.getId() == id) {
- return true;
- }
- }
- }
- return false;
- }
-
/**
* Get the link for the feed item for the purpose of Share. It fallbacks to
* use the feed's link if the named feed item has no link.
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java
deleted file mode 100644
index 29d095cd2..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/FeedtitleComparator.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package de.danoeh.antennapod.core.util;
-
-import java.util.Comparator;
-
-import de.danoeh.antennapod.core.feed.Feed;
-
-/** Compares the title of two feeds for sorting. */
-class FeedtitleComparator implements Comparator<Feed> {
-
- @Override
- public int compare(Feed lhs, Feed rhs) {
- return lhs.getTitle().compareToIgnoreCase(rhs.getTitle());
- }
-
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java
index 14f091249..1da7a5c50 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/ThemeUtils.java
@@ -3,30 +3,11 @@ package de.danoeh.antennapod.core.util;
import android.content.Context;
import android.support.annotation.AttrRes;
import android.support.annotation.ColorInt;
-import android.util.Log;
import android.util.TypedValue;
-import de.danoeh.antennapod.core.R;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
-
public class ThemeUtils {
- private ThemeUtils(){}
-
- private static final String TAG = "ThemeUtils";
+ private ThemeUtils() {
- public static int getSelectionBackgroundColor() {
- int theme = UserPreferences.getTheme();
- if (theme == R.style.Theme_AntennaPod_Dark) {
- return R.color.selection_background_color_dark;
- } else if (theme == R.style.Theme_AntennaPod_TrueBlack){
- return R.color.selection_background_color_trueblack;
- } else if (theme == R.style.Theme_AntennaPod_Light) {
- return R.color.selection_background_color_light;
- } else {
- Log.e(TAG,
- "getSelectionBackgroundColor could not match the current theme to any color!");
- return R.color.selection_background_color_light;
- }
}
public static @ColorInt int getColorFromAttr(Context context, @AttrRes int attr) {
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java b/core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java
deleted file mode 100644
index 56a684475..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/comparator/SearchResultValueComparator.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package de.danoeh.antennapod.core.util.comparator;
-
-import java.util.Comparator;
-
-import de.danoeh.antennapod.core.feed.FeedItem;
-import de.danoeh.antennapod.core.feed.SearchResult;
-
-public class SearchResultValueComparator implements Comparator<SearchResult> {
-
- /**
- * Compare items based, first, on where they were found (ie. title, chapters, or show notes).
- * If they were found in the same section, then compare based on the title, in lexicographic
- * order. This is still not ideal since, for example, "#12 Example A" would be considered
- * before "#8 Example B" due to the fact that "8" has a larger unicode value than "1"
- */
- @Override
- public int compare(SearchResult lhs, SearchResult rhs) {
- int value = rhs.getValue() - lhs.getValue();
- if (value == 0 && lhs.getComponent() instanceof FeedItem && rhs.getComponent() instanceof FeedItem) {
- String lhsTitle = ((FeedItem) lhs.getComponent()).getTitle();
- String rhsTitle = ((FeedItem) rhs.getComponent()).getTitle();
- return lhsTitle.compareTo(rhsTitle);
- }
- return value;
- }
-
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java
index 645bae5f3..9b644c3ba 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/ExternalMedia.java
@@ -182,7 +182,7 @@ public class ExternalMedia implements Playable {
editor.putLong(PREF_LAST_PLAYED_TIME, timestamp);
position = newPosition;
lastPlayedTime = timestamp;
- editor.commit();
+ editor.apply();
}
@Override
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java
index 0cfaaab3c..ac5418dd0 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/playback/PlaybackController.java
@@ -728,6 +728,8 @@ public class PlaybackController {
public void setPlaybackSpeed(float speed) {
if (playbackService != null) {
playbackService.setSpeed(speed);
+ } else {
+ onPlaybackSpeedChange();
}
}
public void setSkipSilence(boolean skipSilence) {