summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordamoasda <46045854+damoasda@users.noreply.github.com>2019-08-04 09:59:32 +0200
committerGitHub <noreply@github.com>2019-08-04 09:59:32 +0200
commit51f348caa3054189ad426f1ff7f43e5f2940dd99 (patch)
treedddc3c27d77935fb7d45860c939f5b06720b0745
parent9b7a61471d342a2db4a2a6fe0681e748f15ca903 (diff)
parent5173dd0118ab6683013c45297c0eb589d0a52a65 (diff)
downloadAntennaPod-51f348caa3054189ad426f1ff7f43e5f2940dd99.zip
Merge branch 'develop' into Queue-Sort-Order
-rw-r--r--.circleci/config.yml6
-rw-r--r--.gitignore1
-rw-r--r--app/build.gradle13
-rw-r--r--app/proguard.cfg3
-rw-r--r--app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java3
-rw-r--r--app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java1
-rw-r--r--app/src/main/AndroidManifest.xml23
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java120
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java13
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java5
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/DataFolderAdapter.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java76
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java84
-rw-r--r--app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java1
-rw-r--r--app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java53
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java97
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java12
-rw-r--r--app/src/main/java/de/danoeh/antennapod/discovery/CombinedSearcher.java96
-rw-r--r--app/src/main/java/de/danoeh/antennapod/discovery/FyydPodcastSearcher.java38
-rw-r--r--app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java38
-rw-r--r--app/src/main/java/de/danoeh/antennapod/discovery/ItunesPodcastSearcher.java74
-rw-r--r--app/src/main/java/de/danoeh/antennapod/discovery/ItunesTopListLoader.java110
-rw-r--r--app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearchResult.java81
-rw-r--r--app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcher.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java99
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java281
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java13
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/CombinedSearchFragment.java173
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java137
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java57
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java39
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java77
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java32
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java80
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java210
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java32
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java89
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java9
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java119
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java19
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java99
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java143
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/FlattrPreferencesFragment.java61
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/IntegrationsPreferencesFragment.java12
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java7
-rw-r--r--app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java8
-rw-r--r--app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java29
-rw-r--r--app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java17
-rw-r--r--app/src/main/java/de/danoeh/antennapod/view/WrappingGridView.java35
-rw-r--r--app/src/main/play/listings/en-US/full-description.txt3
-rw-r--r--app/src/main/res/layout/addfeed.xml255
-rw-r--r--app/src/main/res/layout/autoflattr_preference_dialog.xml35
-rw-r--r--app/src/main/res/layout/empty_view_layout.xml54
-rw-r--r--app/src/main/res/layout/flattr_auth.xml30
-rw-r--r--app/src/main/res/layout/gpodnetauth_credentials.xml4
-rw-r--r--app/src/main/res/layout/gpodnetauth_device.xml6
-rw-r--r--app/src/main/res/layout/mediaplayerinfo_activity.xml20
-rw-r--r--app/src/main/res/layout/quick_feed_discovery.xml83
-rw-r--r--app/src/main/res/layout/quick_feed_discovery_item.xml14
-rw-r--r--app/src/main/res/menu/advanced_search.xml14
-rw-r--r--app/src/main/res/menu/allepisodes_context.xml10
-rw-r--r--app/src/main/res/menu/episodes.xml4
-rw-r--r--app/src/main/res/menu/feedinfo.xml6
-rw-r--r--app/src/main/res/menu/feeditem_options.xml6
-rw-r--r--app/src/main/res/menu/feeditemlist_context.xml7
-rw-r--r--app/src/main/res/menu/feedlist.xml8
-rw-r--r--app/src/main/res/menu/mediaplayer.xml7
-rw-r--r--app/src/main/res/menu/nav_feed_context.xml4
-rw-r--r--app/src/main/res/menu/queue.xml18
-rw-r--r--app/src/main/res/menu/queue_context.xml6
-rw-r--r--app/src/main/res/xml/preferences_flattr.xml21
-rw-r--r--app/src/main/res/xml/preferences_integrations.xml8
-rw-r--r--app/src/main/res/xml/preferences_playback.xml2
-rw-r--r--app/src/main/templates/about.html5
-rw-r--r--build.gradle5
-rw-r--r--core/build.gradle3
-rw-r--r--core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java3
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java36
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java81
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java231
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java45
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java86
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java5
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java29
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java19
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java13
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/preferences/UserPreferences.java42
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/PlayerWidgetJobService.java11
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/service/playback/LocalPSMP.java2
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DBReader.java31
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DBTasks.java44
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java4
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/DBWriter.java118
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java90
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java32
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java68
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java7
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java220
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java30
-rw-r--r--core/src/main/res/drawable/ic_bookmark_grey600_24dp.xml5
-rw-r--r--core/src/main/res/drawable/ic_bookmark_white_24dp.xml5
-rw-r--r--core/src/main/res/layout/player_widget.xml12
-rw-r--r--core/src/main/res/values-ar/strings.xml2
-rw-r--r--core/src/main/res/values-b+ast/strings.xml8
-rw-r--r--core/src/main/res/values-bg/strings.xml8
-rw-r--r--core/src/main/res/values-ca/strings.xml10
-rw-r--r--core/src/main/res/values-cs-rCZ/strings.xml6
-rw-r--r--core/src/main/res/values-da/strings.xml10
-rw-r--r--core/src/main/res/values-de/strings.xml10
-rw-r--r--core/src/main/res/values-es-rES/strings.xml2
-rw-r--r--core/src/main/res/values-es/strings.xml10
-rw-r--r--core/src/main/res/values-et/strings.xml4
-rw-r--r--core/src/main/res/values-fa/strings.xml6
-rw-r--r--core/src/main/res/values-fr/strings.xml10
-rw-r--r--core/src/main/res/values-gl-rES/strings.xml10
-rw-r--r--core/src/main/res/values-h768dp/dimens.xml4
-rw-r--r--core/src/main/res/values-hi-rIN/strings.xml4
-rw-r--r--core/src/main/res/values-hu/strings.xml6
-rw-r--r--core/src/main/res/values-id/strings.xml2
-rw-r--r--core/src/main/res/values-it/strings.xml10
-rw-r--r--core/src/main/res/values-iw-rIL/strings.xml10
-rw-r--r--core/src/main/res/values-ja/strings.xml10
-rw-r--r--core/src/main/res/values-ko/strings.xml8
-rw-r--r--core/src/main/res/values-lt/strings.xml10
-rw-r--r--core/src/main/res/values-nb/strings.xml6
-rw-r--r--core/src/main/res/values-nl/strings.xml10
-rw-r--r--core/src/main/res/values-pl-rPL/strings.xml10
-rw-r--r--core/src/main/res/values-pt-rBR/strings.xml10
-rw-r--r--core/src/main/res/values-pt/strings.xml10
-rw-r--r--core/src/main/res/values-ru/strings.xml10
-rw-r--r--core/src/main/res/values-sv-rSE/strings.xml10
-rw-r--r--core/src/main/res/values-tr/strings.xml10
-rw-r--r--core/src/main/res/values-uk-rUA/strings.xml10
-rw-r--r--core/src/main/res/values-vi/strings.xml6
-rw-r--r--core/src/main/res/values-zh-rCN/strings.xml8
-rw-r--r--core/src/main/res/values-zh-rTW/strings.xml6
-rw-r--r--core/src/main/res/values/attrs.xml1
-rw-r--r--core/src/main/res/values/dimens.xml2
-rw-r--r--core/src/main/res/values/strings.xml70
-rw-r--r--core/src/main/res/values/styles.xml3
-rw-r--r--core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java3
147 files changed, 2031 insertions, 3087 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6bac87a46..7446862c6 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -3,7 +3,7 @@ version: 2
jobs:
build:
docker:
- - image: circleci/android:api-26-alpha
+ - image: circleci/android:api-28
working_directory: ~/AntennaPod
@@ -13,7 +13,7 @@ jobs:
steps:
- checkout
-
+
- restore_cache:
keys:
- v1-android-{{ checksum "build.gradle" }}
@@ -24,7 +24,7 @@ jobs:
# To build release, we need to create a temporary keystore that can be used to sign the app
command: |
keytool -noprompt -genkey -v -keystore "app/keystore" -alias alias -storepass password -keypass password -keyalg RSA -validity 10 -dname "CN=antennapod.org, OU=dummy, O=dummy, L=dummy, S=dummy, C=US"
- ./gradlew assemblePlayRelease :core:testPlayReleaseUnitTest -PdisablePreDex
+ ./gradlew assembleRelease :core:testPlayReleaseUnitTest -PdisablePreDex
no_output_timeout: 1800
- store_artifacts:
diff --git a/.gitignore b/.gitignore
index 4f342ddca..7e39550e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,7 +39,6 @@ contributers.py
proguard
libs
*.DS_Store
-src/de/danoeh/antennapod/util/flattr/FlattrConfig.java
gradle.properties
*.keystore
*.p12
diff --git a/app/build.gradle b/app/build.gradle
index a9cce57d4..030dcfa4a 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -59,16 +59,10 @@ android {
buildTypes {
def STRING = "String"
- def FLATTR_APP_KEY = "FLATTR_APP_KEY"
- def FLATTR_APP_SECRET = "FLATTR_APP_SECRET"
- def mFlattrAppKey = (project.hasProperty("flattrAppKey")) ? flattrAppKey : "\"\""
- def mFlattrAppSecret = (project.hasProperty("flattrAppSecret")) ? flattrAppSecret : "\"\""
debug {
applicationIdSuffix ".debug"
resValue "string", "provider_authority", "de.danoeh.antennapod.debug.provider"
- buildConfigField STRING, FLATTR_APP_KEY, mFlattrAppKey
- buildConfigField STRING, FLATTR_APP_SECRET, mFlattrAppSecret
dexcount {
if (project.hasProperty("enableDexcountInDebug")) {
runOnEachPackage enableDexcountInDebug.toBoolean()
@@ -82,8 +76,6 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), "proguard.cfg"
signingConfig signingConfigs.releaseConfig
- buildConfigField STRING, FLATTR_APP_KEY, mFlattrAppKey
- buildConfigField STRING, FLATTR_APP_SECRET, mFlattrAppSecret
}
}
@@ -145,9 +137,6 @@ dependencies {
annotationProcessor "android.arch.lifecycle:compiler:$lifecycle_version"
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
- implementation("org.shredzone.flattr4j:flattr4j-core:$flattr4jVersion") {
- exclude group: "org.json", module: "json"
- }
implementation "commons-io:commons-io:$commonsioVersion"
implementation "org.jsoup:jsoup:$jsoupVersion"
implementation "com.github.bumptech.glide:glide:$glideVersion"
@@ -176,7 +165,7 @@ dependencies {
implementation "com.github.AntennaPod:AntennaPod-AudioPlayer:$audioPlayerVersion"
implementation 'com.github.mfietz:fyydlin:v0.4.2'
- implementation 'com.github.ByteHamster:SearchPreference:v1.2.5'
+ implementation 'com.github.ByteHamster:SearchPreference:v1.2.6'
implementation "org.awaitility:awaitility:$awaitilityVersion"
androidTestImplementation "com.jayway.android.robotium:robotium-solo:$robotiumSoloVersion"
diff --git a/app/proguard.cfg b/app/proguard.cfg
index 31f51ac4a..958048ef3 100644
--- a/app/proguard.cfg
+++ b/app/proguard.cfg
@@ -75,9 +75,6 @@
-dontwarn android.support.v7.**
-dontwarn com.google.android.wearable.**
--keep class org.shredzone.flattr4j.** { *; }
--dontwarn org.shredzone.flattr4j.**
-
-keep class org.apache.commons.** { *; }
-dontskipnonpubliclibraryclassmembers
diff --git a/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java b/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java
index a577e5e36..f58008172 100644
--- a/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java
+++ b/app/src/androidTest/java/de/test/antennapod/storage/DBTestUtils.java
@@ -14,7 +14,6 @@ import de.danoeh.antennapod.core.feed.FeedMedia;
import de.danoeh.antennapod.core.feed.SimpleChapter;
import de.danoeh.antennapod.core.storage.PodDBAdapter;
import de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator;
-import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
/**
* Utility methods for DB* tests.
@@ -46,7 +45,7 @@ class DBTestUtils {
adapter.open();
for (int i = 0; i < numFeeds; i++) {
Feed f = new Feed(0, null, "feed " + i, null, "link" + i, "descr", null, null,
- null, null, "id" + i, null, null, "url" + i, false, new FlattrStatus(), false, null, null, false);
+ null, null, "id" + i, null, null, "url" + i, false, false, null, null, false);
f.setItems(new ArrayList<>());
for (int j = 0; j < numItems; j++) {
FeedItem item = new FeedItem(0, "item " + j, "id" + j, "link" + j, new Date(),
diff --git a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java
index 89542d222..9aedbb493 100644
--- a/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java
+++ b/app/src/androidTest/java/de/test/antennapod/util/syndication/feedgenerator/GeneratorUtil.java
@@ -14,7 +14,6 @@ class GeneratorUtil {
String ns = (withNamespace) ? "http://www.w3.org/2005/Atom" : null;
xml.startTag(ns, "link");
xml.attribute(null, "rel", "payment");
- xml.attribute(null, "title", "Flattr this!");
xml.attribute(null, "href", paymentLink);
xml.attribute(null, "type", "text/html");
xml.endTag(ns, "link");
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index ee1cf8936..73af654e9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -7,6 +7,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
+ <uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<supports-screens
android:anyDensity="true"
@@ -142,25 +143,6 @@
<activity android:name=".activity.StorageErrorActivity">
</activity>
<activity
- android:name=".activity.FlattrAuthActivity"
- android:label="@string/flattr_auth_label">
- <intent-filter>
- <action android:name=".activities.FlattrAuthActivity"/>
-
- <category android:name="android.intent.category.DEFAULT"/>
- </intent-filter>
- <intent-filter>
- <action android:name="android.intent.action.VIEW"/>
-
- <category android:name="android.intent.category.DEFAULT"/>
- <category android:name="android.intent.category.BROWSABLE"/>
-
- <data
- android:host="de.danoeh.antennapod"
- android:scheme="flattr4j"/>
- </intent-filter>
- </activity>
- <activity
android:name=".activity.AboutActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="@string/about_pref">
@@ -337,8 +319,7 @@
<activity
android:name=".activity.gpoddernet.GpodnetAuthenticationActivity"
android:configChanges="orientation"
- android:label="@string/gpodnet_auth_label"
- android:screenOrientation="portrait">
+ android:label="@string/gpodnet_auth_label">
<intent-filter>
<action android:name=".activity.gpoddernet.GpodnetAuthenticationActivity"/>
<category android:name="android.intent.category.DEFAULT"/>
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java
index bfa694e5c..26e360bd3 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java
@@ -199,8 +199,6 @@ public class FeedInfoActivity extends AppCompatActivity {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
- menu.findItem(R.id.support_item).setVisible(
- feed != null && feed.getPaymentLink() != null);
menu.findItem(R.id.share_link_item).setVisible(feed != null && feed.getLink() != null);
menu.findItem(R.id.visit_website_item).setVisible(feed != null && feed.getLink() != null &&
IntentUtils.isCallable(this, new Intent(Intent.ACTION_VIEW, Uri.parse(feed.getLink()))));
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java
deleted file mode 100644
index 2b4384a02..000000000
--- a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java
+++ /dev/null
@@ -1,120 +0,0 @@
-package de.danoeh.antennapod.activity;
-
-
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-import android.util.Log;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.widget.Button;
-import android.widget.TextView;
-
-import org.shredzone.flattr4j.exception.FlattrException;
-
-import de.danoeh.antennapod.BuildConfig;
-import de.danoeh.antennapod.R;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
-
-/** Guides the user through the authentication process */
-
-public class FlattrAuthActivity extends AppCompatActivity {
- private static final String TAG = "FlattrAuthActivity";
-
- private TextView txtvExplanation;
- private Button butAuthenticate;
- private Button butReturn;
-
- private boolean authSuccessful;
-
- private static FlattrAuthActivity singleton;
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- setTheme(UserPreferences.getTheme());
- super.onCreate(savedInstanceState);
- singleton = this;
- authSuccessful = false;
- if (BuildConfig.DEBUG) Log.d(TAG, "Activity created");
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- setContentView(R.layout.flattr_auth);
- txtvExplanation = findViewById(R.id.txtvExplanation);
- butAuthenticate = findViewById(R.id.but_authenticate);
- butReturn = findViewById(R.id.but_return_home);
-
- butReturn.setOnClickListener(v -> {
- Intent intent = new Intent(FlattrAuthActivity.this, MainActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- });
-
- butAuthenticate.setOnClickListener(v -> {
- try {
- FlattrUtils.startAuthProcess(FlattrAuthActivity.this);
- } catch (FlattrException e) {
- e.printStackTrace();
- }
- });
- }
-
- public static FlattrAuthActivity getInstance() {
- return singleton;
- }
-
- @Override
- protected void onResume() {
- super.onResume();
- if (BuildConfig.DEBUG) Log.d(TAG, "Activity resumed");
- Uri uri = getIntent().getData();
- if (uri != null) {
- if (BuildConfig.DEBUG) Log.d(TAG, "Received uri");
- FlattrUtils.handleCallback(this, uri);
- }
- }
-
- public void handleAuthenticationSuccess() {
- authSuccessful = true;
- txtvExplanation.setText(R.string.flattr_auth_success);
- butAuthenticate.setEnabled(false);
- butReturn.setVisibility(View.VISIBLE);
- }
-
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- super.onCreateOptionsMenu(menu);
- return true;
- }
-
-
-
- @Override
- protected void onPause() {
- super.onPause();
- if (authSuccessful) {
- finish();
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case android.R.id.home:
- if (authSuccessful) {
- Intent intent = new Intent(this, PreferenceActivity.class);
- intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- } else {
- finish();
- }
- break;
- default:
- return false;
- }
- return true;
- }
-
-
-}
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
index 91e89d7c5..728019196 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
@@ -208,7 +208,6 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
checkFirstLaunch();
PreferenceUpgrader.checkUpgrades(this);
- NotificationUtils.createChannels(this);
}
private void saveLastNavFragment(String tag) {
@@ -579,17 +578,17 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
}
Feed feed = navDrawerData.feeds.get(position - navAdapter.getSubscriptionOffset());
switch(item.getItemId()) {
- case R.id.mark_all_seen_item:
- ConfirmationDialog markAllSeenConfirmationDialog = new ConfirmationDialog(this,
- R.string.mark_all_seen_label,
- R.string.mark_all_seen_confirmation_msg) {
+ case R.id.remove_all_new_flags_item:
+ ConfirmationDialog removeAllNewFlagsConfirmationDialog = new ConfirmationDialog(this,
+ R.string.remove_all_new_flags_label,
+ R.string.remove_all_new_flags_confirmation_msg) {
@Override
public void onConfirmButtonPressed(DialogInterface dialog) {
dialog.dismiss();
- DBWriter.markFeedSeen(feed.getId());
+ DBWriter.removeFeedNewFlag(feed.getId());
}
};
- markAllSeenConfirmationDialog.createNewDialog().show();
+ removeAllNewFlagsConfirmationDialog.createNewDialog().show();
return true;
case R.id.mark_all_read_item:
ConfirmationDialog markAllReadConfirmationDialog = new ConfirmationDialog(this,
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 3d5c59a4a..3946400a4 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
@@ -330,11 +330,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
Playable media = controller.getMedia();
boolean isFeedMedia = media != null && (media instanceof FeedMedia);
- menu.findItem(R.id.support_item).setVisible(isFeedMedia && media.getPaymentLink() != null &&
- ((FeedMedia) media).getItem() != null &&
- ((FeedMedia) media).getItem().getFlattrStatus().flattrable()
- );
-
boolean hasWebsiteLink = ( getWebsiteLinkWithFallback(media) != null );
menu.findItem(R.id.visit_website_item).setVisible(hasWebsiteLink);
@@ -603,11 +598,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
Uri uri = Uri.parse(getWebsiteLinkWithFallback(media));
startActivity(new Intent(Intent.ACTION_VIEW, uri));
break;
- case R.id.support_item:
- if (media instanceof FeedMedia) {
- DBTasks.flattrItemIfLoggedIn(this, ((FeedMedia) media).getItem());
- }
- break;
case R.id.share_link_item:
if (media instanceof FeedMedia) {
ShareUtils.shareFeedItemLink(this, ((FeedMedia) media).getItem());
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
index 191481dd8..4fec1cfc5 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
@@ -46,7 +46,6 @@ import de.danoeh.antennapod.core.service.playback.PlayerStatus;
import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.util.IntentUtils;
-import de.danoeh.antennapod.core.util.download.AutoUpdateManager;
import de.danoeh.antennapod.core.util.playback.Playable;
import de.danoeh.antennapod.core.util.playback.PlaybackController;
import de.danoeh.antennapod.dialog.RenameFeedDialog;
@@ -170,6 +169,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
pager.setCurrentItem(lastPosition);
}
+ @Override
protected void onStart() {
super.onStart();
EventDistributor.getInstance().register(contentUpdate);
@@ -339,8 +339,8 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
}
Feed feed = navDrawerData.feeds.get(position - navAdapter.getSubscriptionOffset());
switch(item.getItemId()) {
- case R.id.mark_all_seen_item:
- DBWriter.markFeedSeen(feed.getId());
+ case R.id.remove_all_new_flags_item:
+ DBWriter.removeFeedNewFlag(feed.getId());
return true;
case R.id.mark_all_read_item:
DBWriter.markFeedRead(feed.getId());
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
index c13f713e0..7e0ae173f 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
@@ -15,7 +15,6 @@ import com.bytehamster.lib.preferencesearch.SearchPreferenceResultListener;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.fragment.preferences.AutoDownloadPreferencesFragment;
-import de.danoeh.antennapod.fragment.preferences.FlattrPreferencesFragment;
import de.danoeh.antennapod.fragment.preferences.GpodderPreferencesFragment;
import de.danoeh.antennapod.fragment.preferences.IntegrationsPreferencesFragment;
import de.danoeh.antennapod.fragment.preferences.MainPreferencesFragment;
@@ -64,8 +63,6 @@ public class PreferenceActivity extends AppCompatActivity implements SearchPrefe
prefFragment = new AutoDownloadPreferencesFragment();
} else if (screen == R.xml.preferences_gpodder) {
prefFragment = new GpodderPreferencesFragment();
- } else if (screen == R.xml.preferences_flattr) {
- prefFragment = new FlattrPreferencesFragment();
} else if (screen == R.xml.preferences_playback) {
prefFragment = new PlaybackPreferencesFragment();
}
@@ -86,8 +83,6 @@ public class PreferenceActivity extends AppCompatActivity implements SearchPrefe
return R.string.user_interface_label;
case R.xml.preferences_integrations:
return R.string.integrations_label;
- case R.xml.preferences_flattr:
- return R.string.flattr_label;
case R.xml.preferences_gpodder:
return R.string.gpodnet_main_label;
default:
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java
index df21f713d..2d7898d5b 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java
@@ -104,10 +104,6 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
return super.onOptionsItemSelected(item);
}
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- }
-
private void setupLoginView(View view) {
final EditText username = view.findViewById(R.id.etxtUsername);
final EditText password = view.findViewById(R.id.etxtPassword);
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
index 8866d987e..7aa9f8f21 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
@@ -1,6 +1,5 @@
package de.danoeh.antennapod.adapter;
-import android.content.Context;
import android.os.Build;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
@@ -280,7 +279,7 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
};
FeedItemMenuHandler.onPrepareMenu(contextMenuInterface, item, true, null);
- contextMenuInterface.setItemVisibility(R.id.mark_as_seen_item, item.isNew());
+ contextMenuInterface.setItemVisibility(R.id.remove_new_flag_item, item.isNew());
}
}
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DataFolderAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DataFolderAdapter.java
index 636a23088..909fd6459 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/DataFolderAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/DataFolderAdapter.java
@@ -49,9 +49,10 @@ public class DataFolderAdapter extends RecyclerView.Adapter<DataFolderAdapter.Vi
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
StoragePath storagePath = entries.get(position);
String freeSpace = Converter.byteToString(storagePath.getAvailableSpace());
+ String totalSpace = Converter.byteToString(storagePath.getTotalSpace());
holder.path.setText(storagePath.getShortPath());
- holder.size.setText(String.format(freeSpaceString, freeSpace));
+ holder.size.setText(String.format(freeSpaceString, freeSpace, totalSpace));
holder.progressBar.setProgress(storagePath.getUsagePercentage());
holder.root.setOnClickListener((View v) -> selectAndDismiss(storagePath));
holder.radioButton.setOnClickListener((View v) -> selectAndDismiss(storagePath));
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java
new file mode 100644
index 000000000..df7ec46e0
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedDiscoverAdapter.java
@@ -0,0 +1,76 @@
+package de.danoeh.antennapod.adapter;
+
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.ImageView;
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.RequestOptions;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.activity.MainActivity;
+import de.danoeh.antennapod.discovery.PodcastSearchResult;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+
+public class FeedDiscoverAdapter extends BaseAdapter {
+
+ private final WeakReference<MainActivity> mainActivityRef;
+ private final List<PodcastSearchResult> data = new ArrayList<>();
+
+ public FeedDiscoverAdapter(MainActivity mainActivity) {
+ this.mainActivityRef = new WeakReference<>(mainActivity);
+ }
+
+ public void updateData(List<PodcastSearchResult> newData) {
+ data.clear();
+ data.addAll(newData);
+ notifyDataSetChanged();
+ }
+
+ @Override
+ public int getCount() {
+ return data.size();
+ }
+
+ @Override
+ public PodcastSearchResult getItem(int position) {
+ return data.get(position);
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return 0;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ Holder holder;
+
+ if (convertView == null) {
+ convertView = View.inflate(mainActivityRef.get(), R.layout.quick_feed_discovery_item, null);
+ holder = new Holder();
+ holder.imageView = convertView.findViewById(R.id.discovery_cover);
+ convertView.setTag(holder);
+ } else {
+ holder = (Holder) convertView.getTag();
+ }
+
+
+ final PodcastSearchResult podcast = getItem(position);
+ Glide.with(mainActivityRef.get())
+ .load(podcast.imageUrl)
+ .apply(new RequestOptions()
+ .placeholder(R.color.light_gray)
+ .fitCenter()
+ .dontAnimate())
+ .into(holder.imageView);
+
+ return convertView;
+ }
+
+ static class Holder {
+ ImageView imageView;
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java
index 2cf17c85f..f5213e4ab 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java
@@ -2,7 +2,6 @@ package de.danoeh.antennapod.adapter.itunes;
import android.content.Context;
import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
@@ -13,18 +12,14 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.bumptech.glide.request.RequestOptions;
-import de.danoeh.antennapod.core.glide.ApGlideSettings;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
+import de.danoeh.antennapod.discovery.PodcastSearchResult;
import java.util.List;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MainActivity;
-import de.mfietz.fyydlin.SearchHit;
-public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> {
+public class ItunesAdapter extends ArrayAdapter<PodcastSearchResult> {
/**
* Related Context
*/
@@ -33,7 +28,7 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> {
/**
* List holding the podcasts found in the search
*/
- private final List<Podcast> data;
+ private final List<PodcastSearchResult> data;
/**
* Constructor.
@@ -41,7 +36,7 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> {
* @param context Related context
* @param objects Search result
*/
- public ItunesAdapter(Context context, List<Podcast> objects) {
+ public ItunesAdapter(Context context, List<PodcastSearchResult> objects) {
super(context, 0, objects);
this.data = objects;
this.context = context;
@@ -51,7 +46,7 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> {
@Override
public View getView(int position, View convertView, @NonNull ViewGroup parent) {
//Current podcast
- Podcast podcast = data.get(position);
+ PodcastSearchResult podcast = data.get(position);
//ViewHolder
PodcastViewHolder viewHolder;
@@ -94,75 +89,6 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> {
}
/**
- * Represents an individual podcast on the iTunes Store.
- */
- public static class Podcast { //TODO: Move this out eventually. Possibly to core.itunes.model
-
- /**
- * The name of the podcast
- */
- public final String title;
-
- /**
- * URL of the podcast image
- */
- @Nullable
- public final String imageUrl;
- /**
- * URL of the podcast feed
- */
- @Nullable
- public final String feedUrl;
-
-
- private Podcast(String title, @Nullable String imageUrl, @Nullable String feedUrl) {
- this.title = title;
- this.imageUrl = imageUrl;
- this.feedUrl = feedUrl;
- }
-
- /**
- * Constructs a Podcast instance from a iTunes search result
- *
- * @param json object holding the podcast information
- * @throws JSONException
- */
- public static Podcast fromSearch(JSONObject json) {
- String title = json.optString("collectionName", "");
- String imageUrl = json.optString("artworkUrl100", null);
- String feedUrl = json.optString("feedUrl", null);
- return new Podcast(title, imageUrl, feedUrl);
- }
-
- public static Podcast fromSearch(SearchHit searchHit) {
- return new Podcast(searchHit.getTitle(), searchHit.getThumbImageURL(), searchHit.getXmlUrl());
- }
-
- /**
- * Constructs a Podcast instance from iTunes toplist entry
- *
- * @param json object holding the podcast information
- * @throws JSONException
- */
- public static Podcast fromToplist(JSONObject json) throws JSONException {
- String title = json.getJSONObject("title").getString("label");
- String imageUrl = null;
- JSONArray images = json.getJSONArray("im:image");
- for(int i=0; imageUrl == null && i < images.length(); i++) {
- JSONObject image = images.getJSONObject(i);
- String height = image.getJSONObject("attributes").getString("height");
- if(Integer.parseInt(height) >= 100) {
- imageUrl = image.getString("label");
- }
- }
- String feedUrl = "https://itunes.apple.com/lookup?id=" +
- json.getJSONObject("id").getJSONObject("attributes").getString("im:id");
- return new Podcast(title, imageUrl, feedUrl);
- }
-
- }
-
- /**
* View holder object for the GridView
*/
static class PodcastViewHolder {
diff --git a/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java b/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java
index 4138738f6..3dd7c350d 100644
--- a/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java
+++ b/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java
@@ -16,7 +16,6 @@ class ClientConfigurator {
ClientConfig.downloadServiceCallbacks = new DownloadServiceCallbacksImpl();
ClientConfig.gpodnetCallbacks = new GpodnetCallbacksImpl();
ClientConfig.playbackServiceCallbacks = new PlaybackServiceCallbacksImpl();
- ClientConfig.flattrCallbacks = new FlattrCallbacksImpl();
ClientConfig.dbTasksCallbacks = new DBTasksCallbacksImpl();
ClientConfig.castCallbacks = new CastCallbackImpl();
}
diff --git a/app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java
deleted file mode 100644
index 3817db6de..000000000
--- a/app/src/main/java/de/danoeh/antennapod/config/FlattrCallbacksImpl.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package de.danoeh.antennapod.config;
-
-
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.Intent;
-import android.util.Log;
-
-import org.shredzone.flattr4j.oauth.AccessToken;
-
-import de.danoeh.antennapod.BuildConfig;
-import de.danoeh.antennapod.activity.FlattrAuthActivity;
-import de.danoeh.antennapod.activity.MainActivity;
-import de.danoeh.antennapod.core.FlattrCallbacks;
-
-public class FlattrCallbacksImpl implements FlattrCallbacks {
- private static final String TAG = "FlattrCallbacksImpl";
-
- @Override
- public boolean flattrEnabled() {
- return true;
- }
-
- @Override
- public Intent getFlattrAuthenticationActivityIntent(Context context) {
- return new Intent(context, FlattrAuthActivity.class);
- }
-
- @Override
- public PendingIntent getFlattrFailedNotificationContentIntent(Context context) {
- return PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
- }
-
- @Override
- public String getFlattrAppKey() {
- return BuildConfig.FLATTR_APP_KEY;
- }
-
- @Override
- public String getFlattrAppSecret() {
- return BuildConfig.FLATTR_APP_SECRET;
- }
-
- @Override
- public void handleFlattrAuthenticationSuccess(AccessToken token) {
- FlattrAuthActivity instance = FlattrAuthActivity.getInstance();
- if (instance != null) {
- instance.handleAuthenticationSuccess();
- } else {
- Log.e(TAG, "FlattrAuthActivity instance was null");
- }
- }
-}
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java
deleted file mode 100644
index c28342374..000000000
--- a/app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package de.danoeh.antennapod.dialog;
-
-import android.annotation.SuppressLint;
-import android.app.Activity;
-import android.content.Context;
-import android.support.v7.app.AlertDialog;
-import android.view.View;
-import android.widget.CheckBox;
-import android.widget.SeekBar;
-import android.widget.TextView;
-
-import org.apache.commons.lang3.Validate;
-
-import de.danoeh.antennapod.R;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
-
-/**
- * Creates a new AlertDialog that displays preferences for auto-flattring to the user.
- */
-public class AutoFlattrPreferenceDialog {
-
- private AutoFlattrPreferenceDialog() {
- }
-
- public static void newAutoFlattrPreferenceDialog(final Activity activity, final AutoFlattrPreferenceDialogInterface callback) {
- Validate.notNull(activity);
- Validate.notNull(callback);
-
- AlertDialog.Builder builder = new AlertDialog.Builder(activity);
-
- @SuppressLint("InflateParams") View view = activity.getLayoutInflater().inflate(R.layout.autoflattr_preference_dialog, null);
- final CheckBox chkAutoFlattr = view.findViewById(R.id.chkAutoFlattr);
- final SeekBar skbPercent = view.findViewById(R.id.skbPercent);
- final TextView txtvStatus = view.findViewById(R.id.txtvStatus);
-
- chkAutoFlattr.setChecked(UserPreferences.isAutoFlattr());
- skbPercent.setEnabled(chkAutoFlattr.isChecked());
- txtvStatus.setEnabled(chkAutoFlattr.isChecked());
-
- final int initialValue = (int) (UserPreferences.getAutoFlattrPlayedDurationThreshold() * 100.0f);
- setStatusMsgText(activity, txtvStatus, initialValue);
- skbPercent.setProgress(initialValue);
-
- chkAutoFlattr.setOnClickListener(v -> {
- skbPercent.setEnabled(chkAutoFlattr.isChecked());
- txtvStatus.setEnabled(chkAutoFlattr.isChecked());
- });
-
- skbPercent.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
- @Override
- public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- setStatusMsgText(activity, txtvStatus, progress);
- }
-
- @Override
- public void onStartTrackingTouch(SeekBar seekBar) {
-
- }
-
- @Override
- public void onStopTrackingTouch(SeekBar seekBar) {
-
- }
- });
-
- builder.setTitle(R.string.pref_auto_flattr_title)
- .setView(view)
- .setPositiveButton(R.string.confirm_label, (dialog, which) -> {
- float progDouble = ((float) skbPercent.getProgress()) / 100.0f;
- callback.onConfirmed(chkAutoFlattr.isChecked(), progDouble);
- dialog.dismiss();
- })
- .setNegativeButton(R.string.cancel_label, (dialog, which) -> {
- callback.onCancelled();
- dialog.dismiss();
- })
- .setCancelable(false).show();
- }
-
- private static void setStatusMsgText(Context context, TextView txtvStatus, int progress) {
- if (progress == 0) {
- txtvStatus.setText(R.string.auto_flattr_ater_beginning);
- } else if (progress == 100) {
- txtvStatus.setText(R.string.auto_flattr_ater_end);
- } else {
- txtvStatus.setText(context.getString(R.string.auto_flattr_after_percent, progress));
- }
- }
-
- public interface AutoFlattrPreferenceDialogInterface {
- void onCancelled();
-
- void onConfirmed(boolean autoFlattrEnabled, float autoFlattrValue);
- }
-
-
-}
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java
index ab9b7fcf5..7697aaa69 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java
@@ -3,6 +3,7 @@ package de.danoeh.antennapod.dialog;
import android.app.AlertDialog;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
+import android.os.Build;
import android.os.Bundle;
import android.support.annotation.IdRes;
import android.support.annotation.NonNull;
@@ -12,6 +13,7 @@ import android.support.design.widget.Snackbar;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.Fragment;
import android.support.v4.util.ArrayMap;
+import android.support.v4.view.ViewCompat;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
@@ -45,7 +47,7 @@ public class EpisodesApplyActionFragment extends Fragment {
public static final String TAG = "EpisodeActionFragment";
public static final int ACTION_ADD_TO_QUEUE = 1;
- private static final int ACTION_REMOVE_FROM_QUEUE = 2;
+ public static final int ACTION_REMOVE_FROM_QUEUE = 2;
private static final int ACTION_MARK_PLAYED = 4;
private static final int ACTION_MARK_UNPLAYED = 8;
private static final int ACTION_DOWNLOAD = 16;
@@ -203,6 +205,10 @@ public class EpisodesApplyActionFragment extends Fragment {
return true;
});
+ if (Build.VERSION.SDK_INT == 23 || Build.VERSION.SDK_INT == 24) {
+ ViewCompat.setElevation(view.findViewById(R.id.fabSDScrollCtr), 8);
+ }
+
showSpeedDialIfAnyChecked();
return view;
@@ -218,10 +224,6 @@ public class EpisodesApplyActionFragment extends Fragment {
mSpeedDialView.setVisibility(checkedIds.size() > 0 ? View.VISIBLE : View.GONE);
}
- private void hideSpeedDial() {
- mSpeedDialView.setVisibility(View.GONE);
- }
-
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/CombinedSearcher.java b/app/src/main/java/de/danoeh/antennapod/discovery/CombinedSearcher.java
new file mode 100644
index 000000000..18d65a03c
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/discovery/CombinedSearcher.java
@@ -0,0 +1,96 @@
+package de.danoeh.antennapod.discovery;
+
+import android.content.Context;
+import android.util.Log;
+import android.util.Pair;
+import io.reactivex.Single;
+import io.reactivex.SingleOnSubscribe;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.schedulers.Schedulers;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.CountDownLatch;
+
+public class CombinedSearcher implements PodcastSearcher {
+ private static final String TAG = "CombinedSearcher";
+
+ private final List<Pair<PodcastSearcher, Float>> searchProviders = new ArrayList<>();
+
+ public CombinedSearcher(Context context) {
+ addProvider(new FyydPodcastSearcher(), 1.f);
+ addProvider(new ItunesPodcastSearcher(context), 1.f);
+ addProvider(new GpodnetPodcastSearcher(), 0.6f);
+ }
+
+ private void addProvider(PodcastSearcher provider, float priority) {
+ searchProviders.add(new Pair<>(provider, priority));
+ }
+
+ public Single<List<PodcastSearchResult>> search(String query) {
+ ArrayList<Disposable> disposables = new ArrayList<>();
+ List<List<PodcastSearchResult>> singleResults = new ArrayList<>(Collections.nCopies(searchProviders.size(), null));
+ CountDownLatch latch = new CountDownLatch(searchProviders.size());
+ for (int i = 0; i < searchProviders.size(); i++) {
+ Pair<PodcastSearcher, Float> searchProviderInfo = searchProviders.get(i);
+ PodcastSearcher searcher = searchProviderInfo.first;
+ final int index = i;
+ disposables.add(searcher.search(query).subscribe(e -> {
+ singleResults.set(index, e);
+ latch.countDown();
+ }, throwable -> {
+ Log.d(TAG, Log.getStackTraceString(throwable));
+ latch.countDown();
+ }
+ ));
+ }
+
+ return Single.create((SingleOnSubscribe<List<PodcastSearchResult>>) subscriber -> {
+ latch.await();
+ List<PodcastSearchResult> results = weightSearchResults(singleResults);
+ subscriber.onSuccess(results);
+ })
+ .doOnDispose(() -> {
+ for (Disposable disposable : disposables) {
+ disposable.dispose();
+ }
+ })
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
+ }
+
+ private List<PodcastSearchResult> weightSearchResults(List<List<PodcastSearchResult>> singleResults) {
+ HashMap<String, Float> resultRanking = new HashMap<>();
+ HashMap<String, PodcastSearchResult> urlToResult = new HashMap<>();
+ for (int i = 0; i < singleResults.size(); i++) {
+ float providerPriority = searchProviders.get(i).second;
+ List<PodcastSearchResult> providerResults = singleResults.get(i);
+ if (providerResults == null) {
+ continue;
+ }
+ for (int position = 0; position < providerResults.size(); position++) {
+ PodcastSearchResult result = providerResults.get(position);
+ urlToResult.put(result.feedUrl, result);
+
+ float ranking = 0;
+ if (resultRanking.containsKey(result.feedUrl)) {
+ ranking = resultRanking.get(result.feedUrl);
+ }
+ ranking += 1.f / (position + 1.f);
+ resultRanking.put(result.feedUrl, ranking * providerPriority);
+ }
+ }
+ List<Map.Entry<String, Float>> sortedResults = new ArrayList<>(resultRanking.entrySet());
+ Collections.sort(sortedResults, (o1, o2) -> Double.compare(o2.getValue(), o1.getValue()));
+
+ List<PodcastSearchResult> results = new ArrayList<>();
+ for (Map.Entry<String, Float> res : sortedResults) {
+ results.add(urlToResult.get(res.getKey()));
+ }
+ return results;
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/FyydPodcastSearcher.java b/app/src/main/java/de/danoeh/antennapod/discovery/FyydPodcastSearcher.java
new file mode 100644
index 000000000..529a9e3d5
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/discovery/FyydPodcastSearcher.java
@@ -0,0 +1,38 @@
+package de.danoeh.antennapod.discovery;
+
+import de.danoeh.antennapod.core.service.download.AntennapodHttpClient;
+import de.mfietz.fyydlin.FyydClient;
+import de.mfietz.fyydlin.FyydResponse;
+import de.mfietz.fyydlin.SearchHit;
+import io.reactivex.Single;
+import io.reactivex.SingleOnSubscribe;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FyydPodcastSearcher implements PodcastSearcher {
+ private final FyydClient client = new FyydClient(AntennapodHttpClient.getHttpClient());
+
+ public Single<List<PodcastSearchResult>> search(String query) {
+ return Single.create((SingleOnSubscribe<List<PodcastSearchResult>>) subscriber -> {
+ FyydResponse response = client.searchPodcasts(query, 10)
+ .subscribeOn(Schedulers.io())
+ .blockingGet();
+
+ ArrayList<PodcastSearchResult> searchResults = new ArrayList<>();
+
+ if (!response.getData().isEmpty()) {
+ for (SearchHit searchHit : response.getData()) {
+ PodcastSearchResult podcast = PodcastSearchResult.fromFyyd(searchHit);
+ searchResults.add(podcast);
+ }
+ }
+
+ subscriber.onSuccess(searchResults);
+ })
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java b/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java
new file mode 100644
index 000000000..6e5debb38
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/discovery/GpodnetPodcastSearcher.java
@@ -0,0 +1,38 @@
+package de.danoeh.antennapod.discovery;
+
+import de.danoeh.antennapod.core.gpoddernet.GpodnetService;
+import de.danoeh.antennapod.core.gpoddernet.GpodnetServiceException;
+import de.danoeh.antennapod.core.gpoddernet.model.GpodnetPodcast;
+import io.reactivex.Single;
+import io.reactivex.SingleOnSubscribe;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class GpodnetPodcastSearcher implements PodcastSearcher {
+ public Single<List<PodcastSearchResult>> search(String query) {
+ return Single.create((SingleOnSubscribe<List<PodcastSearchResult>>) subscriber -> {
+ GpodnetService service = null;
+ try {
+ service = new GpodnetService();
+ List<GpodnetPodcast> gpodnetPodcasts = service.searchPodcasts(query, 0);
+ List<PodcastSearchResult> results = new ArrayList<>();
+ for (GpodnetPodcast podcast : gpodnetPodcasts) {
+ results.add(PodcastSearchResult.fromGpodder(podcast));
+ }
+ subscriber.onSuccess(results);
+ } catch (GpodnetServiceException e) {
+ e.printStackTrace();
+ subscriber.onError(e);
+ } finally {
+ if (service != null) {
+ service.shutdown();
+ }
+ }
+ })
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/ItunesPodcastSearcher.java b/app/src/main/java/de/danoeh/antennapod/discovery/ItunesPodcastSearcher.java
new file mode 100644
index 000000000..a91aae1a8
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/discovery/ItunesPodcastSearcher.java
@@ -0,0 +1,74 @@
+package de.danoeh.antennapod.discovery;
+
+import android.content.Context;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.core.ClientConfig;
+import de.danoeh.antennapod.core.service.download.AntennapodHttpClient;
+import io.reactivex.Single;
+import io.reactivex.SingleOnSubscribe;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ItunesPodcastSearcher implements PodcastSearcher {
+ private static final String ITUNES_API_URL = "https://itunes.apple.com/search?media=podcast&term=%s";
+ private final Context context;
+
+ public ItunesPodcastSearcher(Context context) {
+ this.context = context;
+ }
+
+ public Single<List<PodcastSearchResult>> search(String query) {
+ return Single.create((SingleOnSubscribe<List<PodcastSearchResult>>) subscriber -> {
+ String encodedQuery;
+ try {
+ encodedQuery = URLEncoder.encode(query, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // this won't ever be thrown
+ encodedQuery = query;
+ }
+
+ String formattedUrl = String.format(ITUNES_API_URL, encodedQuery);
+
+ OkHttpClient client = AntennapodHttpClient.getHttpClient();
+ Request.Builder httpReq = new Request.Builder()
+ .url(formattedUrl)
+ .header("User-Agent", ClientConfig.USER_AGENT);
+ List<PodcastSearchResult> podcasts = new ArrayList<>();
+ try {
+ Response response = client.newCall(httpReq.build()).execute();
+
+ if (response.isSuccessful()) {
+ String resultString = response.body().string();
+ JSONObject result = new JSONObject(resultString);
+ JSONArray j = result.getJSONArray("results");
+
+ for (int i = 0; i < j.length(); i++) {
+ JSONObject podcastJson = j.getJSONObject(i);
+ PodcastSearchResult podcast = PodcastSearchResult.fromItunes(podcastJson);
+ podcasts.add(podcast);
+ }
+ } else {
+ String prefix = context.getString(R.string.error_msg_prefix);
+ subscriber.onError(new IOException(prefix + response));
+ }
+ } catch (IOException | JSONException e) {
+ subscriber.onError(e);
+ }
+ subscriber.onSuccess(podcasts);
+ })
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/ItunesTopListLoader.java b/app/src/main/java/de/danoeh/antennapod/discovery/ItunesTopListLoader.java
new file mode 100644
index 000000000..bc9133258
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/discovery/ItunesTopListLoader.java
@@ -0,0 +1,110 @@
+package de.danoeh.antennapod.discovery;
+
+import android.content.Context;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.core.ClientConfig;
+import de.danoeh.antennapod.core.service.download.AntennapodHttpClient;
+import io.reactivex.Single;
+import io.reactivex.SingleOnSubscribe;
+import io.reactivex.android.schedulers.AndroidSchedulers;
+import io.reactivex.schedulers.Schedulers;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+public class ItunesTopListLoader {
+ private final Context context;
+
+ public ItunesTopListLoader(Context context) {
+ this.context = context;
+ }
+
+ public Single<List<PodcastSearchResult>> loadToplist(int limit) {
+ return Single.create((SingleOnSubscribe<List<PodcastSearchResult>>) emitter -> {
+ String lang = Locale.getDefault().getLanguage();
+ OkHttpClient client = AntennapodHttpClient.getHttpClient();
+ String feedString;
+ try {
+ try {
+ feedString = getTopListFeed(client, lang, limit);
+ } catch (IOException e) {
+ feedString = getTopListFeed(client, "us", limit);
+ }
+ List<PodcastSearchResult> podcasts = parseFeed(feedString);
+ emitter.onSuccess(podcasts);
+ } catch (IOException | JSONException e) {
+ emitter.onError(e);
+ }
+ })
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
+ }
+
+ public Single<String> getFeedUrl(PodcastSearchResult podcast) {
+ if (!podcast.feedUrl.contains("itunes.apple.com")) {
+ return Single.just(podcast.feedUrl)
+ .observeOn(AndroidSchedulers.mainThread());
+ }
+ return Single.create((SingleOnSubscribe<String>) emitter -> {
+ OkHttpClient client = AntennapodHttpClient.getHttpClient();
+ Request.Builder httpReq = new Request.Builder()
+ .url(podcast.feedUrl)
+ .header("User-Agent", ClientConfig.USER_AGENT);
+ try {
+ Response response = client.newCall(httpReq.build()).execute();
+ if (response.isSuccessful()) {
+ String resultString = response.body().string();
+ JSONObject result = new JSONObject(resultString);
+ JSONObject results = result.getJSONArray("results").getJSONObject(0);
+ String feedUrl = results.getString("feedUrl");
+ emitter.onSuccess(feedUrl);
+ } else {
+ String prefix = context.getString(R.string.error_msg_prefix);
+ emitter.onError(new IOException(prefix + response));
+ }
+ } catch (IOException | JSONException e) {
+ emitter.onError(e);
+ }
+ })
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread());
+ }
+
+ private String getTopListFeed(OkHttpClient client, String language, int limit) throws IOException {
+ String url = "https://itunes.apple.com/%s/rss/toppodcasts/limit="+limit+"/explicit=true/json";
+ Request.Builder httpReq = new Request.Builder()
+ .header("User-Agent", ClientConfig.USER_AGENT)
+ .url(String.format(url, language));
+
+ try (Response response = client.newCall(httpReq.build()).execute()) {
+ if (response.isSuccessful()) {
+ return response.body().string();
+ }
+ String prefix = context.getString(R.string.error_msg_prefix);
+ throw new IOException(prefix + response);
+ }
+ }
+
+ private List<PodcastSearchResult> parseFeed(String jsonString) throws JSONException {
+ JSONObject result = new JSONObject(jsonString);
+ JSONObject feed = result.getJSONObject("feed");
+ JSONArray entries = feed.getJSONArray("entry");
+
+ List<PodcastSearchResult> results = new ArrayList<>();
+ for (int i=0; i < entries.length(); i++) {
+ JSONObject json = entries.getJSONObject(i);
+ results.add(PodcastSearchResult.fromItunesToplist(json));
+ }
+
+ return results;
+ }
+
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearchResult.java b/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearchResult.java
new file mode 100644
index 000000000..ca9ed83d7
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearchResult.java
@@ -0,0 +1,81 @@
+package de.danoeh.antennapod.discovery;
+
+import android.support.annotation.Nullable;
+import de.danoeh.antennapod.core.gpoddernet.model.GpodnetPodcast;
+import de.mfietz.fyydlin.SearchHit;
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+public class PodcastSearchResult {
+
+ /**
+ * The name of the podcast
+ */
+ public final String title;
+
+ /**
+ * URL of the podcast image
+ */
+ @Nullable
+ public final String imageUrl;
+ /**
+ * URL of the podcast feed
+ */
+ @Nullable
+ public final String feedUrl;
+
+
+ private PodcastSearchResult(String title, @Nullable String imageUrl, @Nullable String feedUrl) {
+ this.title = title;
+ this.imageUrl = imageUrl;
+ this.feedUrl = feedUrl;
+ }
+
+ public static PodcastSearchResult dummy() {
+ return new PodcastSearchResult("", "", "");
+ }
+
+ /**
+ * Constructs a Podcast instance from a iTunes search result
+ *
+ * @param json object holding the podcast information
+ * @throws JSONException
+ */
+ public static PodcastSearchResult fromItunes(JSONObject json) {
+ String title = json.optString("collectionName", "");
+ String imageUrl = json.optString("artworkUrl100", null);
+ String feedUrl = json.optString("feedUrl", null);
+ return new PodcastSearchResult(title, imageUrl, feedUrl);
+ }
+
+ /**
+ * Constructs a Podcast instance from iTunes toplist entry
+ *
+ * @param json object holding the podcast information
+ * @throws JSONException
+ */
+ public static PodcastSearchResult fromItunesToplist(JSONObject json) throws JSONException {
+ String title = json.getJSONObject("title").getString("label");
+ String imageUrl = null;
+ JSONArray images = json.getJSONArray("im:image");
+ for(int i=0; imageUrl == null && i < images.length(); i++) {
+ JSONObject image = images.getJSONObject(i);
+ String height = image.getJSONObject("attributes").getString("height");
+ if(Integer.parseInt(height) >= 100) {
+ imageUrl = image.getString("label");
+ }
+ }
+ String feedUrl = "https://itunes.apple.com/lookup?id=" +
+ json.getJSONObject("id").getJSONObject("attributes").getString("im:id");
+ return new PodcastSearchResult(title, imageUrl, feedUrl);
+ }
+
+ public static PodcastSearchResult fromFyyd(SearchHit searchHit) {
+ return new PodcastSearchResult(searchHit.getTitle(), searchHit.getThumbImageURL(), searchHit.getXmlUrl());
+ }
+
+ public static PodcastSearchResult fromGpodder(GpodnetPodcast searchHit) {
+ return new PodcastSearchResult(searchHit.getTitle(), searchHit.getLogoUrl(), searchHit.getUrl());
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcher.java b/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcher.java
new file mode 100644
index 000000000..b19d7d695
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/discovery/PodcastSearcher.java
@@ -0,0 +1,10 @@
+package de.danoeh.antennapod.discovery;
+
+import io.reactivex.Single;
+import io.reactivex.disposables.Disposable;
+import io.reactivex.functions.Consumer;
+import java.util.List;
+
+public interface PodcastSearcher {
+ Single<List<PodcastSearchResult>> search(String query);
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
index ee2373da8..35bcaa76e 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
@@ -2,13 +2,20 @@ package de.danoeh.antennapod.fragment;
import android.content.Intent;
import android.os.Bundle;
+import android.provider.MediaStore;
import android.support.v4.app.Fragment;
+import android.view.ContextMenu;
+import android.view.KeyEvent;
import android.view.LayoutInflater;
+import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.TextView;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MainActivity;
import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
@@ -27,11 +34,28 @@ public class AddFeedFragment extends Fragment {
*/
private static final String ARG_FEED_URL = "feedurl";
+ private EditText combinedFeedSearchBox;
+ private MainActivity activity;
+
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
View root = inflater.inflate(R.layout.addfeed, container, false);
+ activity = (MainActivity) getActivity();
+ activity.getSupportActionBar().setTitle(R.string.add_feed_label);
+
+ setupAdvancedSearchButtons(root);
+ setupSeachBox(root);
+
+ View butOpmlImport = root.findViewById(R.id.btn_opml_import);
+ butOpmlImport.setOnClickListener(v -> startActivity(new Intent(getActivity(),
+ OpmlImportFromPathActivity.class)));
+
+ return root;
+ }
+
+ private void setupSeachBox(View root) {
final EditText etxtFeedurl = root.findViewById(R.id.etxtFeedurl);
Bundle args = getArguments();
@@ -39,32 +63,69 @@ public class AddFeedFragment extends Fragment {
etxtFeedurl.setText(args.getString(ARG_FEED_URL));
}
- Button butSearchITunes = root.findViewById(R.id.butSearchItunes);
- Button butBrowserGpoddernet = root.findViewById(R.id.butBrowseGpoddernet);
- Button butSearchFyyd = root.findViewById(R.id.butSearchFyyd);
- Button butOpmlImport = root.findViewById(R.id.butOpmlImport);
- Button butConfirm = root.findViewById(R.id.butConfirm);
+ Button butConfirmAddUrl = root.findViewById(R.id.butConfirm);
+ butConfirmAddUrl.setOnClickListener(v -> {
+ addUrl(etxtFeedurl.getText().toString());
+ });
- final MainActivity activity = (MainActivity) getActivity();
- activity.getSupportActionBar().setTitle(R.string.add_feed_label);
+ combinedFeedSearchBox = root.findViewById(R.id.combinedFeedSearchBox);
+ combinedFeedSearchBox.setOnEditorActionListener((v, actionId, event) -> {
+ if (actionId == EditorInfo.IME_ACTION_SEARCH) {
+ performSearch();
+ return true;
+ }
+ return false;
+ });
+ }
- butSearchITunes.setOnClickListener(v -> activity.loadChildFragment(new ItunesSearchFragment()));
+ private void setupAdvancedSearchButtons(View root) {
+ View butAdvancedSearch = root.findViewById(R.id.advanced_search);
+ registerForContextMenu(butAdvancedSearch);
+ butAdvancedSearch.setOnClickListener(v -> butAdvancedSearch.showContextMenu());
+ }
- butBrowserGpoddernet.setOnClickListener(v -> activity.loadChildFragment(new GpodnetMainFragment()));
+ @Override
+ public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
+ getActivity().getMenuInflater().inflate(R.menu.advanced_search, menu);
+ }
- butSearchFyyd.setOnClickListener(v -> activity.loadChildFragment(new FyydSearchFragment()));
+ @Override
+ public boolean onContextItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case R.id.search_fyyd:
+ activity.loadChildFragment(new FyydSearchFragment());
+ return true;
+ case R.id.search_gpodder:
+ activity.loadChildFragment(new GpodnetMainFragment());
+ return true;
+ case R.id.search_itunes:
+ activity.loadChildFragment(new ItunesSearchFragment());
+ return true;
+ }
+ return false;
+ }
- butOpmlImport.setOnClickListener(v -> startActivity(new Intent(getActivity(),
- OpmlImportFromPathActivity.class)));
- butConfirm.setOnClickListener(v -> {
- Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
- intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, etxtFeedurl.getText().toString());
- intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, getString(R.string.add_feed_label));
- startActivity(intent);
- });
+ private void addUrl(String url) {
+ Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
+ intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, url);
+ intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, getString(R.string.add_feed_label));
+ startActivity(intent);
+ }
- return root;
+ private void performSearch() {
+ String query = combinedFeedSearchBox.getText().toString();
+
+ if (query.startsWith("http")) {
+ addUrl(query);
+ return;
+ }
+
+ Bundle bundle = new Bundle();
+ bundle.putString(CombinedSearchFragment.ARGUMENT_QUERY, query);
+ CombinedSearchFragment fragment = new CombinedSearchFragment();
+ fragment.setArguments(bundle);
+ activity.loadChildFragment(fragment);
}
@Override
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java
index 8f4e9f656..62d798cf6 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java
@@ -21,11 +21,15 @@ import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ProgressBar;
-import android.widget.TextView;
import android.widget.Toast;
import com.yqritc.recyclerviewflexibledivider.HorizontalDividerItemDecoration;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
+
+import java.util.ArrayList;
import java.util.List;
import de.danoeh.antennapod.R;
@@ -40,6 +44,7 @@ import de.danoeh.antennapod.core.feed.Feed;
import de.danoeh.antennapod.core.feed.FeedItem;
import de.danoeh.antennapod.core.feed.FeedMedia;
import de.danoeh.antennapod.core.preferences.UserPreferences;
+import de.danoeh.antennapod.core.service.download.DownloadRequest;
import de.danoeh.antennapod.core.service.download.DownloadService;
import de.danoeh.antennapod.core.service.download.Downloader;
import de.danoeh.antennapod.core.storage.DBReader;
@@ -50,15 +55,11 @@ import de.danoeh.antennapod.core.util.FeedItemUtil;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
import de.danoeh.antennapod.menuhandler.MenuItemUtils;
-
import de.danoeh.antennapod.view.EmptyViewHandler;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
/**
* Shows unread or recently published episodes
@@ -81,11 +82,10 @@ public class AllEpisodesFragment extends Fragment {
private ProgressBar progLoading;
EmptyViewHandler emptyView;
- List<FeedItem> episodes;
- private List<Downloader> downloaderList;
-
- private boolean itemsLoaded = false;
- private boolean viewsCreated = false;
+ @NonNull
+ List<FeedItem> episodes = new ArrayList<>();
+ @NonNull
+ private List<Downloader> downloaderList = new ArrayList<>();
private boolean isUpdatingFeeds;
boolean isMenuInvalidationAllowed = false;
@@ -93,29 +93,26 @@ public class AllEpisodesFragment extends Fragment {
Disposable disposable;
private LinearLayoutManager layoutManager;
- boolean showOnlyNewEpisodes() { return false; }
- String getPrefName() { return DEFAULT_PREF_NAME; }
+ boolean showOnlyNewEpisodes() {
+ return false;
+ }
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setHasOptionsMenu(true);
+ String getPrefName() {
+ return DEFAULT_PREF_NAME;
}
@Override
public void onStart() {
super.onStart();
+ setHasOptionsMenu(true);
EventDistributor.getInstance().register(contentUpdate);
- if (viewsCreated && itemsLoaded) {
- onFragmentLoaded();
- }
EventBus.getDefault().register(this);
+ loadItems();
}
@Override
public void onResume() {
super.onResume();
- loadItems();
registerForContextMenu(recyclerView);
}
@@ -136,17 +133,11 @@ public class AllEpisodesFragment extends Fragment {
}
}
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- resetViewState();
- }
-
private void saveScrollPosition() {
int firstItem = layoutManager.findFirstVisibleItemPosition();
View firstItemView = layoutManager.findViewByPosition(firstItem);
float topOffset;
- if(firstItemView == null) {
+ if (firstItemView == null) {
topOffset = 0;
} else {
topOffset = firstItemView.getTop();
@@ -173,43 +164,35 @@ public class AllEpisodesFragment extends Fragment {
}
}
- void resetViewState() {
- viewsCreated = false;
- listAdapter = null;
- }
-
-
private final MenuItemUtils.UpdateRefreshMenuItemChecker updateRefreshMenuItemChecker =
() -> DownloadService.isRunning && DownloadRequester.getInstance().isDownloadingFeeds();
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if(!isAdded()) {
+ if (!isAdded()) {
return;
}
super.onCreateOptionsMenu(menu, inflater);
- if (itemsLoaded) {
- inflater.inflate(R.menu.episodes, menu);
-
- MenuItem searchItem = menu.findItem(R.id.action_search);
- final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem);
- MenuItemUtils.adjustTextColor(getActivity(), sv);
- sv.setQueryHint(getString(R.string.search_hint));
- sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
- @Override
- public boolean onQueryTextSubmit(String s) {
- sv.clearFocus();
- ((MainActivity) getActivity()).loadChildFragment(SearchFragment.newInstance(s));
- return true;
- }
+ inflater.inflate(R.menu.episodes, menu);
+
+ MenuItem searchItem = menu.findItem(R.id.action_search);
+ final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem);
+ MenuItemUtils.adjustTextColor(getActivity(), sv);
+ sv.setQueryHint(getString(R.string.search_hint));
+ sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String s) {
+ sv.clearFocus();
+ ((MainActivity) requireActivity()).loadChildFragment(SearchFragment.newInstance(s));
+ return true;
+ }
- @Override
- public boolean onQueryTextChange(String s) {
- return false;
- }
- });
- isUpdatingFeeds = MenuItemUtils.updateRefreshMenuItem(menu, R.id.refresh_item, updateRefreshMenuItemChecker);
- }
+ @Override
+ public boolean onQueryTextChange(String s) {
+ return false;
+ }
+ });
+ isUpdatingFeeds = MenuItemUtils.updateRefreshMenuItem(menu, R.id.refresh_item, updateRefreshMenuItemChecker);
}
@Override
@@ -217,11 +200,11 @@ public class AllEpisodesFragment extends Fragment {
super.onPrepareOptionsMenu(menu);
MenuItem markAllRead = menu.findItem(R.id.mark_all_read_item);
if (markAllRead != null) {
- markAllRead.setVisible(!showOnlyNewEpisodes() && episodes != null && !episodes.isEmpty());
+ markAllRead.setVisible(!showOnlyNewEpisodes() && !episodes.isEmpty());
}
- MenuItem markAllSeen = menu.findItem(R.id.mark_all_seen_item);
- if(markAllSeen != null) {
- markAllSeen.setVisible(showOnlyNewEpisodes() && episodes != null && !episodes.isEmpty());
+ MenuItem removeAllNewFlags = menu.findItem(R.id.remove_all_new_flags_item);
+ if (removeAllNewFlags != null) {
+ removeAllNewFlags.setVisible(showOnlyNewEpisodes() && !episodes.isEmpty());
}
}
@@ -249,19 +232,19 @@ public class AllEpisodesFragment extends Fragment {
};
markAllReadConfirmationDialog.createNewDialog().show();
return true;
- case R.id.mark_all_seen_item:
- ConfirmationDialog markAllSeenConfirmationDialog = new ConfirmationDialog(getActivity(),
- R.string.mark_all_seen_label,
- R.string.mark_all_seen_confirmation_msg) {
+ case R.id.remove_all_new_flags_item:
+ ConfirmationDialog removeAllNewFlagsConfirmationDialog = new ConfirmationDialog(getActivity(),
+ R.string.remove_all_new_flags_label,
+ R.string.remove_all_new_flags_confirmation_msg) {
@Override
public void onConfirmButtonPressed(DialogInterface dialog) {
dialog.dismiss();
- DBWriter.markNewItemsSeen();
- Toast.makeText(getActivity(), R.string.mark_all_seen_msg, Toast.LENGTH_SHORT).show();
+ DBWriter.removeAllNewFlags();
+ Toast.makeText(getActivity(), R.string.removed_all_new_flags_msg, Toast.LENGTH_SHORT).show();
}
};
- markAllSeenConfirmationDialog.createNewDialog().show();
+ removeAllNewFlagsConfirmationDialog.createNewDialog().show();
return true;
default:
return false;
@@ -275,111 +258,102 @@ public class AllEpisodesFragment extends Fragment {
@Override
public boolean onContextItemSelected(MenuItem item) {
Log.d(TAG, "onContextItemSelected() called with: " + "item = [" + item + "]");
- if(!isVisible()) {
+ if (!getUserVisibleHint()) {
return false;
}
- if(item.getItemId() == R.id.share_item) {
+ if (!isVisible()) {
+ return false;
+ }
+ if (item.getItemId() == R.id.share_item) {
return true; // avoids that the position is reset when we need it in the submenu
}
- if (listAdapter == null || listAdapter.getSelectedItem() == null) {
+ if (listAdapter.getSelectedItem() == null) {
Log.i(TAG, "Selected item or listAdapter was null, ignoring selection");
return super.onContextItemSelected(item);
}
FeedItem selectedItem = listAdapter.getSelectedItem();
- // Mark as seen contains UI logic specific to All/New/FavoriteSegments,
+ // Remove new flag contains UI logic specific to All/New/FavoriteSegments,
// e.g., Undo with Snackbar,
// and is handled by this class rather than the generic FeedItemMenuHandler
- // Undo is useful for Mark as seen, given there is no UI to undo it otherwise,
+ // Undo is useful for Remove new flag, given there is no UI to undo it otherwise,
// i.e., there is context menu item for Mark as new
- if (R.id.mark_as_seen_item == item.getItemId()) {
- markItemAsSeenWithUndo(selectedItem);
+ if (R.id.remove_new_flag_item == item.getItemId()) {
+ removeNewFlagWithUndo(selectedItem);
return true;
}
return FeedItemMenuHandler.onMenuItemClicked(getActivity(), item.getItemId(), selectedItem);
}
+ @NonNull
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- return onCreateViewHelper(inflater, container, savedInstanceState,
- R.layout.all_episodes_fragment);
- }
-
- View onCreateViewHelper(LayoutInflater inflater,
- ViewGroup container,
- Bundle savedInstanceState,
- int fragmentResource) {
+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreateView(inflater, container, savedInstanceState);
+ View root = inflater.inflate(R.layout.all_episodes_fragment, container, false);
- View root = inflater.inflate(fragmentResource, container, false);
-
- recyclerView = root.findViewById(android.R.id.list);
- RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
- if (animator instanceof SimpleItemAnimator) {
- ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
- }
layoutManager = new LinearLayoutManager(getActivity());
+ recyclerView = root.findViewById(android.R.id.list);
recyclerView.setLayoutManager(layoutManager);
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).build());
+ recyclerView.setVisibility(View.GONE);
- progLoading = root.findViewById(R.id.progLoading);
-
- if (!itemsLoaded) {
- progLoading.setVisibility(View.VISIBLE);
+ RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
+ if (animator instanceof SimpleItemAnimator) {
+ ((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
}
- viewsCreated = true;
-
- if (itemsLoaded) {
- onFragmentLoaded();
- }
+ progLoading = root.findViewById(R.id.progLoading);
+ progLoading.setVisibility(View.VISIBLE);
emptyView = new EmptyViewHandler(getContext());
emptyView.attachToRecyclerView(recyclerView);
+ emptyView.setIcon(R.attr.feed);
emptyView.setTitle(R.string.no_all_episodes_head_label);
emptyView.setMessage(R.string.no_all_episodes_label);
+ createRecycleAdapter(recyclerView, emptyView);
+ emptyView.hide();
+
return root;
}
- private void onFragmentLoaded() {
- if (episodes != null && episodes.size() > 0) {
- if (listAdapter == null) {
- MainActivity mainActivity = (MainActivity) getActivity();
- listAdapter = new AllEpisodesRecycleAdapter(mainActivity, itemAccess, showOnlyNewEpisodes());
- listAdapter.setHasStableIds(true);
- recyclerView.setAdapter(listAdapter);
- emptyView.updateAdapter(listAdapter);
- }
- recyclerView.setVisibility(View.VISIBLE);
- listAdapter.notifyDataSetChanged();
- } else {
- listAdapter = null;
- recyclerView.setVisibility(View.GONE);
- emptyView.updateAdapter(listAdapter);
+ private void onFragmentLoaded(List<FeedItem> episodes) {
+ this.episodes = episodes;
+ listAdapter.notifyDataSetChanged();
+
+ if (episodes.size() == 0) {
+ createRecycleAdapter(recyclerView, emptyView);
}
restoreScrollPosition();
- getActivity().supportInvalidateOptionsMenu();
- updateShowOnlyEpisodesListViewState();
+ requireActivity().invalidateOptionsMenu();
+ }
+
+ /**
+ * Currently, we need to recreate the list adapter in order to be able to undo last item via the
+ * snackbar. See #3084 for details.
+ */
+ private void createRecycleAdapter(RecyclerView recyclerView, EmptyViewHandler emptyViewHandler) {
+ MainActivity mainActivity = (MainActivity) getActivity();
+ listAdapter = new AllEpisodesRecycleAdapter(mainActivity, itemAccess, showOnlyNewEpisodes());
+ listAdapter.setHasStableIds(true);
+ recyclerView.setAdapter(listAdapter);
+ emptyViewHandler.updateAdapter(listAdapter);
}
private final AllEpisodesRecycleAdapter.ItemAccess itemAccess = new AllEpisodesRecycleAdapter.ItemAccess() {
@Override
public int getCount() {
- if (episodes != null) {
- return episodes.size();
- }
- return 0;
+ return episodes.size();
}
@Override
public FeedItem getItem(int position) {
- if (episodes != null && 0 <= position && position < episodes.size()) {
+ if (0 <= position && position < episodes.size()) {
return episodes.get(position);
}
return null;
@@ -387,11 +361,8 @@ public class AllEpisodesFragment extends Fragment {
@Override
public LongList getItemsIds() {
- if(episodes == null) {
- return new LongList(0);
- }
LongList ids = new LongList(episodes.size());
- for(FeedItem episode : episodes) {
+ for (FeedItem episode : episodes) {
ids.add(episode.getId());
}
return ids;
@@ -399,12 +370,11 @@ public class AllEpisodesFragment extends Fragment {
@Override
public int getItemDownloadProgressPercent(FeedItem item) {
- if (downloaderList != null) {
- for (Downloader downloader : downloaderList) {
- if (downloader.getDownloadRequest().getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA
- && downloader.getDownloadRequest().getFeedfileId() == item.getMedia().getId()) {
- return downloader.getDownloadRequest().getProgressPercent();
- }
+ for (Downloader downloader : downloaderList) {
+ DownloadRequest downloadRequest = downloader.getDownloadRequest();
+ if (downloadRequest.getFeedfileType() == FeedMedia.FEEDFILETYPE_FEEDMEDIA
+ && downloadRequest.getFeedfileId() == item.getMedia().getId()) {
+ return downloadRequest.getProgressPercent();
}
}
return 0;
@@ -418,11 +388,8 @@ public class AllEpisodesFragment extends Fragment {
@Override
public LongList getQueueIds() {
LongList queueIds = new LongList();
- if(episodes == null) {
- return queueIds;
- }
- for(FeedItem item : episodes) {
- if(item.isTagged(FeedItem.TAG_QUEUE)) {
+ for (FeedItem item : episodes) {
+ if (item.isTagged(FeedItem.TAG_QUEUE)) {
queueIds.add(item.getId());
}
}
@@ -434,12 +401,6 @@ public class AllEpisodesFragment extends Fragment {
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventMainThread(FeedItemEvent event) {
Log.d(TAG, "onEventMainThread() called with: " + "event = [" + event + "]");
- if (episodes == null) {
- return;
- } else if (listAdapter == null) {
- loadItems();
- return;
- }
for (FeedItem item : event.items) {
int pos = FeedItemUtil.indexOfItemWithId(episodes, item.getId());
if (pos >= 0) {
@@ -464,16 +425,12 @@ public class AllEpisodesFragment extends Fragment {
DownloaderUpdate update = event.update;
downloaderList = update.downloaders;
if (isMenuInvalidationAllowed && isUpdatingFeeds != update.feedIds.length > 0) {
- getActivity().supportInvalidateOptionsMenu();
- }
- if (listAdapter == null) {
- loadItems();
- return;
+ requireActivity().invalidateOptionsMenu();
}
if (update.mediaIds.length > 0) {
- for(long mediaId : update.mediaIds) {
+ for (long mediaId : update.mediaIds) {
int pos = FeedItemUtil.indexOfItemWithMediaId(episodes, mediaId);
- if(pos >= 0) {
+ if (pos >= 0) {
listAdapter.notifyItemChanged(pos);
}
}
@@ -486,35 +443,22 @@ public class AllEpisodesFragment extends Fragment {
if ((arg & EVENTS) != 0) {
loadItems();
if (isUpdatingFeeds != updateRefreshMenuItemChecker.isRefreshing()) {
- getActivity().supportInvalidateOptionsMenu();
+ requireActivity().invalidateOptionsMenu();
}
}
}
};
- private void updateShowOnlyEpisodesListViewState() {
- }
-
void loadItems() {
if (disposable != null) {
disposable.dispose();
}
- if (viewsCreated && !itemsLoaded) {
- recyclerView.setVisibility(View.GONE);
- emptyView.hide();
- progLoading.setVisibility(View.VISIBLE);
- }
disposable = Observable.fromCallable(this::loadData)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(data -> {
- recyclerView.setVisibility(View.VISIBLE);
progLoading.setVisibility(View.GONE);
- episodes = data;
- itemsLoaded = true;
- if (viewsCreated) {
- onFragmentLoaded();
- }
+ onFragmentLoaded(data);
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
}
@@ -523,12 +467,12 @@ public class AllEpisodesFragment extends Fragment {
return DBReader.getRecentlyPublishedEpisodes(RECENT_EPISODES_LIMIT);
}
- void markItemAsSeenWithUndo(FeedItem item) {
+ void removeNewFlagWithUndo(FeedItem item) {
if (item == null) {
return;
}
- Log.d(TAG, "markItemAsSeenWithUndo(" + item.getId() + ")");
+ Log.d(TAG, "removeNewFlagWithUndo(" + item.getId() + ")");
if (disposable != null) {
disposable.dispose();
}
@@ -537,14 +481,14 @@ public class AllEpisodesFragment extends Fragment {
DBWriter.markItemPlayed(FeedItem.UNPLAYED, item.getId());
final Handler h = new Handler(getActivity().getMainLooper());
- final Runnable r = () -> {
+ final Runnable r = () -> {
FeedMedia media = item.getMedia();
if (media != null && media.hasAlmostEnded() && UserPreferences.isAutoDelete()) {
DBWriter.deleteFeedMediaOfItem(getActivity(), media.getId());
}
};
- Snackbar snackbar = Snackbar.make(getView(), getString(R.string.marked_as_seen_label),
+ Snackbar snackbar = Snackbar.make(getView(), getString(R.string.removed_new_flag_label),
Snackbar.LENGTH_LONG);
snackbar.setAction(getString(R.string.undo), v -> {
DBWriter.markItemPlayed(FeedItem.NEW, item.getId());
@@ -552,7 +496,6 @@ public class AllEpisodesFragment extends Fragment {
h.removeCallbacks(r);
});
snackbar.show();
- h.postDelayed(r, (int)Math.ceil(snackbar.getDuration() * 1.05f));
+ h.postDelayed(r, (int) Math.ceil(snackbar.getDuration() * 1.05f));
}
-
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java
index 0ffd1a8da..4bebfe4c9 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ChaptersFragment.java
@@ -15,6 +15,7 @@ import de.danoeh.antennapod.core.feed.Chapter;
import de.danoeh.antennapod.core.util.playback.Playable;
import de.danoeh.antennapod.core.util.playback.PlaybackController;
+import de.danoeh.antennapod.view.EmptyViewHandler;
import io.reactivex.Maybe;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
@@ -25,6 +26,7 @@ public class ChaptersFragment extends ListFragment {
private ChaptersListAdapter adapter;
private PlaybackController controller;
private Disposable disposable;
+ private EmptyViewHandler emptyView;
@Override
@@ -36,6 +38,12 @@ public class ChaptersFragment extends ListFragment {
final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding);
lv.setPadding(0, vertPadding, 0, vertPadding);
+ emptyView = new EmptyViewHandler(getContext());
+ emptyView.attachToListView(lv);
+ emptyView.setIcon(R.attr.ic_bookmark);
+ emptyView.setTitle(R.string.no_chapters_head_label);
+ emptyView.setMessage(R.string.no_chapters_label);
+
adapter = new ChaptersListAdapter(getActivity(), 0, pos -> {
Chapter chapter = (Chapter) getListAdapter().getItem(pos);
controller.seekToChapter(chapter);
@@ -118,10 +126,7 @@ public class ChaptersFragment extends ListFragment {
if (adapter != null) {
adapter.setMedia(media);
adapter.notifyDataSetChanged();
- if (media == null || media.getChapters() == null || media.getChapters().size() == 0) {
- setEmptyText(getString(R.string.no_chapters_label));
- } else {
- setEmptyText(null);
+ if (media != null && media.getChapters() != null && media.getChapters().size() != 0) {
scrollTo(getCurrentChapter(media));
}
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CombinedSearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CombinedSearchFragment.java
new file mode 100644
index 000000000..1d9020f0d
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/CombinedSearchFragment.java
@@ -0,0 +1,173 @@
+package de.danoeh.antennapod.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.view.MenuItemCompat;
+import android.support.v7.widget.SearchView;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.GridView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
+import de.danoeh.antennapod.adapter.itunes.ItunesAdapter;
+import de.danoeh.antennapod.discovery.CombinedSearcher;
+import de.danoeh.antennapod.discovery.PodcastSearchResult;
+import de.danoeh.antennapod.menuhandler.MenuItemUtils;
+import io.reactivex.disposables.Disposable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class CombinedSearchFragment extends Fragment {
+
+ private static final String TAG = "CombinedSearchFragment";
+ public static final String ARGUMENT_QUERY = "query";
+
+ /**
+ * Adapter responsible with the search results
+ */
+ private ItunesAdapter adapter;
+ private GridView gridView;
+ private ProgressBar progressBar;
+ private TextView txtvError;
+ private Button butRetry;
+ private TextView txtvEmpty;
+
+ /**
+ * List of podcasts retreived from the search
+ */
+ private List<PodcastSearchResult> searchResults = new ArrayList<>();
+ private Disposable disposable;
+
+ /**
+ * Constructor
+ */
+ public CombinedSearchFragment() {
+ // Required empty public constructor
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ View root = inflater.inflate(R.layout.fragment_itunes_search, container, false);
+ gridView = root.findViewById(R.id.gridView);
+ adapter = new ItunesAdapter(getActivity(), new ArrayList<>());
+ gridView.setAdapter(adapter);
+
+ //Show information about the podcast when the list item is clicked
+ gridView.setOnItemClickListener((parent, view1, position, id) -> {
+ PodcastSearchResult podcast = searchResults.get(position);
+ Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
+ intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, podcast.feedUrl);
+ intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, podcast.title);
+ startActivity(intent);
+ });
+ progressBar = root.findViewById(R.id.progressBar);
+ txtvError = root.findViewById(R.id.txtvError);
+ butRetry = root.findViewById(R.id.butRetry);
+ txtvEmpty = root.findViewById(android.R.id.empty);
+
+ return root;
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (disposable != null) {
+ disposable.dispose();
+ }
+ adapter = null;
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ super.onCreateOptionsMenu(menu, inflater);
+ inflater.inflate(R.menu.itunes_search, menu);
+ MenuItem searchItem = menu.findItem(R.id.action_search);
+ final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem);
+ MenuItemUtils.adjustTextColor(getActivity(), sv);
+ sv.setQueryHint(getString(R.string.search_label));
+ sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String s) {
+ sv.clearFocus();
+ search(s);
+ return true;
+ }
+
+ @Override
+ public boolean onQueryTextChange(String s) {
+ return false;
+ }
+ });
+ MenuItemCompat.setOnActionExpandListener(searchItem, new MenuItemCompat.OnActionExpandListener() {
+ @Override
+ public boolean onMenuItemActionExpand(MenuItem item) {
+ return true;
+ }
+
+ @Override
+ public boolean onMenuItemActionCollapse(MenuItem item) {
+ getActivity().getSupportFragmentManager().popBackStack();
+ return true;
+ }
+ });
+ MenuItemCompat.expandActionView(searchItem);
+
+ if (getArguments() != null && getArguments().getString(ARGUMENT_QUERY, null) != null) {
+ sv.setQuery(getArguments().getString(ARGUMENT_QUERY, null), true);
+ }
+ }
+
+ private void search(String query) {
+ if (disposable != null) {
+ disposable.dispose();
+ }
+
+ showOnlyProgressBar();
+
+ CombinedSearcher searcher = new CombinedSearcher(getContext());
+ disposable = searcher.search(query).subscribe(result -> {
+ searchResults = result;
+ progressBar.setVisibility(View.GONE);
+
+ adapter.clear();
+ adapter.addAll(searchResults);
+ adapter.notifyDataSetInvalidated();
+ gridView.setVisibility(!searchResults.isEmpty() ? View.VISIBLE : View.GONE);
+ txtvEmpty.setVisibility(searchResults.isEmpty() ? View.VISIBLE : View.GONE);
+
+ }, error -> {
+ Log.e(TAG, Log.getStackTraceString(error));
+ progressBar.setVisibility(View.GONE);
+ txtvError.setText(error.toString());
+ txtvError.setVisibility(View.VISIBLE);
+ butRetry.setOnClickListener(v -> search(query));
+ butRetry.setVisibility(View.VISIBLE);
+ });
+ }
+
+ private void showOnlyProgressBar() {
+ gridView.setVisibility(View.GONE);
+ txtvError.setVisibility(View.GONE);
+ butRetry.setVisibility(View.GONE);
+ txtvEmpty.setVisibility(View.GONE);
+ progressBar.setVisibility(View.VISIBLE);
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java
index b52fd444f..705151062 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java
@@ -1,7 +1,7 @@
package de.danoeh.antennapod.fragment;
-import android.content.Context;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.v4.app.ListFragment;
import android.util.Log;
import android.view.Menu;
@@ -10,6 +10,7 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
+import java.util.ArrayList;
import java.util.List;
import de.danoeh.antennapod.R;
@@ -27,6 +28,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
+import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_ADD_TO_QUEUE;
+import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_DELETE;
+
/**
* Displays all running downloads and provides a button to delete them
*/
@@ -38,24 +42,27 @@ public class CompletedDownloadsFragment extends ListFragment {
EventDistributor.DOWNLOADLOG_UPDATE |
EventDistributor.UNREAD_ITEMS_UPDATE;
- private List<FeedItem> items;
+ private List<FeedItem> items = new ArrayList<>();
private DownloadedEpisodesListAdapter listAdapter;
-
- private boolean viewCreated = false;
-
private Disposable disposable;
@Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
+ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
+ super.onViewCreated(view, savedInstanceState);
setHasOptionsMenu(true);
- loadItems();
+ addVerticalPadding();
+ addEmptyView();
+
+ listAdapter = new DownloadedEpisodesListAdapter(getActivity(), itemAccess);
+ setListAdapter(listAdapter);
+ setListShown(false);
}
@Override
public void onStart() {
super.onStart();
EventDistributor.getInstance().register(contentUpdate);
+ loadItems();
}
@Override
@@ -68,104 +75,54 @@ public class CompletedDownloadsFragment extends ListFragment {
}
@Override
- public void onDetach() {
- super.onDetach();
- if (disposable != null) {
- disposable.dispose();
- }
+ public void onListItemClick(ListView l, View v, int position, long id) {
+ super.onListItemClick(l, v, position, id);
+ position -= l.getHeaderViewsCount();
+ long[] ids = FeedItemUtil.getIds(items);
+ ((MainActivity) requireActivity()).loadChildFragment(ItemFragment.newInstance(ids, position));
}
@Override
- public void onDestroyView() {
- super.onDestroyView();
- listAdapter = null;
- viewCreated = false;
- if (disposable != null) {
- disposable.dispose();
- }
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ super.onCreateOptionsMenu(menu, inflater);
+ inflater.inflate(R.menu.downloads_completed, menu);
+ menu.findItem(R.id.episode_actions).setVisible(items.size() > 0);
}
@Override
- public void onAttach(Context context) {
- super.onAttach(context);
- if (viewCreated && items != null) {
- onFragmentLoaded();
+ public boolean onOptionsItemSelected(MenuItem item) {
+ if (item.getItemId() == R.id.episode_actions) {
+ ((MainActivity) requireActivity())
+ .loadChildFragment(EpisodesApplyActionFragment.newInstance(items, ACTION_DELETE | ACTION_ADD_TO_QUEUE));
+ return true;
}
+ return false;
}
- @Override
- public void onViewCreated(View view, Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
-
- // add padding
- final ListView lv = getListView();
- lv.setClipToPadding(false);
- final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding);
- lv.setPadding(0, vertPadding, 0, vertPadding);
-
- viewCreated = true;
- if (items != null && getActivity() != null) {
- onFragmentLoaded();
- }
-
+ private void addEmptyView() {
EmptyViewHandler emptyView = new EmptyViewHandler(getActivity());
+ emptyView.setIcon(R.attr.av_download);
emptyView.setTitle(R.string.no_comp_downloads_head_label);
emptyView.setMessage(R.string.no_comp_downloads_label);
emptyView.attachToListView(getListView());
}
- @Override
- public void onListItemClick(ListView l, View v, int position, long id) {
- super.onListItemClick(l, v, position, id);
- position -= l.getHeaderViewsCount();
- long[] ids = FeedItemUtil.getIds(items);
- ((MainActivity) getActivity()).loadChildFragment(ItemFragment.newInstance(ids, position));
- }
-
- private void onFragmentLoaded() {
- if (listAdapter == null) {
- listAdapter = new DownloadedEpisodesListAdapter(getActivity(), itemAccess);
- setListAdapter(listAdapter);
- }
- setListShown(true);
- listAdapter.notifyDataSetChanged();
- getActivity().supportInvalidateOptionsMenu();
- }
-
- @Override
- public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if(!isAdded()) {
- return;
- }
- super.onCreateOptionsMenu(menu, inflater);
- if(items != null) {
- inflater.inflate(R.menu.downloads_completed, menu);
- menu.findItem(R.id.episode_actions).setVisible(items.size() > 0);
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case R.id.episode_actions:
- EpisodesApplyActionFragment fragment = EpisodesApplyActionFragment
- .newInstance(items, EpisodesApplyActionFragment.ACTION_DELETE | EpisodesApplyActionFragment.ACTION_ADD_TO_QUEUE);
- ((MainActivity) getActivity()).loadChildFragment(fragment);
- return true;
- default:
- return false;
- }
+ private void addVerticalPadding() {
+ final ListView lv = getListView();
+ lv.setClipToPadding(false);
+ final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding);
+ lv.setPadding(0, vertPadding, 0, vertPadding);
}
private final DownloadedEpisodesListAdapter.ItemAccess itemAccess = new DownloadedEpisodesListAdapter.ItemAccess() {
@Override
public int getCount() {
- return (items != null) ? items.size() : 0;
+ return items.size();
}
@Override
public FeedItem getItem(int position) {
- if (items != null && 0 <= position && position < items.size()) {
+ if (0 <= position && position < items.size()) {
return items.get(position);
} else {
return null;
@@ -174,7 +131,7 @@ public class CompletedDownloadsFragment extends ListFragment {
@Override
public void onFeedItemSecondaryAction(FeedItem item) {
- DBWriter.deleteFeedMediaOfItem(getActivity(), item.getMedia().getId());
+ DBWriter.deleteFeedMediaOfItem(requireActivity(), item.getMedia().getId());
}
};
@@ -191,18 +148,18 @@ public class CompletedDownloadsFragment extends ListFragment {
if (disposable != null) {
disposable.dispose();
}
- if (items == null && viewCreated) {
- setListShown(false);
- }
disposable = Observable.fromCallable(DBReader::getDownloadedItems)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(result -> {
items = result;
- if (viewCreated && getActivity() != null) {
- onFragmentLoaded();
- }
- }, error -> Log.e(TAG, Log.getStackTraceString(error)));
+ onItemsLoaded();
+ }, error -> Log.e(TAG, Log.getStackTraceString(error)));
}
+ private void onItemsLoaded() {
+ setListShown(true);
+ listAdapter.notifyDataSetChanged();
+ requireActivity().invalidateOptionsMenu();
+ }
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java
index 973772049..26b115b4b 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java
@@ -14,6 +14,7 @@ import android.view.View;
import android.widget.ListView;
import android.widget.TextView;
+import java.util.ArrayList;
import java.util.List;
import de.danoeh.antennapod.R;
@@ -37,18 +38,13 @@ public class DownloadLogFragment extends ListFragment {
private static final String TAG = "DownloadLogFragment";
- private List<DownloadStatus> downloadLog;
+ private List<DownloadStatus> downloadLog = new ArrayList<>();
private DownloadLogAdapter adapter;
-
- private boolean viewsCreated = false;
- private boolean itemsLoaded = false;
-
private Disposable disposable;
@Override
public void onStart() {
super.onStart();
- setHasOptionsMenu(true);
EventDistributor.getInstance().register(contentUpdate);
loadItems();
}
@@ -57,7 +53,7 @@ public class DownloadLogFragment extends ListFragment {
public void onStop() {
super.onStop();
EventDistributor.getInstance().unregister(contentUpdate);
- if(disposable != null) {
+ if (disposable != null) {
disposable.dispose();
}
}
@@ -65,6 +61,7 @@ public class DownloadLogFragment extends ListFragment {
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
+ setHasOptionsMenu(true);
// add padding
final ListView lv = getListView();
@@ -72,23 +69,17 @@ public class DownloadLogFragment extends ListFragment {
final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding);
lv.setPadding(0, vertPadding, 0, vertPadding);
- viewsCreated = true;
- if (itemsLoaded) {
- onFragmentLoaded();
- }
-
EmptyViewHandler emptyView = new EmptyViewHandler(getActivity());
+ emptyView.setIcon(R.attr.av_download);
emptyView.setTitle(R.string.no_log_downloads_head_label);
emptyView.setMessage(R.string.no_log_downloads_label);
emptyView.attachToListView(getListView());
+ adapter = new DownloadLogAdapter(getActivity(), itemAccess);
+ setListAdapter(adapter);
}
private void onFragmentLoaded() {
- if (adapter == null) {
- adapter = new DownloadLogAdapter(getActivity(), itemAccess);
- setListAdapter(adapter);
- }
setListShown(true);
adapter.notifyDataSetChanged();
getActivity().supportInvalidateOptionsMenu();
@@ -129,12 +120,12 @@ public class DownloadLogFragment extends ListFragment {
@Override
public int getCount() {
- return (downloadLog != null) ? downloadLog.size() : 0;
+ return downloadLog.size();
}
@Override
public DownloadStatus getItem(int position) {
- if (downloadLog != null && 0 <= position && position < downloadLog.size()) {
+ if (0 <= position && position < downloadLog.size()) {
return downloadLog.get(position);
} else {
return null;
@@ -154,27 +145,23 @@ public class DownloadLogFragment extends ListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if(!isAdded()) {
+ if (!isAdded()) {
return;
}
super.onCreateOptionsMenu(menu, inflater);
- if (itemsLoaded) {
- MenuItem clearHistory = menu.add(Menu.NONE, R.id.clear_history_item, Menu.CATEGORY_CONTAINER, R.string.clear_history_label);
- MenuItemCompat.setShowAsAction(clearHistory, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
- TypedArray drawables = getActivity().obtainStyledAttributes(new int[]{R.attr.content_discard});
- clearHistory.setIcon(drawables.getDrawable(0));
- drawables.recycle();
- }
+ MenuItem clearHistory = menu.add(Menu.NONE, R.id.clear_history_item, Menu.CATEGORY_CONTAINER, R.string.clear_history_label);
+ MenuItemCompat.setShowAsAction(clearHistory, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
+ TypedArray drawables = getActivity().obtainStyledAttributes(new int[]{R.attr.content_discard});
+ clearHistory.setIcon(drawables.getDrawable(0));
+ drawables.recycle();
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
- if (itemsLoaded) {
- MenuItem menuItem = menu.findItem(R.id.clear_history_item);
- if(menuItem != null) {
- menuItem.setVisible(downloadLog != null && !downloadLog.isEmpty());
- }
+ MenuItem menuItem = menu.findItem(R.id.clear_history_item);
+ if (menuItem != null) {
+ menuItem.setVisible(!downloadLog.isEmpty());
}
}
@@ -194,7 +181,7 @@ public class DownloadLogFragment extends ListFragment {
}
private void loadItems() {
- if(disposable != null) {
+ if (disposable != null) {
disposable.dispose();
}
disposable = Observable.fromCallable(DBReader::getDownloadLog)
@@ -203,12 +190,8 @@ public class DownloadLogFragment extends ListFragment {
.subscribe(result -> {
if (result != null) {
downloadLog = result;
- itemsLoaded = true;
- if (viewsCreated) {
- onFragmentLoaded();
- }
+ onFragmentLoaded();
}
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
}
-
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java
index d362d5c0b..bb029b731 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FavoriteEpisodesFragment.java
@@ -1,6 +1,7 @@
package de.danoeh.antennapod.fragment;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.design.widget.Snackbar;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
@@ -8,7 +9,8 @@ import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.TextView;
+
+import org.greenrobot.eventbus.Subscribe;
import java.util.List;
@@ -18,42 +20,37 @@ import de.danoeh.antennapod.core.event.FavoritesEvent;
import de.danoeh.antennapod.core.feed.FeedItem;
import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBWriter;
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
-
/**
* Like 'EpisodesFragment' except that it only shows favorite episodes and
* supports swiping to remove from favorites.
*/
-
public class FavoriteEpisodesFragment extends AllEpisodesFragment {
private static final String TAG = "FavoriteEpisodesFrag";
-
private static final String PREF_NAME = "PrefFavoriteEpisodesFragment";
@Override
- protected boolean showOnlyNewEpisodes() { return true; }
+ protected boolean showOnlyNewEpisodes() {
+ return true;
+ }
@Override
- protected String getPrefName() { return PREF_NAME; }
+ protected String getPrefName() {
+ return PREF_NAME;
+ }
@Subscribe
public void onEvent(FavoritesEvent event) {
- Log.d(TAG, "onEvent() called with: " + "event = [" + event + "]");
+ Log.d(TAG, String.format("onEvent() called with: event = [%s]", event));
loadItems();
}
+ @NonNull
@Override
- protected void resetViewState() {
- super.resetViewState();
- }
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View root = super.onCreateViewHelper(inflater, container, savedInstanceState,
- R.layout.all_episodes_fragment);
+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View root = super.onCreateView(inflater, container, savedInstanceState);
+ emptyView.setIcon(R.attr.ic_unfav);
emptyView.setTitle(R.string.no_fav_episodes_head_label);
emptyView.setMessage(R.string.no_fav_episodes_label);
@@ -65,8 +62,8 @@ public class FavoriteEpisodesFragment extends AllEpisodesFragment {
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) {
- AllEpisodesRecycleAdapter.Holder holder = (AllEpisodesRecycleAdapter.Holder)viewHolder;
- Log.d(TAG, "remove(" + holder.getItemId() + ")");
+ AllEpisodesRecycleAdapter.Holder holder = (AllEpisodesRecycleAdapter.Holder) viewHolder;
+ Log.d(TAG, String.format("remove(%s)", holder.getItemId()));
if (disposable != null) {
disposable.dispose();
@@ -75,8 +72,7 @@ public class FavoriteEpisodesFragment extends AllEpisodesFragment {
if (item != null) {
DBWriter.removeFavoriteItem(item);
- Snackbar snackbar = Snackbar.make(root, getString(R.string.removed_item),
- Snackbar.LENGTH_LONG);
+ Snackbar snackbar = Snackbar.make(root, getString(R.string.removed_item), Snackbar.LENGTH_LONG);
snackbar.setAction(getString(R.string.undo), v -> DBWriter.addFavoriteItem(item));
snackbar.show();
}
@@ -88,6 +84,7 @@ public class FavoriteEpisodesFragment extends AllEpisodesFragment {
return root;
}
+ @NonNull
@Override
protected List<FeedItem> loadData() {
return DBReader.getFavoriteItemsList();
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java
index dadc596e2..9c16cfe56 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java
@@ -16,24 +16,16 @@ import android.widget.Button;
import android.widget.GridView;
import android.widget.ProgressBar;
import android.widget.TextView;
-
-import java.util.ArrayList;
-import java.util.List;
-
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
import de.danoeh.antennapod.adapter.itunes.ItunesAdapter;
-import de.danoeh.antennapod.core.service.download.AntennapodHttpClient;
+import de.danoeh.antennapod.discovery.FyydPodcastSearcher;
+import de.danoeh.antennapod.discovery.PodcastSearchResult;
import de.danoeh.antennapod.menuhandler.MenuItemUtils;
-import de.mfietz.fyydlin.FyydClient;
-import de.mfietz.fyydlin.FyydResponse;
-import de.mfietz.fyydlin.SearchHit;
-import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
-import io.reactivex.schedulers.Schedulers;
-import static de.danoeh.antennapod.adapter.itunes.ItunesAdapter.Podcast;
-import static java.util.Collections.emptyList;
+import java.util.ArrayList;
+import java.util.List;
public class FyydSearchFragment extends Fragment {
@@ -49,12 +41,10 @@ public class FyydSearchFragment extends Fragment {
private Button butRetry;
private TextView txtvEmpty;
- private final FyydClient client = new FyydClient(AntennapodHttpClient.getHttpClient());
-
/**
* List of podcasts retreived from the search
*/
- private List<Podcast> searchResults;
+ private List<PodcastSearchResult> searchResults;
private Disposable disposable;
/**
@@ -81,7 +71,7 @@ public class FyydSearchFragment extends Fragment {
//Show information about the podcast when the list item is clicked
gridView.setOnItemClickListener((parent, view1, position, id) -> {
- Podcast podcast = searchResults.get(position);
+ PodcastSearchResult podcast = searchResults.get(position);
Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, podcast.feedUrl);
intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, podcast.title);
@@ -145,20 +135,26 @@ public class FyydSearchFragment extends Fragment {
disposable.dispose();
}
showOnlyProgressBar();
- disposable = client.searchPodcasts(query, 10)
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(result -> {
- progressBar.setVisibility(View.GONE);
- processSearchResult(result);
- }, error -> {
- Log.e(TAG, Log.getStackTraceString(error));
- progressBar.setVisibility(View.GONE);
- txtvError.setText(error.toString());
- txtvError.setVisibility(View.VISIBLE);
- butRetry.setOnClickListener(v -> search(query));
- butRetry.setVisibility(View.VISIBLE);
- });
+
+ FyydPodcastSearcher searcher = new FyydPodcastSearcher();
+ disposable = searcher.search(query).subscribe(result -> {
+ searchResults = result;
+ progressBar.setVisibility(View.GONE);
+
+ adapter.clear();
+ adapter.addAll(searchResults);
+ adapter.notifyDataSetInvalidated();
+ gridView.setVisibility(!searchResults.isEmpty() ? View.VISIBLE : View.GONE);
+ txtvEmpty.setVisibility(searchResults.isEmpty() ? View.VISIBLE : View.GONE);
+
+ }, error -> {
+ Log.e(TAG, Log.getStackTraceString(error));
+ progressBar.setVisibility(View.GONE);
+ txtvError.setText(error.toString());
+ txtvError.setVisibility(View.VISIBLE);
+ butRetry.setOnClickListener(v -> search(query));
+ butRetry.setVisibility(View.VISIBLE);
+ });
}
private void showOnlyProgressBar() {
@@ -168,25 +164,4 @@ public class FyydSearchFragment extends Fragment {
txtvEmpty.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
}
-
- private void processSearchResult(FyydResponse response) {
- adapter.clear();
- if (!response.getData().isEmpty()) {
- adapter.clear();
- searchResults = new ArrayList<>();
- for (SearchHit searchHit : response.getData()) {
- Podcast podcast = Podcast.fromSearch(searchHit);
- searchResults.add(podcast);
- }
- } else {
- searchResults = emptyList();
- }
- for(Podcast podcast : searchResults) {
- adapter.add(podcast);
- }
- adapter.notifyDataSetInvalidated();
- gridView.setVisibility(!searchResults.isEmpty() ? View.VISIBLE : View.GONE);
- txtvEmpty.setVisibility(searchResults.isEmpty() ? View.VISIBLE : View.GONE);
- }
-
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java
index a2472b071..432ada44e 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java
@@ -36,6 +36,9 @@ import com.joanzapata.iconify.Iconify;
import com.joanzapata.iconify.widget.IconButton;
import org.apache.commons.lang3.ArrayUtils;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
@@ -71,9 +74,6 @@ import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
/**
* Displays information about a FeedItem and actions.
@@ -266,7 +266,6 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
- load();
}
@Override
@@ -274,6 +273,7 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
super.onStart();
EventDistributor.getInstance().register(contentUpdate);
EventBus.getDefault().register(this);
+ load();
}
@Override
@@ -306,19 +306,20 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
@Override
public boolean onSwipeLeftToRight() {
- Log.d(TAG, "onSwipeLeftToRight()");
- feedItemPos = feedItemPos - 1;
- if(feedItemPos < 0) {
- feedItemPos = feedItems.length - 1;
- }
- load();
- return true;
+ return swipeFeedItem(-1);
}
@Override
public boolean onSwipeRightToLeft() {
- Log.d(TAG, "onSwipeRightToLeft()");
- feedItemPos = (feedItemPos + 1) % feedItems.length;
+ return swipeFeedItem(+1);
+ }
+
+ private boolean swipeFeedItem(int position) {
+ Log.d(TAG, String.format("onSwipe() shift: %s", position));
+ feedItemPos = (feedItemPos + position) % feedItems.length;
+ if (feedItemPos < 0) {
+ feedItemPos = feedItems.length - 1;
+ }
load();
return true;
}
@@ -602,8 +603,9 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
@Nullable
private FeedItem loadInBackground() {
FeedItem feedItem = DBReader.getFeedItem(feedItems[feedItemPos]);
- if (feedItem != null) {
- Timeline t = new Timeline(getContext(), feedItem);
+ Context context = getContext();
+ if (feedItem != null && context != null) {
+ Timeline t = new Timeline(context, feedItem);
webviewData = t.processShownotes(false);
}
return feedItem;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java
index 6a04758b9..0c75af986 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java
@@ -30,6 +30,9 @@ import com.joanzapata.iconify.Iconify;
import com.joanzapata.iconify.widget.IconTextView;
import org.apache.commons.lang3.Validate;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
import java.util.List;
@@ -71,9 +74,6 @@ import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
/**
* Displays a list of FeedItems.
@@ -96,8 +96,6 @@ public class ItemlistFragment extends ListFragment {
private long feedID;
private Feed feed;
- private boolean itemsLoaded = false;
- private boolean viewsCreated = false;
private boolean headerCreated = false;
private List<Downloader> downloaderList;
@@ -105,7 +103,7 @@ public class ItemlistFragment extends ListFragment {
private MoreContentListFooterUtil listFooter;
private boolean isUpdatingFeed;
-
+
private TextView txtvTitle;
private IconTextView txtvFailure;
private ImageView imgvBackground;
@@ -146,9 +144,7 @@ public class ItemlistFragment extends ListFragment {
super.onStart();
EventDistributor.getInstance().register(contentUpdate);
EventBus.getDefault().register(this);
- if (viewsCreated && itemsLoaded) {
- onFragmentLoaded();
- }
+ loadItems();
}
@Override
@@ -156,7 +152,6 @@ public class ItemlistFragment extends ListFragment {
super.onResume();
((MainActivity)getActivity()).getSupportActionBar().setTitle("");
updateProgressBarVisibility();
- loadItems();
}
@Override
@@ -177,7 +172,6 @@ public class ItemlistFragment extends ListFragment {
private void resetViewState() {
adapter = null;
- viewsCreated = false;
listFooter = null;
}
@@ -190,45 +184,43 @@ public class ItemlistFragment extends ListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if(!isAdded()) {
+ if (!isAdded()) {
return;
}
super.onCreateOptionsMenu(menu, inflater);
- if (itemsLoaded) {
- FeedMenuHandler.onCreateOptionsMenu(inflater, menu);
-
- MenuItem searchItem = menu.findItem(R.id.action_search);
- final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem);
- MenuItemUtils.adjustTextColor(getActivity(), sv);
- sv.setQueryHint(getString(R.string.search_hint));
- sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
- @Override
- public boolean onQueryTextSubmit(String s) {
- sv.clearFocus();
- if (itemsLoaded) {
- ((MainActivity) getActivity()).loadChildFragment(SearchFragment.newInstance(s, feed.getId()));
- }
- return true;
- }
+ FeedMenuHandler.onCreateOptionsMenu(inflater, menu);
- @Override
- public boolean onQueryTextChange(String s) {
- return false;
+ MenuItem searchItem = menu.findItem(R.id.action_search);
+ final SearchView sv = (SearchView) MenuItemCompat.getActionView(searchItem);
+ MenuItemUtils.adjustTextColor(getActivity(), sv);
+ sv.setQueryHint(getString(R.string.search_hint));
+ sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String s) {
+ sv.clearFocus();
+ if (feed != null) {
+ ((MainActivity) getActivity()).loadChildFragment(SearchFragment.newInstance(s, feed.getId()));
}
- });
- if(feed == null || feed.getLink() == null) {
- menu.findItem(R.id.share_link_item).setVisible(false);
- menu.findItem(R.id.visit_website_item).setVisible(false);
+ return true;
}
- isUpdatingFeed = MenuItemUtils.updateRefreshMenuItem(menu, R.id.refresh_item, updateRefreshMenuItemChecker);
+ @Override
+ public boolean onQueryTextChange(String s) {
+ return false;
+ }
+ });
+ if (feed == null || feed.getLink() == null) {
+ menu.findItem(R.id.share_link_item).setVisible(false);
+ menu.findItem(R.id.visit_website_item).setVisible(false);
}
+
+ isUpdatingFeed = MenuItemUtils.updateRefreshMenuItem(menu, R.id.refresh_item, updateRefreshMenuItemChecker);
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
- if (itemsLoaded) {
+ if (feed != null) {
FeedMenuHandler.onPrepareOptionsMenu(menu, feed);
}
}
@@ -341,11 +333,6 @@ public class ItemlistFragment extends ListFragment {
super.onViewCreated(view, savedInstanceState);
registerForContextMenu(getListView());
-
- viewsCreated = true;
- if (itemsLoaded) {
- onFragmentLoaded();
- }
}
@Override
@@ -503,7 +490,7 @@ public class ItemlistFragment extends ListFragment {
butShowInfo.setOnClickListener(v -> showFeedInfo());
imgvCover.setOnClickListener(v -> showFeedInfo());
butShowSettings.setOnClickListener(v -> {
- if (viewsCreated && itemsLoaded) {
+ if (feed != null) {
Intent startIntent = new Intent(getActivity(), FeedSettingsActivity.class);
startIntent.putExtra(FeedSettingsActivity.EXTRA_FEED_ID,
feed.getId());
@@ -514,7 +501,7 @@ public class ItemlistFragment extends ListFragment {
}
private void showFeedInfo() {
- if (viewsCreated && itemsLoaded) {
+ if (feed != null) {
Intent startIntent = new Intent(getActivity(), FeedInfoActivity.class);
startIntent.putExtra(FeedInfoActivity.EXTRA_FEED_ID,
feed.getId());
@@ -624,10 +611,7 @@ public class ItemlistFragment extends ListFragment {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(result -> {
feed = result.orElse(null);
- itemsLoaded = true;
- if (viewsCreated) {
- onFragmentLoaded();
- }
+ onFragmentLoaded();
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java
index a9f56d317..80767bef2 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java
@@ -20,13 +20,14 @@ import android.widget.TextView;
import com.afollestad.materialdialogs.MaterialDialog;
+import de.danoeh.antennapod.discovery.ItunesPodcastSearcher;
+import de.danoeh.antennapod.discovery.ItunesTopListLoader;
+import de.danoeh.antennapod.discovery.PodcastSearchResult;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
@@ -46,15 +47,11 @@ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
-import static de.danoeh.antennapod.adapter.itunes.ItunesAdapter.Podcast;
-
//Searches iTunes store for given string and displays results in a list
public class ItunesSearchFragment extends Fragment {
private static final String TAG = "ItunesSearchFragment";
- private static final String API_URL = "https://itunes.apple.com/search?media=podcast&term=%s";
-
/**
* Adapter responsible with the search results
@@ -69,21 +66,21 @@ public class ItunesSearchFragment extends Fragment {
/**
* List of podcasts retreived from the search
*/
- private List<Podcast> searchResults;
- private List<Podcast> topList;
+ private List<PodcastSearchResult> searchResults;
+ private List<PodcastSearchResult> topList;
private Disposable disposable;
/**
* Replace adapter data with provided search results from SearchTask.
* @param result List of Podcast objects containing search results
*/
- private void updateData(List<Podcast> result) {
+ private void updateData(List<PodcastSearchResult> result) {
this.searchResults = result;
adapter.clear();
if (result != null && result.size() > 0) {
gridView.setVisibility(View.VISIBLE);
txtvEmpty.setVisibility(View.GONE);
- for (Podcast p : result) {
+ for (PodcastSearchResult p : result) {
adapter.add(p);
}
adapter.notifyDataSetInvalidated();
@@ -117,61 +114,31 @@ public class ItunesSearchFragment extends Fragment {
//Show information about the podcast when the list item is clicked
gridView.setOnItemClickListener((parent, view1, position, id) -> {
- Podcast podcast = searchResults.get(position);
- if(podcast.feedUrl == null) {
+ PodcastSearchResult podcast = searchResults.get(position);
+ if (podcast.feedUrl == null) {
return;
}
- if (!podcast.feedUrl.contains("itunes.apple.com")) {
- Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
- intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, podcast.feedUrl);
- intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, "iTunes");
- startActivity(intent);
- } else {
- gridView.setVisibility(View.GONE);
- progressBar.setVisibility(View.VISIBLE);
- disposable = Single.create((SingleOnSubscribe<String>) emitter -> {
- OkHttpClient client = AntennapodHttpClient.getHttpClient();
- Request.Builder httpReq = new Request.Builder()
- .url(podcast.feedUrl)
- .header("User-Agent", ClientConfig.USER_AGENT);
- try {
- Response response = client.newCall(httpReq.build()).execute();
- if (response.isSuccessful()) {
- String resultString = response.body().string();
- JSONObject result = new JSONObject(resultString);
- JSONObject results = result.getJSONArray("results").getJSONObject(0);
- String feedUrl = results.getString("feedUrl");
- emitter.onSuccess(feedUrl);
- } else {
- String prefix = getString(R.string.error_msg_prefix);
- emitter.onError(new IOException(prefix + response));
- }
- } catch (IOException | JSONException e) {
- if (!disposable.isDisposed()) {
- emitter.onError(e);
- }
- }
- })
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(feedUrl -> {
- progressBar.setVisibility(View.GONE);
- gridView.setVisibility(View.VISIBLE);
- Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
- intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, feedUrl);
- intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, "iTunes");
- startActivity(intent);
- }, error -> {
- Log.e(TAG, Log.getStackTraceString(error));
- progressBar.setVisibility(View.GONE);
- gridView.setVisibility(View.VISIBLE);
- String prefix = getString(R.string.error_msg_prefix);
- new MaterialDialog.Builder(getActivity())
- .content(prefix + " " + error.getMessage())
- .neutralText(android.R.string.ok)
- .show();
- });
- }
+ gridView.setVisibility(View.GONE);
+ progressBar.setVisibility(View.VISIBLE);
+ ItunesTopListLoader loader = new ItunesTopListLoader(getContext());
+ disposable = loader.getFeedUrl(podcast)
+ .subscribe(feedUrl -> {
+ progressBar.setVisibility(View.GONE);
+ gridView.setVisibility(View.VISIBLE);
+ Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
+ intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, feedUrl);
+ intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, "iTunes");
+ startActivity(intent);
+ }, error -> {
+ Log.e(TAG, Log.getStackTraceString(error));
+ progressBar.setVisibility(View.GONE);
+ gridView.setVisibility(View.VISIBLE);
+ String prefix = getString(R.string.error_msg_prefix);
+ new MaterialDialog.Builder(getActivity())
+ .content(prefix + " " + error.getMessage())
+ .neutralText(android.R.string.ok)
+ .show();
+ });
});
progressBar = root.findViewById(R.id.progressBar);
txtvError = root.findViewById(R.id.txtvError);
@@ -239,26 +206,9 @@ public class ItunesSearchFragment extends Fragment {
butRetry.setVisibility(View.GONE);
txtvEmpty.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
- disposable = Single.create((SingleOnSubscribe<List<Podcast>>) emitter -> {
- String lang = Locale.getDefault().getLanguage();
- OkHttpClient client = AntennapodHttpClient.getHttpClient();
- String feedString;
- try {
- try {
- feedString = getTopListFeed(client, lang);
- } catch (IOException e) {
- feedString = getTopListFeed(client, "us");
- }
- List<Podcast> podcasts = parseFeed(feedString);
- emitter.onSuccess(podcasts);
- } catch (IOException | JSONException e) {
- if (!disposable.isDisposed()) {
- emitter.onError(e);
- }
- }
- })
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
+
+ ItunesTopListLoader loader = new ItunesTopListLoader(getContext());
+ disposable = loader.loadToplist(25)
.subscribe(podcasts -> {
progressBar.setVisibility(View.GONE);
topList = podcasts;
@@ -273,35 +223,6 @@ public class ItunesSearchFragment extends Fragment {
});
}
- private String getTopListFeed(OkHttpClient client, String language) throws IOException {
- String url = "https://itunes.apple.com/%s/rss/toppodcasts/limit=25/explicit=true/json";
- Request.Builder httpReq = new Request.Builder()
- .header("User-Agent", ClientConfig.USER_AGENT)
- .url(String.format(url, language));
-
- try (Response response = client.newCall(httpReq.build()).execute()) {
- if (response.isSuccessful()) {
- return response.body().string();
- }
- String prefix = getString(R.string.error_msg_prefix);
- throw new IOException(prefix + response);
- }
- }
-
- private List<Podcast> parseFeed(String jsonString) throws JSONException {
- JSONObject result = new JSONObject(jsonString);
- JSONObject feed = result.getJSONObject("feed");
- JSONArray entries = feed.getJSONArray("entry");
-
- List<Podcast> results = new ArrayList<>();
- for (int i=0; i < entries.length(); i++) {
- JSONObject json = entries.getJSONObject(i);
- results.add(Podcast.fromToplist(json));
- }
-
- return results;
- }
-
private void search(String query) {
if (disposable != null) {
disposable.dispose();
@@ -311,60 +232,19 @@ public class ItunesSearchFragment extends Fragment {
butRetry.setVisibility(View.GONE);
txtvEmpty.setVisibility(View.GONE);
progressBar.setVisibility(View.VISIBLE);
- disposable = Single.create((SingleOnSubscribe<List<Podcast>>) subscriber -> {
- String encodedQuery = null;
- try {
- encodedQuery = URLEncoder.encode(query, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- // this won't ever be thrown
- }
- if (encodedQuery == null) {
- encodedQuery = query; // failsafe
- }
-
- String formattedUrl = String.format(API_URL, encodedQuery);
-
- OkHttpClient client = AntennapodHttpClient.getHttpClient();
- Request.Builder httpReq = new Request.Builder()
- .url(formattedUrl)
- .header("User-Agent", ClientConfig.USER_AGENT);
- List<Podcast> podcasts = new ArrayList<>();
- try {
- Response response = client.newCall(httpReq.build()).execute();
-
- if(response.isSuccessful()) {
- String resultString = response.body().string();
- JSONObject result = new JSONObject(resultString);
- JSONArray j = result.getJSONArray("results");
- for (int i = 0; i < j.length(); i++) {
- JSONObject podcastJson = j.getJSONObject(i);
- Podcast podcast = Podcast.fromSearch(podcastJson);
- podcasts.add(podcast);
- }
- }
- else {
- String prefix = getString(R.string.error_msg_prefix);
- subscriber.onError(new IOException(prefix + response));
- }
- } catch (IOException | JSONException e) {
- subscriber.onError(e);
- }
- subscriber.onSuccess(podcasts);
- })
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(podcasts -> {
- progressBar.setVisibility(View.GONE);
- updateData(podcasts);
- }, error -> {
- Log.e(TAG, Log.getStackTraceString(error));
- progressBar.setVisibility(View.GONE);
- txtvError.setText(error.toString());
- txtvError.setVisibility(View.VISIBLE);
- butRetry.setOnClickListener(v -> search(query));
- butRetry.setVisibility(View.VISIBLE);
- });
+ ItunesPodcastSearcher searcher = new ItunesPodcastSearcher(getContext());
+ disposable = searcher.search(query).subscribe(podcasts -> {
+ progressBar.setVisibility(View.GONE);
+ updateData(podcasts);
+ }, error -> {
+ Log.e(TAG, Log.getStackTraceString(error));
+ progressBar.setVisibility(View.GONE);
+ txtvError.setText(error.toString());
+ txtvError.setVisibility(View.VISIBLE);
+ butRetry.setOnClickListener(v -> search(query));
+ butRetry.setVisibility(View.VISIBLE);
+ });
}
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java
index 5751855c7..1bf907aee 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/NewEpisodesFragment.java
@@ -1,40 +1,37 @@
package de.danoeh.antennapod.fragment;
import android.os.Bundle;
+import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.helper.ItemTouchHelper;
-import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
-import android.widget.TextView;
+
import java.util.List;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.adapter.AllEpisodesRecycleAdapter;
-import de.danoeh.antennapod.core.event.FeedItemEvent;
import de.danoeh.antennapod.core.feed.FeedItem;
import de.danoeh.antennapod.core.storage.DBReader;
-import de.danoeh.antennapod.core.util.FeedItemUtil;
-
/**
* Like 'EpisodesFragment' except that it only shows new episodes and
* supports swiping to mark as read.
*/
-
public class NewEpisodesFragment extends AllEpisodesFragment {
public static final String TAG = "NewEpisodesFragment";
private static final String PREF_NAME = "PrefNewEpisodesFragment";
- @Override
- protected boolean showOnlyNewEpisodes() { return true; }
@Override
- protected String getPrefName() { return PREF_NAME; }
+ protected boolean showOnlyNewEpisodes() {
+ return true;
+ }
@Override
- protected void resetViewState() {
- super.resetViewState();
+ protected String getPrefName() {
+ return PREF_NAME;
}
@Override
@@ -42,10 +39,10 @@ public class NewEpisodesFragment extends AllEpisodesFragment {
return item.isNew();
}
+ @NonNull
@Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View root = super.onCreateViewHelper(inflater, container, savedInstanceState,
- R.layout.all_episodes_fragment);
+ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ View root = super.onCreateView(inflater, container, savedInstanceState);
emptyView.setTitle(R.string.no_new_episodes_head_label);
emptyView.setMessage(R.string.no_new_episodes_label);
@@ -57,8 +54,8 @@ public class NewEpisodesFragment extends AllEpisodesFragment {
@Override
public void onSwiped(RecyclerView.ViewHolder viewHolder, int swipeDir) {
- AllEpisodesRecycleAdapter.Holder holder = (AllEpisodesRecycleAdapter.Holder)viewHolder;
- markItemAsSeenWithUndo(holder.getFeedItem());
+ AllEpisodesRecycleAdapter.Holder holder = (AllEpisodesRecycleAdapter.Holder) viewHolder;
+ removeNewFlagWithUndo(holder.getFeedItem());
}
@Override
@@ -75,6 +72,7 @@ public class NewEpisodesFragment extends AllEpisodesFragment {
super.onSelectedChanged(viewHolder, actionState);
}
+
@Override
public void clearView(RecyclerView recyclerView,
RecyclerView.ViewHolder viewHolder) {
@@ -94,9 +92,9 @@ public class NewEpisodesFragment extends AllEpisodesFragment {
return root;
}
+ @NonNull
@Override
protected List<FeedItem> loadData() {
return DBReader.getNewItemsList();
}
-
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
index da11383a5..e2060481f 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java
@@ -1,6 +1,5 @@
package de.danoeh.antennapod.fragment;
-import android.content.Context;
import android.content.res.TypedArray;
import android.os.Bundle;
import android.support.annotation.NonNull;
@@ -13,6 +12,10 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+import org.greenrobot.eventbus.ThreadMode;
+
import java.util.List;
import de.danoeh.antennapod.R;
@@ -34,9 +37,6 @@ import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
-import org.greenrobot.eventbus.ThreadMode;
public class PlaybackHistoryFragment extends ListFragment {
@@ -47,23 +47,10 @@ public class PlaybackHistoryFragment extends ListFragment {
private List<FeedItem> playbackHistory;
private FeedItemlistAdapter adapter;
-
- private boolean itemsLoaded = false;
- private boolean viewsCreated = false;
-
private List<Downloader> downloaderList;
-
private Disposable disposable;
@Override
- public void onAttach(Context context) {
- super.onAttach(context);
- if (viewsCreated && itemsLoaded) {
- onFragmentLoaded();
- }
- }
-
- @Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
@@ -80,16 +67,17 @@ public class PlaybackHistoryFragment extends ListFragment {
final int vertPadding = getResources().getDimensionPixelSize(R.dimen.list_vertical_padding);
lv.setPadding(0, vertPadding, 0, vertPadding);
- viewsCreated = true;
- if (itemsLoaded) {
- onFragmentLoaded();
- }
-
EmptyViewHandler emptyView = new EmptyViewHandler(getActivity());
+ emptyView.setIcon(R.attr.ic_history);
emptyView.setTitle(R.string.no_history_head_label);
emptyView.setMessage(R.string.no_history_label);
emptyView.attachToListView(getListView());
+ // played items shoudln't be transparent for this fragment since, *all* items
+ // in this fragment will, by definition, be played. So it serves no purpose and can make
+ // it harder to read.
+ adapter = new FeedItemlistAdapter(getActivity(), itemAccess, true, false);
+ setListAdapter(adapter);
}
@Override
@@ -105,34 +93,17 @@ public class PlaybackHistoryFragment extends ListFragment {
super.onStop();
EventBus.getDefault().unregister(this);
EventDistributor.getInstance().unregister(contentUpdate);
- if(disposable != null) {
- disposable.dispose();
- }
- }
-
- @Override
- public void onDetach() {
- super.onDetach();
- if(disposable != null) {
+ if (disposable != null) {
disposable.dispose();
}
}
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- adapter = null;
- viewsCreated = false;
- }
-
@Subscribe(sticky = true)
public void onEvent(DownloadEvent event) {
Log.d(TAG, "onEvent() called with: " + "event = [" + event + "]");
DownloaderUpdate update = event.update;
downloaderList = update.downloaders;
- if (adapter != null) {
- adapter.notifyDataSetChanged();
- }
+ adapter.notifyDataSetChanged();
}
@Override
@@ -145,27 +116,23 @@ public class PlaybackHistoryFragment extends ListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
- if(!isAdded()) {
+ if (!isAdded()) {
return;
}
super.onCreateOptionsMenu(menu, inflater);
- if (itemsLoaded) {
- MenuItem clearHistory = menu.add(Menu.NONE, R.id.clear_history_item, Menu.CATEGORY_CONTAINER, R.string.clear_history_label);
- MenuItemCompat.setShowAsAction(clearHistory, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
- TypedArray drawables = getActivity().obtainStyledAttributes(new int[]{R.attr.content_discard});
- clearHistory.setIcon(drawables.getDrawable(0));
- drawables.recycle();
- }
+ MenuItem clearHistory = menu.add(Menu.NONE, R.id.clear_history_item, Menu.CATEGORY_CONTAINER, R.string.clear_history_label);
+ MenuItemCompat.setShowAsAction(clearHistory, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
+ TypedArray drawables = getActivity().obtainStyledAttributes(new int[]{R.attr.content_discard});
+ clearHistory.setIcon(drawables.getDrawable(0));
+ drawables.recycle();
}
@Override
public void onPrepareOptionsMenu(Menu menu) {
super.onPrepareOptionsMenu(menu);
- if (itemsLoaded) {
- MenuItem menuItem = menu.findItem(R.id.clear_history_item);
- if (menuItem != null) {
- menuItem.setVisible(playbackHistory != null && !playbackHistory.isEmpty());
- }
+ MenuItem menuItem = menu.findItem(R.id.clear_history_item);
+ if (menuItem != null) {
+ menuItem.setVisible(playbackHistory != null && !playbackHistory.isEmpty());
}
}
@@ -211,14 +178,6 @@ public class PlaybackHistoryFragment extends ListFragment {
};
private void onFragmentLoaded() {
- if (adapter == null) {
- // played items shoudln't be transparent for this fragment since, *all* items
- // in this fragment will, by definition, be played. So it serves no purpose and can make
- // it harder to read.
- adapter = new FeedItemlistAdapter(getActivity(), itemAccess, true, false);
- setListAdapter(adapter);
- }
- setListShown(true);
adapter.notifyDataSetChanged();
getActivity().supportInvalidateOptionsMenu();
}
@@ -277,10 +236,7 @@ public class PlaybackHistoryFragment extends ListFragment {
.subscribe(result -> {
if (result != null) {
playbackHistory = result;
- itemsLoaded = true;
- if (viewsCreated) {
- onFragmentLoaded();
- }
+ onFragmentLoaded();
}
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
}
@@ -291,5 +247,4 @@ public class PlaybackHistoryFragment extends ListFragment {
DBReader.loadAdditionalFeedItemListData(history);
return history;
}
-
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
index f3421c8fd..4947d5a87 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
@@ -49,6 +49,7 @@ import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.FeedItemUtil;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.QueueSorter;
+import de.danoeh.antennapod.dialog.EpisodesApplyActionFragment;
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
import de.danoeh.antennapod.menuhandler.MenuItemUtils;
@@ -61,6 +62,9 @@ import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
+import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_DELETE;
+import static de.danoeh.antennapod.dialog.EpisodesApplyActionFragment.ACTION_REMOVE_FROM_QUEUE;
+
/**
* Shows all items in the queue
*/
@@ -323,6 +327,10 @@ public class QueueFragment extends Fragment {
};
conDialog.createNewDialog().show();
return true;
+ case R.id.episode_actions:
+ ((MainActivity) requireActivity()) .loadChildFragment(
+ EpisodesApplyActionFragment.newInstance(queue, ACTION_DELETE | ACTION_REMOVE_FROM_QUEUE));
+ return true;
case R.id.queue_sort_episode_title_asc:
QueueSorter.sort(QueueSorter.Rule.EPISODE_TITLE_ASC, true);
return true;
@@ -518,6 +526,7 @@ public class QueueFragment extends Fragment {
emptyView = new EmptyViewHandler(getContext());
emptyView.attachToRecyclerView(recyclerView);
+ emptyView.setIcon(R.attr.stat_playlist);
emptyView.setTitle(R.string.no_items_header_label);
emptyView.setMessage(R.string.no_items_label);
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java
new file mode 100644
index 000000000..e4213cc6b
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/QuickFeedDiscoveryFragment.java
@@ -0,0 +1,119 @@
+package de.danoeh.antennapod.fragment;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.GridView;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import com.afollestad.materialdialogs.MaterialDialog;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.activity.MainActivity;
+import de.danoeh.antennapod.activity.OnlineFeedViewActivity;
+import de.danoeh.antennapod.adapter.FeedDiscoverAdapter;
+import de.danoeh.antennapod.discovery.ItunesTopListLoader;
+import de.danoeh.antennapod.discovery.PodcastSearchResult;
+import io.reactivex.disposables.Disposable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+public class QuickFeedDiscoveryFragment extends Fragment implements AdapterView.OnItemClickListener {
+ private static final String TAG = "FeedDiscoveryFragment";
+
+ private ProgressBar progressBar;
+ private Disposable disposable;
+ private FeedDiscoverAdapter adapter;
+ private GridView subscriptionGridLayout;
+ private TextView errorTextView;
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
+ super.onCreateView(inflater, container, savedInstanceState);
+ View root = inflater.inflate(R.layout.quick_feed_discovery, container, false);
+ View discoverMore = root.findViewById(R.id.discover_more);
+ discoverMore.setOnClickListener(v ->
+ ((MainActivity) getActivity()).loadChildFragment(new ItunesSearchFragment()));
+
+ subscriptionGridLayout = root.findViewById(R.id.discover_grid);
+ progressBar = root.findViewById(R.id.discover_progress_bar);
+ errorTextView = root.findViewById(R.id.discover_error);
+
+ adapter = new FeedDiscoverAdapter((MainActivity) getActivity());
+ subscriptionGridLayout.setAdapter(adapter);
+ subscriptionGridLayout.setOnItemClickListener(this);
+
+ // Fill with dummy elements to have a fixed height and
+ // prevent the UI elements below from jumping on slow connections
+ List<PodcastSearchResult> dummies = new ArrayList<>();
+ for (int i = 0; i < 8; i++) {
+ dummies.add(PodcastSearchResult.dummy());
+ }
+ adapter.updateData(dummies);
+
+ loadToplist();
+
+ return root;
+ }
+
+ @Override
+ public void onDestroy() {
+ super.onDestroy();
+ if (disposable != null) {
+ disposable.dispose();
+ }
+ }
+
+ private void loadToplist() {
+ progressBar.setVisibility(View.VISIBLE);
+ subscriptionGridLayout.setVisibility(View.INVISIBLE);
+ errorTextView.setVisibility(View.GONE);
+
+ ItunesTopListLoader loader = new ItunesTopListLoader(getContext());
+ disposable = loader.loadToplist(8)
+ .subscribe(podcasts -> {
+ errorTextView.setVisibility(View.GONE);
+ progressBar.setVisibility(View.GONE);
+ subscriptionGridLayout.setVisibility(View.VISIBLE);
+ adapter.updateData(podcasts);
+ }, error -> {
+ Log.e(TAG, Log.getStackTraceString(error));
+ errorTextView.setText(error.getLocalizedMessage());
+ errorTextView.setVisibility(View.VISIBLE);
+ progressBar.setVisibility(View.GONE);
+ subscriptionGridLayout.setVisibility(View.INVISIBLE);
+ });
+ }
+
+ @Override
+ public void onItemClick(AdapterView<?> parent, final View view, int position, long id) {
+ PodcastSearchResult podcast = adapter.getItem(position);
+ if (podcast.feedUrl == null) {
+ return;
+ }
+ view.setAlpha(0.5f);
+ ItunesTopListLoader loader = new ItunesTopListLoader(getContext());
+ disposable = loader.getFeedUrl(podcast)
+ .subscribe(feedUrl -> {
+ view.setAlpha(1f);
+ Intent intent = new Intent(getActivity(), OnlineFeedViewActivity.class);
+ intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, feedUrl);
+ intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, getString(R.string.add_feed_label));
+ startActivity(intent);
+ }, error -> {
+ Log.e(TAG, Log.getStackTraceString(error));
+ view.setAlpha(1f);
+ String prefix = getString(R.string.error_msg_prefix);
+ new MaterialDialog.Builder(getActivity())
+ .content(prefix + " " + error.getMessage())
+ .neutralText(android.R.string.ok)
+ .show();
+ });
+ }
+}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java
index 718502ea2..2a7f7d12b 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/RunningDownloadsFragment.java
@@ -7,6 +7,10 @@ import android.view.View;
import android.widget.ListView;
import android.widget.Toast;
+import org.greenrobot.eventbus.EventBus;
+import org.greenrobot.eventbus.Subscribe;
+
+import java.util.ArrayList;
import java.util.List;
import de.danoeh.antennapod.R;
@@ -21,8 +25,6 @@ import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.storage.DownloadRequester;
import de.danoeh.antennapod.view.EmptyViewHandler;
-import org.greenrobot.eventbus.EventBus;
-import org.greenrobot.eventbus.Subscribe;
/**
* Displays all running downloads and provides actions to cancel them
@@ -32,7 +34,7 @@ public class RunningDownloadsFragment extends ListFragment {
private static final String TAG = "RunningDownloadsFrag";
private DownloadlistAdapter adapter;
- private List<Downloader> downloaderList;
+ private List<Downloader> downloaderList = new ArrayList<>();
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
@@ -48,6 +50,7 @@ public class RunningDownloadsFragment extends ListFragment {
setListAdapter(adapter);
EmptyViewHandler emptyView = new EmptyViewHandler(getActivity());
+ emptyView.setIcon(R.attr.av_download);
emptyView.setTitle(R.string.no_run_downloads_head_label);
emptyView.setMessage(R.string.no_run_downloads_label);
emptyView.attachToListView(getListView());
@@ -70,7 +73,6 @@ public class RunningDownloadsFragment extends ListFragment {
public void onDestroy() {
super.onDestroy();
setListAdapter(null);
- adapter = null;
}
@Subscribe(sticky = true)
@@ -78,21 +80,18 @@ public class RunningDownloadsFragment extends ListFragment {
Log.d(TAG, "onEvent() called with: " + "event = [" + event + "]");
DownloaderUpdate update = event.update;
downloaderList = update.downloaders;
- if (adapter != null) {
- adapter.notifyDataSetChanged();
- }
+ adapter.notifyDataSetChanged();
}
-
private final DownloadlistAdapter.ItemAccess itemAccess = new DownloadlistAdapter.ItemAccess() {
@Override
public int getCount() {
- return (downloaderList != null) ? downloaderList.size() : 0;
+ return downloaderList.size();
}
@Override
public Downloader getItem(int position) {
- if (downloaderList != null && 0 <= position && position < downloaderList.size()) {
+ if (0 <= position && position < downloaderList.size()) {
return downloaderList.get(position);
} else {
return null;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java
index 1d7ac8824..0892bce0a 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/SearchFragment.java
@@ -14,6 +14,7 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
+import java.util.ArrayList;
import java.util.List;
import de.danoeh.antennapod.R;
@@ -40,11 +41,7 @@ public class SearchFragment extends ListFragment {
private static final String ARG_FEED = "feed";
private SearchlistAdapter searchAdapter;
- private List<SearchResult> searchResults;
-
- private boolean viewCreated = false;
- private boolean itemsLoaded = false;
-
+ private List<SearchResult> searchResults = new ArrayList<>();
private Disposable disposable;
/**
@@ -74,13 +71,13 @@ public class SearchFragment extends ListFragment {
super.onCreate(savedInstanceState);
setRetainInstance(true);
setHasOptionsMenu(true);
- search();
}
@Override
public void onStart() {
super.onStart();
EventDistributor.getInstance().register(contentUpdate);
+ search();
}
@Override
@@ -93,21 +90,6 @@ public class SearchFragment extends ListFragment {
}
@Override
- public void onDetach() {
- super.onDetach();
- if(disposable != null) {
- disposable.dispose();
- }
- }
-
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- searchAdapter = null;
- viewCreated = false;
- }
-
- @Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
@@ -118,10 +100,9 @@ public class SearchFragment extends ListFragment {
lv.setPadding(0, vertPadding, 0, vertPadding);
((AppCompatActivity) getActivity()).getSupportActionBar().setTitle(R.string.search_label);
- viewCreated = true;
- if (itemsLoaded) {
- onFragmentLoaded();
- }
+
+ searchAdapter = new SearchlistAdapter(getActivity(), itemAccess);
+ setListAdapter(searchAdapter);
}
@Override
@@ -142,28 +123,26 @@ public class SearchFragment extends ListFragment {
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
- if (itemsLoaded) {
- MenuItem item = menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label);
- MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
- final SearchView sv = new SearchView(getActivity());
- sv.setQueryHint(getString(R.string.search_hint));
- sv.setQuery(getArguments().getString(ARG_QUERY), false);
- sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
- @Override
- public boolean onQueryTextSubmit(String s) {
- getArguments().putString(ARG_QUERY, s);
- itemsLoaded = false;
- search();
- return true;
- }
-
- @Override
- public boolean onQueryTextChange(String s) {
- return false;
- }
- });
- MenuItemCompat.setActionView(item, sv);
- }
+ MenuItem item = menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label);
+ MenuItemCompat.setShowAsAction(item, MenuItemCompat.SHOW_AS_ACTION_IF_ROOM);
+ final SearchView sv = new SearchView(getActivity());
+ sv.setQueryHint(getString(R.string.search_hint));
+ sv.setQuery(getArguments().getString(ARG_QUERY), false);
+ sv.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
+ @Override
+ public boolean onQueryTextSubmit(String s) {
+ sv.clearFocus();
+ getArguments().putString(ARG_QUERY, s);
+ search();
+ return true;
+ }
+
+ @Override
+ public boolean onQueryTextChange(String s) {
+ return false;
+ }
+ });
+ MenuItemCompat.setActionView(item, sv);
}
private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() {
@@ -176,14 +155,9 @@ public class SearchFragment extends ListFragment {
}
};
- private void onFragmentLoaded() {
- if (searchAdapter == null) {
- searchAdapter = new SearchlistAdapter(getActivity(), itemAccess);
- setListAdapter(searchAdapter);
- }
+ private void onSearchResults(List<SearchResult> results) {
+ searchResults = results;
searchAdapter.notifyDataSetChanged();
- setListShown(true);
-
String query = getArguments().getString(ARG_QUERY);
setEmptyText(getString(R.string.no_results_for_query, query));
}
@@ -191,12 +165,12 @@ public class SearchFragment extends ListFragment {
private final SearchlistAdapter.ItemAccess itemAccess = new SearchlistAdapter.ItemAccess() {
@Override
public int getCount() {
- return (searchResults != null) ? searchResults.size() : 0;
+ return searchResults.size();
}
@Override
public SearchResult getItem(int position) {
- if (searchResults != null && 0 <= position && position < searchResults.size()) {
+ if (0 <= position && position < searchResults.size()) {
return searchResults.get(position);
} else {
return null;
@@ -204,24 +178,14 @@ public class SearchFragment extends ListFragment {
}
};
-
private void search() {
if(disposable != null) {
disposable.dispose();
}
- if (viewCreated && !itemsLoaded) {
- setListShown(false);
- }
disposable = Observable.fromCallable(this::performSearch)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
- .subscribe(result -> {
- itemsLoaded = true;
- searchResults = result;
- if (viewCreated) {
- onFragmentLoaded();
- }
- }, error -> Log.e(TAG, Log.getStackTraceString(error)));
+ .subscribe(this::onSearchResults, error -> Log.e(TAG, Log.getStackTraceString(error)));
}
@NonNull
@@ -232,5 +196,4 @@ public class SearchFragment extends ListFragment {
Context context = getActivity();
return FeedSearcher.performSearch(context, query, feed);
}
-
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
index 75da522d1..15c6052a9 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
@@ -1,9 +1,11 @@
package de.danoeh.antennapod.fragment;
+import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
+import android.support.annotation.StringRes;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.ContextMenu;
@@ -16,6 +18,8 @@ import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.GridView;
+import java.util.concurrent.Callable;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MainActivity;
import de.danoeh.antennapod.adapter.SubscriptionsAdapter;
@@ -56,16 +60,13 @@ public class SubscriptionFragment extends Fragment {
private Disposable disposable;
private SharedPreferences prefs;
- public SubscriptionFragment() {
- }
-
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setRetainInstance(true);
setHasOptionsMenu(true);
- prefs = getActivity().getSharedPreferences(PREFS, Context.MODE_PRIVATE);
+ prefs = requireActivity().getSharedPreferences(PREFS, Context.MODE_PRIVATE);
}
@Override
@@ -123,23 +124,25 @@ public class SubscriptionFragment extends Fragment {
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
subscriptionAdapter = new SubscriptionsAdapter((MainActivity)getActivity(), itemAccess);
-
subscriptionGridLayout.setAdapter(subscriptionAdapter);
-
- loadSubscriptions();
-
subscriptionGridLayout.setOnItemClickListener(subscriptionAdapter);
if (getActivity() instanceof MainActivity) {
((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.subscriptions_label);
}
+ }
+ @Override
+ public void onStart() {
+ super.onStart();
EventDistributor.getInstance().register(contentUpdate);
+ loadSubscriptions();
}
@Override
- public void onDestroy() {
- super.onDestroy();
+ public void onStop() {
+ super.onStop();
+ EventDistributor.getInstance().unregister(contentUpdate);
if(disposable != null) {
disposable.dispose();
}
@@ -172,7 +175,7 @@ public class SubscriptionFragment extends Fragment {
Feed feed = (Feed)selectedObject;
- MenuInflater inflater = getActivity().getMenuInflater();
+ MenuInflater inflater = requireActivity().getMenuInflater();
inflater.inflate(R.menu.nav_feed_context, menu);
menu.setHeaderTitle(feed.getTitle());
@@ -182,7 +185,6 @@ public class SubscriptionFragment extends Fragment {
@Override
public boolean onContextItemSelected(MenuItem item) {
-
final int position = mPosition;
mPosition = -1; // reset
if(position < 0) {
@@ -197,84 +199,73 @@ public class SubscriptionFragment extends Fragment {
Feed feed = (Feed)selectedObject;
switch(item.getItemId()) {
- case R.id.mark_all_seen_item:
- ConfirmationDialog markAllSeenConfirmationDialog = new ConfirmationDialog(getActivity(),
- R.string.mark_all_seen_label,
- R.string.mark_all_seen_confirmation_msg) {
-
- @Override
- public void onConfirmButtonPressed(DialogInterface dialog) {
- dialog.dismiss();
-
- Observable.fromCallable(() -> DBWriter.markFeedSeen(feed.getId()))
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(result -> loadSubscriptions(),
- error -> Log.e(TAG, Log.getStackTraceString(error)));
- }
- };
- markAllSeenConfirmationDialog.createNewDialog().show();
+ case R.id.remove_all_new_flags_item:
+ displayConfirmationDialog(
+ R.string.remove_all_new_flags_label,
+ R.string.remove_all_new_flags_confirmation_msg,
+ () -> DBWriter.removeFeedNewFlag(feed.getId()));
return true;
case R.id.mark_all_read_item:
- ConfirmationDialog markAllReadConfirmationDialog = new ConfirmationDialog(getActivity(),
+ displayConfirmationDialog(
R.string.mark_all_read_label,
- R.string.mark_all_read_confirmation_msg) {
-
- @Override
- public void onConfirmButtonPressed(DialogInterface dialog) {
- dialog.dismiss();
- Observable.fromCallable(() -> DBWriter.markFeedRead(feed.getId()))
- .subscribeOn(Schedulers.io())
- .observeOn(AndroidSchedulers.mainThread())
- .subscribe(result -> loadSubscriptions(),
- error -> Log.e(TAG, Log.getStackTraceString(error)));
- }
- };
- markAllReadConfirmationDialog.createNewDialog().show();
+ R.string.mark_all_read_confirmation_msg,
+ () -> DBWriter.markFeedRead(feed.getId()));
return true;
case R.id.rename_item:
new RenameFeedDialog(getActivity(), feed).show();
return true;
case R.id.remove_item:
- final FeedRemover remover = new FeedRemover(getContext(), feed) {
- @Override
- protected void onPostExecute(Void result) {
- super.onPostExecute(result);
- loadSubscriptions();
- }
- };
- ConfirmationDialog conDialog = new ConfirmationDialog(getContext(),
- R.string.remove_feed_label,
- getString(R.string.feed_delete_confirmation_msg, feed.getTitle())) {
- @Override
- public void onConfirmButtonPressed(
- DialogInterface dialog) {
- dialog.dismiss();
- long mediaId = PlaybackPreferences.getCurrentlyPlayingFeedMediaId();
- if (mediaId > 0 &&
- FeedItemUtil.indexOfItemWithMediaId(feed.getItems(), mediaId) >= 0) {
- Log.d(TAG, "Currently playing episode is about to be deleted, skipping");
- remover.skipOnCompletion = true;
- int playerStatus = PlaybackPreferences.getCurrentPlayerStatus();
- if(playerStatus == PlaybackPreferences.PLAYER_STATUS_PLAYING) {
- IntentUtils.sendLocalBroadcast(getContext(), PlaybackService.ACTION_PAUSE_PLAY_CURRENT_EPISODE);
-
- }
- }
- remover.executeAsync();
- }
- };
- conDialog.createNewDialog().show();
+ displayRemoveFeedDialog(feed);
return true;
default:
return super.onContextItemSelected(item);
}
}
- @Override
- public void onResume() {
- super.onResume();
- loadSubscriptions();
+ private void displayRemoveFeedDialog(Feed feed) {
+ final FeedRemover remover = new FeedRemover(getContext(), feed) {
+ @Override
+ protected void onPostExecute(Void result) {
+ super.onPostExecute(result);
+ loadSubscriptions();
+ }
+ };
+
+ String message = getString(R.string.feed_delete_confirmation_msg, feed.getTitle());
+ ConfirmationDialog dialog = new ConfirmationDialog(getContext(), R.string.remove_feed_label, message) {
+ @Override
+ public void onConfirmButtonPressed(DialogInterface clickedDialog) {
+ clickedDialog.dismiss();
+ long mediaId = PlaybackPreferences.getCurrentlyPlayingFeedMediaId();
+ if (mediaId > 0 && FeedItemUtil.indexOfItemWithMediaId(feed.getItems(), mediaId) >= 0) {
+ Log.d(TAG, "Currently playing episode is about to be deleted, skipping");
+ remover.skipOnCompletion = true;
+ int playerStatus = PlaybackPreferences.getCurrentPlayerStatus();
+ if(playerStatus == PlaybackPreferences.PLAYER_STATUS_PLAYING) {
+ IntentUtils.sendLocalBroadcast(getContext(), PlaybackService.ACTION_PAUSE_PLAY_CURRENT_EPISODE);
+
+ }
+ }
+ remover.executeAsync();
+ }
+ };
+ dialog.createNewDialog().show();
+ }
+
+ private <T> void displayConfirmationDialog(@StringRes int title, @StringRes int message, Callable<? extends T> task) {
+ ConfirmationDialog dialog = new ConfirmationDialog(getActivity(), title, message) {
+ @Override
+ @SuppressLint("CheckResult")
+ public void onConfirmButtonPressed(DialogInterface clickedDialog) {
+ clickedDialog.dismiss();
+ Observable.fromCallable(task)
+ .subscribeOn(Schedulers.io())
+ .observeOn(AndroidSchedulers.mainThread())
+ .subscribe(result -> loadSubscriptions(),
+ error -> Log.e(TAG, Log.getStackTraceString(error)));
+ }
+ };
+ dialog.createNewDialog().show();
}
private final EventDistributor.EventListener contentUpdate = new EventDistributor.EventListener() {
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/FlattrPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/FlattrPreferencesFragment.java
deleted file mode 100644
index 152c3da87..000000000
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/FlattrPreferencesFragment.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package de.danoeh.antennapod.fragment.preferences;
-
-import android.os.Bundle;
-import android.support.v7.preference.PreferenceFragmentCompat;
-import de.danoeh.antennapod.R;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
-import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog;
-
-public class FlattrPreferencesFragment extends PreferenceFragmentCompat {
- private static final String PREF_FLATTR_AUTH = "pref_flattr_authenticate";
- private static final String PREF_FLATTR_REVOKE = "prefRevokeAccess";
- private static final String PREF_AUTO_FLATTR_PREFS = "prefAutoFlattrPrefs";
-
- @Override
- public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
- addPreferencesFromResource(R.xml.preferences_flattr);
- setupFlattrScreen();
- }
-
- @Override
- public void onResume() {
- super.onResume();
- checkFlattrItemVisibility();
- }
-
- private void setupFlattrScreen() {
- findPreference(PREF_FLATTR_REVOKE).setOnPreferenceClickListener(
- preference -> {
- FlattrUtils.revokeAccessToken(getActivity());
- checkFlattrItemVisibility();
- return true;
- }
- );
-
- findPreference(PREF_AUTO_FLATTR_PREFS)
- .setOnPreferenceClickListener(preference -> {
- AutoFlattrPreferenceDialog.newAutoFlattrPreferenceDialog(getActivity(),
- new AutoFlattrPreferenceDialog.AutoFlattrPreferenceDialogInterface() {
- @Override
- public void onCancelled() {
-
- }
-
- @Override
- public void onConfirmed(boolean autoFlattrEnabled, float autoFlattrValue) {
- UserPreferences.setAutoFlattrSettings(autoFlattrEnabled, autoFlattrValue);
- checkFlattrItemVisibility();
- }
- });
- return true;
- });
- }
-
- private void checkFlattrItemVisibility() {
- boolean hasFlattrToken = FlattrUtils.hasToken();
- findPreference(PREF_FLATTR_AUTH).setEnabled(!hasFlattrToken);
- findPreference(PREF_FLATTR_REVOKE).setEnabled(hasFlattrToken);
- findPreference(PREF_AUTO_FLATTR_PREFS).setEnabled(hasFlattrToken);
- }
-}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/IntegrationsPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/IntegrationsPreferencesFragment.java
index 805d84215..229274b76 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/IntegrationsPreferencesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/IntegrationsPreferencesFragment.java
@@ -4,10 +4,8 @@ import android.os.Bundle;
import android.support.v7.preference.PreferenceFragmentCompat;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.PreferenceActivity;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
public class IntegrationsPreferencesFragment extends PreferenceFragmentCompat {
- private static final String PREF_SCREEN_FLATTR = "prefFlattrSettings";
private static final String PREF_SCREEN_GPODDER = "prefGpodderSettings";
@Override
@@ -17,19 +15,9 @@ public class IntegrationsPreferencesFragment extends PreferenceFragmentCompat {
}
private void setupIntegrationsScreen() {
- findPreference(PREF_SCREEN_FLATTR).setOnPreferenceClickListener(preference -> {
- ((PreferenceActivity) getActivity()).openScreen(R.xml.preferences_flattr);
- return true;
- });
findPreference(PREF_SCREEN_GPODDER).setOnPreferenceClickListener(preference -> {
((PreferenceActivity) getActivity()).openScreen(R.xml.preferences_gpodder);
return true;
});
}
-
- @Override
- public void onResume() {
- super.onResume();
- findPreference(PREF_SCREEN_FLATTR).setEnabled(FlattrUtils.hasAPICredentials());
- }
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java
index 5a4866206..701d21ce0 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/preferences/MainPreferencesFragment.java
@@ -143,8 +143,5 @@ public class MainPreferencesFragment extends PreferenceFragmentCompat {
config.index(R.xml.preferences_gpodder)
.addBreadcrumb(PreferenceActivity.getTitleOfPage(R.xml.preferences_integrations))
.addBreadcrumb(PreferenceActivity.getTitleOfPage(R.xml.preferences_gpodder));
- config.index(R.xml.preferences_flattr)
- .addBreadcrumb(PreferenceActivity.getTitleOfPage(R.xml.preferences_integrations))
- .addBreadcrumb(PreferenceActivity.getTitleOfPage(R.xml.preferences_flattr));
}
}
diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java
index 2886a7e33..0c7622a47 100644
--- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java
+++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedItemMenuHandler.java
@@ -124,10 +124,6 @@ public class FeedItemMenuHandler {
mi.setItemVisibility(R.id.deactivate_auto_download, false);
}
- if (selectedItem.getPaymentLink() == null || !selectedItem.getFlattrStatus().flattrable()) {
- mi.setItemVisibility(R.id.support_item, false);
- }
-
boolean isFavorite = selectedItem.isTagged(FeedItem.TAG_FAVORITE);
mi.setItemVisibility(R.id.add_to_favorites_item, !isFavorite);
mi.setItemVisibility(R.id.remove_from_favorites_item, isFavorite);
@@ -230,9 +226,6 @@ public class FeedItemMenuHandler {
Toast.LENGTH_SHORT).show();
}
break;
- case R.id.support_item:
- DBTasks.flattrItemIfLoggedIn(context, selectedItem);
- break;
case R.id.share_link_item:
ShareUtils.shareFeedItemLink(context, selectedItem);
break;
diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java
index bd4fe9bcf..0928cfd62 100644
--- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java
+++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java
@@ -46,11 +46,6 @@ public class FeedMenuHandler {
}
Log.d(TAG, "Preparing options menu");
- if (selectedFeed.getPaymentLink() != null && selectedFeed.getFlattrStatus().flattrable()) {
- menu.findItem(R.id.support_item).setVisible(true);
- } else {
- menu.findItem(R.id.support_item).setVisible(false);
- }
menu.findItem(R.id.refresh_complete_item).setVisible(selectedFeed.isPaged());
@@ -98,9 +93,6 @@ public class FeedMenuHandler {
Toast.LENGTH_SHORT).show();
}
break;
- case R.id.support_item:
- DBTasks.flattrFeedIfLoggedIn(context, selectedFeed);
- break;
case R.id.share_link_item:
ShareUtils.shareFeedlink(context, selectedFeed);
break;
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java
index 93b326698..5866f8715 100644
--- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java
+++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceUpgrader.java
@@ -2,28 +2,51 @@ package de.danoeh.antennapod.preferences;
import android.content.Context;
import android.content.SharedPreferences;
+import android.preference.PreferenceManager;
import de.danoeh.antennapod.BuildConfig;
import de.danoeh.antennapod.core.preferences.UserPreferences;
+import de.danoeh.antennapod.core.util.gui.NotificationUtils;
public class PreferenceUpgrader {
private static final String PREF_CONFIGURED_VERSION = "configuredVersion";
private static final String PREF_NAME = "PreferenceUpgrader";
+ private static SharedPreferences prefs;
public static void checkUpgrades(Context context) {
- SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
- int oldVersion = prefs.getInt(PREF_CONFIGURED_VERSION, 1070200);
+ prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ SharedPreferences upgraderPrefs = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
+ int oldVersion = upgraderPrefs.getInt(PREF_CONFIGURED_VERSION, 1070200);
int newVersion = BuildConfig.VERSION_CODE;
if (oldVersion != newVersion) {
- prefs.edit().putInt(PREF_CONFIGURED_VERSION, newVersion).apply();
+ NotificationUtils.createChannels(context);
+
+ upgraderPrefs.edit().putInt(PREF_CONFIGURED_VERSION, newVersion).apply();
upgrade(oldVersion);
}
}
private static void upgrade(int oldVersion) {
+ if (oldVersion < 1070196) {
+ // migrate episode cleanup value (unit changed from days to hours)
+ int oldValueInDays = UserPreferences.getEpisodeCleanupValue();
+ if (oldValueInDays > 0) {
+ UserPreferences.setEpisodeCleanupValue(oldValueInDays * 24);
+ } // else 0 or special negative values, no change needed
+ }
+ if (oldVersion < 1070197) {
+ if (prefs.getBoolean("prefMobileUpdate", false)) {
+ prefs.edit().putString(UserPreferences.PREF_MOBILE_UPDATE, "everything").apply();
+ }
+ }
if (oldVersion < 1070300) {
UserPreferences.restartUpdateAlarm();
+
+ if (UserPreferences.getMediaPlayer().equals("builtin")) {
+ prefs.edit().putString(UserPreferences.PREF_MEDIA_PLAYER,
+ UserPreferences.PREF_MEDIA_PLAYER_EXOPLAYER).apply();
+ }
}
}
}
diff --git a/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java b/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java
index 42c11bc8e..8b886e699 100644
--- a/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java
+++ b/app/src/main/java/de/danoeh/antennapod/view/EmptyViewHandler.java
@@ -1,9 +1,14 @@
package de.danoeh.antennapod.view;
import android.content.Context;
+import android.graphics.drawable.Drawable;
+import android.support.annotation.AttrRes;
+import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
+import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
+import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
@@ -15,14 +20,18 @@ public class EmptyViewHandler {
private RecyclerView recyclerView;
private RecyclerView.Adapter adapter;
+ private final Context context;
private final View emptyView;
private final TextView tvTitle;
private final TextView tvMessage;
+ private final ImageView ivIcon;
public EmptyViewHandler(Context context) {
emptyView = View.inflate(context, R.layout.empty_view_layout, null);
+ this.context = context;
tvTitle = emptyView.findViewById(R.id.emptyViewTitle);
tvMessage = emptyView.findViewById(R.id.emptyViewMessage);
+ ivIcon = emptyView.findViewById(R.id.emptyViewIcon);
}
public void setTitle(int title) {
@@ -33,6 +42,14 @@ public class EmptyViewHandler {
tvMessage.setText(message);
}
+ public void setIcon(@AttrRes int iconAttr) {
+ TypedValue typedValue = new TypedValue();
+ context.getTheme().resolveAttribute(iconAttr, typedValue, true);
+ Drawable d = ContextCompat.getDrawable(context, typedValue.resourceId);
+ ivIcon.setImageDrawable(d);
+ ivIcon.setVisibility(View.VISIBLE);
+ }
+
public void hide() {
emptyView.setVisibility(View.GONE);
}
diff --git a/app/src/main/java/de/danoeh/antennapod/view/WrappingGridView.java b/app/src/main/java/de/danoeh/antennapod/view/WrappingGridView.java
new file mode 100644
index 000000000..37792b4d1
--- /dev/null
+++ b/app/src/main/java/de/danoeh/antennapod/view/WrappingGridView.java
@@ -0,0 +1,35 @@
+package de.danoeh.antennapod.view;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.widget.GridView;
+
+/**
+ * Source: https://stackoverflow.com/a/46350213/
+ */
+public class WrappingGridView extends GridView {
+
+ public WrappingGridView(Context context) {
+ super(context);
+ }
+
+ public WrappingGridView(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public WrappingGridView(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
+ int heightSpec = heightMeasureSpec;
+ if (getLayoutParams().height == LayoutParams.WRAP_CONTENT) {
+ // The great Android "hackatlon", the love, the magic.
+ // The two leftmost bits in the height measure spec have
+ // a special meaning, hence we can't use them to describe height.
+ heightSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST);
+ }
+ super.onMeasure(widthMeasureSpec, heightSpec);
+ }
+}
diff --git a/app/src/main/play/listings/en-US/full-description.txt b/app/src/main/play/listings/en-US/full-description.txt
index 2f5b4b2ff..c562387af 100644
--- a/app/src/main/play/listings/en-US/full-description.txt
+++ b/app/src/main/play/listings/en-US/full-description.txt
@@ -1,5 +1,5 @@
AntennaPod is a podcast manager and player that gives you instant access to millions of free and paid podcasts, from independent podcasters to large publishing houses such as the BBC, NPR and CNN. Add, import and export their feeds hassle-free using the iTunes podcast database, OPML files or simple RSS URLs. Save effort, battery power and mobile data usage with powerful automation controls for downloading episodes (specify times, intervals and WiFi networks) and deleting episodes (based on your favourites and delay settings).<br>
-But most importantly: Download, stream or queue episodes and enjoy them the way you like with adjustable playback speeds, chapter support and a sleep timer. You can even show your love to the content creators with our Flattr integration.
+But most importantly: Download, stream or queue episodes and enjoy them the way you like with adjustable playback speeds, chapter support and a sleep timer.
Made by podcast-enthousiast, AntennaPod is free in all senses of the word: open source, no costs, no ads.
@@ -15,7 +15,6 @@ KEEP TRACK, SHARE & APPRECIATE<br>
&#8226; Keep track of the best of the best by marking episodes as favourites<br>
&#8226; Find that one episode through the playback history or by searching (titles and shownotes)<br>
&#8226; Share episodes and feeds through advanced social media and email options, the gPodder.net services and via OPML export<br>
-&#8226; Support content creators with Flattr integration including automatic flattring
CONTROL THE SYSTEM<br>
&#8226; Take control over automated downloading: choose feeds, exclude mobile networks, select specific WiFi networks, require the phone to be charging and set times or intervals<br>
diff --git a/app/src/main/res/layout/addfeed.xml b/app/src/main/res/layout/addfeed.xml
index 33951e060..011aa4c8b 100644
--- a/app/src/main/res/layout/addfeed.xml
+++ b/app/src/main/res/layout/addfeed.xml
@@ -1,100 +1,173 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:scrollbars="vertical">
-
- <LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:paddingBottom="8dp"
- android:paddingLeft="16dp"
- android:paddingRight="16dp"
- android:paddingTop="8dp">
-
- <TextView
- android:id="@+id/txtvPodcastDirectories"
- style="@style/AntennaPod.TextView.Heading"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/podcastdirectories_label"/>
-
- <TextView
- android:id="@+id/txtvPodcastDirectoriesDescr"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/podcastdirectories_descr"
- android:textSize="@dimen/text_size_medium"/>
-
- <Button
- android:id="@+id/butSearchItunes"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_marginTop="4dp"
- android:text="@string/search_itunes_label"/>
-
- <Button
- android:id="@+id/butSearchFyyd"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/search_fyyd_label"/>
-
- <Button
- android:id="@+id/butBrowseGpoddernet"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/browse_gpoddernet_label"/>
-
- <View style="@style/Divider"/>
+ android:layout_height="match_parent"
+ android:scrollbars="vertical">
- <TextView
- android:id="@+id/txtvFeedurl"
- style="@style/AntennaPod.TextView.Heading"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/txtvfeedurl_label"/>
-
- <EditText
- android:id="@+id/etxtFeedurl"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:cursorVisible="true"
- android:focusable="true"
- android:focusableInTouchMode="true"
- android:hint="@string/etxtFeedurlHint"
- android:inputType="textUri"/>
-
- <Button
- android:id="@+id/butConfirm"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/confirm_label"/>
-
- <View style="@style/Divider"/>
-
- <TextView
- android:id="@+id/txtvOpmlImport"
- style="@style/AntennaPod.TextView.Heading"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/opml_import_label"/>
-
- <TextView
- android:id="@+id/txtvOpmlImportExpl"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:text="@string/opml_import_txtv_button_lable"
- android:textSize="@dimen/text_size_medium"/>
-
- <Button
- android:id="@+id/butOpmlImport"
+ <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginTop="4dp"
- android:text="@string/opml_import_label"/>
+ android:orientation="vertical"
+ android:padding="8dp">
+
+ <android.support.v7.widget.CardView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:cardCornerRadius="4dp"
+ android:elevation="16dp"
+ android:layout_margin="8dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <ImageView
+ android:layout_width="40dp"
+ android:layout_height="match_parent"
+ android:contentDescription="@string/search_podcast_hint"
+ app:srcCompat="?attr/action_search"
+ android:scaleType="center"/>
+
+ <EditText
+ android:id="@+id/combinedFeedSearchBox"
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:layout_weight="1"
+ android:inputType="text"
+ android:imeOptions="actionSearch"
+ android:importantForAutofill="no"
+ android:layout_marginLeft="8dp"
+ android:layout_marginRight="8dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:hint="@string/search_podcast_hint"
+ android:background="@null"/>
+
+ </LinearLayout>
+
+ </android.support.v7.widget.CardView>
+
+ <fragment
+ android:id="@+id/quickFeedDiscovery"
+ android:name="de.danoeh.antennapod.fragment.QuickFeedDiscoveryFragment"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="8dp"/>
+
+ <android.support.v7.widget.CardView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:cardCornerRadius="4dp"
+ android:elevation="8dp"
+ android:layout_margin="8dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="8dp"
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/txtvFeedurl"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/txtvfeedurl_label"
+ android:textSize="18sp"
+ android:layout_marginBottom="8dp"
+ android:textColor="?android:attr/textColorPrimary"/>
+
+ <EditText
+ android:id="@+id/etxtFeedurl"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:cursorVisible="true"
+ android:focusable="true"
+ android:focusableInTouchMode="true"
+ android:hint="@string/etxtFeedurlHint"
+ android:inputType="textUri"/>
+
+ <Button
+ android:id="@+id/butConfirm"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/confirm_label"/>
+
+ </LinearLayout>
+
+ </android.support.v7.widget.CardView>
+
+ <android.support.v7.widget.CardView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:cardCornerRadius="4dp"
+ android:elevation="8dp"
+ android:layout_margin="8dp">
+
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_horizontal"
+ android:orientation="horizontal">
+
+ <LinearLayout
+ android:id="@+id/advanced_search"
+ android:layout_width="96dp"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:gravity="center_horizontal"
+ android:padding="16dp"
+ android:background="?android:attr/selectableItemBackground">
+
+ <ImageView
+ android:layout_width="40dp"
+ android:layout_height="match_parent"
+ android:contentDescription="@string/advanced_search"
+ app:srcCompat="?attr/action_search"
+ android:scaleType="center"
+ android:layout_marginBottom="4dp"
+ android:tint="?android:attr/textColorPrimary"/>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/advanced_search"
+ android:textAlignment="center"
+ android:textColor="?android:attr/textColorPrimary"/>
+ </LinearLayout>
+
+ <LinearLayout
+ android:id="@+id/btn_opml_import"
+ android:layout_width="96dp"
+ android:layout_height="wrap_content"
+ android:orientation="vertical"
+ android:gravity="center_horizontal"
+ android:padding="16dp"
+ android:background="?android:attr/selectableItemBackground">
+
+ <ImageView
+ android:layout_width="40dp"
+ android:layout_height="match_parent"
+ android:contentDescription="@string/opml_import_label"
+ app:srcCompat="?attr/av_download"
+ android:scaleType="center"
+ android:layout_marginBottom="4dp"
+ android:tint="?android:attr/textColorPrimary"/>
+
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/opml_import_label"
+ android:textAlignment="center"
+ android:textColor="?android:attr/textColorPrimary"/>
+ </LinearLayout>
+
+ </LinearLayout>
+
+ </android.support.v7.widget.CardView>
</LinearLayout>
-</ScrollView>
+</ScrollView> \ No newline at end of file
diff --git a/app/src/main/res/layout/autoflattr_preference_dialog.xml b/app/src/main/res/layout/autoflattr_preference_dialog.xml
deleted file mode 100644
index fc2df30d7..000000000
--- a/app/src/main/res/layout/autoflattr_preference_dialog.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical">
-
- <CheckBox
- android:id="@+id/chkAutoFlattr"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="4dp"
- android:text="@string/auto_flattr_enable"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="@dimen/text_size_small" />
-
- <SeekBar
- android:id="@+id/skbPercent"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="8dp"
- android:max="100" />
-
- <TextView
- android:id="@+id/txtvStatus"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="8dp"
- android:ellipsize="end"
- android:lines="2"
- android:text="@string/auto_flattr_after_percent"
- android:textColor="?android:attr/textColorPrimary"
- android:textSize="@dimen/text_size_small" />
-
-</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/empty_view_layout.xml b/app/src/main/res/layout/empty_view_layout.xml
index 84b171af0..4ccbf45db 100644
--- a/app/src/main/res/layout/empty_view_layout.xml
+++ b/app/src/main/res/layout/empty_view_layout.xml
@@ -1,31 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical"
- android:gravity="center"
- android:layout_centerInParent="true"
- xmlns:tools="http://schemas.android.com/tools">
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical"
+ android:gravity="center"
+ android:layout_centerInParent="true"
+ android:paddingLeft="40dp"
+ android:paddingRight="40dp"
+ xmlns:tools="http://schemas.android.com/tools">
+
+ <ImageView
+ android:id="@+id/emptyViewIcon"
+ android:layout_width="40dp"
+ android:layout_height="40dp"
+ android:paddingBottom="8dp"
+ android:visibility="gone"
+ tools:src="@drawable/ic_feed_grey600_24dp"
+ tools:visibility="visible"/>
<TextView
- android:id="@+id/emptyViewTitle"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:paddingLeft="10dp"
- android:paddingRight="10dp"
- tools:text="empty"
- android:textSize="20sp"
- android:textStyle="bold"
- android:paddingBottom="10dp"/>
+ android:id="@+id/emptyViewTitle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ tools:text="Title"
+ android:textSize="16sp"
+ android:textStyle="bold"
+ android:paddingBottom="8dp"/>
<TextView
- android:id="@+id/emptyViewMessage"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:textSize="15sp"
- tools:text="empty"
- android:paddingLeft="15dp"
- android:paddingRight="15dp"
- android:textAlignment="center"/>
+ android:id="@+id/emptyViewMessage"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textSize="14sp"
+ tools:text="Message"
+ android:textAlignment="center"/>
</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/flattr_auth.xml b/app/src/main/res/layout/flattr_auth.xml
deleted file mode 100644
index 9244b786d..000000000
--- a/app/src/main/res/layout/flattr_auth.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
-
- <TextView
- android:id="@+id/txtvExplanation"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:layout_margin="8dp"
- android:text="@string/flattr_auth_explanation" />
-
- <Button
- android:id="@+id/but_authenticate"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:layout_margin="8dp"
- android:text="@string/authenticate_label" />
-
- <Button
- android:id="@+id/but_return_home"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_horizontal"
- android:text="@string/return_home_label"
- android:visibility="gone" />
-
-</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/layout/gpodnetauth_credentials.xml b/app/src/main/res/layout/gpodnetauth_credentials.xml
index f995ae4cc..e8948fc52 100644
--- a/app/src/main/res/layout/gpodnetauth_credentials.xml
+++ b/app/src/main/res/layout/gpodnetauth_credentials.xml
@@ -36,7 +36,7 @@
android:cursorVisible="true"
android:maxLines="1"
android:inputType="text"
- android:imeOptions="actionNext"
+ android:imeOptions="actionNext|flagNoFullscreen"
android:nextFocusForward="@id/etxtPassword"/>
<EditText
@@ -50,7 +50,7 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:cursorVisible="true"
- android:imeOptions="actionGo"
+ android:imeOptions="actionGo|flagNoFullscreen"
android:imeActionLabel="@string/gpodnetauth_login_butLabel"/>
<Button
diff --git a/app/src/main/res/layout/gpodnetauth_device.xml b/app/src/main/res/layout/gpodnetauth_device.xml
index 5840fe955..1f38bf457 100644
--- a/app/src/main/res/layout/gpodnetauth_device.xml
+++ b/app/src/main/res/layout/gpodnetauth_device.xml
@@ -30,7 +30,8 @@
android:layout_height="wrap_content"
android:hint="@string/gpodnetauth_device_caption"
android:layout_below="@id/txtvDescription"
- android:layout_margin="8dp"/>
+ android:layout_margin="8dp"
+ android:imeOptions="flagNoFullscreen"/>
<TextView
android:id="@+id/txtvDeviceID"
@@ -53,7 +54,8 @@
android:layout_toEndOf="@id/txtvDeviceID"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
- android:layout_margin="8dp"/>
+ android:layout_margin="8dp"
+ android:imeOptions="flagNoFullscreen"/>
<Button
android:id="@+id/butCreateNewDevice"
diff --git a/app/src/main/res/layout/mediaplayerinfo_activity.xml b/app/src/main/res/layout/mediaplayerinfo_activity.xml
index c9e93e149..a6427e985 100644
--- a/app/src/main/res/layout/mediaplayerinfo_activity.xml
+++ b/app/src/main/res/layout/mediaplayerinfo_activity.xml
@@ -51,11 +51,13 @@
android:orientation="vertical">
- <RelativeLayout
+ <RelativeLayout
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:paddingTop="@dimen/scrubber_vertical_padding"
+ android:paddingBottom="@dimen/scrubber_vertical_padding">
- <TextView
+ <TextView
android:id="@+id/txtvPosition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -67,9 +69,9 @@
android:text="@string/position_default_label"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/text_size_micro"
- tools:background="@android:color/holo_green_dark" />
+ tools:background="@android:color/holo_green_dark"/>
- <TextView
+ <TextView
android:id="@+id/txtvLength"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -81,9 +83,9 @@
android:text="@string/position_default_label"
android:textColor="?android:attr/textColorSecondary"
android:textSize="@dimen/text_size_micro"
- tools:background="@android:color/holo_green_dark" />
+ tools:background="@android:color/holo_green_dark"/>
- <SeekBar
+ <SeekBar
android:id="@+id/sbPosition"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -97,9 +99,9 @@
android:layout_toRightOf="@id/txtvPosition"
android:layout_toEndOf="@id/txtvPosition"
android:max="500"
- tools:background="@android:color/holo_green_dark" />
+ tools:background="@android:color/holo_green_dark"/>
- </RelativeLayout>
+ </RelativeLayout>
<RelativeLayout
android:id="@+id/player_control"
diff --git a/app/src/main/res/layout/quick_feed_discovery.xml b/app/src/main/res/layout/quick_feed_discovery.xml
new file mode 100644
index 000000000..ce5cfa65b
--- /dev/null
+++ b/app/src/main/res/layout/quick_feed_discovery.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<android.support.v7.widget.CardView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:cardCornerRadius="4dp"
+ android:elevation="16dp">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="8dp"
+ android:orientation="vertical">
+
+ <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/discover"
+ android:textSize="18sp"
+ android:layout_marginBottom="8dp"
+ android:textColor="?android:attr/textColorPrimary"/>
+
+ <TextView
+ android:layout_width="0dp"
+ android:layout_height="wrap_content"
+ android:text="@string/discover_more"
+ android:gravity="end"
+ android:textAlignment="viewEnd"
+ android:textSize="18sp"
+ android:background="?android:attr/selectableItemBackground"
+ android:layout_marginBottom="8dp"
+ android:paddingStart="8dp"
+ android:paddingEnd="8dp"
+ android:paddingLeft="8dp"
+ android:paddingRight="8dp"
+ android:layout_weight="1"
+ android:id="@+id/discover_more"
+ android:textColor="@color/antennapod_blue"/>
+ </LinearLayout>
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <de.danoeh.antennapod.view.WrappingGridView
+ android:id="@+id/discover_grid"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:numColumns="4"
+ app:layout_columnWeight="1"
+ app:layout_rowWeight="1"
+ android:horizontalSpacing="4dp"
+ android:verticalSpacing="4dp"
+ android:scrollbars="none"
+ android:layout_marginTop="8dp"
+ android:layout_centerInParent="true"
+ android:layout_gravity="center_horizontal"/>
+
+ <ProgressBar
+ android:id="@+id/discover_progress_bar"
+ style="?android:attr/progressBarStyle"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:layout_centerInParent="true"
+ android:layout_marginTop="30dp"/>
+
+ <TextView
+ android:id="@+id/discover_error"
+ android:textColor="@color/md_edittext_error"
+ android:layout_width="match_parent"
+ android:layout_centerInParent="true"
+ android:layout_height="wrap_content" />
+
+ </RelativeLayout>
+
+ </LinearLayout>
+
+</android.support.v7.widget.CardView>
+
diff --git a/app/src/main/res/layout/quick_feed_discovery_item.xml b/app/src/main/res/layout/quick_feed_discovery_item.xml
new file mode 100644
index 000000000..6b0c98013
--- /dev/null
+++ b/app/src/main/res/layout/quick_feed_discovery_item.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <de.danoeh.antennapod.view.SquareImageView
+ android:id="@+id/discovery_cover"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:foreground="?android:attr/selectableItemBackground"/>
+
+</LinearLayout>
+
diff --git a/app/src/main/res/menu/advanced_search.xml b/app/src/main/res/menu/advanced_search.xml
new file mode 100644
index 000000000..297ebfce8
--- /dev/null
+++ b/app/src/main/res/menu/advanced_search.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <item
+ android:id="@+id/search_itunes"
+ android:title="@string/search_itunes_label" />
+ <item
+ android:id="@+id/search_gpodder"
+ android:title="@string/browse_gpoddernet_label" />
+ <item
+ android:id="@+id/search_fyyd"
+ android:title="@string/search_fyyd_label" />
+
+</menu>
diff --git a/app/src/main/res/menu/allepisodes_context.xml b/app/src/main/res/menu/allepisodes_context.xml
index 28493c5b6..907bc9334 100644
--- a/app/src/main/res/menu/allepisodes_context.xml
+++ b/app/src/main/res/menu/allepisodes_context.xml
@@ -9,9 +9,9 @@
<item
- android:id="@+id/mark_as_seen_item"
+ android:id="@+id/remove_new_flag_item"
android:menuCategory="container"
- android:title="@string/mark_as_seen_label" />
+ android:title="@string/remove_new_flag_label" />
<item
android:id="@+id/mark_read_item"
@@ -83,10 +83,4 @@
android:title="@string/share_file_label" />
</menu>
</item>
-
- <item
- android:id="@+id/support_item"
- android:menuCategory="container"
- android:title="@string/support_label" />
-
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/episodes.xml b/app/src/main/res/menu/episodes.xml
index e21aac04e..23c8f862a 100644
--- a/app/src/main/res/menu/episodes.xml
+++ b/app/src/main/res/menu/episodes.xml
@@ -25,8 +25,8 @@
android:icon="?attr/navigation_accept"/>
<item
- android:id="@+id/mark_all_seen_item"
- android:title="@string/mark_all_seen_label"
+ android:id="@+id/remove_all_new_flags_item"
+ android:title="@string/remove_all_new_flags_label"
android:menuCategory="container"
custom:showAsAction="collapseActionView"
android:icon="?attr/navigation_accept"/>
diff --git a/app/src/main/res/menu/feedinfo.xml b/app/src/main/res/menu/feedinfo.xml
index 9fdd56b6c..300068007 100644
--- a/app/src/main/res/menu/feedinfo.xml
+++ b/app/src/main/res/menu/feedinfo.xml
@@ -9,12 +9,6 @@
android:visible="true">
</item>
<item
- android:id="@+id/support_item"
- custom:showAsAction="ifRoom|collapseActionView"
- android:title="@string/support_label"
- android:visible="false">
- </item>
- <item
android:id="@+id/share_link_item"
custom:showAsAction="collapseActionView"
android:title="@string/share_link_label">
diff --git a/app/src/main/res/menu/feeditem_options.xml b/app/src/main/res/menu/feeditem_options.xml
index 7e111d816..0801b79a1 100644
--- a/app/src/main/res/menu/feeditem_options.xml
+++ b/app/src/main/res/menu/feeditem_options.xml
@@ -92,12 +92,6 @@
</item>
<item
- android:id="@+id/support_item"
- custom:showAsAction="collapseActionView"
- android:title="@string/support_label">
- </item>
-
- <item
android:id="@+id/open_podcast"
custom:showAsAction="collapseActionView"
android:title="@string/open_podcast">
diff --git a/app/src/main/res/menu/feeditemlist_context.xml b/app/src/main/res/menu/feeditemlist_context.xml
index 1f4f09faa..df13cb027 100644
--- a/app/src/main/res/menu/feeditemlist_context.xml
+++ b/app/src/main/res/menu/feeditemlist_context.xml
@@ -83,11 +83,4 @@
android:title="@string/share_file_label" />
</menu>
</item>
-
-
- <item
- android:id="@+id/support_item"
- android:menuCategory="container"
- android:title="@string/support_label" />
-
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/feedlist.xml b/app/src/main/res/menu/feedlist.xml
index 3882cdff1..e62fc9d36 100644
--- a/app/src/main/res/menu/feedlist.xml
+++ b/app/src/main/res/menu/feedlist.xml
@@ -38,14 +38,6 @@
android:title="@string/search_label"/>
<item
- android:id="@+id/support_item"
- android:menuCategory="container"
- android:title="@string/support_label"
- android:visible="false"
- custom:showAsAction="collapseActionView">
- </item>
-
- <item
android:id="@+id/visit_website_item"
android:icon="?attr/location_web_site"
android:menuCategory="container"
diff --git a/app/src/main/res/menu/mediaplayer.xml b/app/src/main/res/menu/mediaplayer.xml
index 98c7478a6..44d511ee4 100644
--- a/app/src/main/res/menu/mediaplayer.xml
+++ b/app/src/main/res/menu/mediaplayer.xml
@@ -78,11 +78,4 @@
android:title="@string/share_file_label" />
</menu>
</item>
- <item
- android:id="@+id/support_item"
- custom:showAsAction="collapseActionView"
- android:title="@string/support_label"
- android:visible="false">
- </item>
-
</menu> \ No newline at end of file
diff --git a/app/src/main/res/menu/nav_feed_context.xml b/app/src/main/res/menu/nav_feed_context.xml
index 4da40441f..7fdee5661 100644
--- a/app/src/main/res/menu/nav_feed_context.xml
+++ b/app/src/main/res/menu/nav_feed_context.xml
@@ -2,9 +2,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
- android:id="@+id/mark_all_seen_item"
+ android:id="@+id/remove_all_new_flags_item"
android:menuCategory="container"
- android:title="@string/mark_all_seen_label" />
+ android:title="@string/remove_all_new_flags_label" />
<item
android:id="@+id/mark_all_read_item"
diff --git a/app/src/main/res/menu/queue.xml b/app/src/main/res/menu/queue.xml
index 5844c9ff5..0f7729be1 100644
--- a/app/src/main/res/menu/queue.xml
+++ b/app/src/main/res/menu/queue.xml
@@ -24,13 +24,6 @@
android:title="@string/search_label"/>
<item
- android:id="@+id/clear_queue"
- android:title="@string/clear_queue_label"
- android:menuCategory="container"
- custom:showAsAction="collapseActionView"
- android:icon="?attr/navigation_accept"/>
-
- <item
android:id="@+id/queue_sort"
android:title="@string/sort">
@@ -112,4 +105,15 @@
</menu>
</item>
+ <item
+ android:id="@+id/clear_queue"
+ android:title="@string/clear_queue_label"
+ custom:showAsAction="collapseActionView"
+ android:icon="?attr/navigation_accept"/>
+
+ <item
+ android:id="@+id/episode_actions"
+ custom:showAsAction="collapseActionView"
+ android:title="@string/batch_edit" />
+
</menu>
diff --git a/app/src/main/res/menu/queue_context.xml b/app/src/main/res/menu/queue_context.xml
index c88620665..e1c3e6216 100644
--- a/app/src/main/res/menu/queue_context.xml
+++ b/app/src/main/res/menu/queue_context.xml
@@ -84,10 +84,4 @@
android:title="@string/share_file_label" />
</menu>
</item>
- <item
- android:id="@+id/support_item"
- android:menuCategory="container"
- android:title="@string/support_label" />
-
-
</menu> \ No newline at end of file
diff --git a/app/src/main/res/xml/preferences_flattr.xml b/app/src/main/res/xml/preferences_flattr.xml
deleted file mode 100644
index 6b4c38a0b..000000000
--- a/app/src/main/res/xml/preferences_flattr.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen
- xmlns:android="http://schemas.android.com/apk/res/android">
-
- <PreferenceScreen
- android:key="pref_flattr_authenticate"
- android:summary="@string/pref_flattr_auth_sum"
- android:title="@string/pref_flattr_auth_title">
- <intent android:action=".activities.FlattrAuthActivity"/>
- </PreferenceScreen>
-
- <Preference
- android:key="prefAutoFlattrPrefs"
- android:summary="@string/pref_auto_flattr_sum"
- android:title="@string/pref_auto_flattr_title"/>
- <Preference
- android:key="prefRevokeAccess"
- android:summary="@string/pref_revokeAccess_sum"
- android:title="@string/pref_revokeAccess_title"/>
-
-</PreferenceScreen>
diff --git a/app/src/main/res/xml/preferences_integrations.xml b/app/src/main/res/xml/preferences_integrations.xml
index c0fd299ec..716f6c476 100644
--- a/app/src/main/res/xml/preferences_integrations.xml
+++ b/app/src/main/res/xml/preferences_integrations.xml
@@ -1,12 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto">
-
- <Preference
- android:key="prefFlattrSettings"
- android:title="@string/flattr_label"
- android:summary="@string/flattr_summary" />
+ xmlns:android="http://schemas.android.com/apk/res/android">
<Preference
android:key="prefGpodderSettings"
diff --git a/app/src/main/res/xml/preferences_playback.xml b/app/src/main/res/xml/preferences_playback.xml
index 8b8efa023..d609d3daa 100644
--- a/app/src/main/res/xml/preferences_playback.xml
+++ b/app/src/main/res/xml/preferences_playback.xml
@@ -115,7 +115,7 @@
<PreferenceCategory android:title="@string/media_player">
<ListPreference
- android:defaultValue="sonic"
+ android:defaultValue="exoplayer"
android:entries="@array/media_player_options"
android:key="prefMediaPlayer"
android:title="@string/media_player"
diff --git a/app/src/main/templates/about.html b/app/src/main/templates/about.html
index cc3a24e62..05d1b6e28 100644
--- a/app/src/main/templates/about.html
+++ b/app/src/main/templates/about.html
@@ -104,11 +104,6 @@ by Google, licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt
</div>
<div class="card">
-<h2>flattr4j <a href="http://www.shredzone.org/projects/flattr4j/wiki">(Link)</a></h2>
-licensed under the Apache 2.0 license <a href="LICENSE_APACHE-2.0.txt">(View)</a>
-</div>
-
-<div class="card">
<h2>Glide <a href="https://github.com/bumptech/glide/">(Link)</a></h2>
licensed under the Simplified BSD license <a href="LICENSE_GLIDE.txt">(View)</a>
</div>
diff --git a/build.gradle b/build.gradle
index 797e7c520..02f3be587 100644
--- a/build.gradle
+++ b/build.gradle
@@ -40,9 +40,9 @@ subprojects {
}
project.ext {
- compileSdkVersion = 26
+ compileSdkVersion = 28
minSdkVersion = 14
- targetSdkVersion = 26
+ targetSdkVersion = 28
supportVersion = "27.1.1"
lifecycle_version = "1.1.1"
@@ -52,7 +52,6 @@ project.ext {
commonslangVersion = "3.6"
commonstextVersion = "1.3"
eventbusVersion = "3.1.1"
- flattr4jVersion = "2.14"
glideVersion = "4.8.0"
glideOkhttpIntegrationVersion = "4.8.0"
iconifyVersion = "2.2.2"
diff --git a/core/build.gradle b/core/build.gradle
index c0ddd9f2d..08617c093 100644
--- a/core/build.gradle
+++ b/core/build.gradle
@@ -54,9 +54,6 @@ dependencies {
implementation "org.apache.commons:commons-lang3:$commonslangVersion"
implementation "org.apache.commons:commons-text:$commonstextVersion"
- implementation ("org.shredzone.flattr4j:flattr4j-core:$flattr4jVersion") {
- exclude group: "org.json", module: "json"
- }
implementation "commons-io:commons-io:$commonsioVersion"
implementation "com.jayway.android.robotium:robotium-solo:$robotiumSoloVersion"
implementation "org.jsoup:jsoup:$jsoupVersion"
diff --git a/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java b/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java
index 88ae6d6bc..c17376639 100644
--- a/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java
+++ b/core/src/free/java/de/danoeh/antennapod/core/ClientConfig.java
@@ -27,8 +27,6 @@ public class ClientConfig {
public static GpodnetCallbacks gpodnetCallbacks;
- public static FlattrCallbacks flattrCallbacks;
-
public static DBTasksCallbacks dbTasksCallbacks;
public static CastCallbacks castCallbacks;
@@ -41,7 +39,6 @@ public class ClientConfig {
}
PodDBAdapter.init(context);
UserPreferences.init(context);
- UpdateManager.init(context);
PlaybackPreferences.init(context);
NetworkUtils.init(context);
SleepTimerPreferences.init(context);
diff --git a/core/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java b/core/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java
deleted file mode 100644
index 5fa6faa13..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/FlattrCallbacks.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package de.danoeh.antennapod.core;
-
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.Intent;
-
-import org.shredzone.flattr4j.oauth.AccessToken;
-
-/**
- * Callbacks for the flattr integration of the app.
- */
-public interface FlattrCallbacks {
-
- /**
- * Returns if true if the flattr integration should be activated,
- * false otherwise.
- */
- boolean flattrEnabled();
-
- /**
- * Returns an intent that starts the activity that is responsible for
- * letting users log into their flattr account.
- *
- * @return The intent that starts the authentication activity or null
- * if flattr integration is disabled (i.e. flattrEnabled() == false).
- */
- Intent getFlattrAuthenticationActivityIntent(Context context);
-
- PendingIntent getFlattrFailedNotificationContentIntent(Context context);
-
- String getFlattrAppKey();
-
- String getFlattrAppSecret();
-
- void handleFlattrAuthenticationSuccess(AccessToken token);
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java b/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java
deleted file mode 100644
index 1b4cbc0ea..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/UpdateManager.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package de.danoeh.antennapod.core;
-
-
-import android.content.Context;
-import android.content.SharedPreferences;
-import android.content.pm.PackageInfo;
-import android.content.pm.PackageManager;
-import android.os.Build;
-import android.util.Log;
-
-import org.antennapod.audio.MediaPlayer;
-
-import de.danoeh.antennapod.core.preferences.UserPreferences;
-
-/*
- * This class's job is do perform maintenance tasks whenever the app has been updated
- */
-class UpdateManager {
-
- private UpdateManager(){}
-
- private static final String TAG = UpdateManager.class.getSimpleName();
-
- private static final String PREF_NAME = "app_version";
- private static final String KEY_VERSION_CODE = "version_code";
-
- private static int currentVersionCode;
-
- private static Context context;
- private static SharedPreferences prefs;
-
- public static void init(Context context) {
- UpdateManager.context = context;
- prefs = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
- PackageManager pm = context.getPackageManager();
- try {
- PackageInfo info = pm.getPackageInfo(context.getPackageName(), 0);
- currentVersionCode = info.versionCode;
- } catch (PackageManager.NameNotFoundException e) {
- Log.e(TAG, "Failed to obtain package info for package name: " + context.getPackageName(), e);
- currentVersionCode = 0;
- return;
- }
- final int oldVersionCode = getStoredVersionCode();
- Log.d(TAG, "old: " + oldVersionCode + ", current: " + currentVersionCode);
- if(oldVersionCode < currentVersionCode) {
- onUpgrade(oldVersionCode, currentVersionCode);
- setCurrentVersionCode();
- }
- }
-
- private static int getStoredVersionCode() {
- return prefs.getInt(KEY_VERSION_CODE, -1);
- }
-
- private static void setCurrentVersionCode() {
- prefs.edit().putInt(KEY_VERSION_CODE, currentVersionCode).apply();
- }
-
- private static void onUpgrade(final int oldVersionCode, final int newVersionCode) {
- if (oldVersionCode < 1050004) {
- if(MediaPlayer.isPrestoLibraryInstalled(context) && Build.VERSION.SDK_INT >= 16) {
- UserPreferences.enableSonic();
- }
- }
-
- if (oldVersionCode < 1070196) {
- // migrate episode cleanup value (unit changed from days to hours)
- int oldValueInDays = UserPreferences.getEpisodeCleanupValue();
- if (oldValueInDays > 0) {
- UserPreferences.setEpisodeCleanupValue(oldValueInDays * 24);
- } // else 0 or special negative values, no change needed
- }
- if (oldVersionCode < 1070197) {
- if (prefs.getBoolean("prefMobileUpdate", false)) {
- prefs.edit().putString(UserPreferences.PREF_MOBILE_UPDATE, "everything").apply();
- }
- }
- }
-
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java
deleted file mode 100644
index 318e404c8..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrClickWorker.java
+++ /dev/null
@@ -1,231 +0,0 @@
-package de.danoeh.antennapod.core.asynctask;
-
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.os.AsyncTask;
-import android.support.annotation.NonNull;
-import android.support.v4.app.NotificationCompat;
-import android.util.Log;
-import android.widget.Toast;
-
-import org.shredzone.flattr4j.exception.FlattrException;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Future;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import de.danoeh.antennapod.core.BuildConfig;
-import de.danoeh.antennapod.core.ClientConfig;
-import de.danoeh.antennapod.core.R;
-import de.danoeh.antennapod.core.storage.DBReader;
-import de.danoeh.antennapod.core.storage.DBWriter;
-import de.danoeh.antennapod.core.util.NetworkUtils;
-import de.danoeh.antennapod.core.util.flattr.FlattrThing;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
-import de.danoeh.antennapod.core.util.gui.NotificationUtils;
-
-/**
- * Performs a click action in a background thread.
- * <p/>
- * When started, the flattr click worker will try to flattr every item that is in the flattr queue. If no network
- * connection is available it will shut down immediately. The FlattrClickWorker can also be given one additional
- * FlattrThing which will be flattrd immediately.
- * <p/>
- * The FlattrClickWorker will display a toast notification for every item that has been flattrd. If the FlattrClickWorker failed
- * to flattr something, a notification will be displayed.
- */
-public class FlattrClickWorker extends AsyncTask<Void, Integer, FlattrClickWorker.ExitCode> {
- private static final String TAG = "FlattrClickWorker";
-
- private static final int NOTIFICATION_ID = 4;
-
- private final Context context;
-
- public enum ExitCode {EXIT_NORMAL, NO_TOKEN, NO_NETWORK, NO_THINGS}
-
- private final AtomicInteger countFailed = new AtomicInteger();
- private final AtomicInteger countSuccess = new AtomicInteger();
-
- private volatile FlattrThing extraFlattrThing;
-
- /**
- * Only relevant if just one thing is flattrd
- */
- private volatile FlattrException exception;
-
- /**
- * Creates a new FlattrClickWorker which will only flattr all things in the queue.
- * <p/>
- * The FlattrClickWorker has to be started by calling executeAsync().
- *
- * @param context A context for accessing the database and posting notifications. Must not be null.
- */
- public FlattrClickWorker(@NonNull Context context) {
- this.context = context.getApplicationContext();
- }
-
- /**
- * Creates a new FlattrClickWorker which will flattr all things in the queue and one additional
- * FlattrThing.
- * <p/>
- * The FlattrClickWorker has to be started by calling executeAsync().
- *
- * @param context A context for accessing the database and posting notifications. Must not be null.
- * @param extraFlattrThing The additional thing to flattr
- */
- public FlattrClickWorker(Context context, FlattrThing extraFlattrThing) {
- this(context);
- this.extraFlattrThing = extraFlattrThing;
- }
-
-
- @Override
- protected ExitCode doInBackground(Void... params) {
-
- if (!FlattrUtils.hasToken()) {
- return ExitCode.NO_TOKEN;
- }
-
- if (!NetworkUtils.networkAvailable()) {
- return ExitCode.NO_NETWORK;
- }
-
- final List<FlattrThing> flattrQueue = DBReader.getFlattrQueue();
- if (extraFlattrThing != null) {
- flattrQueue.add(extraFlattrThing);
- } else if (flattrQueue.size() == 1) {
- // if only one item is flattrd, the report can specifically mentioned that this item has failed
- extraFlattrThing = flattrQueue.get(0);
- }
-
- if (flattrQueue.isEmpty()) {
- return ExitCode.NO_THINGS;
- }
-
- List<Future<?>> dbFutures = new LinkedList<>();
- for (FlattrThing thing : flattrQueue) {
- if (BuildConfig.DEBUG) Log.d(TAG, "Processing " + thing.getTitle());
-
- try {
- thing.getFlattrStatus().setUnflattred(); // pop from queue to prevent unflattrable things from getting stuck in flattr queue infinitely
- FlattrUtils.clickUrl(context, thing.getPaymentLink());
- thing.getFlattrStatus().setFlattred();
- publishProgress(R.string.flattr_click_success);
- countSuccess.incrementAndGet();
-
- } catch (FlattrException e) {
- e.printStackTrace();
- int failed = countFailed.incrementAndGet();
- if (failed == 1) {
- exception = e;
- }
- }
-
- Future<?> f = DBWriter.setFlattredStatus(context, thing, false);
- if (f != null) {
- dbFutures.add(f);
- }
- }
-
- for (Future<?> f : dbFutures) {
- try {
- f.get();
- } catch (InterruptedException | ExecutionException e) {
- e.printStackTrace();
- }
- }
-
- return ExitCode.EXIT_NORMAL;
- }
-
- @Override
- protected void onPostExecute(ExitCode exitCode) {
- super.onPostExecute(exitCode);
- switch (exitCode) {
- case EXIT_NORMAL:
- if (countFailed.get() > 0) {
- postFlattrFailedNotification();
- }
- break;
- case NO_NETWORK:
- postToastNotification(R.string.flattr_click_enqueued);
- break;
- case NO_TOKEN:
- postNoTokenNotification();
- break;
- case NO_THINGS: // nothing to notify here
- break;
- }
- }
-
- @Override
- protected void onProgressUpdate(Integer... values) {
- super.onProgressUpdate(values);
- postToastNotification(values[0]);
- }
-
- private void postToastNotification(int msg) {
- Toast.makeText(context, context.getString(msg), Toast.LENGTH_LONG).show();
- }
-
- private void postNoTokenNotification() {
- PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
- ClientConfig.flattrCallbacks.getFlattrAuthenticationActivityIntent(context), 0);
-
- Notification notification = new NotificationCompat.Builder(context, NotificationUtils.CHANNEL_ID_ERROR)
- .setStyle(new NotificationCompat.BigTextStyle().bigText(context.getString(R.string.no_flattr_token_notification_msg)))
- .setContentIntent(contentIntent)
- .setContentTitle(context.getString(R.string.no_flattr_token_title))
- .setTicker(context.getString(R.string.no_flattr_token_title))
- .setSmallIcon(R.drawable.stat_notify_sync_error)
- .setOngoing(false)
- .setAutoCancel(true)
- .build();
- ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notification);
- }
-
- private void postFlattrFailedNotification() {
- int failed = countFailed.get();
- if (failed == 0) {
- return;
- }
-
- PendingIntent contentIntent = ClientConfig.flattrCallbacks.getFlattrFailedNotificationContentIntent(context);
- String title;
- String subtext;
-
- if (failed == 1) {
- title = context.getString(R.string.flattrd_failed_label);
- String exceptionMsg = (exception.getMessage() != null) ? exception.getMessage() : "";
- subtext = context.getString(R.string.flattr_click_failure, extraFlattrThing.getTitle())
- + "\n" + exceptionMsg;
- } else {
- title = context.getString(R.string.flattrd_label);
- subtext = context.getString(R.string.flattr_click_success_count, countSuccess.get()) + "\n"
- + context.getString(R.string.flattr_click_failure_count, failed);
- }
-
- Notification notification = new NotificationCompat.Builder(context, NotificationUtils.CHANNEL_ID_ERROR)
- .setStyle(new NotificationCompat.BigTextStyle().bigText(subtext))
- .setContentIntent(contentIntent)
- .setContentTitle(title)
- .setTicker(title)
- .setSmallIcon(R.drawable.stat_notify_sync_error)
- .setOngoing(false)
- .setAutoCancel(true)
- .build();
- ((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE)).notify(NOTIFICATION_ID, notification);
- }
-
-
- /**
- * Starts the FlattrClickWorker as an AsyncTask.
- */
- public void executeAsync() {
- executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
- }
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java
deleted file mode 100644
index 6d9ab2bd3..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrStatusFetcher.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package de.danoeh.antennapod.core.asynctask;
-
-import android.content.Context;
-import android.util.Log;
-
-import org.shredzone.flattr4j.exception.FlattrException;
-import org.shredzone.flattr4j.model.Flattr;
-
-import java.util.List;
-import java.util.concurrent.ExecutionException;
-
-import de.danoeh.antennapod.core.BuildConfig;
-import de.danoeh.antennapod.core.storage.DBWriter;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
-
-/**
- * Fetch list of flattred things and flattr status in database in a background thread.
- */
-
-public class FlattrStatusFetcher extends Thread {
- private static final String TAG = "FlattrStatusFetcher";
-
- public FlattrStatusFetcher(Context context) {
- super();
- }
-
- @Override
- public void run() {
- if (BuildConfig.DEBUG) Log.d(TAG, "Starting background work: Retrieving Flattr status");
-
- Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
-
- try {
- List<Flattr> flattredThings = FlattrUtils.retrieveFlattredThings();
- DBWriter.setFlattredStatus(flattredThings).get();
- } catch (FlattrException e) {
- e.printStackTrace();
- Log.d(TAG, "flattrQueue exception retrieving list with flattred items " + e.getMessage());
- } catch (InterruptedException | ExecutionException e) {
- e.printStackTrace();
- }
-
- if (BuildConfig.DEBUG) Log.d(TAG, "Finished background work: Retrieved Flattr status");
- }
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java b/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java
deleted file mode 100644
index 985cabbf8..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/asynctask/FlattrTokenFetcher.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package de.danoeh.antennapod.core.asynctask;
-
-
-import android.app.ProgressDialog;
-import android.content.Context;
-import android.net.Uri;
-import android.os.AsyncTask;
-import android.util.Log;
-
-import org.shredzone.flattr4j.exception.FlattrException;
-import org.shredzone.flattr4j.oauth.AccessToken;
-import org.shredzone.flattr4j.oauth.AndroidAuthenticator;
-
-import de.danoeh.antennapod.core.BuildConfig;
-import de.danoeh.antennapod.core.ClientConfig;
-import de.danoeh.antennapod.core.R;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
-
-/**
- * Fetches the access token in the background in order to avoid networkOnMainThread exception.
- */
-
-public class FlattrTokenFetcher extends AsyncTask<Void, Void, AccessToken> {
- private static final String TAG = "FlattrTokenFetcher";
- private final Context context;
- private final AndroidAuthenticator auth;
- private AccessToken token;
- private final Uri uri;
- private ProgressDialog dialog;
- private FlattrException exception;
-
- public FlattrTokenFetcher(Context context, AndroidAuthenticator auth, Uri uri) {
- super();
- this.context = context;
- this.auth = auth;
- this.uri = uri;
- }
-
- @Override
- protected void onPostExecute(AccessToken result) {
- if (result != null) {
- FlattrUtils.storeToken(result);
- }
- dialog.dismiss();
- if (exception == null) {
- ClientConfig.flattrCallbacks.handleFlattrAuthenticationSuccess(result);
- } else {
- FlattrUtils.showErrorDialog(context, exception.getMessage());
- }
- }
-
-
- @Override
- protected void onPreExecute() {
- super.onPreExecute();
- dialog = new ProgressDialog(context);
- dialog.setMessage(context.getString(R.string.processing_label));
- dialog.setIndeterminate(true);
- dialog.setCancelable(false);
- dialog.show();
- }
-
-
- @Override
- protected AccessToken doInBackground(Void... params) {
- try {
- token = auth.fetchAccessToken(uri);
- } catch (FlattrException e) {
- e.printStackTrace();
- exception = e;
- return null;
- }
- if (token != null) {
- if (BuildConfig.DEBUG) Log.d(TAG, "Successfully got token");
- return token;
- } else {
- Log.w(TAG, "Flattr token was null");
- return null;
- }
- }
-
- public void executeAsync() {
- executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
- }
-
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java b/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java
index dcb033267..7ca6f78de 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/event/DownloaderUpdate.java
@@ -1,5 +1,7 @@
package de.danoeh.antennapod.core.event;
+import android.support.annotation.NonNull;
+
import java.util.Arrays;
import java.util.List;
@@ -11,6 +13,7 @@ import de.danoeh.antennapod.core.util.LongList;
public class DownloaderUpdate {
/* Downloaders that are currently running */
+ @NonNull
public final List<Downloader> downloaders;
/**
@@ -25,7 +28,7 @@ public class DownloaderUpdate {
*/
public final long[] mediaIds;
- public DownloaderUpdate(List<Downloader> downloaders) {
+ DownloaderUpdate(@NonNull List<Downloader> downloaders) {
this.downloaders = downloaders;
LongList feedIds1 = new LongList(), mediaIds1 = new LongList();
for(Downloader d1 : downloaders) {
diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java
index 3395653f3..5718c06c2 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/feed/Feed.java
@@ -11,15 +11,12 @@ import java.util.List;
import de.danoeh.antennapod.core.asynctask.ImageResource;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.storage.PodDBAdapter;
-import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
-import de.danoeh.antennapod.core.util.flattr.FlattrThing;
-
/**
* Data Object for a whole feed
*
* @author daniel
*/
-public class Feed extends FeedFile implements FlattrThing, ImageResource {
+public class Feed extends FeedFile implements ImageResource {
public static final int FEEDFILETYPE_FEED = 0;
public static final String TYPE_RSS2 = "rss";
@@ -52,7 +49,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
*/
private String lastUpdate;
- private FlattrStatus flattrStatus;
private String paymentLink;
/**
* Feed type, for example RSS 2 or Atom
@@ -97,7 +93,7 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
*/
public Feed(long id, String lastUpdate, String title, String customTitle, String link, String description, String paymentLink,
String author, String language, String type, String feedIdentifier, String imageUrl, String fileUrl,
- String downloadUrl, boolean downloaded, FlattrStatus status, boolean paged, String nextPageLink,
+ String downloadUrl, boolean downloaded, boolean paged, String nextPageLink,
String filter, boolean lastUpdateFailed) {
super(fileUrl, downloadUrl, downloaded);
this.id = id;
@@ -112,7 +108,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
this.type = type;
this.feedIdentifier = feedIdentifier;
this.imageUrl = imageUrl;
- this.flattrStatus = status;
this.paged = paged;
this.nextPageLink = nextPageLink;
this.items = new ArrayList<>();
@@ -125,13 +120,13 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
}
/**
- * This constructor is used for test purposes and uses a default flattr status object.
+ * This constructor is used for test purposes
*/
public Feed(long id, String lastUpdate, String title, String link, String description, String paymentLink,
String author, String language, String type, String feedIdentifier, String imageUrl, String fileUrl,
String downloadUrl, boolean downloaded) {
this(id, lastUpdate, title, null, link, description, paymentLink, author, language, type, feedIdentifier, imageUrl,
- fileUrl, downloadUrl, downloaded, new FlattrStatus(), false, null, null, false);
+ fileUrl, downloadUrl, downloaded, false, null, null, false);
}
/**
@@ -139,7 +134,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
*/
public Feed() {
super();
- this.flattrStatus = new FlattrStatus();
}
/**
@@ -149,7 +143,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
public Feed(String url, String lastUpdate) {
super(null, url, false);
this.lastUpdate = lastUpdate;
- this.flattrStatus = new FlattrStatus();
}
/**
@@ -159,7 +152,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
public Feed(String url, String lastUpdate, String title) {
this(url, lastUpdate);
this.feedTitle = title;
- this.flattrStatus = new FlattrStatus();
}
/**
@@ -186,7 +178,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
int indexFileUrl = cursor.getColumnIndex(PodDBAdapter.KEY_FILE_URL);
int indexDownloadUrl = cursor.getColumnIndex(PodDBAdapter.KEY_DOWNLOAD_URL);
int indexDownloaded = cursor.getColumnIndex(PodDBAdapter.KEY_DOWNLOADED);
- int indexFlattrStatus = cursor.getColumnIndex(PodDBAdapter.KEY_FLATTR_STATUS);
int indexIsPaged = cursor.getColumnIndex(PodDBAdapter.KEY_IS_PAGED);
int indexNextPageLink = cursor.getColumnIndex(PodDBAdapter.KEY_NEXT_PAGE_LINK);
int indexHide = cursor.getColumnIndex(PodDBAdapter.KEY_HIDE);
@@ -209,7 +200,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
cursor.getString(indexFileUrl),
cursor.getString(indexDownloadUrl),
cursor.getInt(indexDownloaded) > 0,
- new FlattrStatus(cursor.getLong(indexFlattrStatus)),
cursor.getInt(indexIsPaged) > 0,
cursor.getString(indexNextPageLink),
cursor.getString(indexHide),
@@ -291,9 +281,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
if (other.paymentLink != null) {
paymentLink = other.paymentLink;
}
- if (other.flattrStatus != null) {
- flattrStatus = other.flattrStatus;
- }
// this feed's nextPage might already point to a higher page, so we only update the nextPage value
// if this feed is not paged and the other feed is.
if (!this.paged && other.paged) {
@@ -444,14 +431,6 @@ public class Feed extends FeedFile implements FlattrThing, ImageResource {
this.feedIdentifier = feedIdentifier;
}
- public void setFlattrStatus(FlattrStatus status) {
- this.flattrStatus = status;
- }
-
- public FlattrStatus getFlattrStatus() {
- return flattrStatus;
- }
-
public String getPaymentLink() {
return paymentLink;
}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java
index 0f0343f25..3495164a6 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedItem.java
@@ -18,15 +18,13 @@ import de.danoeh.antennapod.core.asynctask.ImageResource;
import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.PodDBAdapter;
import de.danoeh.antennapod.core.util.ShownotesProvider;
-import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
-import de.danoeh.antennapod.core.util.flattr.FlattrThing;
/**
* Data Object for a XML message
*
* @author daniel
*/
-public class FeedItem extends FeedComponent implements ShownotesProvider, FlattrThing, ImageResource {
+public class FeedItem extends FeedComponent implements ShownotesProvider, ImageResource {
/** tag that indicates this item is in the queue */
public static final String TAG_QUEUE = "Queue";
@@ -60,7 +58,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
public static final int PLAYED = 1;
private String paymentLink;
- private final FlattrStatus flattrStatus;
/**
* Is true if the database contains any chapters that belong to this item. This attribute is only
@@ -92,7 +89,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
public FeedItem() {
this.state = UNPLAYED;
- this.flattrStatus = new FlattrStatus();
this.hasChapters = false;
}
@@ -100,7 +96,7 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
* This constructor is used by DBReader.
* */
public FeedItem(long id, String title, String link, Date pubDate, String paymentLink, long feedId,
- FlattrStatus flattrStatus, boolean hasChapters, String imageUrl, int state,
+ boolean hasChapters, String imageUrl, int state,
String itemIdentifier, long autoDownload) {
this.id = id;
this.title = title;
@@ -108,7 +104,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
this.pubDate = pubDate;
this.paymentLink = paymentLink;
this.feedId = feedId;
- this.flattrStatus = flattrStatus;
this.hasChapters = hasChapters;
this.imageUrl = imageUrl;
this.state = state;
@@ -127,7 +122,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
this.pubDate = (pubDate != null) ? (Date) pubDate.clone() : null;
this.state = state;
this.feed = feed;
- this.flattrStatus = new FlattrStatus();
this.hasChapters = false;
}
@@ -142,7 +136,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
this.pubDate = (pubDate != null) ? (Date) pubDate.clone() : null;
this.state = state;
this.feed = feed;
- this.flattrStatus = new FlattrStatus();
this.hasChapters = hasChapters;
}
@@ -153,7 +146,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
int indexPubDate = cursor.getColumnIndex(PodDBAdapter.KEY_PUBDATE);
int indexPaymentLink = cursor.getColumnIndex(PodDBAdapter.KEY_PAYMENT_LINK);
int indexFeedId = cursor.getColumnIndex(PodDBAdapter.KEY_FEED);
- int indexFlattrStatus = cursor.getColumnIndex(PodDBAdapter.KEY_FLATTR_STATUS);
int indexHasChapters = cursor.getColumnIndex(PodDBAdapter.KEY_HAS_CHAPTERS);
int indexRead = cursor.getColumnIndex(PodDBAdapter.KEY_READ);
int indexItemIdentifier = cursor.getColumnIndex(PodDBAdapter.KEY_ITEM_IDENTIFIER);
@@ -167,13 +159,12 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
String paymentLink = cursor.getString(indexPaymentLink);
long feedId = cursor.getLong(indexFeedId);
boolean hasChapters = cursor.getInt(indexHasChapters) > 0;
- FlattrStatus flattrStatus = new FlattrStatus(cursor.getLong(indexFlattrStatus));
int state = cursor.getInt(indexRead);
String itemIdentifier = cursor.getString(indexItemIdentifier);
long autoDownload = cursor.getLong(indexAutoDownload);
String imageUrl = cursor.getString(indexImageUrl);
- return new FeedItem(id, title, link, pubDate, paymentLink, feedId, flattrStatus,
+ return new FeedItem(id, title, link, pubDate, paymentLink, feedId,
hasChapters, imageUrl, state, itemIdentifier, autoDownload);
}
@@ -329,10 +320,6 @@ public class FeedItem extends FeedComponent implements ShownotesProvider, Flattr
public void setContentEncoded(String contentEncoded) {
this.contentEncoded = contentEncoded;
}
-
- public FlattrStatus getFlattrStatus() {
- return flattrStatus;
- }
public String getPaymentLink() {
return paymentLink;
diff --git a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java
index f3a43e2d0..218570632 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/feed/FeedMedia.java
@@ -25,7 +25,6 @@ import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.storage.PodDBAdapter;
import de.danoeh.antennapod.core.util.ChapterUtils;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
import de.danoeh.antennapod.core.util.playback.Playable;
public class FeedMedia extends FeedFile implements Playable {
@@ -49,7 +48,7 @@ public class FeedMedia extends FeedFile implements Playable {
private int duration;
private int position; // Current position in file
private long lastPlayedTime; // Last time this media was played (in ms)
- private int played_duration; // How many ms of this file have been played (for autoflattring)
+ private int played_duration; // How many ms of this file have been played
private long size; // File size in Byte
private String mime_type;
@Nullable private volatile FeedItem item;
@@ -526,16 +525,6 @@ public class FeedMedia extends FeedFile implements Playable {
.build();
GpodnetPreferences.enqueueEpisodeAction(action);
}
- // Auto flattr
- float autoFlattrThreshold = UserPreferences.getAutoFlattrPlayedDurationThreshold();
- if (FlattrUtils.hasToken() &&
- UserPreferences.isAutoFlattr() &&
- item.getPaymentLink() != null &&
- item.getFlattrStatus().getUnflattred() &&
- ((completed && autoFlattrThreshold <= 1.0f) ||
- (played_duration >= autoFlattrThreshold * duration))) {
- DBTasks.flattrItemIfLoggedIn(context, item);
- }
}
}
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 cfa217a12..9348ca807 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
@@ -95,8 +95,6 @@ public class UserPreferences {
private static final String PREF_PROXY_PASSWORD = "prefProxyPassword";
// Services
- private static final String PREF_AUTO_FLATTR = "pref_auto_flattr";
- private static final String PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD = "prefAutoFlattrPlayedDurationThreshold";
private static final String PREF_GPODNET_NOTIFICATIONS = "pref_gpodnet_notifications";
// Other
@@ -318,10 +316,6 @@ public class UserPreferences {
return prefs.getBoolean(PREF_DELETE_REMOVES_FROM_QUEUE, false);
}
- public static boolean isAutoFlattr() {
- return prefs.getBoolean(PREF_AUTO_FLATTR, false);
- }
-
public static String getPlaybackSpeed() {
return prefs.getString(PREF_PLAYBACK_SPEED, "1.00");
}
@@ -450,16 +444,7 @@ public class UserPreferences {
}
public static int getRewindSecs() {
- return prefs.getInt(PREF_REWIND_SECS, 30);
- }
-
-
- /**
- * Returns the time after which an episode should be auto-flattr'd in percent of the episode's
- * duration.
- */
- public static float getAutoFlattrPlayedDurationThreshold() {
- return prefs.getFloat(PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD, 0.8f);
+ return prefs.getInt(PREF_REWIND_SECS, 10);
}
public static String[] getAutodownloadSelectedNetworks() {
@@ -588,23 +573,6 @@ public class UserPreferences {
AutoUpdateManager.disableAutoUpdate();
}
- /**
- * Change the auto-flattr settings
- *
- * @param enabled Whether automatic flattring should be enabled at all
- * @param autoFlattrThreshold The percentage of playback time after which an episode should be
- * flattrd. Must be a value between 0 and 1 (inclusive)
- * */
- public static void setAutoFlattrSettings( boolean enabled, float autoFlattrThreshold) {
- if(autoFlattrThreshold < 0.0 || autoFlattrThreshold > 1.0) {
- throw new IllegalArgumentException("Flattr threshold must be in range [0.0, 1.0]");
- }
- prefs.edit()
- .putBoolean(PREF_AUTO_FLATTR, enabled)
- .putFloat(PREF_AUTO_FLATTR_PLAYED_DURATION_THRESHOLD, autoFlattrThreshold)
- .apply();
- }
-
public static boolean gpodnetNotificationsEnabled() {
return prefs.getBoolean(PREF_GPODNET_NOTIFICATIONS, true);
}
@@ -681,12 +649,16 @@ public class UserPreferences {
return selectedSpeeds;
}
+ public static String getMediaPlayer() {
+ return prefs.getString(PREF_MEDIA_PLAYER, PREF_MEDIA_PLAYER_EXOPLAYER);
+ }
+
public static boolean useSonic() {
- return prefs.getString(PREF_MEDIA_PLAYER, "sonic").equals("sonic");
+ return getMediaPlayer().equals("sonic");
}
public static boolean useExoplayer() {
- return prefs.getString(PREF_MEDIA_PLAYER, "sonic").equals(PREF_MEDIA_PLAYER_EXOPLAYER);
+ return getMediaPlayer().equals(PREF_MEDIA_PLAYER_EXOPLAYER);
}
public static void enableSonic() {
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 1165d689a..b26d3011d 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
@@ -41,6 +41,7 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
private PlaybackService playbackService;
private final Object waitForService = new Object();
+ private final Object waitUsingService = new Object();
private static final int JOB_ID = -17001;
@@ -67,7 +68,11 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
}
}
- updateViews();
+ synchronized (waitUsingService) {
+ if (playbackService != null) {
+ updateViews();
+ }
+ }
if (playbackService != null) {
try {
@@ -230,7 +235,9 @@ public class PlayerWidgetJobService extends SafeJobIntentService {
@Override
public void onServiceDisconnected(ComponentName name) {
- playbackService = null;
+ synchronized (waitUsingService) {
+ playbackService = null;
+ }
Log.d(TAG, "Disconnected from service");
}
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 7988526d9..9a8353806 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
@@ -243,7 +243,7 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
callback.onMediaChanged(false);
if (stream) {
mediaPlayer.setDataSource(media.getStreamUrl());
- } else if (new File(media.getLocalMediaUrl()).canRead()) {
+ } else if (media.getLocalMediaUrl() != null && new File(media.getLocalMediaUrl()).canRead()) {
mediaPlayer.setDataSource(media.getLocalMediaUrl());
} else {
throw new IOException("Unable to read local file " + media.getLocalMediaUrl());
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 1b579f99a..19faa5aed 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
@@ -26,7 +26,6 @@ import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.comparator.DownloadStatusComparator;
import de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator;
import de.danoeh.antennapod.core.util.comparator.PlaybackCompletionDateComparator;
-import de.danoeh.antennapod.core.util.flattr.FlattrThing;
/**
* Provides methods for reading data from the AntennaPod database.
@@ -1004,36 +1003,6 @@ public final class DBReader {
}
/**
- * Returns the flattr queue as a List of FlattrThings. The list consists of Feeds and FeedItems.
- *
- * @return The flattr queue as a List.
- */
- public static List<FlattrThing> getFlattrQueue() {
- Log.d(TAG, "getFlattrQueue() called with: " + "");
- PodDBAdapter adapter = PodDBAdapter.getInstance();
- adapter.open();
- List<FlattrThing> result = new ArrayList<>();
-
- // load feeds
- Cursor feedCursor = adapter.getFeedsInFlattrQueueCursor();
- if (feedCursor.moveToFirst()) {
- do {
- result.add(extractFeedFromCursorRow(feedCursor));
- } while (feedCursor.moveToNext());
- }
- feedCursor.close();
-
- //load feed items
- Cursor feedItemCursor = adapter.getFeedItemsInFlattrQueueCursor();
- result.addAll(extractItemlistFromCursor(adapter, feedItemCursor));
- feedItemCursor.close();
-
- adapter.close();
- Log.d(TAG, "Returning flattrQueueIterator for queue with " + result.size() + " items.");
- 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
* items.
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 dab8e19b5..e68bff16e 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
@@ -20,8 +20,6 @@ import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicBoolean;
import de.danoeh.antennapod.core.ClientConfig;
-import de.danoeh.antennapod.core.asynctask.FlattrClickWorker;
-import de.danoeh.antennapod.core.asynctask.FlattrStatusFetcher;
import de.danoeh.antennapod.core.feed.EventDistributor;
import de.danoeh.antennapod.core.feed.Feed;
import de.danoeh.antennapod.core.feed.FeedItem;
@@ -35,7 +33,6 @@ import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.comparator.FeedItemPubdateComparator;
import de.danoeh.antennapod.core.util.exception.MediaFileNotFoundException;
-import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
import static android.content.Context.MODE_PRIVATE;
@@ -182,14 +179,6 @@ public final class DBTasks {
SharedPreferences prefs = context.getSharedPreferences(PREF_NAME, MODE_PRIVATE);
prefs.edit().putLong(PREF_LAST_REFRESH, System.currentTimeMillis()).apply();
- if (FlattrUtils.hasToken()) {
- Log.d(TAG, "Flattring all pending things.");
- new FlattrClickWorker(context).executeAsync(); // flattr pending things
-
- Log.d(TAG, "Fetching flattr status.");
- new FlattrStatusFetcher(context).start();
-
- }
if (ClientConfig.gpodnetCallbacks.gpodnetEnabled()) {
GpodnetSyncService.sendSyncIntent(context);
}
@@ -771,37 +760,4 @@ public final class DBTasks {
this.result = result;
}
}
-
- /**
- * Adds the given FeedItem to the flattr queue if the user is logged in. Otherwise, a dialog
- * will be opened that lets the user go either to the login screen or the website of the flattr thing.
- *
- * @param context
- * @param item
- */
- public static void flattrItemIfLoggedIn(Context context, FeedItem item) {
- if (FlattrUtils.hasToken()) {
- item.getFlattrStatus().setFlattrQueue();
- DBWriter.setFlattredStatus(context, item, true);
- } else {
- FlattrUtils.showNoTokenDialogOrRedirect(context, item.getPaymentLink());
- }
- }
-
- /**
- * Adds the given Feed to the flattr queue if the user is logged in. Otherwise, a dialog
- * will be opened that lets the user go either to the login screen or the website of the flattr thing.
- *
- * @param context
- * @param feed
- */
- public static void flattrFeedIfLoggedIn(Context context, Feed feed) {
- if (FlattrUtils.hasToken()) {
- feed.getFlattrStatus().setFlattrQueue();
- DBWriter.setFlattredStatus(context, feed, true);
- } else {
- FlattrUtils.showNoTokenDialogOrRedirect(context, feed.getPaymentLink());
- }
- }
-
}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java
index 0beb765e7..306f8d104 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/storage/DBUpgrader.java
@@ -76,10 +76,10 @@ class DBUpgrader {
}
if (oldVersion <= 10) {
db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS
- + " ADD COLUMN " + PodDBAdapter.KEY_FLATTR_STATUS
+ + " ADD COLUMN flattr_status"
+ " INTEGER");
db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_ITEMS
- + " ADD COLUMN " + PodDBAdapter.KEY_FLATTR_STATUS
+ + " ADD COLUMN flattr_status"
+ " INTEGER");
db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA
+ " ADD COLUMN " + PodDBAdapter.KEY_PLAYED_DURATION
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 515b463db..2de811788 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
@@ -9,7 +9,6 @@ import android.support.annotation.NonNull;
import android.util.Log;
import org.greenrobot.eventbus.EventBus;
-import org.shredzone.flattr4j.model.Flattr;
import java.io.File;
import java.io.UnsupportedEncodingException;
@@ -26,7 +25,6 @@ import java.util.concurrent.Future;
import de.danoeh.antennapod.core.ClientConfig;
import de.danoeh.antennapod.core.R;
-import de.danoeh.antennapod.core.asynctask.FlattrClickWorker;
import de.danoeh.antennapod.core.event.FavoritesEvent;
import de.danoeh.antennapod.core.event.FeedItemEvent;
import de.danoeh.antennapod.core.event.MessageEvent;
@@ -47,9 +45,6 @@ import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.Permutor;
import de.danoeh.antennapod.core.util.QueueSorter;
-import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
-import de.danoeh.antennapod.core.util.flattr.FlattrThing;
-import de.danoeh.antennapod.core.util.flattr.SimpleFlattrThing;
/**
* Provides methods for writing data to AntennaPod's database.
@@ -685,7 +680,7 @@ public class DBWriter {
*
* @param feedId ID of the Feed.
*/
- public static Future<?> markFeedSeen(final long feedId) {
+ public static Future<?> removeFeedNewFlag(final long feedId) {
return dbExec.submit(() -> {
final PodDBAdapter adapter = PodDBAdapter.getInstance();
adapter.open();
@@ -729,7 +724,7 @@ public class DBWriter {
/**
* Sets the 'read'-attribute of all NEW FeedItems to UNPLAYED.
*/
- public static Future<?> markNewItemsSeen() {
+ public static Future<?> removeAllNewFlags() {
return dbExec.submit(() -> {
final PodDBAdapter adapter = PodDBAdapter.getInstance();
adapter.open();
@@ -855,44 +850,6 @@ public class DBWriter {
}
/**
- * Saves the FlattrStatus of a FeedItem object in the database.
- *
- * @param startFlattrClickWorker true if FlattrClickWorker should be started after the FlattrStatus has been saved
- */
- private static Future<?> setFeedItemFlattrStatus(final Context context,
- final FeedItem item,
- final boolean startFlattrClickWorker) {
- return dbExec.submit(() -> {
- PodDBAdapter adapter = PodDBAdapter.getInstance();
- adapter.open();
- adapter.setFeedItemFlattrStatus(item);
- adapter.close();
- if (startFlattrClickWorker) {
- new FlattrClickWorker(context).executeAsync();
- }
- });
- }
-
- /**
- * Saves the FlattrStatus of a Feed object in the database.
- *
- * @param startFlattrClickWorker true if FlattrClickWorker should be started after the FlattrStatus has been saved
- */
- private static Future<?> setFeedFlattrStatus(final Context context,
- final Feed feed,
- final boolean startFlattrClickWorker) {
- return dbExec.submit(() -> {
- PodDBAdapter adapter = PodDBAdapter.getInstance();
- adapter.open();
- adapter.setFeedFlattrStatus(feed);
- adapter.close();
- if (startFlattrClickWorker) {
- new FlattrClickWorker(context).executeAsync();
- }
- });
- }
-
- /**
* Saves if a feed's last update failed
*
* @param lastUpdateFailed true if last update failed
@@ -917,77 +874,6 @@ public class DBWriter {
});
}
-
- /**
- * format an url for querying the database
- * (postfix a / and apply percent-encoding)
- */
- private static String formatURIForQuery(String uri) {
- try {
- return URLEncoder.encode(uri.endsWith("/") ? uri.substring(0, uri.length() - 1) : uri, "UTF-8");
- } catch (UnsupportedEncodingException e) {
- Log.e(TAG, e.getMessage());
- return "";
- }
- }
-
-
- /**
- * Set flattr status of the passed thing (either a FeedItem or a Feed)
- *
- * @param context
- * @param thing
- * @param startFlattrClickWorker true if FlattrClickWorker should be started after the FlattrStatus has been saved
- * @return
- */
- public static Future<?> setFlattredStatus(Context context, FlattrThing thing, boolean startFlattrClickWorker) {
- // must propagate this to back db
- if (thing instanceof FeedItem) {
- return setFeedItemFlattrStatus(context, (FeedItem) thing, startFlattrClickWorker);
- } else if (thing instanceof Feed) {
- return setFeedFlattrStatus(context, (Feed) thing, startFlattrClickWorker);
- } else if (thing instanceof SimpleFlattrThing) {
- // SimpleFlattrThings are generated on the fly and do not have DB backing
- } else {
- Log.e(TAG, "flattrQueue processing - thing is neither FeedItem nor Feed nor SimpleFlattrThing");
- }
-
- return null;
- }
-
- /**
- * Reset flattr status to unflattrd for all items
- */
- public static Future<?> clearAllFlattrStatus() {
- Log.d(TAG, "clearAllFlattrStatus()");
- return dbExec.submit(() -> {
- PodDBAdapter adapter = PodDBAdapter.getInstance();
- adapter.open();
- adapter.clearAllFlattrStatus();
- adapter.close();
- });
- }
-
- /**
- * Set flattr status of the feeds/feeditems in flattrList to flattred at the given timestamp,
- * where the information has been retrieved from the flattr API
- */
- public static Future<?> setFlattredStatus(final List<Flattr> flattrList) {
- Log.d(TAG, "setFlattredStatus to status retrieved from flattr api running with " + flattrList.size() + " items");
- // clear flattr status in db
- clearAllFlattrStatus();
-
- // submit list with flattred things having normalized URLs to db
- return dbExec.submit(() -> {
- PodDBAdapter adapter = PodDBAdapter.getInstance();
- adapter.open();
- for (Flattr flattr : flattrList) {
- adapter.setItemFlattrStatus(formatURIForQuery(flattr.getThing().getUrl()), new FlattrStatus(flattr.getCreated().getTime()));
- }
- adapter.close();
- });
- }
-
/**
* Sort the FeedItems in the queue with the given Permutor.
*
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 405c246c9..f7956372b 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
@@ -38,7 +38,6 @@ import de.danoeh.antennapod.core.feed.FeedPreferences;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.service.download.DownloadStatus;
import de.danoeh.antennapod.core.util.LongIntMap;
-import de.danoeh.antennapod.core.util.flattr.FlattrStatus;
import org.greenrobot.eventbus.EventBus;
// TODO Remove media column from feeditem table
@@ -96,7 +95,6 @@ public class PodDBAdapter {
public static final String KEY_HAS_CHAPTERS = "has_simple_chapters";
public static final String KEY_TYPE = "type";
public static final String KEY_ITEM_IDENTIFIER = "item_identifier";
- public static final String KEY_FLATTR_STATUS = "flattr_status";
public static final String KEY_FEED_IDENTIFIER = "feed_identifier";
public static final String KEY_REASON_DETAILED = "reason_detailed";
public static final String KEY_DOWNLOADSTATUS_TITLE = "title";
@@ -139,7 +137,6 @@ public class PodDBAdapter {
+ KEY_LASTUPDATE + " TEXT," + KEY_LANGUAGE + " TEXT," + KEY_AUTHOR
+ " TEXT," + KEY_IMAGE_URL + " TEXT," + KEY_TYPE + " TEXT,"
+ KEY_FEED_IDENTIFIER + " TEXT," + KEY_AUTO_DOWNLOAD + " INTEGER DEFAULT 1,"
- + KEY_FLATTR_STATUS + " INTEGER,"
+ KEY_USERNAME + " TEXT,"
+ KEY_PASSWORD + " TEXT,"
+ KEY_INCLUDE_FILTER + " TEXT DEFAULT '',"
@@ -158,7 +155,6 @@ public class PodDBAdapter {
+ KEY_DESCRIPTION + " TEXT," + KEY_PAYMENT_LINK + " TEXT,"
+ KEY_MEDIA + " INTEGER," + KEY_FEED + " INTEGER,"
+ KEY_HAS_CHAPTERS + " INTEGER," + KEY_ITEM_IDENTIFIER + " TEXT,"
- + KEY_FLATTR_STATUS + " INTEGER,"
+ KEY_IMAGE_URL + " TEXT,"
+ KEY_AUTO_DOWNLOAD + " INTEGER)";
@@ -239,7 +235,6 @@ public class PodDBAdapter {
TABLE_NAME_FEEDS + "." + KEY_FEED_IDENTIFIER,
TABLE_NAME_FEEDS + "." + KEY_AUTO_DOWNLOAD,
TABLE_NAME_FEEDS + "." + KEY_KEEP_UPDATED,
- TABLE_NAME_FEEDS + "." + KEY_FLATTR_STATUS,
TABLE_NAME_FEEDS + "." + KEY_IS_PAGED,
TABLE_NAME_FEEDS + "." + KEY_NEXT_PAGE_LINK,
TABLE_NAME_FEEDS + "." + KEY_USERNAME,
@@ -266,7 +261,6 @@ public class PodDBAdapter {
TABLE_NAME_FEED_ITEMS + "." + KEY_FEED,
TABLE_NAME_FEED_ITEMS + "." + KEY_HAS_CHAPTERS,
TABLE_NAME_FEED_ITEMS + "." + KEY_ITEM_IDENTIFIER,
- TABLE_NAME_FEED_ITEMS + "." + KEY_FLATTR_STATUS,
TABLE_NAME_FEED_ITEMS + "." + KEY_IMAGE_URL,
TABLE_NAME_FEED_ITEMS + "." + KEY_AUTO_DOWNLOAD
};
@@ -382,9 +376,6 @@ public class PodDBAdapter {
values.put(KEY_TYPE, feed.getType());
values.put(KEY_FEED_IDENTIFIER, feed.getFeedIdentifier());
- Log.d(TAG, "Setting feed with flattr status " + feed.getTitle() + ": " + feed.getFlattrStatus().toLong());
-
- values.put(KEY_FLATTR_STATUS, feed.getFlattrStatus().toLong());
values.put(KEY_IS_PAGED, feed.isPaged());
values.put(KEY_NEXT_PAGE_LINK, feed.getNextPageLink());
if (feed.getItemFilter() != null && feed.getItemFilter().getValues().length > 0) {
@@ -516,31 +507,6 @@ public class PodDBAdapter {
}
/**
- * Update the flattr status of a feed
- */
- public void setFeedFlattrStatus(Feed feed) {
- ContentValues values = new ContentValues();
- values.put(KEY_FLATTR_STATUS, feed.getFlattrStatus().toLong());
- db.update(TABLE_NAME_FEEDS, values, KEY_ID + "=?", new String[]{String.valueOf(feed.getId())});
- }
-
- /**
- * Get all feeds in the flattr queue.
- */
- public Cursor getFeedsInFlattrQueueCursor() {
- return db.query(TABLE_NAME_FEEDS, FEED_SEL_STD, KEY_FLATTR_STATUS + "=?",
- new String[]{String.valueOf(FlattrStatus.STATUS_QUEUE)}, null, null, null);
- }
-
- /**
- * Get all feed items in the flattr queue.
- */
- public Cursor getFeedItemsInFlattrQueueCursor() {
- return db.query(TABLE_NAME_FEED_ITEMS, FEEDITEM_SEL_FI_SMALL, KEY_FLATTR_STATUS + "=?",
- new String[]{String.valueOf(FlattrStatus.STATUS_QUEUE)}, null, null, null);
- }
-
- /**
* Updates the download URL of a Feed.
*/
public void setFeedDownloadUrl(String original, String updated) {
@@ -578,61 +544,6 @@ public class PodDBAdapter {
}
/**
- * Update the flattr status of a FeedItem
- */
- public void setFeedItemFlattrStatus(FeedItem feedItem) {
- ContentValues values = new ContentValues();
- values.put(KEY_FLATTR_STATUS, feedItem.getFlattrStatus().toLong());
- db.update(TABLE_NAME_FEED_ITEMS, values, KEY_ID + "=?", new String[]{String.valueOf(feedItem.getId())});
- }
-
- /**
- * Update the flattr status of a feed or feed item specified by its payment link
- * and the new flattr status to use
- */
- public void setItemFlattrStatus(String url, FlattrStatus status) {
- //Log.d(TAG, "setItemFlattrStatus(" + url + ") = " + status.toString());
- ContentValues values = new ContentValues();
- values.put(KEY_FLATTR_STATUS, status.toLong());
-
- // regexps in sqlite would be neat!
- String[] query_urls = new String[]{
- "*" + url + "&*",
- "*" + url + "%2F&*",
- "*" + url + "",
- "*" + url + "%2F"
- };
-
- if (db.update(TABLE_NAME_FEEDS, values,
- KEY_PAYMENT_LINK + " GLOB ?"
- + " OR " + KEY_PAYMENT_LINK + " GLOB ?"
- + " OR " + KEY_PAYMENT_LINK + " GLOB ?"
- + " OR " + KEY_PAYMENT_LINK + " GLOB ?", query_urls
- ) > 0) {
- Log.i(TAG, "setItemFlattrStatus found match for " + url + " = " + status.toLong() + " in Feeds table");
- return;
- }
- if (db.update(TABLE_NAME_FEED_ITEMS, values,
- KEY_PAYMENT_LINK + " GLOB ?"
- + " OR " + KEY_PAYMENT_LINK + " GLOB ?"
- + " OR " + KEY_PAYMENT_LINK + " GLOB ?"
- + " OR " + KEY_PAYMENT_LINK + " GLOB ?", query_urls
- ) > 0) {
- Log.i(TAG, "setItemFlattrStatus found match for " + url + " = " + status.toLong() + " in FeedsItems table");
- }
- }
-
- /**
- * Reset flattr status to unflattrd for all items
- */
- public void clearAllFlattrStatus() {
- ContentValues values = new ContentValues();
- values.put(KEY_FLATTR_STATUS, 0);
- db.update(TABLE_NAME_FEEDS, values, null, null);
- db.update(TABLE_NAME_FEED_ITEMS, values, null, null);
- }
-
- /**
* Inserts or updates a feeditem entry
*
* @param item The FeedItem
@@ -665,7 +576,6 @@ public class PodDBAdapter {
}
values.put(KEY_HAS_CHAPTERS, item.getChapters() != null || item.hasChapters());
values.put(KEY_ITEM_IDENTIFIER, item.getItemIdentifier());
- values.put(KEY_FLATTR_STATUS, item.getFlattrStatus().toLong());
values.put(KEY_AUTO_DOWNLOAD, item.getAutoDownload());
values.put(KEY_IMAGE_URL, item.getImageUrl());
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java
deleted file mode 100644
index d4d5843d2..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrServiceCreator.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package de.danoeh.antennapod.core.util.flattr;
-
-import android.util.Log;
-
-import org.shredzone.flattr4j.FlattrFactory;
-import org.shredzone.flattr4j.FlattrService;
-import org.shredzone.flattr4j.oauth.AccessToken;
-
-import de.danoeh.antennapod.core.BuildConfig;
-
-/** Ensures that only one instance of the FlattrService class exists at a time */
-
-class FlattrServiceCreator {
- private FlattrServiceCreator(){}
-
- public static final String TAG = "FlattrServiceCreator";
-
- private static volatile FlattrService flattrService;
-
- public static synchronized FlattrService getService(AccessToken token) {
- if (flattrService == null) {
- flattrService = FlattrFactory.getInstance().createFlattrService(token);
- }
- return flattrService;
- }
-
- public static synchronized void deleteFlattrService() {
- if (BuildConfig.DEBUG) Log.d(TAG, "Deleting service instance");
- flattrService = null;
- }
-}
-
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java
deleted file mode 100644
index 40a9fc7d5..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrStatus.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package de.danoeh.antennapod.core.util.flattr;
-
-import java.util.Calendar;
-
-public class FlattrStatus {
- private static final int STATUS_UNFLATTERED = 0;
- public static final int STATUS_QUEUE = 1;
- private static final int STATUS_FLATTRED = 2;
-
- private int status = STATUS_UNFLATTERED;
- private Calendar lastFlattred;
-
- public FlattrStatus() {
- status = STATUS_UNFLATTERED;
- lastFlattred = Calendar.getInstance();
- }
-
- public FlattrStatus(long status) {
- lastFlattred = Calendar.getInstance();
- fromLong(status);
- }
-
- public void setFlattred() {
- status = STATUS_FLATTRED;
- lastFlattred = Calendar.getInstance();
- }
-
- public void setUnflattred() {
- status = STATUS_UNFLATTERED;
- }
-
- public boolean getUnflattred() {
- return status == STATUS_UNFLATTERED;
- }
-
- public void setFlattrQueue() {
- if (flattrable())
- status = STATUS_QUEUE;
- }
-
- private void fromLong(long status) {
- if (status == STATUS_UNFLATTERED || status == STATUS_QUEUE)
- this.status = (int) status;
- else {
- this.status = STATUS_FLATTRED;
- lastFlattred.setTimeInMillis(status);
- }
- }
-
- public long toLong() {
- if (status == STATUS_UNFLATTERED || status == STATUS_QUEUE)
- return status;
- else {
- return lastFlattred.getTimeInMillis();
- }
- }
-
- public boolean flattrable() {
- Calendar firstOfMonth = Calendar.getInstance();
- firstOfMonth.set(Calendar.DAY_OF_MONTH, Calendar.getInstance().getActualMinimum(Calendar.DAY_OF_MONTH));
-
- return (status == STATUS_UNFLATTERED) || (status == STATUS_FLATTRED && firstOfMonth.after(lastFlattred) );
- }
-
- public boolean getFlattrQueue() {
- return status == STATUS_QUEUE;
- }
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java
deleted file mode 100644
index d5bb88771..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrThing.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package de.danoeh.antennapod.core.util.flattr;
-
-public interface FlattrThing {
- String getTitle();
- String getPaymentLink();
- FlattrStatus getFlattrStatus();
-}
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java
deleted file mode 100644
index 919fc82f2..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/FlattrUtils.java
+++ /dev/null
@@ -1,220 +0,0 @@
-package de.danoeh.antennapod.core.util.flattr;
-
-import android.content.Context;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.net.Uri;
-import android.preference.PreferenceManager;
-import android.support.v7.app.AlertDialog;
-import android.text.TextUtils;
-import android.util.Log;
-
-import org.shredzone.flattr4j.FlattrService;
-import org.shredzone.flattr4j.exception.FlattrException;
-import org.shredzone.flattr4j.model.Flattr;
-import org.shredzone.flattr4j.model.Thing;
-import org.shredzone.flattr4j.oauth.AccessToken;
-import org.shredzone.flattr4j.oauth.AndroidAuthenticator;
-import org.shredzone.flattr4j.oauth.Scope;
-
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.EnumSet;
-import java.util.List;
-import java.util.TimeZone;
-
-import de.danoeh.antennapod.core.ClientConfig;
-import de.danoeh.antennapod.core.R;
-import de.danoeh.antennapod.core.asynctask.FlattrTokenFetcher;
-import de.danoeh.antennapod.core.storage.DBWriter;
-
-/**
- * Utility methods for doing something with flattr.
- */
-
-public class FlattrUtils {
- private FlattrUtils(){}
-
- private static final String TAG = "FlattrUtils";
-
- private static final String HOST_NAME = "de.danoeh.antennapod";
-
- private static final String PREF_ACCESS_TOKEN = "de.danoeh.antennapod.preference.flattrAccessToken";
-
- private static volatile AccessToken cachedToken;
-
- private static AndroidAuthenticator createAuthenticator() {
- return new AndroidAuthenticator(HOST_NAME, ClientConfig.flattrCallbacks.getFlattrAppKey(),
- ClientConfig.flattrCallbacks.getFlattrAppSecret());
- }
-
- public static void startAuthProcess(Context context) throws FlattrException {
- AndroidAuthenticator auth = createAuthenticator();
- auth.setScope(EnumSet.of(Scope.FLATTR));
- Intent intent = auth.createAuthenticateIntent();
- context.startActivity(intent);
- }
-
- private static AccessToken retrieveToken() {
- if (cachedToken == null) {
- Log.d(TAG, "Retrieving access token");
- String token = PreferenceManager.getDefaultSharedPreferences(
- ClientConfig.applicationCallbacks.getApplicationInstance())
- .getString(PREF_ACCESS_TOKEN, null);
- if (token != null) {
- Log.d(TAG, "Found access token. Caching.");
- cachedToken = new AccessToken(token);
- } else {
- Log.d(TAG, "No access token found");
- return null;
- }
- }
- return cachedToken;
-
- }
-
- /**
- * Returns true if FLATTR_APP_KEY and FLATTR_APP_SECRET in BuildConfig are not null and not empty
- */
- public static boolean hasAPICredentials() {
- return !TextUtils.isEmpty(ClientConfig.flattrCallbacks.getFlattrAppKey())
- && !TextUtils.isEmpty(ClientConfig.flattrCallbacks.getFlattrAppSecret());
- }
-
- public static boolean hasToken() {
- return retrieveToken() != null;
- }
-
- public static void storeToken(AccessToken token) {
- Log.d(TAG, "Storing token");
- SharedPreferences.Editor editor = PreferenceManager
- .getDefaultSharedPreferences(ClientConfig.applicationCallbacks.getApplicationInstance()).edit();
- if (token != null) {
- editor.putString(PREF_ACCESS_TOKEN, token.getToken());
- } else {
- editor.putString(PREF_ACCESS_TOKEN, null);
- }
- editor.commit();
- cachedToken = token;
- }
-
- private static void deleteToken() {
- Log.d(TAG, "Deleting flattr token");
- storeToken(null);
- }
-
- public static void clickUrl(Context context, String url)
- throws FlattrException {
- if (hasToken()) {
- FlattrService fs = FlattrServiceCreator.getService(retrieveToken());
- fs.flattr(url);
- } else {
- Log.e(TAG, "clickUrl was called with null access token");
- }
- }
-
- public static List<Flattr> retrieveFlattredThings()
- throws FlattrException {
- ArrayList<Flattr> myFlattrs = new ArrayList<>();
-
- if (hasToken()) {
- FlattrService fs = FlattrServiceCreator.getService(retrieveToken());
-
- Calendar firstOfMonth = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
- firstOfMonth.set(Calendar.MILLISECOND, 0);
- firstOfMonth.set(Calendar.SECOND, 0);
- firstOfMonth.set(Calendar.MINUTE, 0);
- firstOfMonth.set(Calendar.HOUR_OF_DAY, 0);
- firstOfMonth.set(Calendar.DAY_OF_MONTH, Calendar.getInstance().getActualMinimum(Calendar.DAY_OF_MONTH));
-
- Date firstOfMonthDate = firstOfMonth.getTime();
-
- // subscriptions some times get flattrd slightly before midnight - give it an hour leeway
- firstOfMonthDate = new Date(firstOfMonthDate.getTime() - 60 * 60 * 1000);
-
- final int FLATTR_COUNT = 30;
- final int FLATTR_MAXPAGE = 5;
-
- for (int page = 0; page < FLATTR_MAXPAGE; page++) {
- for (Flattr fl : fs.getMyFlattrs(FLATTR_COUNT, page)) {
- if (fl.getCreated().after(firstOfMonthDate))
- myFlattrs.add(fl);
- else
- break;
- }
- }
-
- Log.d(TAG, "Got my flattrs list of length " + Integer.toString(myFlattrs.size()) + " comparison date" + firstOfMonthDate);
- for (Flattr fl : myFlattrs) {
- Thing thing = fl.getThing();
- Log.d(TAG, "Flattr thing: " + fl.getThingId() + " name: " + thing.getTitle() + " url: " + thing.getUrl() + " on: " + fl.getCreated());
- }
- } else {
- Log.e(TAG, "retrieveFlattrdThings was called with null access token");
- }
-
- return myFlattrs;
- }
-
- public static void handleCallback(Context context, Uri uri) {
- AndroidAuthenticator auth = createAuthenticator();
- new FlattrTokenFetcher(context, auth, uri).executeAsync();
- }
-
- public static void revokeAccessToken(Context context) {
- Log.d(TAG, "Revoking access token");
- deleteToken();
- FlattrServiceCreator.deleteFlattrService();
- showRevokeDialog(context);
- DBWriter.clearAllFlattrStatus();
- }
-
- // ------------------------------------------------ DIALOGS
-
- private static void showRevokeDialog(final Context context) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
- builder.setTitle(R.string.access_revoked_title);
- builder.setMessage(R.string.access_revoked_info);
- builder.setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.cancel());
- builder.create().show();
- }
-
- /**
- * Opens a dialog that ask the user to either connect the app with flattr or to be redirected to
- * the thing's website.
- * If no API credentials are available, the user will immediately be redirected to the thing's website.
- */
- public static void showNoTokenDialogOrRedirect(final Context context, final String url) {
- if (hasAPICredentials()) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
- builder.setTitle(R.string.no_flattr_token_title);
- builder.setMessage(R.string.no_flattr_token_msg);
- builder.setPositiveButton(R.string.authenticate_now_label,
- (dialog, which) -> context.startActivity(
- ClientConfig.flattrCallbacks.getFlattrAuthenticationActivityIntent(context))
- );
-
- builder.setNegativeButton(R.string.visit_website_label,
- (dialog, which) -> {
- Uri uri = Uri.parse(url);
- context.startActivity(new Intent(Intent.ACTION_VIEW,
- uri));
- }
- );
- builder.create().show();
- } else {
- Uri uri = Uri.parse(url);
- context.startActivity(new Intent(Intent.ACTION_VIEW, uri));
- }
- }
-
- public static void showErrorDialog(final Context context, final String msg) {
- AlertDialog.Builder builder = new AlertDialog.Builder(context);
- builder.setTitle(R.string.error_label);
- builder.setMessage(msg);
- builder.setNeutralButton(android.R.string.ok, (dialog, which) -> dialog.cancel());
- builder.create().show();
- }
-
-} \ No newline at end of file
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java b/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java
deleted file mode 100644
index 43cd5f170..000000000
--- a/core/src/main/java/de/danoeh/antennapod/core/util/flattr/SimpleFlattrThing.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package de.danoeh.antennapod.core.util.flattr;
-
-/* SimpleFlattrThing is a trivial implementation of the FlattrThing interface */
-public class SimpleFlattrThing implements FlattrThing {
- public SimpleFlattrThing(String title, String url, FlattrStatus status)
- {
- this.title = title;
- this.url = url;
- this.status = status;
- }
-
- public String getTitle()
- {
- return this.title;
- }
-
- public String getPaymentLink()
- {
- return this.url;
- }
-
- public FlattrStatus getFlattrStatus()
- {
- return this.status;
- }
-
- private final String title;
- private final String url;
- private final FlattrStatus status;
-}
diff --git a/core/src/main/res/drawable/ic_bookmark_grey600_24dp.xml b/core/src/main/res/drawable/ic_bookmark_grey600_24dp.xml
new file mode 100644
index 000000000..d665d42a5
--- /dev/null
+++ b/core/src/main/res/drawable/ic_bookmark_grey600_24dp.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#b4b4b4"
+ android:viewportHeight="24.0" android:viewportWidth="24.0"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFb4b4b4" android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z"/>
+</vector>
diff --git a/core/src/main/res/drawable/ic_bookmark_white_24dp.xml b/core/src/main/res/drawable/ic_bookmark_white_24dp.xml
new file mode 100644
index 000000000..02728b731
--- /dev/null
+++ b/core/src/main/res/drawable/ic_bookmark_white_24dp.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#FFFFFF"
+ android:viewportHeight="24.0" android:viewportWidth="24.0"
+ android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
+ <path android:fillColor="#FFFFFFFF" android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z"/>
+</vector>
diff --git a/core/src/main/res/layout/player_widget.xml b/core/src/main/res/layout/player_widget.xml
index daf661002..f8d909a97 100644
--- a/core/src/main/res/layout/player_widget.xml
+++ b/core/src/main/res/layout/player_widget.xml
@@ -15,6 +15,7 @@
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
android:layout_margin="12dp"
android:background="@drawable/borderless_button_dark"
android:src="@drawable/ic_play_arrow_white_24dp" />
@@ -24,7 +25,9 @@
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
android:layout_toLeftOf="@id/butPlay"
+ android:layout_toStartOf="@id/butPlay"
android:background="@drawable/borderless_button_dark"
android:gravity="fill_horizontal"
android:orientation="horizontal" >
@@ -33,15 +36,12 @@
android:id="@+id/imgvCover"
android:layout_width="@android:dimen/app_icon_size"
android:layout_height="match_parent"
- android:layout_alignParentLeft="true"
- android:layout_margin="12dp"
- android:layout_toLeftOf="@id/layout_center" />
+ android:layout_margin="12dp" />
<LinearLayout
android:id="@+id/layout_center"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:layout_alignParentRight="true"
android:gravity="center_vertical"
android:orientation="vertical" >
@@ -49,7 +49,6 @@
android:id="@+id/txtNoPlaying"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginVertical="12dp"
android:maxLines="3"
android:text="@string/no_media_playing_label"
android:textColor="@color/white"
@@ -60,7 +59,6 @@
android:id="@+id/txtvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginVertical="8dp"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="@dimen/text_size_medium"
@@ -71,7 +69,7 @@
android:id="@+id/txtvProgress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginVertical="8dp"
+ android:layout_marginTop="4dp"
android:textColor="@color/white"
android:visibility="gone" />
</LinearLayout>
diff --git a/core/src/main/res/values-ar/strings.xml b/core/src/main/res/values-ar/strings.xml
index 5c29b5119..0e29db095 100644
--- a/core/src/main/res/values-ar/strings.xml
+++ b/core/src/main/res/values-ar/strings.xml
@@ -76,7 +76,7 @@
<!--'Add Feed' Activity labels-->
<!--Actions on feeds-->
<string name="mark_all_read_label">تعليمه ك تم تشغيله</string>
- <string name="mark_all_seen_label">تعليمه ك تم مشاهدته</string>
+ <string name="remove_all_new_flags_label">تعليمه ك تم مشاهدته</string>
<string name="show_info_label">اظهار المعلومات</string>
<string name="share_label">مشاركة</string>
<string name="share_link_label">مشاركة الرابط</string>
diff --git a/core/src/main/res/values-b+ast/strings.xml b/core/src/main/res/values-b+ast/strings.xml
index 421896086..29c7e4d87 100644
--- a/core/src/main/res/values-b+ast/strings.xml
+++ b/core/src/main/res/values-b+ast/strings.xml
@@ -96,9 +96,9 @@
<string name="mark_all_read_msg">Conseñáronse tolos episodios como reproducíos</string>
<string name="mark_all_read_confirmation_msg">Confirma que quies conseñar tolos episodios como reproducíos, por favor.</string>
<string name="mark_all_read_feed_confirmation_msg">Confirma que quies conseñar tolos episodios nesti feed como reproducíos, por favor.</string>
- <string name="mark_all_seen_label">Conseñar too como visto</string>
- <string name="mark_all_seen_msg">Conseñáronse tolos episodios como vistos</string>
- <string name="mark_all_seen_confirmation_msg">Confirma que quies conseñar tolos episodios como vistos.</string>
+ <string name="remove_all_new_flags_label">Conseñar too como visto</string>
+ <string name="removed_all_new_flags_msg">Conseñáronse tolos episodios como vistos</string>
+ <string name="remove_all_new_flags_confirmation_msg">Confirma que quies conseñar tolos episodios como vistos.</string>
<string name="show_info_label">Amosar información</string>
<string name="rename_feed_label">Renomar podcast</string>
<string name="remove_feed_label">Desaniciar podcast</string>
@@ -126,7 +126,7 @@
<string name="remove_label">Desaniciar</string>
<string name="delete_label">Desaniciar</string>
<string name="remove_episode_lable">Desaniciar episodiu</string>
- <string name="marked_as_seen_label">Conseñóse como vistu</string>
+ <string name="removed_new_flag_label">Conseñóse como vistu</string>
<string name="mark_read_label">Conseñar como reproducíu</string>
<string name="marked_as_read_label">Conseñóse como reproducíu</string>
<string name="mark_unread_label">Conseñar como non reproducíu</string>
diff --git a/core/src/main/res/values-bg/strings.xml b/core/src/main/res/values-bg/strings.xml
index 19dc2a971..818db781f 100644
--- a/core/src/main/res/values-bg/strings.xml
+++ b/core/src/main/res/values-bg/strings.xml
@@ -70,9 +70,9 @@
<string name="mark_all_read_msg">Всички епизоди са маркирани като слушани</string>
<string name="mark_all_read_confirmation_msg">Моля, потвърдете, че искате да маркирате всички епизоди като слушани.</string>
<string name="mark_all_read_feed_confirmation_msg">Моля, потвърдете, че искате да маркирате всички епизоди в тази емисия като слушани.</string>
- <string name="mark_all_seen_label">Маркирай всички като прегледани</string>
- <string name="mark_all_seen_msg">Всички епизоди са маркирани като прегледани</string>
- <string name="mark_all_seen_confirmation_msg">Моля, потвърдете, че искате да маркирате всички епизоди като прегледани.</string>
+ <string name="remove_all_new_flags_label">Маркирай всички като прегледани</string>
+ <string name="removed_all_new_flags_msg">Всички епизоди са маркирани като прегледани</string>
+ <string name="remove_all_new_flags_confirmation_msg">Моля, потвърдете, че искате да маркирате всички епизоди като прегледани.</string>
<string name="show_info_label">Покажи информация</string>
<string name="rename_feed_label">Преименуване на подкаст</string>
<string name="remove_feed_label">Премахване на подкаст</string>
@@ -88,7 +88,7 @@
<string name="hide_not_downloaded_episodes_label">Неизтеглени</string>
<!--actions on feeditems-->
<string name="stream_label">Стрийм</string>
- <string name="marked_as_seen_label">Маркиран като прегледан</string>
+ <string name="removed_new_flag_label">Маркиран като прегледан</string>
<string name="mark_read_label">Маркирай като слушан</string>
<string name="marked_as_read_label">Маркиран като слушан</string>
<string name="mark_unread_label">Маркирай като неслушан</string>
diff --git a/core/src/main/res/values-ca/strings.xml b/core/src/main/res/values-ca/strings.xml
index 6983d140e..6cc1fa9c9 100644
--- a/core/src/main/res/values-ca/strings.xml
+++ b/core/src/main/res/values-ca/strings.xml
@@ -111,9 +111,9 @@
<string name="mark_all_read_msg">S\'han marcat tots els episodis com a llegits</string>
<string name="mark_all_read_confirmation_msg">Si us plau confirma que vols marcar tots els episodis com reproduits.</string>
<string name="mark_all_read_feed_confirmation_msg">Si us plau, confirmeu que voleu marcar tots els episodis d\'aquest podcast com a reproduïts.</string>
- <string name="mark_all_seen_label">Marca tot com a llegit</string>
- <string name="mark_all_seen_msg">Marcar tots episodis com a visualitzats</string>
- <string name="mark_all_seen_confirmation_msg">Si us plau confirma que vols marcar tots els episodis com vistos.</string>
+ <string name="remove_all_new_flags_label">Marca tot com a llegit</string>
+ <string name="removed_all_new_flags_msg">Marcar tots episodis com a visualitzats</string>
+ <string name="remove_all_new_flags_confirmation_msg">Si us plau confirma que vols marcar tots els episodis com vistos.</string>
<string name="show_info_label">Mostra informació</string>
<string name="show_feed_settings_label">Mostrar configuració del podcast</string>
<string name="feed_info_label">Informació del podcast</string>
@@ -153,8 +153,8 @@
<string name="remove_label">Suprimeix</string>
<string name="delete_label">Esborrar</string>
<string name="delete_failed">No s\'ha pogut esborrar el fitxer. Reiniciar el dispositiu pot ajudar.</string>
- <string name="mark_as_seen_label">Marcar com a visualitzat</string>
- <string name="marked_as_seen_label">Marcat com a vist</string>
+ <string name="remove_new_flag_label">Marcar com a visualitzat</string>
+ <string name="removed_new_flag_label">Marcat com a vist</string>
<string name="mark_read_label">Marca com a llegit</string>
<string name="marked_as_read_label">Marcats com llegits</string>
<string name="mark_unread_label">Marca com a pendent</string>
diff --git a/core/src/main/res/values-cs-rCZ/strings.xml b/core/src/main/res/values-cs-rCZ/strings.xml
index 390730abb..cb784ec6a 100644
--- a/core/src/main/res/values-cs-rCZ/strings.xml
+++ b/core/src/main/res/values-cs-rCZ/strings.xml
@@ -106,8 +106,8 @@
<string name="mark_all_read_label">Označit vše jako poslechnuté</string>
<string name="mark_all_read_msg">Všechny epizody označeny jako poslechnuté</string>
<string name="mark_all_read_confirmation_msg">Potvrďte prosím, že chcete označit všechny vybrané epizody jako poslechnuté.</string>
- <string name="mark_all_seen_label">Označit vše jako zobrazené</string>
- <string name="mark_all_seen_confirmation_msg">Potvrďte prosím, že chcete označit všechny epizody jako shlédnuté.</string>
+ <string name="remove_all_new_flags_label">Označit vše jako zobrazené</string>
+ <string name="remove_all_new_flags_confirmation_msg">Potvrďte prosím, že chcete označit všechny epizody jako shlédnuté.</string>
<string name="show_info_label">Informace o zdroji</string>
<string name="share_label">Sdílet</string>
<string name="share_feed_url_label">Sdílet URL kanálu</string>
@@ -131,7 +131,7 @@
<string name="stream_label">Vysílat</string>
<string name="remove_label">Odstranit</string>
<string name="delete_label">Smazat</string>
- <string name="marked_as_seen_label">Označit jako shlédnuté</string>
+ <string name="removed_new_flag_label">Označit jako shlédnuté</string>
<string name="mark_read_label">Označit jako poslechnuté</string>
<string name="marked_as_read_label">Označeno jako poslechnuté</string>
<string name="mark_unread_label">Označit jako neposlechnuté</string>
diff --git a/core/src/main/res/values-da/strings.xml b/core/src/main/res/values-da/strings.xml
index 565f53a6d..5420eb5c9 100644
--- a/core/src/main/res/values-da/strings.xml
+++ b/core/src/main/res/values-da/strings.xml
@@ -109,9 +109,9 @@
<string name="mark_all_read_label">Marker alle som afspillet</string>
<string name="mark_all_read_msg">Marker alle udsendelser som afspillet</string>
<string name="mark_all_read_confirmation_msg">Bekræft venligst at du ønsker at markere alle udsendelser som værende afspillet.</string>
- <string name="mark_all_seen_label">Marker alle som set</string>
- <string name="mark_all_seen_msg">Markeret alle udsendelser som set</string>
- <string name="mark_all_seen_confirmation_msg">Bekræft venligst at du ønsker at markere alle udsendelser som set.</string>
+ <string name="remove_all_new_flags_label">Marker alle som set</string>
+ <string name="removed_all_new_flags_msg">Markeret alle udsendelser som set</string>
+ <string name="remove_all_new_flags_confirmation_msg">Bekræft venligst at du ønsker at markere alle udsendelser som set.</string>
<string name="show_info_label">Vis information</string>
<string name="feed_info_label">Podcast-info</string>
<string name="rename_feed_label">Omdøb podcast</string>
@@ -148,8 +148,8 @@
<string name="remove_label">Fjern</string>
<string name="delete_label">Slet</string>
<string name="delete_failed">Kan ikke slette fil. En genstart af enheden vil sandsynligvis hjælpe.</string>
- <string name="mark_as_seen_label">Markér som set</string>
- <string name="marked_as_seen_label">Markeret som set</string>
+ <string name="remove_new_flag_label">Markér som set</string>
+ <string name="removed_new_flag_label">Markeret som set</string>
<string name="mark_read_label">Marker som læst</string>
<string name="marked_as_read_label">Markeret som afspillet</string>
<string name="mark_unread_label">Marker som uafspillet</string>
diff --git a/core/src/main/res/values-de/strings.xml b/core/src/main/res/values-de/strings.xml
index 7bc9368b5..a5ceaab57 100644
--- a/core/src/main/res/values-de/strings.xml
+++ b/core/src/main/res/values-de/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Alle Episoden als gespielt markiert</string>
<string name="mark_all_read_confirmation_msg">Bitte bestätige, dass alle Episoden als gespielt markiert werden sollen.</string>
<string name="mark_all_read_feed_confirmation_msg">Bitte bestätige, dass alle Episoden in diesem Feed als gespielt markiert werden sollen.</string>
- <string name="mark_all_seen_label">Alle als gesehen markieren</string>
- <string name="mark_all_seen_msg">Alle Episoden als gesehen markiert</string>
- <string name="mark_all_seen_confirmation_msg">Bitte bestätige, dass alle Episoden als gesehen markiert werden sollen.</string>
+ <string name="remove_all_new_flags_label">Alle als gesehen markieren</string>
+ <string name="removed_all_new_flags_msg">Alle Episoden als gesehen markiert</string>
+ <string name="remove_all_new_flags_confirmation_msg">Bitte bestätige, dass alle Episoden als gesehen markiert werden sollen.</string>
<string name="show_info_label">Informationen anzeigen</string>
<string name="show_feed_settings_label">Zeige Feed-Einstellungen</string>
<string name="feed_info_label">Feed-Informationen</string>
@@ -169,8 +169,8 @@
<item quantity="one">%d Episode gelöscht.</item>
<item quantity="other">%d Episoden gelöscht.</item>
</plurals>
- <string name="mark_as_seen_label">Als gelesen markieren</string>
- <string name="marked_as_seen_label">Als gesehen markiert</string>
+ <string name="remove_new_flag_label">Als gelesen markieren</string>
+ <string name="removed_new_flag_label">Als gesehen markiert</string>
<string name="mark_read_label">Als gespielt markieren</string>
<string name="marked_as_read_label">Als gespielt markiert</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-es-rES/strings.xml b/core/src/main/res/values-es-rES/strings.xml
index 024989498..199eefca7 100644
--- a/core/src/main/res/values-es-rES/strings.xml
+++ b/core/src/main/res/values-es-rES/strings.xml
@@ -75,7 +75,7 @@
<string name="browse_gpoddernet_label">Navegar gpodder.net</string>
<!--Actions on feeds-->
<string name="mark_all_read_label">Marcar todo como leído</string>
- <string name="mark_all_seen_label">Marcar todos como visto</string>
+ <string name="remove_all_new_flags_label">Marcar todos como visto</string>
<string name="show_info_label">Información del programa</string>
<string name="remove_feed_label">Eliminar podcast</string>
<string name="share_link_label">Compartir el enlace de la web</string>
diff --git a/core/src/main/res/values-es/strings.xml b/core/src/main/res/values-es/strings.xml
index 69feafba7..1a60a20b0 100644
--- a/core/src/main/res/values-es/strings.xml
+++ b/core/src/main/res/values-es/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Marcados todos los episodios como reproducidos</string>
<string name="mark_all_read_confirmation_msg">Confirme que quiere marcar todos los episodios como reproducidos.</string>
<string name="mark_all_read_feed_confirmation_msg">Confirme que quiere marcar todos los episodios de este pódcast como reproducidos.</string>
- <string name="mark_all_seen_label">Marcar todos como vistos</string>
- <string name="mark_all_seen_msg">Marcados todos los episodios como vistos</string>
- <string name="mark_all_seen_confirmation_msg">Confirme que quiere marcar todos los episodios como vistos.</string>
+ <string name="remove_all_new_flags_label">Marcar todos como vistos</string>
+ <string name="removed_all_new_flags_msg">Marcados todos los episodios como vistos</string>
+ <string name="remove_all_new_flags_confirmation_msg">Confirme que quiere marcar todos los episodios como vistos.</string>
<string name="show_info_label">Información del programa</string>
<string name="show_feed_settings_label">Mostrar ajustes del pódcast</string>
<string name="feed_info_label">Información del pódcast</string>
@@ -169,8 +169,8 @@
<item quantity="one">%depisodio borrado.</item>
<item quantity="other">%depisodios borrados.</item>
</plurals>
- <string name="mark_as_seen_label">Marcar como visto</string>
- <string name="marked_as_seen_label">Marcado como visto</string>
+ <string name="remove_new_flag_label">Marcar como visto</string>
+ <string name="removed_new_flag_label">Marcado como visto</string>
<string name="mark_read_label">Marcar como reproducido</string>
<string name="marked_as_read_label">Marcado como reproducido</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-et/strings.xml b/core/src/main/res/values-et/strings.xml
index 99e61a5fa..44c9f749b 100644
--- a/core/src/main/res/values-et/strings.xml
+++ b/core/src/main/res/values-et/strings.xml
@@ -91,7 +91,7 @@
<!--Actions on feeds-->
<string name="mark_all_read_label">Märgi kuulatuks</string>
<string name="mark_all_read_msg">Märgi kõik saated esitatuks</string>
- <string name="mark_all_seen_label">Märgi kõik nähtuks</string>
+ <string name="remove_all_new_flags_label">Märgi kõik nähtuks</string>
<string name="show_info_label">Näita infot</string>
<string name="share_label">Jaga...</string>
<string name="share_file_label">Jaga faili</string>
@@ -116,7 +116,7 @@
<string name="stream_label">Voogedastusena</string>
<string name="remove_label">Eemalda</string>
<string name="delete_label">Kustuta</string>
- <string name="marked_as_seen_label">Märgitud nähtuks</string>
+ <string name="removed_new_flag_label">Märgitud nähtuks</string>
<string name="mark_read_label">Märgi esitatuks</string>
<string name="marked_as_read_label">Märgitud kuulatuks</string>
<string name="mark_unread_label">Märgitud kui kuulamata</string>
diff --git a/core/src/main/res/values-fa/strings.xml b/core/src/main/res/values-fa/strings.xml
index dc6e7cb2e..bc530d4de 100644
--- a/core/src/main/res/values-fa/strings.xml
+++ b/core/src/main/res/values-fa/strings.xml
@@ -108,8 +108,8 @@
<string name="mark_all_read_label">علامت گذاری همه به عنوان پخش شده</string>
<string name="mark_all_read_msg">همه قسمت‌ها به عنوان پخش شده علامت‌گذاری شد</string>
<string name="mark_all_read_confirmation_msg">لطفا تأیید کنید که می‌خواهید تمام قسمت‌ها را به عنوان پخش شده علامت بزنید.</string>
- <string name="mark_all_seen_label">علامت گذاری همه به عنوان دیده شده</string>
- <string name="mark_all_seen_confirmation_msg">لطفا تأیید کنید که می‌خواهید تمام قسمت‌ها را به عنوان دیده شده علامت بزنید.</string>
+ <string name="remove_all_new_flags_label">علامت گذاری همه به عنوان دیده شده</string>
+ <string name="remove_all_new_flags_confirmation_msg">لطفا تأیید کنید که می‌خواهید تمام قسمت‌ها را به عنوان دیده شده علامت بزنید.</string>
<string name="show_info_label">نمایش اطلاعات</string>
<string name="show_feed_settings_label">نمایش تنظیمات پادکست</string>
<string name="feed_info_label">اطلاعات پادکست</string>
@@ -145,7 +145,7 @@
<string name="delete_label">حذف</string>
<string name="delete_failed">فایل حذف نشد.! راه اندازی مجدد دستگاه می تواند کمک کند.</string>
<string name="remove_episode_lable">پاک کردن قسمت</string>
- <string name="marked_as_seen_label">علامت گذاری به عنوان دیده شده</string>
+ <string name="removed_new_flag_label">علامت گذاری به عنوان دیده شده</string>
<string name="mark_read_label">علامت گذاری به عنوان پخش شده</string>
<string name="marked_as_read_label">بعنوان پخش شده علامت گذاری شد</string>
<string name="mark_unread_label">علامت گذاری به عنوان پخش نشده</string>
diff --git a/core/src/main/res/values-fr/strings.xml b/core/src/main/res/values-fr/strings.xml
index 42fe07f68..00ecc8ad3 100644
--- a/core/src/main/res/values-fr/strings.xml
+++ b/core/src/main/res/values-fr/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Tous les épisodes ont été marqués comme lus</string>
<string name="mark_all_read_confirmation_msg">Confirmer le marquage de tous les épisode comme lus</string>
<string name="mark_all_read_feed_confirmation_msg">Confirmer le marquage de tous les épisodes de ce podcast comme lus</string>
- <string name="mark_all_seen_label">Marquer tous les épisodes comme vus</string>
- <string name="mark_all_seen_msg">Tous les épisodes ont été marqués vus</string>
- <string name="mark_all_seen_confirmation_msg">Merci de confirmer que vous voulez marquer tous les épisodes comme vus.</string>
+ <string name="remove_all_new_flags_label">Marquer tous les épisodes comme vus</string>
+ <string name="removed_all_new_flags_msg">Tous les épisodes ont été marqués vus</string>
+ <string name="remove_all_new_flags_confirmation_msg">Merci de confirmer que vous voulez marquer tous les épisodes comme vus.</string>
<string name="show_info_label">Voir les détails</string>
<string name="show_feed_settings_label">Paramètres du podcast...</string>
<string name="feed_info_label">Infos du podcast</string>
@@ -169,8 +169,8 @@
<item quantity="one">%d épisode supprimé.</item>
<item quantity="other">%d épisodes supprimés.</item>
</plurals>
- <string name="mark_as_seen_label">Marquer comme vu</string>
- <string name="marked_as_seen_label">Marqué comme vu</string>
+ <string name="remove_new_flag_label">Marquer comme vu</string>
+ <string name="removed_new_flag_label">Marqué comme vu</string>
<string name="mark_read_label">Marquer comme lu</string>
<string name="marked_as_read_label">Les épisodes ont été marqués comme lus</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-gl-rES/strings.xml b/core/src/main/res/values-gl-rES/strings.xml
index 369d39d4c..9897ec272 100644
--- a/core/src/main/res/values-gl-rES/strings.xml
+++ b/core/src/main/res/values-gl-rES/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Marcáronse todos como reproducidos</string>
<string name="mark_all_read_confirmation_msg">Por favor confirme que quere marcar todos os episodios como reproducidos.</string>
<string name="mark_all_read_feed_confirmation_msg">Por favor, confirme que quere marcar todos os episodios deste podcast como reproducidos.</string>
- <string name="mark_all_seen_label">Marcar como visto</string>
- <string name="mark_all_seen_msg">Marcáronse todos os episodios como vistos</string>
- <string name="mark_all_seen_confirmation_msg">Por favor confirme que quere marcar todos os episodios como vistos.</string>
+ <string name="remove_all_new_flags_label">Marcar como visto</string>
+ <string name="removed_all_new_flags_msg">Marcáronse todos os episodios como vistos</string>
+ <string name="remove_all_new_flags_confirmation_msg">Por favor confirme que quere marcar todos os episodios como vistos.</string>
<string name="show_info_label">Mostrar información</string>
<string name="show_feed_settings_label">Mostrar axustes do podcast</string>
<string name="feed_info_label">Información do podcast</string>
@@ -169,8 +169,8 @@
<item quantity="one">%d episodio eliminado.</item>
<item quantity="other">%d episodios eliminados.</item>
</plurals>
- <string name="mark_as_seen_label">Marcar como visto</string>
- <string name="marked_as_seen_label">Marcar como visto</string>
+ <string name="remove_new_flag_label">Marcar como visto</string>
+ <string name="removed_new_flag_label">Marcar como visto</string>
<string name="mark_read_label">Marcar como reproducido</string>
<string name="marked_as_read_label">Marcado como reproducido</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-h768dp/dimens.xml b/core/src/main/res/values-h768dp/dimens.xml
new file mode 100644
index 000000000..fd744e422
--- /dev/null
+++ b/core/src/main/res/values-h768dp/dimens.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+ <dimen name="scrubber_vertical_padding">12dp</dimen>
+</resources> \ No newline at end of file
diff --git a/core/src/main/res/values-hi-rIN/strings.xml b/core/src/main/res/values-hi-rIN/strings.xml
index 17a26e125..3b59e0481 100644
--- a/core/src/main/res/values-hi-rIN/strings.xml
+++ b/core/src/main/res/values-hi-rIN/strings.xml
@@ -144,8 +144,8 @@
<string name="remove_label"> हटाएँ</string>
<string name="delete_label">डिलीट</string>
<string name="delete_failed">फ़ाइल डिलीट करने में असमर्थ। डिवाइस को रिबूट करने से मदद मिल सकती है।</string>
- <string name="mark_as_seen_label">देखा गया के रूप में चिह्नित करें</string>
- <string name="marked_as_seen_label">देखा गया के रूप में चिह्नित किया गया</string>
+ <string name="remove_new_flag_label">देखा गया के रूप में चिह्नित करें</string>
+ <string name="removed_new_flag_label">देखा गया के रूप में चिह्नित किया गया</string>
<string name="mark_read_label">चलाया गया के रूप में चिह्नित करें</string>
<string name="marked_as_read_label">चलाया गया के रूप में चिह्नित किया गया</string>
<string name="mark_unread_label">नही चलाया गया के रूप में चिह्नित करें</string>
diff --git a/core/src/main/res/values-hu/strings.xml b/core/src/main/res/values-hu/strings.xml
index 7c252a0db..2d848b1cb 100644
--- a/core/src/main/res/values-hu/strings.xml
+++ b/core/src/main/res/values-hu/strings.xml
@@ -105,8 +105,8 @@
<string name="mark_all_read_label">Az összes megjelölése lejátszottként</string>
<string name="mark_all_read_msg">Az összes epizód lejátszottként megjelölve</string>
<string name="mark_all_read_confirmation_msg">Biztosan megjelölöd az összes epizódot lejátszottként?</string>
- <string name="mark_all_seen_label">Az összes megjelölése megnézettként</string>
- <string name="mark_all_seen_confirmation_msg">Biztosan megjelölöd az összes epizódott megnézettként?</string>
+ <string name="remove_all_new_flags_label">Az összes megjelölése megnézettként</string>
+ <string name="remove_all_new_flags_confirmation_msg">Biztosan megjelölöd az összes epizódott megnézettként?</string>
<string name="show_info_label">Információ mutatása</string>
<string name="feed_settings_label">Podcast beállítások</string>
<string name="share_label">Megosztás…</string>
@@ -132,7 +132,7 @@
<string name="stream_label">Stream-elés</string>
<string name="remove_label">Eltávolítás</string>
<string name="delete_label">Törlés</string>
- <string name="marked_as_seen_label">Megtekintettként megjelölve</string>
+ <string name="removed_new_flag_label">Megtekintettként megjelölve</string>
<string name="mark_read_label">Jelölés játszottnak</string>
<string name="marked_as_read_label">Lejátszottként megjelölve</string>
<string name="mark_unread_label">Jelölés nem játszottnak</string>
diff --git a/core/src/main/res/values-id/strings.xml b/core/src/main/res/values-id/strings.xml
index 62254518d..2f1ffecea 100644
--- a/core/src/main/res/values-id/strings.xml
+++ b/core/src/main/res/values-id/strings.xml
@@ -43,7 +43,7 @@
<!--Actions on feeds-->
<string name="mark_all_read_label">Tandai semua diputar</string>
<string name="mark_all_read_msg">Tandai semua Kisah diputar</string>
- <string name="mark_all_seen_label">Tandai semua dilihat</string>
+ <string name="remove_all_new_flags_label">Tandai semua dilihat</string>
<string name="remove_feed_label">Hapus Podcast</string>
<string name="share_label">Bagikan...</string>
<string name="share_link_label">Bagikan Tautan</string>
diff --git a/core/src/main/res/values-it/strings.xml b/core/src/main/res/values-it/strings.xml
index 31f252d3e..d1e1b596f 100644
--- a/core/src/main/res/values-it/strings.xml
+++ b/core/src/main/res/values-it/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Segnati tutti gli episodi come riprodotti</string>
<string name="mark_all_read_confirmation_msg">Conferma che desideri segnare tutti gli episodi come riprodotti.</string>
<string name="mark_all_read_feed_confirmation_msg">Conferma che desideri segnare come riprodotti tutti gli episodi del podcast.</string>
- <string name="mark_all_seen_label">Segna tutti come visti</string>
- <string name="mark_all_seen_msg">Segna tutti gli episodi come visti</string>
- <string name="mark_all_seen_confirmation_msg">Conferma che desideri segnare tutti gli episodi come visti.</string>
+ <string name="remove_all_new_flags_label">Segna tutti come visti</string>
+ <string name="removed_all_new_flags_msg">Segna tutti gli episodi come visti</string>
+ <string name="remove_all_new_flags_confirmation_msg">Conferma che desideri segnare tutti gli episodi come visti.</string>
<string name="show_info_label">Informazioni</string>
<string name="show_feed_settings_label">Mostra impostazioni podcast</string>
<string name="feed_info_label">Info podcast</string>
@@ -169,8 +169,8 @@
<item quantity="one">%d episodio eliminato.</item>
<item quantity="other">%d episodi eliminati.</item>
</plurals>
- <string name="mark_as_seen_label">Segna come visto</string>
- <string name="marked_as_seen_label">Segna come visto</string>
+ <string name="remove_new_flag_label">Segna come visto</string>
+ <string name="removed_new_flag_label">Segna come visto</string>
<string name="mark_read_label">Segna come riprodotto</string>
<string name="marked_as_read_label">Segnato come riprodotto</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-iw-rIL/strings.xml b/core/src/main/res/values-iw-rIL/strings.xml
index e9d14b899..d73fdd015 100644
--- a/core/src/main/res/values-iw-rIL/strings.xml
+++ b/core/src/main/res/values-iw-rIL/strings.xml
@@ -120,9 +120,9 @@
<string name="mark_all_read_msg">לסמן את כל הפרקים כנוגנו</string>
<string name="mark_all_read_confirmation_msg">נא לאשר שברצונך לסמן את כל הפרקים כנוגנו.</string>
<string name="mark_all_read_feed_confirmation_msg">נא לאשר שברצונך לסמן את הפרקים של הפודקאסט הזה כאילו כבר נוגנו.</string>
- <string name="mark_all_seen_label">לסמן הכול כנצפו</string>
- <string name="mark_all_seen_msg">כל הפרקים סומנו כאילו כבר נוגנו</string>
- <string name="mark_all_seen_confirmation_msg">נא לאשר שברצונך לסמן את כל הפרקים כנצפו.</string>
+ <string name="remove_all_new_flags_label">לסמן הכול כנצפו</string>
+ <string name="removed_all_new_flags_msg">כל הפרקים סומנו כאילו כבר נוגנו</string>
+ <string name="remove_all_new_flags_confirmation_msg">נא לאשר שברצונך לסמן את כל הפרקים כנצפו.</string>
<string name="show_info_label">הצגת מידע</string>
<string name="show_feed_settings_label">הצגת הגדרות פודקאסט</string>
<string name="feed_info_label">פרטי פודקאסט</string>
@@ -177,8 +177,8 @@
<item quantity="many">%d פרקים נמחקו.</item>
<item quantity="other">%d פרקים נמחקו.</item>
</plurals>
- <string name="mark_as_seen_label">עם סימון כנצפה</string>
- <string name="marked_as_seen_label">סימון כנצפה</string>
+ <string name="remove_new_flag_label">עם סימון כנצפה</string>
+ <string name="removed_new_flag_label">סימון כנצפה</string>
<string name="mark_read_label">סימון כנצפה</string>
<string name="marked_as_read_label">סימון כנוגן</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-ja/strings.xml b/core/src/main/res/values-ja/strings.xml
index f749de958..0818b7044 100644
--- a/core/src/main/res/values-ja/strings.xml
+++ b/core/src/main/res/values-ja/strings.xml
@@ -114,9 +114,9 @@
<string name="mark_all_read_msg">すべてのエピソードを再生済にしました</string>
<string name="mark_all_read_confirmation_msg">再生済としてマークするすべてのエピソードを確認してください。</string>
<string name="mark_all_read_feed_confirmation_msg">再生済としてマークするこのポッドキャストのすべてのエピソードを確認してください。</string>
- <string name="mark_all_seen_label">すべて参照済としてマーク</string>
- <string name="mark_all_seen_msg">すべてのエピソードを参照済にしました</string>
- <string name="mark_all_seen_confirmation_msg">参照済としてマークするすべてのエピソードを確認してください。</string>
+ <string name="remove_all_new_flags_label">すべて参照済としてマーク</string>
+ <string name="removed_all_new_flags_msg">すべてのエピソードを参照済にしました</string>
+ <string name="remove_all_new_flags_confirmation_msg">参照済としてマークするすべてのエピソードを確認してください。</string>
<string name="show_info_label">情報を表示</string>
<string name="show_feed_settings_label">ポッドキャスト設定を表示</string>
<string name="feed_info_label">ポッドキャスト情報</string>
@@ -165,8 +165,8 @@
<plurals name="deleted_episode_batch_label">
<item quantity="other">%d エピソードを削除しました。</item>
</plurals>
- <string name="mark_as_seen_label">参照済</string>
- <string name="marked_as_seen_label">参照済としてマーク</string>
+ <string name="remove_new_flag_label">参照済</string>
+ <string name="removed_new_flag_label">参照済としてマーク</string>
<string name="mark_read_label">再生済としてマーク</string>
<string name="marked_as_read_label">再生済としてマークしました</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-ko/strings.xml b/core/src/main/res/values-ko/strings.xml
index c776885ea..7727e40b7 100644
--- a/core/src/main/res/values-ko/strings.xml
+++ b/core/src/main/res/values-ko/strings.xml
@@ -105,9 +105,9 @@
<string name="mark_all_read_msg">모든 에피소드를 재생했다고 표시했습니다</string>
<string name="mark_all_read_confirmation_msg">모든 에피소드를 재생했다고 표시할지 확인하십시오.</string>
<string name="mark_all_read_feed_confirmation_msg">이 피드에 들어 있는 모든 에피소드를 재생했다고 표시할지 확인하십시오.</string>
- <string name="mark_all_seen_label">모두 봤다고 표시</string>
- <string name="mark_all_seen_msg">모든 에피소드를 봤다고 표시했습니다</string>
- <string name="mark_all_seen_confirmation_msg">모든 에피소드를 본 것으로 표시하는지 확인하십시오.</string>
+ <string name="remove_all_new_flags_label">모두 봤다고 표시</string>
+ <string name="removed_all_new_flags_msg">모든 에피소드를 봤다고 표시했습니다</string>
+ <string name="remove_all_new_flags_confirmation_msg">모든 에피소드를 본 것으로 표시하는지 확인하십시오.</string>
<string name="show_info_label">정보 표시</string>
<string name="rename_feed_label">팟캐스트 이름 바꾸기</string>
<string name="remove_feed_label">팟캐스트 제거</string>
@@ -143,7 +143,7 @@
<string name="delete_label">삭제</string>
<string name="delete_failed">파일을 삭제할 수 없습니다. 장치를 재부팅하면 동작할 수도 있습니다.</string>
<string name="remove_episode_lable">에피소드 제거</string>
- <string name="marked_as_seen_label">봤다고 표시했습니다</string>
+ <string name="removed_new_flag_label">봤다고 표시했습니다</string>
<string name="mark_read_label">재생했다고 표시</string>
<string name="marked_as_read_label">재생했다고 표시했습니다</string>
<string name="mark_unread_label">재생하지 않음으로 표시</string>
diff --git a/core/src/main/res/values-lt/strings.xml b/core/src/main/res/values-lt/strings.xml
index f0820eba4..4c70f6f33 100644
--- a/core/src/main/res/values-lt/strings.xml
+++ b/core/src/main/res/values-lt/strings.xml
@@ -113,9 +113,9 @@
<string name="mark_all_read_msg">Visi epizodai pažymėti kaip perklausyti</string>
<string name="mark_all_read_confirmation_msg">Patvirtinkite, jog norite pažymėti visus epizodus kaip perklausytus.</string>
<string name="mark_all_read_feed_confirmation_msg">Patvirtinkite, jog norite pažymėti visus šios tinklalaidės epizodus kaip perklausytus.</string>
- <string name="mark_all_seen_label">Pažymėti visus kaip matytus</string>
- <string name="mark_all_seen_msg">Pažymėti visus epizodus kaip matytus</string>
- <string name="mark_all_seen_confirmation_msg">Patvirtinkite, jog norite pažymėti visus epizodus kaip matytus.</string>
+ <string name="remove_all_new_flags_label">Pažymėti visus kaip matytus</string>
+ <string name="removed_all_new_flags_msg">Pažymėti visus epizodus kaip matytus</string>
+ <string name="remove_all_new_flags_confirmation_msg">Patvirtinkite, jog norite pažymėti visus epizodus kaip matytus.</string>
<string name="show_info_label">Rodyti informaciją</string>
<string name="show_feed_settings_label">Rodyti tinklalaidės nustatymus</string>
<string name="feed_info_label">Tinklalaidės informacija</string>
@@ -157,8 +157,8 @@
<string name="remove_label">Pašalinti</string>
<string name="delete_label">Ištrinti</string>
<string name="delete_failed">Nepavyksta ištrinti failo. Įrenginio paleidimas iš naujo gali padėti.</string>
- <string name="mark_as_seen_label">Pažymėti kaip matytą</string>
- <string name="marked_as_seen_label">Pažymėtas kaip matytas</string>
+ <string name="remove_new_flag_label">Pažymėti kaip matytą</string>
+ <string name="removed_new_flag_label">Pažymėtas kaip matytas</string>
<string name="mark_read_label">Pažymėti kaip perklausytą</string>
<string name="marked_as_read_label">Pažymėtas kaip perklausytas</string>
<string name="mark_unread_label">Pažymėti kaip neperklausytą</string>
diff --git a/core/src/main/res/values-nb/strings.xml b/core/src/main/res/values-nb/strings.xml
index 53489e180..c7684322c 100644
--- a/core/src/main/res/values-nb/strings.xml
+++ b/core/src/main/res/values-nb/strings.xml
@@ -103,8 +103,8 @@
<string name="mark_all_read_label">Marker alle som avspilt</string>
<string name="mark_all_read_msg">Marker alle episoder som avspilt</string>
<string name="mark_all_read_confirmation_msg">Vennligst bekreft at du ønsker å markere alle episoder som avspilt.</string>
- <string name="mark_all_seen_label">Marker alle som sett</string>
- <string name="mark_all_seen_confirmation_msg">Bekreft at du ønsker å markere alle episoder som sett.</string>
+ <string name="remove_all_new_flags_label">Marker alle som sett</string>
+ <string name="remove_all_new_flags_confirmation_msg">Bekreft at du ønsker å markere alle episoder som sett.</string>
<string name="show_info_label">Vis informasjon</string>
<string name="share_label">Del ...</string>
<string name="share_file_label">Del fil</string>
@@ -130,7 +130,7 @@
<string name="remove_label">Fjern</string>
<string name="delete_label">Slett</string>
<string name="delete_failed">Kan ikke slette filen. Omstart av enheten kan hjelpe.</string>
- <string name="marked_as_seen_label">Marker som sett</string>
+ <string name="removed_new_flag_label">Marker som sett</string>
<string name="mark_read_label">Marker som avspilt</string>
<string name="marked_as_read_label">Marker som avspilt</string>
<string name="mark_unread_label">Marker som ikke avspilt</string>
diff --git a/core/src/main/res/values-nl/strings.xml b/core/src/main/res/values-nl/strings.xml
index 90d081bb7..22f9f6045 100644
--- a/core/src/main/res/values-nl/strings.xml
+++ b/core/src/main/res/values-nl/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Alle afleveringen zijn gemarkeerd als afgespeeld</string>
<string name="mark_all_read_confirmation_msg">Bevestig dat je alle afleveringen wilt markeren als afgespeeld.</string>
<string name="mark_all_read_feed_confirmation_msg">Bevestig dat je alle afleveringen van deze podcast wilt markeren als afgespeeld.</string>
- <string name="mark_all_seen_label">Alles markeren als bekeken</string>
- <string name="mark_all_seen_msg">Alle afleveringen zijn gemarkeerd als bekeken</string>
- <string name="mark_all_seen_confirmation_msg">Bevestig dat je alle afleveringen wilt markeren als bekeken.</string>
+ <string name="remove_all_new_flags_label">Alles markeren als bekeken</string>
+ <string name="removed_all_new_flags_msg">Alle afleveringen zijn gemarkeerd als bekeken</string>
+ <string name="remove_all_new_flags_confirmation_msg">Bevestig dat je alle afleveringen wilt markeren als bekeken.</string>
<string name="show_info_label">Informatie tonen</string>
<string name="show_feed_settings_label">Podcast-instellingen tonen</string>
<string name="feed_info_label">Podcast-informatie</string>
@@ -169,8 +169,8 @@
<item quantity="one">%d aflevering verwijderd.</item>
<item quantity="other">%d afleveringen verwijderd.</item>
</plurals>
- <string name="mark_as_seen_label">Markeren als bekeken</string>
- <string name="marked_as_seen_label">Gemarkeerd als bekeken</string>
+ <string name="remove_new_flag_label">Markeren als bekeken</string>
+ <string name="removed_new_flag_label">Gemarkeerd als bekeken</string>
<string name="mark_read_label">Markeren als afgespeeld</string>
<string name="marked_as_read_label">Gemarkeerd als afgespeeld</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-pl-rPL/strings.xml b/core/src/main/res/values-pl-rPL/strings.xml
index 53bce3911..7cbe3015a 100644
--- a/core/src/main/res/values-pl-rPL/strings.xml
+++ b/core/src/main/res/values-pl-rPL/strings.xml
@@ -109,9 +109,9 @@
<string name="mark_all_read_msg">Wszystkie odcinki zaznaczono jako odtworzone</string>
<string name="mark_all_read_confirmation_msg">Proszę potwierdzić, że chcesz oznaczyć wszystkie odcinki jako odtworzone.</string>
<string name="mark_all_read_feed_confirmation_msg">Proszę potwierdzić, że chcesz oznaczyć wszystkie odcinki tego podcastu jako odtworzone.</string>
- <string name="mark_all_seen_label">Oznacz wszystkie jako wyświetlone</string>
- <string name="mark_all_seen_msg">Oznacz wszystkie odcinki jako wyświetlone</string>
- <string name="mark_all_seen_confirmation_msg">Proszę potwierdzić chęć zaznaczenia wszystkich odcinków jako obejrzanych.</string>
+ <string name="remove_all_new_flags_label">Oznacz wszystkie jako wyświetlone</string>
+ <string name="removed_all_new_flags_msg">Oznacz wszystkie odcinki jako wyświetlone</string>
+ <string name="remove_all_new_flags_confirmation_msg">Proszę potwierdzić chęć zaznaczenia wszystkich odcinków jako obejrzanych.</string>
<string name="show_info_label">Pokaż informacje</string>
<string name="show_feed_settings_label">Pokaż ustawienia podcastu</string>
<string name="feed_settings_label">Ustawienia podcastu</string>
@@ -147,8 +147,8 @@
<string name="remove_label">Usuń</string>
<string name="delete_label">Usuń</string>
<string name="delete_failed">Nie można usunąć pliku. Restart urządzenia może w tym pomóc.</string>
- <string name="mark_as_seen_label">Oznacz jako wyświetlone</string>
- <string name="marked_as_seen_label">Oznaczono jako wyświetlone</string>
+ <string name="remove_new_flag_label">Oznacz jako wyświetlone</string>
+ <string name="removed_new_flag_label">Oznaczono jako wyświetlone</string>
<string name="mark_read_label">Oznacz jako odtworzone</string>
<string name="marked_as_read_label">Oznaczone jako odtworzone</string>
<string name="mark_unread_label">Oznacz jako nieodtworzone</string>
diff --git a/core/src/main/res/values-pt-rBR/strings.xml b/core/src/main/res/values-pt-rBR/strings.xml
index 0f85d9eaf..76f838bde 100644
--- a/core/src/main/res/values-pt-rBR/strings.xml
+++ b/core/src/main/res/values-pt-rBR/strings.xml
@@ -111,9 +111,9 @@
<string name="mark_all_read_msg">Marcar todos Episódios como reproduzidos</string>
<string name="mark_all_read_confirmation_msg">Por favor, confirme que você deseja marcar todos os episódios como já reproduzidos.</string>
<string name="mark_all_read_feed_confirmation_msg">Favor confirmar que deseja marcar todos os episódios nesse podcast como já ouvidos.</string>
- <string name="mark_all_seen_label">Marcar todos como vistos</string>
- <string name="mark_all_seen_msg">Todos os episódios marcados como já ouvidos</string>
- <string name="mark_all_seen_confirmation_msg">Confirme se deseja marcar todos os episódios como vistos.</string>
+ <string name="remove_all_new_flags_label">Marcar todos como vistos</string>
+ <string name="removed_all_new_flags_msg">Todos os episódios marcados como já ouvidos</string>
+ <string name="remove_all_new_flags_confirmation_msg">Confirme se deseja marcar todos os episódios como vistos.</string>
<string name="show_info_label">Mostrar informação</string>
<string name="show_feed_settings_label">Exibir configurações do podcast</string>
<string name="feed_info_label">Informações do podcast</string>
@@ -155,8 +155,8 @@
<string name="remove_label">Remover</string>
<string name="delete_label">Deletar</string>
<string name="delete_failed">Não foi possível deletar o arquivo. Experimente reiniciar o dispositivo.</string>
- <string name="mark_as_seen_label">Marcar como ouvido</string>
- <string name="marked_as_seen_label">Marcar como visto</string>
+ <string name="remove_new_flag_label">Marcar como ouvido</string>
+ <string name="removed_new_flag_label">Marcar como visto</string>
<string name="mark_read_label">Marcar como reproduzido</string>
<string name="marked_as_read_label">Marcado como reproduzido</string>
<string name="mark_unread_label">Marcar como não reproduzido</string>
diff --git a/core/src/main/res/values-pt/strings.xml b/core/src/main/res/values-pt/strings.xml
index 39a3d33c6..3ec88af31 100644
--- a/core/src/main/res/values-pt/strings.xml
+++ b/core/src/main/res/values-pt/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Marcar todos os episódios como reproduzidos</string>
<string name="mark_all_read_confirmation_msg">Tem a certeza de que deseja marcar todos os episódios como reproduzidos?</string>
<string name="mark_all_read_feed_confirmation_msg">Tem a certeza de que deseja marcar como reproduzidos todos os episódios deste podcast?</string>
- <string name="mark_all_seen_label">Marcar tudo como reproduzido</string>
- <string name="mark_all_seen_msg">Marcar todos como reproduzidos</string>
- <string name="mark_all_seen_confirmation_msg">Tem a certeza de que deseja marcar todos os episódios como vistos?</string>
+ <string name="remove_all_new_flags_label">Marcar tudo como reproduzido</string>
+ <string name="removed_all_new_flags_msg">Marcar todos como reproduzidos</string>
+ <string name="remove_all_new_flags_confirmation_msg">Tem a certeza de que deseja marcar todos os episódios como vistos?</string>
<string name="show_info_label">Mostrar informações</string>
<string name="show_feed_settings_label">Mostrar definições do podcast</string>
<string name="feed_info_label">Informações do podcast</string>
@@ -169,8 +169,8 @@
<item quantity="one">%d episódio eliminado.</item>
<item quantity="other">%d episódios eliminados.</item>
</plurals>
- <string name="mark_as_seen_label">Marcar como reproduzido</string>
- <string name="marked_as_seen_label">Marcar como reproduzido</string>
+ <string name="remove_new_flag_label">Marcar como reproduzido</string>
+ <string name="removed_new_flag_label">Marcar como reproduzido</string>
<string name="mark_read_label">Marcar como reproduzido</string>
<string name="marked_as_read_label">Marcado como reproduzido</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-ru/strings.xml b/core/src/main/res/values-ru/strings.xml
index 942be0267..a904d3ad9 100644
--- a/core/src/main/res/values-ru/strings.xml
+++ b/core/src/main/res/values-ru/strings.xml
@@ -113,9 +113,9 @@
<string name="mark_all_read_msg">Отметить все выпуски как прослушанные</string>
<string name="mark_all_read_confirmation_msg">Подтвердите, что хотите пометить все эпизоды как прослушанные.</string>
<string name="mark_all_read_feed_confirmation_msg">Пожалуйста, подтвердите желание отметить все выпуски этого подкаста как прослушанные.</string>
- <string name="mark_all_seen_label">Отметить все как просмотренное</string>
- <string name="mark_all_seen_msg">Все выпуски отмечены как просмотренные</string>
- <string name="mark_all_seen_confirmation_msg">Пожалуйста, подтвердите намерение отметить все выпуски как просмотренные.</string>
+ <string name="remove_all_new_flags_label">Отметить все как просмотренное</string>
+ <string name="removed_all_new_flags_msg">Все выпуски отмечены как просмотренные</string>
+ <string name="remove_all_new_flags_confirmation_msg">Пожалуйста, подтвердите намерение отметить все выпуски как просмотренные.</string>
<string name="show_info_label">Показать информацию</string>
<string name="show_feed_settings_label">Показать настройки подкаста</string>
<string name="feed_info_label">Сведения о подкасте</string>
@@ -157,8 +157,8 @@
<string name="remove_label">Удалить</string>
<string name="delete_label">Удалить</string>
<string name="delete_failed">Невозможно удалить файл. Попробуйте перезагрузить устройство.</string>
- <string name="mark_as_seen_label">Просмотрено</string>
- <string name="marked_as_seen_label">Отмечено как просмотренное</string>
+ <string name="remove_new_flag_label">Просмотрено</string>
+ <string name="removed_new_flag_label">Отмечено как просмотренное</string>
<string name="mark_read_label">Отметить как прослушанное</string>
<string name="marked_as_read_label">Помечено как прослушанное</string>
<string name="mark_unread_label">Отметить как непрослушанное</string>
diff --git a/core/src/main/res/values-sv-rSE/strings.xml b/core/src/main/res/values-sv-rSE/strings.xml
index b0fa69b3b..a44834efb 100644
--- a/core/src/main/res/values-sv-rSE/strings.xml
+++ b/core/src/main/res/values-sv-rSE/strings.xml
@@ -116,9 +116,9 @@
<string name="mark_all_read_msg">Markera alla episoder som spelade</string>
<string name="mark_all_read_confirmation_msg">Bekräfta att du verkligen vill markera alla episoder som spelade.</string>
<string name="mark_all_read_feed_confirmation_msg">Bekräfta att du vill markera alla episider i denna podcast som spelade.</string>
- <string name="mark_all_seen_label">Markera alla som sedda</string>
- <string name="mark_all_seen_msg">Markerade alla episoder som sedda</string>
- <string name="mark_all_seen_confirmation_msg">Bekräfta att du vill markera alla episoder som sedda.</string>
+ <string name="remove_all_new_flags_label">Markera alla som sedda</string>
+ <string name="removed_all_new_flags_msg">Markerade alla episoder som sedda</string>
+ <string name="remove_all_new_flags_confirmation_msg">Bekräfta att du vill markera alla episoder som sedda.</string>
<string name="show_info_label">Visa information</string>
<string name="show_feed_settings_label">Visa podcastinställningar</string>
<string name="feed_info_label">Podcastinfo</string>
@@ -169,8 +169,8 @@
<item quantity="one">1%d episod raderad.</item>
<item quantity="other">1%d episder raderade.</item>
</plurals>
- <string name="mark_as_seen_label">Markera som sedd</string>
- <string name="marked_as_seen_label">Markera som sedd</string>
+ <string name="remove_new_flag_label">Markera som sedd</string>
+ <string name="removed_new_flag_label">Markera som sedd</string>
<string name="mark_read_label">Markera som spelad</string>
<string name="marked_as_read_label">Markera som spelad</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-tr/strings.xml b/core/src/main/res/values-tr/strings.xml
index f27b905bd..79ef2fe2c 100644
--- a/core/src/main/res/values-tr/strings.xml
+++ b/core/src/main/res/values-tr/strings.xml
@@ -107,9 +107,9 @@
<string name="mark_all_read_msg">Tüm bölümleri oynatıldı olarak işaretle</string>
<string name="mark_all_read_confirmation_msg">Lütfen tüm bölümleri oynatıldı olarak işaretlemek istediğinizi onaylayın.</string>
<string name="mark_all_read_feed_confirmation_msg">Lütfen bu yayındaki bütün bölümleri oynatıldı olarak işaretlemek istediğinizi onaylayın.</string>
- <string name="mark_all_seen_label">Hepsini görüldü olarak işaretle</string>
- <string name="mark_all_seen_msg">Bütün bölümler görüldü olarak işaretlendi</string>
- <string name="mark_all_seen_confirmation_msg">Lütfen tüm bölümleri görüldü olarak işaretlemek istediğinizi onaylayın.</string>
+ <string name="remove_all_new_flags_label">Hepsini görüldü olarak işaretle</string>
+ <string name="removed_all_new_flags_msg">Bütün bölümler görüldü olarak işaretlendi</string>
+ <string name="remove_all_new_flags_confirmation_msg">Lütfen tüm bölümleri görüldü olarak işaretlemek istediğinizi onaylayın.</string>
<string name="show_info_label">Bilgiyi göster</string>
<string name="show_feed_settings_label">Cepyayın ayarlarını göster</string>
<string name="feed_info_label">Cepyayın bilgisi</string>
@@ -151,8 +151,8 @@
<string name="remove_label">Kaldır</string>
<string name="delete_label">Sil</string>
<string name="delete_failed">Dosya silinemiyor. Cihazı yeniden başlatmak yardımcı olabilir.</string>
- <string name="mark_as_seen_label">Hepsini görüldü olarak işaretle</string>
- <string name="marked_as_seen_label">Görüldü olarak işaretlendi</string>
+ <string name="remove_new_flag_label">Hepsini görüldü olarak işaretle</string>
+ <string name="removed_new_flag_label">Görüldü olarak işaretlendi</string>
<string name="mark_read_label">Oynatıldı olarak işaretle</string>
<string name="marked_as_read_label">Oynatıldı olarak işaretlendi</string>
<string name="mark_unread_label">Oynatılmadı olarak işaretle</string>
diff --git a/core/src/main/res/values-uk-rUA/strings.xml b/core/src/main/res/values-uk-rUA/strings.xml
index d40baba2d..18ba0c6e3 100644
--- a/core/src/main/res/values-uk-rUA/strings.xml
+++ b/core/src/main/res/values-uk-rUA/strings.xml
@@ -120,9 +120,9 @@
<string name="mark_all_read_msg">Позначено всі епізоди як відтворені</string>
<string name="mark_all_read_confirmation_msg">Будь ласка, підтвердіть що ви бажаєте позначити всі епізоди як відтворені.</string>
<string name="mark_all_read_feed_confirmation_msg">Будь ласка, підтвердіть, що ви бажаєте позначити всі епізоди цього подкасту як відтворені. </string>
- <string name="mark_all_seen_label">Позначити всі як переглянуті</string>
- <string name="mark_all_seen_msg">Всі епізоди позначено як переглянуті</string>
- <string name="mark_all_seen_confirmation_msg">Будь ласка, підтвердіть що ви бажаєте позначити всі епізоди як переглянуті.</string>
+ <string name="remove_all_new_flags_label">Позначити всі як переглянуті</string>
+ <string name="removed_all_new_flags_msg">Всі епізоди позначено як переглянуті</string>
+ <string name="remove_all_new_flags_confirmation_msg">Будь ласка, підтвердіть що ви бажаєте позначити всі епізоди як переглянуті.</string>
<string name="show_info_label">Інформація</string>
<string name="show_feed_settings_label">Показати налаштування подкасту</string>
<string name="feed_info_label">Інформація про подкаст</string>
@@ -177,8 +177,8 @@
<item quantity="many">%dепізодів видалено. </item>
<item quantity="other">%d епізодів видалено.</item>
</plurals>
- <string name="mark_as_seen_label">Позначити як переглянутий</string>
- <string name="marked_as_seen_label">Позначено як переглянутий</string>
+ <string name="remove_new_flag_label">Позначити як переглянутий</string>
+ <string name="removed_new_flag_label">Позначено як переглянутий</string>
<string name="mark_read_label">Позначити як відтворений</string>
<string name="marked_as_read_label">Позначено як відтворений</string>
<plurals name="marked_read_batch_label">
diff --git a/core/src/main/res/values-vi/strings.xml b/core/src/main/res/values-vi/strings.xml
index 0982d2b14..86fd4364f 100644
--- a/core/src/main/res/values-vi/strings.xml
+++ b/core/src/main/res/values-vi/strings.xml
@@ -91,8 +91,8 @@
<string name="mark_all_read_label">Đánh dấu đã nghe tất cả</string>
<string name="mark_all_read_msg">Đánh dấu đã nghe tất cả các tập</string>
<string name="mark_all_read_confirmation_msg">Hãy xác nhận bạn muốn đánh dấu đã nghe tất cả các tập.</string>
- <string name="mark_all_seen_label">Đánh dấu đã xem tất cả</string>
- <string name="mark_all_seen_confirmation_msg">Hãy xác nhận bạn muốn đánh dấu đã xem tất cả các tập.</string>
+ <string name="remove_all_new_flags_label">Đánh dấu đã xem tất cả</string>
+ <string name="remove_all_new_flags_confirmation_msg">Hãy xác nhận bạn muốn đánh dấu đã xem tất cả các tập.</string>
<string name="show_info_label">Hiện thông tin</string>
<string name="share_label">Chia sẻ…</string>
<string name="share_feed_url_label">Chia sẻ liên kết feed</string>
@@ -116,7 +116,7 @@
<string name="remove_label">Loại bỏ</string>
<string name="delete_label">Xoá</string>
<string name="remove_episode_lable">Xoá tập này</string>
- <string name="marked_as_seen_label">Đánh dấu đã xem</string>
+ <string name="removed_new_flag_label">Đánh dấu đã xem</string>
<string name="mark_read_label">Đánh dấu đã nghe</string>
<string name="marked_as_read_label">Đã đánh dấu đã nghe</string>
<string name="mark_unread_label">Đánh dấu chưa nghe</string>
diff --git a/core/src/main/res/values-zh-rCN/strings.xml b/core/src/main/res/values-zh-rCN/strings.xml
index f78c6b0ae..0d9188b0e 100644
--- a/core/src/main/res/values-zh-rCN/strings.xml
+++ b/core/src/main/res/values-zh-rCN/strings.xml
@@ -113,8 +113,8 @@
<string name="mark_all_read_label">全部标识已读</string>
<string name="mark_all_read_msg">将所有曲目标记为已播放</string>
<string name="mark_all_read_confirmation_msg">请确认您要将所有曲目标为已播放</string>
- <string name="mark_all_seen_label">所有可见</string>
- <string name="mark_all_seen_confirmation_msg">请确认您要将所有曲目标记为已读。</string>
+ <string name="remove_all_new_flags_label">所有可见</string>
+ <string name="remove_all_new_flags_confirmation_msg">请确认您要将所有曲目标记为已读。</string>
<string name="show_info_label">查看信息</string>
<string name="feed_info_label">播客信息</string>
<string name="feed_settings_label">播客设置</string>
@@ -145,8 +145,8 @@
<string name="remove_label">删除</string>
<string name="delete_label">删除</string>
<string name="delete_failed">无法删除文件。重启可能解决该问题。</string>
- <string name="mark_as_seen_label">标记为已读</string>
- <string name="marked_as_seen_label">标记为已读</string>
+ <string name="remove_new_flag_label">标记为已读</string>
+ <string name="removed_new_flag_label">标记为已读</string>
<string name="mark_read_label">标记已播放</string>
<string name="marked_as_read_label">已标记为已播放</string>
<string name="mark_unread_label">标记未播放</string>
diff --git a/core/src/main/res/values-zh-rTW/strings.xml b/core/src/main/res/values-zh-rTW/strings.xml
index f00904eda..97ecc4872 100644
--- a/core/src/main/res/values-zh-rTW/strings.xml
+++ b/core/src/main/res/values-zh-rTW/strings.xml
@@ -103,8 +103,8 @@
<string name="mark_all_read_label">全部標記為已播放</string>
<string name="mark_all_read_msg">全部劇集標記為已播放</string>
<string name="mark_all_read_confirmation_msg">請確認你要將所有劇集標記為已播放。</string>
- <string name="mark_all_seen_label">標記為已讀</string>
- <string name="mark_all_seen_confirmation_msg">請確認你要將所有劇集標記為已讀。</string>
+ <string name="remove_all_new_flags_label">標記為已讀</string>
+ <string name="remove_all_new_flags_confirmation_msg">請確認你要將所有劇集標記為已讀。</string>
<string name="show_info_label">顯示資料</string>
<string name="share_label">分享</string>
<string name="share_file_label">分享文件</string>
@@ -131,7 +131,7 @@
<string name="delete_label">刪除</string>
<string name="delete_failed">刪除文件失敗。重啟設備試試看。</string>
<string name="remove_episode_lable">移除劇集</string>
- <string name="marked_as_seen_label">標記為已讀</string>
+ <string name="removed_new_flag_label">標記為已讀</string>
<string name="mark_read_label">標記為已播放</string>
<string name="marked_as_read_label">已標記為已播放</string>
<string name="mark_unread_label">標記為未播放</string>
diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml
index 5311d6cd2..eb7f065ce 100644
--- a/core/src/main/res/values/attrs.xml
+++ b/core/src/main/res/values/attrs.xml
@@ -61,6 +61,7 @@
<attr name="ic_known_issues" format="reference" />
<attr name="master_switch_background" format="color"/>
<attr name="currently_playing_background" format="color"/>
+ <attr name="ic_bookmark" format="reference"/>
<!-- Used in itemdescription -->
<attr name="non_transparent_background" format="reference"/>
diff --git a/core/src/main/res/values/dimens.xml b/core/src/main/res/values/dimens.xml
index 46da1d68e..cdde0027d 100644
--- a/core/src/main/res/values/dimens.xml
+++ b/core/src/main/res/values/dimens.xml
@@ -40,4 +40,6 @@
<dimen name="media_router_controller_playback_control_start_padding">24dp</dimen>
<dimen name="media_router_controller_bottom_margin">8dp</dimen>
+ <dimen name="scrubber_vertical_padding">0dp</dimen>
+
</resources>
diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml
index 3d7cbfe10..9d64cf549 100644
--- a/core/src/main/res/values/strings.xml
+++ b/core/src/main/res/values/strings.xml
@@ -122,15 +122,17 @@
<string name="podcastdirectories_label">Find Podcast in Directory</string>
<string name="podcastdirectories_descr">For new podcasts, you can search iTunes or fyyd, or browse gpodder.net by name, category or popularity.</string>
<string name="browse_gpoddernet_label">Browse gpodder.net</string>
+ <string name="discover">Discover</string>
+ <string name="discover_more">more »</string>
<!-- Actions on feeds -->
<string name="mark_all_read_label">Mark all as played</string>
<string name="mark_all_read_msg">Marked all Episodes as played</string>
<string name="mark_all_read_confirmation_msg">Please confirm that you want to mark all episodes as being played.</string>
<string name="mark_all_read_feed_confirmation_msg">Please confirm that you want to mark all episodes in this podcast as being played.</string>
- <string name="mark_all_seen_label">Mark all as seen</string>
- <string name="mark_all_seen_msg">Marked all episodes as seen</string>
- <string name="mark_all_seen_confirmation_msg">Please confirm that you want to mark all episodes as seen.</string>
+ <string name="remove_all_new_flags_label">Remove all \"new\" flags</string>
+ <string name="removed_all_new_flags_msg">Removed all \"new\" flags</string>
+ <string name="remove_all_new_flags_confirmation_msg">Please confirm that you want to remove the \"new\" flag from all episodes.</string>
<string name="show_info_label">Show information</string>
<string name="show_feed_settings_label">Show podcast settings</string>
<string name="feed_info_label">Podcast info</string>
@@ -182,8 +184,8 @@
<item quantity="one">%d episode deleted.</item>
<item quantity="other">%d episodes deleted.</item>
</plurals>
- <string name="mark_as_seen_label">Mark as seen</string>
- <string name="marked_as_seen_label">Marked as seen</string>
+ <string name="remove_new_flag_label">Remove \"new\" flag</string>
+ <string name="removed_new_flag_label">Removed \"new\" flag</string>
<string name="mark_read_label">Mark as played</string>
<string name="marked_as_read_label">Marked as played</string>
<plurals name="marked_read_batch_label">
@@ -211,7 +213,6 @@
<string name="remove_from_favorite_label">Remove from Favorites</string>
<string name="removed_from_favorites">Removed from Favorites</string>
<string name="visit_website_label">Visit Website</string>
- <string name="support_label">Flattr this</string>
<string name="skip_episode_label">Skip episode</string>
<string name="activate_auto_download">Activate Auto Download</string>
<string name="deactivate_auto_download">Deactivate Auto Download</string>
@@ -305,34 +306,6 @@
<string name="sort_old_to_new">Old to new</string>
<string name="sort_new_to_old">New to old</string>
- <!-- Flattr -->
- <string name="flattr_auth_label">Flattr sign-in</string>
- <string name="flattr_auth_explanation">Press the button below to start the authentication process. You will be forwarded to the flattr login screen in your browser and be asked to give AntennaPod the permission to flattr things. After you have given permission, you will return to this screen automatically.</string>
- <string name="authenticate_label">Authenticate</string>
- <string name="return_home_label">Return to home</string>
- <string name="flattr_auth_success">Authentication was successful! You can now flattr things within the app.</string>
- <string name="no_flattr_token_title">No Flattr token found</string>
- <string name="no_flattr_token_notification_msg">Your flattr account does not seem to be connected to AntennaPod. Tap here to authenticate.</string>
- <string name="no_flattr_token_msg">Your flattr account does not seem to be connected to AntennaPod. You can either connect your account to AntennaPod to flattr things within the app or you can visit the website of the thing to flattr it there.</string>
- <string name="authenticate_now_label">Authenticate</string>
- <string name="action_forbidden_title">Action forbidden</string>
- <string name="action_forbidden_msg">AntennaPod has no permission for this action. The reason for this could be that the access token of AntennaPod to your account has been revoked. You can either re-reauthenticate or visit the website of the thing instead.</string>
- <string name="access_revoked_title">Access revoked</string>
- <string name="access_revoked_info">You have successfully revoked AntennaPod\'s access token to your account. In order to complete the process, you have to remove this app from the list of approved applications in your account settings on the flattr website.</string>
-
- <!-- Flattr -->
- <string name="flattr_click_success">Flattr\'ed one thing!</string>
- <string name="flattr_click_success_count">Flattr\'ed %d things!</string>
- <string name="flattr_click_success_queue">Flattr\'ed: %s.</string>
- <string name="flattr_click_failure_count">Failed to flattr %d things!</string>
- <string name="flattr_click_failure">Not flattr\'ed: %s.</string>
- <string name="flattr_click_enqueued">Thing will be flattr\'ed later</string>
- <string name="flattring_thing">Flattring %s</string>
- <string name="flattring_label">AntennaPod is flattring</string>
- <string name="flattrd_label">AntennaPod has flattr\'ed</string>
- <string name="flattrd_failed_label">AntennaPod flattr failed</string>
- <string name="flattr_retrieving_status">Retrieving flattr\'ed things</string>
-
<!-- Variable Speed -->
<string name="download_plugin_label">Download Plugin</string>
<string name="no_playback_plugin_title">Plugin Not Installed</string>
@@ -344,7 +317,6 @@
<string name="no_items_header_label">No queued episodes</string>
<string name="no_items_label">Add an episode by downloading it, or long press an episode and select \"Add to queue\".</string>
<string name="no_feeds_label">You haven\'t subscribed to any podcasts yet.</string>
- <string name="no_chapters_label">This episode has no chapters.</string>
<string name="no_shownotes_label">This episode has no shownotes.</string>
<string name="no_run_downloads_head_label">No downloads running</string>
<string name="no_run_downloads_label">You can download episodes on the podcast details screen.</string>
@@ -360,6 +332,8 @@
<string name="no_new_episodes_label">When new episodes arrive, they will be shown here.</string>
<string name="no_fav_episodes_head_label">No favorite episodes</string>
<string name="no_fav_episodes_label">You can add episodes to the favorites by long-pressing them.</string>
+ <string name="no_chapters_head_label">No chapters</string>
+ <string name="no_chapters_label">This episode has no chapters.</string>
<!-- Preferences -->
<string name="storage_pref">Storage</string>
@@ -368,8 +342,6 @@
<string name="about_pref">About</string>
<string name="queue_label">Queue</string>
<string name="integrations_label">Integrations</string>
- <string name="flattr_label">Flattr</string>
- <string name="flattr_summary">Micropayment service</string>
<string name="automation">Automation</string>
<string name="download_pref_details">Details</string>
<string name="import_export_pref">Import/Export</string>
@@ -419,15 +391,6 @@
<string name="pref_mobileUpdate_images">Images only</string>
<string name="pref_mobileUpdate_everything">Everything</string>
<string name="refreshing_label">Refreshing</string>
- <string name="flattr_settings_label">Flattr settings</string>
- <string name="pref_flattr_auth_title">Flattr sign-in</string>
- <string name="pref_flattr_auth_sum">Sign in to your flattr account to flattr things directly from the app.</string>
- <string name="pref_flattr_this_app_title">Flattr this App</string>
- <string name="pref_flattr_this_app_sum">Support the development of AntennaPod by flattring it. Thanks!</string>
- <string name="pref_revokeAccess_title">Revoke access</string>
- <string name="pref_revokeAccess_sum">Revoke the access permission to your flattr account for this app.</string>
- <string name="pref_auto_flattr_title">Automatic Flattr</string>
- <string name="pref_auto_flattr_sum">Configure automatic flattring</string>
<string name="user_interface_label">User Interface</string>
<string name="pref_set_theme_title">Select Theme</string>
<string name="pref_nav_drawer_title">Customize Navigation Drawer</string>
@@ -541,12 +504,6 @@
<string name="pref_delete_removes_from_queue_title">Delete removes from Queue</string>
<string name="pref_delete_removes_from_queue_sum">Automatically remove an episode from the queue when it is deleted.</string>
- <!-- Auto-Flattr dialog -->
- <string name="auto_flattr_enable">Enable automatic flattring</string>
- <string name="auto_flattr_after_percent">Flattr episode as soon as %d percent have been played</string>
- <string name="auto_flattr_ater_beginning">Flattr episode when playback starts</string>
- <string name="auto_flattr_ater_end">Flattr episode when playback ends</string>
-
<!-- Search -->
<string name="search_hint">Search for episodes</string>
<string name="found_in_shownotes_label">Found in show notes</string>
@@ -652,7 +609,7 @@
<string name="choose_data_directory">Choose Data Folder</string>
<string name="choose_data_directory_message">Please choose the base of your data folder. AntennaPod will create the appropriate sub-directories.</string>
<string name="choose_data_directory_permission_rationale">Access to external storage is required to change the data folder</string>
- <string name="choose_data_directory_available_space">%1$s free</string>
+ <string name="choose_data_directory_available_space">%1$s of %2$s free</string>
<string name="create_folder_msg">Create new folder with name "%1$s"?</string>
<string name="create_folder_success">Created new folder</string>
<string name="create_folder_error_no_write_access">Cannot write to this folder</string>
@@ -705,10 +662,13 @@
<!-- AntennaPodSP -->
<string name="sp_apps_importing_feeds_msg">Importing subscriptions from single-purpose apps&#8230;</string>
+ <!-- Add podcast fragment -->
+ <string name="search_podcast_hint">Search podcast…</string>
<string name="search_itunes_label">Search iTunes</string>
- <string name="filter">Filter</string>
-
<string name="search_fyyd_label">Search fyyd</string>
+ <string name="advanced_search">Advanced search</string>
+
+ <string name="filter">Filter</string>
<!-- Episodes apply actions -->
<string name="all_label">All</string>
diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml
index d80137ea3..4c69306a9 100644
--- a/core/src/main/res/values/styles.xml
+++ b/core/src/main/res/values/styles.xml
@@ -71,7 +71,7 @@
<item name="ic_question_answer">@drawable/ic_forum_grey600_24dp</item>
<item name="ic_bug">@drawable/ic_bug_grey600_24dp</item>
<item name="ic_known_issues">@drawable/ic_format_list_bulleted_grey600_24dp</item>
-
+ <item name="ic_bookmark">@drawable/ic_bookmark_grey600_24dp</item>
<item name="master_switch_background">@color/master_switch_background_light</item>
<item name="currently_playing_background">@color/highlight_light</item>
@@ -155,6 +155,7 @@
<item name="ic_question_answer">@drawable/ic_baseline_question_answer_white_24dp</item>
<item name="ic_bug">@drawable/ic_bug_white_24dp</item>
<item name="ic_known_issues">@drawable/ic_format_list_bulleted_white_24dp</item>
+ <item name="ic_bookmark">@drawable/ic_bookmark_white_24dp</item>
<item name="master_switch_background">@color/master_switch_background_dark</item>
<item name="currently_playing_background">@color/highlight_dark</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
diff --git a/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java b/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java
index 9af76cf86..862fe23f5 100644
--- a/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java
+++ b/core/src/play/java/de/danoeh/antennapod/core/ClientConfig.java
@@ -29,8 +29,6 @@ public class ClientConfig {
public static GpodnetCallbacks gpodnetCallbacks;
- public static FlattrCallbacks flattrCallbacks;
-
public static DBTasksCallbacks dbTasksCallbacks;
public static CastCallbacks castCallbacks;
@@ -43,7 +41,6 @@ public class ClientConfig {
}
PodDBAdapter.init(context);
UserPreferences.init(context);
- UpdateManager.init(context);
PlaybackPreferences.init(context);
NetworkUtils.init(context);
CastManager.init(context);