Merge pull request #2867 from mfietz/develop

Merge master back into develop
This commit is contained in:
Martin Fietz 2018-10-20 23:02:30 +02:00 committed by GitHub
commit f1710cae47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 51 additions and 3 deletions

View File

@ -21,6 +21,7 @@ import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
*/
class DBTestUtils {
private DBTestUtils(){}
/**
* Use this method when tests don't involve chapters.
*/

View File

@ -8,6 +8,7 @@ import java.io.IOException;
* Utility methods for FeedGenerator
*/
class GeneratorUtil {
private GeneratorUtil(){}
public static void addPaymentLink(XmlSerializer xml, String paymentLink, boolean withNamespace) throws IOException {
String ns = (withNamespace) ? "http://www.w3.org/2005/Atom" : null;

View File

@ -14,6 +14,8 @@ import de.danoeh.antennapod.core.export.opml.OpmlElement;
*/
public class OpmlImportHolder {
private OpmlImportHolder(){}
private static ArrayList<OpmlElement> readElements;
public static ArrayList<OpmlElement> getReadElements() {

View File

@ -8,6 +8,8 @@ import de.danoeh.antennapod.core.ClientConfig;
*/
class ClientConfigurator {
private ClientConfigurator(){}
static {
ClientConfig.USER_AGENT = "AntennaPod/" + BuildConfig.VERSION_NAME;
ClientConfig.applicationCallbacks = new ApplicationCallbacksImpl();

View File

@ -17,6 +17,9 @@ import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
* Creates a dialog that lets the user change the hostname for the gpodder.net service.
*/
public class GpodnetSetHostnameDialog {
private GpodnetSetHostnameDialog(){}
private static final String TAG = "GpodnetSetHostnameDialog";
public static AlertDialog createDialog(final Context context) {

View File

@ -17,6 +17,8 @@ import de.danoeh.antennapod.R;
public class RatingDialog {
private RatingDialog(){}
private static final String TAG = RatingDialog.class.getSimpleName();
private static final int AFTER_DAYS = 7;

View File

@ -30,6 +30,9 @@ import de.danoeh.antennapod.core.util.ShareUtils;
* Handles interactions with the FeedItemMenu.
*/
public class FeedMenuHandler {
private FeedMenuHandler(){ }
private static final String TAG = "FeedMenuHandler";
public static boolean onCreateOptionsMenu(MenuInflater inflater, Menu menu) {

View File

@ -24,6 +24,8 @@ import de.danoeh.antennapod.core.storage.DBWriter;
*/
class UpdateManager {
private UpdateManager(){}
private static final String TAG = UpdateManager.class.getSimpleName();
private static final String PREF_NAME = "app_version";

View File

@ -6,6 +6,7 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
* The settings that AntennaPod will use for various Glide options
*/
public class ApGlideSettings {
private ApGlideSettings(){}
public static final DiskCacheStrategy AP_DISK_CACHE_STRATEGY = DiskCacheStrategy.ALL;
}

View File

@ -24,6 +24,8 @@ import de.danoeh.antennapod.core.service.GpodnetSyncService;
*/
public class GpodnetPreferences {
private GpodnetPreferences(){}
private static final String TAG = "GpodnetPreferences";
private static final String PREF_NAME = "gpodder.net";

View File

@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit;
* when called.
*/
public class UserPreferences {
private UserPreferences(){}
private static final String IMPORT_DIR = "import/";

View File

@ -40,6 +40,9 @@ import okhttp3.internal.http.StatusLine;
* Provides access to a HttpClient singleton.
*/
public class AntennapodHttpClient {
private AntennapodHttpClient(){}
private static final String TAG = "AntennapodHttpClient";
private static final int CONNECTION_TIMEOUT = 30000;

View File

@ -19,6 +19,8 @@ import de.danoeh.antennapod.core.util.comparator.SearchResultValueComparator;
* Performs search on Feeds and FeedItems
*/
public class FeedSearcher {
private FeedSearcher(){}
private static final String TAG = "FeedSearcher";

View File

@ -17,7 +17,9 @@ import java.util.TimeZone;
*/
public class DateUtils {
private static final String TAG = "DateUtils";
private DateUtils(){}
private static final String TAG = "DateUtils";
private static final TimeZone defaultTimezone = TimeZone.getTimeZone("GMT");

View File

@ -5,6 +5,7 @@ import java.util.List;
import de.danoeh.antennapod.core.feed.FeedItem;
public class FeedItemUtil {
private FeedItemUtil(){}
public static int indexOfItemWithDownloadUrl(List<FeedItem> items, String downloadUrl) {
if(items == null) {

View File

@ -8,6 +8,7 @@ import android.content.pm.ResolveInfo;
import java.util.List;
public class IntentUtils {
private IntentUtils(){}
/*
* Checks if there is at least one exported activity that can be performed for the intent

View File

@ -5,6 +5,9 @@ import android.support.v4.util.ArrayMap;
import java.nio.charset.Charset;
public class LangUtils {
private LangUtils(){}
public static final Charset UTF_8 = Charset.forName("UTF-8");
private static final ArrayMap<String, String> languages;

View File

@ -27,6 +27,7 @@ import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
public class NetworkUtils {
private NetworkUtils(){}
private static final String TAG = NetworkUtils.class.getSimpleName();

View File

@ -9,6 +9,7 @@ import java.util.concurrent.TimeUnit;
* Media file should be "rewinded" x seconds after user resumes the playback.
*/
public class RewindAfterPauseUtils {
private RewindAfterPauseUtils(){}
public static final long ELAPSED_TIME_FOR_SHORT_REWIND = TimeUnit.MINUTES.toMillis(1);
public static final long ELAPSED_TIME_FOR_MEDIUM_REWIND = TimeUnit.HOURS.toMillis(1);

View File

@ -14,6 +14,8 @@ import de.danoeh.antennapod.core.preferences.UserPreferences;
* Utility functions for handling storage errors
*/
public class StorageUtils {
private StorageUtils(){}
private static final String TAG = "StorageUtils";
public static boolean storageAvailable() {

View File

@ -11,6 +11,8 @@ import de.danoeh.antennapod.core.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
public class ThemeUtils {
private ThemeUtils(){}
private static final String TAG = "ThemeUtils";
public static int getSelectionBackgroundColor() {

View File

@ -11,7 +11,9 @@ import de.danoeh.antennapod.core.BuildConfig;
/** Ensures that only one instance of the FlattrService class exists at a time */
class FlattrServiceCreator {
private static final String TAG = "FlattrServiceCreator";
private FlattrServiceCreator(){}
public static final String TAG = "FlattrServiceCreator";
private static volatile FlattrService flattrService;

View File

@ -36,6 +36,8 @@ import de.danoeh.antennapod.core.storage.DBWriter;
*/
public class FlattrUtils {
private FlattrUtils(){}
private static final String TAG = "FlattrUtils";
private static final String HOST_NAME = "de.danoeh.antennapod";

View File

@ -7,6 +7,7 @@ import de.danoeh.antennapod.core.R;
/** Utility class for MediaPlayer errors. */
public class MediaPlayerError {
private MediaPlayerError(){}
/** Get a human-readable string for a specific error code. */
public static String getErrorString(Context context, int code) {

View File

@ -176,6 +176,8 @@ public interface Playable extends Parcelable,
* Provides utility methods for Playable objects.
*/
class PlayableUtils {
private PlayableUtils(){}
private static final String TAG = "PlayableUtils";
/**

View File

@ -335,7 +335,7 @@
<string name="pref_unpauseOnHeadsetReconnect_sum">Resume playback when the headphones are reconnected</string>
<string name="pref_unpauseOnBluetoothReconnect_sum">Resume playback when bluetooth reconnects</string>
<string name="pref_hardwareForwardButtonSkips_title">Forward Button Skips</string>
<string name="pref_hardwareForwardButtonSkips_sum">When pressing a hardware forward button skip to the next episode instead of fast-forwarding</string>
<string name="pref_hardwareForwardButtonSkips_sum">When pressing a forward button on a bluetooth-connected device skip to the next episode instead of fast-forwarding</string>
<string name="pref_hardwarePreviousButtonRestarts_title">Previous button restarts</string>
<string name="pref_hardwarePreviousButtonRestarts_sum">When pressing a hardware previous button restart playing the current episode instead of rewinding</string>
<string name="pref_followQueue_sum">Jump to next queue item when playback completes</string>

View File

@ -14,6 +14,7 @@ import de.danoeh.antennapod.core.util.NetworkUtils;
* Apps using the core module of AntennaPod should register implementations of all interfaces here.
*/
public class ClientConfig {
private ClientConfig(){}
/**
* Should be used when setting User-Agent header for HTTP-requests.

View File

@ -23,6 +23,8 @@ import de.danoeh.antennapod.core.util.playback.Playable;
* Helper functions for Cast support.
*/
public class CastUtils {
private CastUtils(){}
private static final String TAG = "CastUtils";
public static final String KEY_MEDIA_ID = "de.danoeh.antennapod.core.cast.MediaId";