diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2018-06-10 10:18:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-10 10:18:58 +0200 |
commit | 1b6f691feafa157960a3c8454d93caa177b6ad9d (patch) | |
tree | b6f854bb7b0d546cb5d2d1f527abd4c07df70b25 | |
parent | f0151501a5195bf3c2dbd50336c51005e629196f (diff) | |
parent | ac2acc65c36284270a8a41fe9e3fb50d03092d30 (diff) | |
download | AntennaPod-1b6f691feafa157960a3c8454d93caa177b6ad9d.zip |
Merge pull request #2713 from ByteHamster/remove-unused-code
Removed unused code
13 files changed, 0 insertions, 239 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java index 091f8daab..285ba54ea 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -690,7 +690,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements if(controller == null || controller.getMedia() == null) { return false; } - Playable media = controller.getMedia(); SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE); showTimeLeft = prefs.getBoolean(PREF_SHOW_TIME_LEFT, false); onPositionObserverUpdate(); diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java index 5bc67a95a..a8c60c19e 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java @@ -121,15 +121,6 @@ public class DownloadlistAdapter extends BaseAdapter { ImageButton butSecondary; } - public int getSelectedItemIndex() { - return selectedItemIndex; - } - - public void setSelectedItemIndex(int selectedItemIndex) { - this.selectedItemIndex = selectedItemIndex; - notifyDataSetChanged(); - } - public interface ItemAccess { int getCount(); diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java deleted file mode 100644 index 1b4aafeaa..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/DBTaskLoader.java +++ /dev/null @@ -1,29 +0,0 @@ -package de.danoeh.antennapod.core.asynctask; - -import android.content.Context; -import android.support.v4.content.AsyncTaskLoader; - -/** - * Subclass of AsyncTaskLoader that is made for loading data with one of the DB*-classes. - * This class will provide a useful default implementation that would otherwise always be necessary when interacting - * with the DB*-classes with an AsyncTaskLoader. - */ -abstract class DBTaskLoader<D> extends AsyncTaskLoader<D> { - - public DBTaskLoader(Context context) { - super(context); - } - - @Override - protected void onStopLoading() { - super.onStopLoading(); - cancelLoad(); - } - - @Override - protected void onStartLoading() { - super.onStartLoading(); - // according to https://code.google.com/p/android/issues/detail?id=14944, this has to be called manually - forceLoad(); - } -} 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 e59fe4c11..062cbc7ee 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 @@ -109,7 +109,6 @@ public class UserPreferences { // Experimental public static final String PREF_SONIC = "prefSonic"; private static final String PREF_STEREO_TO_MONO = "PrefStereoToMono"; - public static final String PREF_NORMALIZER = "prefNormalizer"; public static final String PREF_CAST_ENABLED = "prefCast"; //Used for enabling Chromecast support public static final int EPISODE_CLEANUP_QUEUE = -1; public static final int EPISODE_CLEANUP_NULL = -2; @@ -122,7 +121,6 @@ public class UserPreferences { private static final int EPISODE_CACHE_SIZE_UNLIMITED = -1; public static final int FEED_ORDER_COUNTER = 0; public static final int FEED_ORDER_ALPHABETICAL = 1; - public static final int FEED_ORDER_LAST_UPDATE = 2; public static final int FEED_ORDER_MOST_PLAYED = 3; public static final int FEED_COUNTER_SHOW_NEW_UNPLAYED_SUM = 0; public static final int FEED_COUNTER_SHOW_NEW = 1; diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java index 9a64bebf7..75c28564e 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloadRequest.java @@ -211,10 +211,6 @@ public class DownloadRequest implements Parcelable { this.size = size; } - public int getStatusMsg() { - return statusMsg; - } - public void setStatusMsg(int statusMsg) { this.statusMsg = statusMsg; } diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java deleted file mode 100644 index b0829f084..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/DownloaderCallback.java +++ /dev/null @@ -1,10 +0,0 @@ -package de.danoeh.antennapod.core.service.download; - -/** - * Callback used by the Downloader-classes to notify the requester that the - * download has completed. - */ -public interface DownloaderCallback { - - void onDownloadCompleted(Downloader downloader); -} 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 da500fd3e..c2706d183 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 @@ -237,27 +237,6 @@ public final class DBTasks { } /** - * Downloads all pages of the given feed. - * - * @param context Used for requesting the download. - * @param feed The Feed object. - */ - public static void refreshCompleteFeed(final Context context, final Feed feed) { - try { - refreshFeed(context, feed, true, false); - } catch (DownloadRequestException e) { - e.printStackTrace(); - DBWriter.addDownloadStatus( - new DownloadStatus(feed, feed - .getHumanReadableIdentifier(), - DownloadError.ERROR_REQUEST_ERROR, false, e - .getMessage() - ) - ); - } - } - - /** * Downloads all pages of the given feed even if feed has not been modified since last refresh * * @param context Used for requesting the download. @@ -378,27 +357,6 @@ public final class DBTasks { } /** - * Request the download of all objects in the queue. from a separate Thread. - * - * @param context Used for requesting the download an accessing the database. - */ - public static void downloadAllItemsInQueue(final Context context) { - new Thread() { - public void run() { - List<FeedItem> queue = DBReader.getQueue(); - if (!queue.isEmpty()) { - try { - downloadFeedItems(context, - queue.toArray(new FeedItem[queue.size()])); - } catch (DownloadRequestException e) { - e.printStackTrace(); - } - } - } - }.start(); - } - - /** * Requests the download of a list of FeedItem objects. * * @param context Used for requesting the download and accessing the DB. diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java index 1f4fad4ba..4ba7491a6 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java @@ -460,22 +460,6 @@ public class DBWriter { }); } - public static Future<?> addFavoriteItemById(final long itemId) { - return dbExec.submit(() -> { - final FeedItem item = DBReader.getFeedItem(itemId); - if (item == null) { - Log.d(TAG, "Can't find item for itemId " + itemId); - return; - } - final PodDBAdapter adapter = PodDBAdapter.getInstance().open(); - adapter.addFavoriteItem(item); - adapter.close(); - item.addTag(FeedItem.TAG_FAVORITE); - EventBus.getDefault().post(FavoritesEvent.added(item)); - EventBus.getDefault().post(FeedItemEvent.updated(item)); - }); - } - public static Future<?> removeFavoriteItem(final FeedItem item) { return dbExec.submit(() -> { final PodDBAdapter adapter = PodDBAdapter.getInstance().open(); 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 591015dff..51b41d3b3 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 @@ -543,31 +543,6 @@ public class PodDBAdapter { } /** - * Counts feeds and feed items in the flattr queue - */ - public int getFlattrQueueSize() { - int res = 0; - Cursor c = db.rawQuery(String.format("SELECT count(*) FROM %s WHERE %s=%s", - TABLE_NAME_FEEDS, KEY_FLATTR_STATUS, String.valueOf(FlattrStatus.STATUS_QUEUE)), null); - if (c.moveToFirst()) { - res = c.getInt(0); - c.close(); - } else { - Log.e(TAG, "Unable to determine size of flattr queue: Could not count number of feeds"); - } - c = db.rawQuery(String.format("SELECT count(*) FROM %s WHERE %s=%s", - TABLE_NAME_FEED_ITEMS, KEY_FLATTR_STATUS, String.valueOf(FlattrStatus.STATUS_QUEUE)), null); - if (c.moveToFirst()) { - res += c.getInt(0); - c.close(); - } else { - Log.e(TAG, "Unable to determine size of flattr queue: Could not count number of feed items"); - } - - return res; - } - - /** * Updates the download URL of a Feed. */ public void setFeedDownloadUrl(String original, String updated) { @@ -874,17 +849,6 @@ public class PodDBAdapter { return count > 0; } - public long getDownloadLogSize() { - final String query = String.format("SELECT COUNT(%s) FROM %s", KEY_ID, TABLE_NAME_DOWNLOAD_LOG); - Cursor result = db.rawQuery(query, null); - long count = 0; - if (result.moveToFirst()) { - count = result.getLong(0); - } - result.close(); - return count; - } - public void setQueue(List<FeedItem> queue) { ContentValues values = new ContentValues(); try { @@ -1013,18 +977,6 @@ public class PodDBAdapter { } /** - * Returns a cursor for a DB query in the FeedMedia table for a given ID. - * - * @param item The item you want to get the FeedMedia from - * @return The cursor of the query - */ - public final Cursor getFeedMediaOfItemCursor(final FeedItem item) { - return db.query(TABLE_NAME_FEED_MEDIA, null, KEY_ID + "=?", - new String[]{String.valueOf(item.getMedia().getId())}, null, - null, null); - } - - /** * Returns a cursor for a DB query in the FeedImages table for given IDs. * * @param imageIds IDs of the images diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java b/core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java deleted file mode 100644 index fb1b0dc8f..000000000 --- a/core/src/main/java/de/danoeh/antennapod/core/util/EpisodeFilter.java +++ /dev/null @@ -1,50 +0,0 @@ -package de.danoeh.antennapod.core.util; - -import java.util.ArrayList; -import java.util.List; - -import de.danoeh.antennapod.core.feed.FeedItem; - -class EpisodeFilter { - - private EpisodeFilter() { - - } - - /** Return a copy of the itemlist without items which have no media. */ - public static ArrayList<FeedItem> getEpisodeList(List<FeedItem> items) { - ArrayList<FeedItem> episodes = new ArrayList<>(items); - for (FeedItem item : items) { - if (item.getMedia() == null) { - episodes.remove(item); - } - } - return episodes; - } - - public static int countItemsWithEpisodes(List<FeedItem> items) { - int count = 0; - for (FeedItem item : items) { - if (item.getMedia() != null) { - count++; - } - } - return count; - } - - public static FeedItem accessEpisodeByIndex(List<FeedItem> items, - int position) { - int count = 0; - for (FeedItem item : items) { - - if (item.getMedia() != null) { - if (count == position) { - return item; - } else { - count++; - } - } - } - return null; - } -} diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java b/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java index 7377b202d..9408be348 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/QueueAccess.java @@ -58,19 +58,4 @@ public abstract class QueueAccess { }; } - public static QueueAccess NotInQueueAccess() { - return new QueueAccess() { - @Override - public boolean contains(long id) { - return false; - } - - @Override - public boolean remove(long id) { - return false; - } - }; - - } - } diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java index ecb641dad..3000e2fa4 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java +++ b/core/src/main/java/de/danoeh/antennapod/core/util/exception/MediaFileNotFoundException.java @@ -12,11 +12,6 @@ public class MediaFileNotFoundException extends Exception { this.media = media; } - public MediaFileNotFoundException(FeedMedia media) { - super(); - this.media = media; - } - public FeedMedia getMedia() { return media; } diff --git a/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java b/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java index 894e85a90..c6524e868 100644 --- a/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java +++ b/core/src/play/java/de/danoeh/antennapod/core/cast/RemoteMedia.java @@ -131,14 +131,6 @@ public class RemoteMedia implements Playable { return feedUrl; } - public FeedMedia lookForFeedMedia() { - FeedItem feedItem = DBReader.getFeedItem(feedUrl, itemIdentifier); - if (feedItem == null) { - return null; - } - return feedItem.getMedia(); - } - @Override public void writeToPreferences(SharedPreferences.Editor prefEditor) { //it seems pointless to do it, since the session should be kept by the remote device. |