summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorH. Lehmann <ByteHamster@users.noreply.github.com>2018-10-21 19:12:14 +0200
committerGitHub <noreply@github.com>2018-10-21 19:12:14 +0200
commit94a4b78449043583570d3b97b758985c78e9f4a6 (patch)
tree516adc07943008ba02982e44a01798eaff7d84d9 /app/src/main
parenta05f386793a7790302502983579b528bb6b46eaa (diff)
parent59c2c5b1d6e007ea7fa8260d994d21743a092f73 (diff)
downloadAntennaPod-94a4b78449043583570d3b97b758985c78e9f4a6.zip
Merge branch 'develop' into glide-48
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/AndroidManifest.xml4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/PodcastApp.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java29
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java42
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java8
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java12
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java28
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java18
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java18
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java14
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/OpmlImportHolder.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java1
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/StatisticsActivity.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java17
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java32
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java20
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java5
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java12
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java12
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java16
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java16
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java22
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java8
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/adapter/itunes/ItunesAdapter.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java1
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java35
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java13
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/RatingDialog.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java12
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java6
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java7
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java34
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java29
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java28
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java10
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java16
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java4
-rw-r--r--app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java8
-rw-r--r--app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java2
-rw-r--r--app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java1
-rw-r--r--app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java1
-rw-r--r--app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java35
-rw-r--r--app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java2
-rw-r--r--app/src/main/play/de/listing/fulldescription4
-rw-r--r--app/src/main/res/xml/preferences.xml2
71 files changed, 381 insertions, 375 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 65055f84b..9bb89d02a 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.danoeh.antennapod"
android:installLocation="auto"
- android:versionCode="1060691"
- android:versionName="1.6.6-RC2">
+ android:versionCode="1070000"
+ android:versionName="1.7.0">
<!--
Version code schema:
"1.2.3-SNAPSHOT" -> 1020300
diff --git a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java
index 3abf7557a..fde9af16f 100644
--- a/app/src/main/java/de/danoeh/antennapod/PodcastApp.java
+++ b/app/src/main/java/de/danoeh/antennapod/PodcastApp.java
@@ -20,7 +20,7 @@ public class PodcastApp extends Application {
try {
Class.forName("de.danoeh.antennapod.config.ClientConfigurator");
} catch (Exception e) {
- throw new RuntimeException("ClientConfigurator not found");
+ throw new RuntimeException("ClientConfigurator not found", e);
}
}
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
index 141fddd1c..266619840 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
@@ -43,8 +43,8 @@ public class AboutActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayShowHomeEnabled(true);
setContentView(R.layout.about);
- webViewContainer = (LinearLayout) findViewById(R.id.webViewContainer);
- webView = (WebView) findViewById(R.id.webViewAbout);
+ webViewContainer = findViewById(R.id.webViewContainer);
+ webView = findViewById(R.id.webViewAbout);
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java
index 390d4cef8..33def125e 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/DirectoryChooserActivity.java
@@ -64,11 +64,11 @@ public class DirectoryChooserActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.directory_chooser);
- butConfirm = (Button) findViewById(R.id.butConfirm);
- butCancel = (Button) findViewById(R.id.butCancel);
- butNavUp = (ImageButton) findViewById(R.id.butNavUp);
- txtvSelectedFolder = (TextView) findViewById(R.id.txtvSelectedFolder);
- listDirectories = (ListView) findViewById(R.id.directory_list);
+ butConfirm = findViewById(R.id.butConfirm);
+ butCancel = findViewById(R.id.butCancel);
+ butNavUp = findViewById(R.id.butNavUp);
+ txtvSelectedFolder = findViewById(R.id.txtvSelectedFolder);
+ listDirectories = findViewById(R.id.directory_list);
butConfirm.setOnClickListener(new OnClickListener() {
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java
index e726afaec..5e04d743d 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/DownloadAuthenticationActivity.java
@@ -49,11 +49,11 @@ public class DownloadAuthenticationActivity extends AppCompatActivity {
}
setContentView(R.layout.download_authentication_activity);
- TextView txtvDescription = (TextView) findViewById(R.id.txtvDescription);
- etxtUsername = (EditText) findViewById(R.id.etxtUsername);
- etxtPassword = (EditText) findViewById(R.id.etxtPassword);
- Button butConfirm = (Button) findViewById(R.id.butConfirm);
- Button butCancel = (Button) findViewById(R.id.butCancel);
+ TextView txtvDescription = findViewById(R.id.txtvDescription);
+ etxtUsername = findViewById(R.id.etxtUsername);
+ etxtPassword = findViewById(R.id.etxtPassword);
+ Button butConfirm = findViewById(R.id.butConfirm);
+ Button butCancel = findViewById(R.id.butCancel);
Validate.isTrue(getIntent().hasExtra(ARG_DOWNLOAD_REQUEST), "Download request missing");
DownloadRequest request = getIntent().getParcelableExtra(ARG_DOWNLOAD_REQUEST);
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 e07b6e13b..4b6245ee6 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java
@@ -16,9 +16,15 @@ import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
+
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.joanzapata.iconify.Iconify;
+
+import org.apache.commons.lang3.StringUtils;
+import org.jsoup.Jsoup;
+import org.jsoup.nodes.Document;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
import de.danoeh.antennapod.core.feed.Feed;
@@ -31,9 +37,6 @@ import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.LangUtils;
import de.danoeh.antennapod.core.util.syndication.HtmlToPlainText;
import de.danoeh.antennapod.menuhandler.FeedMenuHandler;
-import org.apache.commons.lang3.StringUtils;
-import org.jsoup.Jsoup;
-import org.jsoup.nodes.Document;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
@@ -83,22 +86,22 @@ public class FeedInfoActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
long feedId = getIntent().getLongExtra(EXTRA_FEED_ID, -1);
- imgvCover = (ImageView) findViewById(R.id.imgvCover);
- txtvTitle = (TextView) findViewById(R.id.txtvTitle);
- TextView txtvAuthorHeader = (TextView) findViewById(R.id.txtvAuthor);
- ImageView imgvBackground = (ImageView) findViewById(R.id.imgvBackground);
+ imgvCover = findViewById(R.id.imgvCover);
+ txtvTitle = findViewById(R.id.txtvTitle);
+ TextView txtvAuthorHeader = findViewById(R.id.txtvAuthor);
+ ImageView imgvBackground = findViewById(R.id.imgvBackground);
findViewById(R.id.butShowInfo).setVisibility(View.INVISIBLE);
findViewById(R.id.butShowSettings).setVisibility(View.INVISIBLE);
// https://github.com/bumptech/glide/issues/529
imgvBackground.setColorFilter(new LightingColorFilter(0xff828282, 0x000000));
- txtvDescription = (TextView) findViewById(R.id.txtvDescription);
- lblLanguage = (TextView) findViewById(R.id.lblLanguage);
- txtvLanguage = (TextView) findViewById(R.id.txtvLanguage);
- lblAuthor = (TextView) findViewById(R.id.lblAuthor);
- txtvAuthor = (TextView) findViewById(R.id.txtvDetailsAuthor);
- txtvUrl = (TextView) findViewById(R.id.txtvUrl);
+ txtvDescription = findViewById(R.id.txtvDescription);
+ lblLanguage = findViewById(R.id.lblLanguage);
+ txtvLanguage = findViewById(R.id.txtvLanguage);
+ lblAuthor = findViewById(R.id.lblAuthor);
+ txtvAuthor = findViewById(R.id.txtvDetailsAuthor);
+ txtvUrl = findViewById(R.id.txtvUrl);
txtvUrl.setOnClickListener(copyUrlToClipboard);
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java
index 7c0965c76..5180cdf54 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java
@@ -25,8 +25,10 @@ import android.widget.RadioButton;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
+
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator;
@@ -70,22 +72,6 @@ public class FeedSettingsActivity extends AppCompatActivity {
private Subscription subscription;
-
- private final View.OnClickListener copyUrlToClipboard = new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- if(feed != null && feed.getDownload_url() != null) {
- String url = feed.getDownload_url();
- ClipData clipData = ClipData.newPlainText(url, url);
- android.content.ClipboardManager cm = (android.content.ClipboardManager) FeedSettingsActivity.this
- .getSystemService(Context.CLIPBOARD_SERVICE);
- cm.setPrimaryClip(clipData);
- Toast t = Toast.makeText(FeedSettingsActivity.this, R.string.copied_url_msg, Toast.LENGTH_SHORT);
- t.show();
- }
- }
- };
-
private boolean authInfoChanged = false;
private final TextWatcher authTextWatcher = new TextWatcher() {
@@ -128,27 +114,27 @@ public class FeedSettingsActivity extends AppCompatActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
long feedId = getIntent().getLongExtra(EXTRA_FEED_ID, -1);
- imgvCover = (ImageView) findViewById(R.id.imgvCover);
- txtvTitle = (TextView) findViewById(R.id.txtvTitle);
- TextView txtvAuthorHeader = (TextView) findViewById(R.id.txtvAuthor);
- ImageView imgvBackground = (ImageView) findViewById(R.id.imgvBackground);
+ imgvCover = findViewById(R.id.imgvCover);
+ txtvTitle = findViewById(R.id.txtvTitle);
+ TextView txtvAuthorHeader = findViewById(R.id.txtvAuthor);
+ ImageView imgvBackground = findViewById(R.id.imgvBackground);
findViewById(R.id.butShowInfo).setVisibility(View.INVISIBLE);
findViewById(R.id.butShowSettings).setVisibility(View.INVISIBLE);
// https://github.com/bumptech/glide/issues/529
imgvBackground.setColorFilter(new LightingColorFilter(0xff828282, 0x000000));
- cbxAutoDownload = (CheckBox) findViewById(R.id.cbxAutoDownload);
- cbxKeepUpdated = (CheckBox) findViewById(R.id.cbxKeepUpdated);
- spnAutoDelete = (Spinner) findViewById(R.id.spnAutoDelete);
- etxtUsername = (EditText) findViewById(R.id.etxtUsername);
- etxtPassword = (EditText) findViewById(R.id.etxtPassword);
- etxtFilterText = (EditText) findViewById(R.id.etxtEpisodeFilterText);
- rdoFilterInclude = (RadioButton) findViewById(R.id.radio_filter_include);
+ cbxAutoDownload = findViewById(R.id.cbxAutoDownload);
+ cbxKeepUpdated = findViewById(R.id.cbxKeepUpdated);
+ spnAutoDelete = findViewById(R.id.spnAutoDelete);
+ etxtUsername = findViewById(R.id.etxtUsername);
+ etxtPassword = findViewById(R.id.etxtPassword);
+ etxtFilterText = findViewById(R.id.etxtEpisodeFilterText);
+ rdoFilterInclude = findViewById(R.id.radio_filter_include);
rdoFilterInclude.setOnClickListener(v -> {
filterInclude = true;
filterTextChanged = true;
});
- rdoFilterExclude = (RadioButton) findViewById(R.id.radio_filter_exclude);
+ rdoFilterExclude = findViewById(R.id.radio_filter_exclude);
rdoFilterExclude.setOnClickListener(v -> {
filterInclude = false;
filterTextChanged = true;
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java
index 26352f58f..2b4384a02 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/FlattrAuthActivity.java
@@ -41,9 +41,9 @@ public class FlattrAuthActivity extends AppCompatActivity {
if (BuildConfig.DEBUG) Log.d(TAG, "Activity created");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.flattr_auth);
- txtvExplanation = (TextView) findViewById(R.id.txtvExplanation);
- butAuthenticate = (Button) findViewById(R.id.but_authenticate);
- butReturn = (Button) findViewById(R.id.but_return_home);
+ 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);
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java
index 91462bce9..e6c9c37cc 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/ImportExportActivity.java
@@ -13,9 +13,7 @@ import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.MenuItem;
-import de.danoeh.antennapod.R;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
-import de.danoeh.antennapod.core.storage.PodDBAdapter;
+
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
@@ -26,6 +24,10 @@ import java.io.IOException;
import java.io.InputStream;
import java.nio.channels.FileChannel;
+import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.core.preferences.UserPreferences;
+import de.danoeh.antennapod.core.storage.PodDBAdapter;
+
/**
* Displays the 'import/export' screen
*/
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 0879b2cec..f506921d2 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java
@@ -30,9 +30,6 @@ import android.widget.ListView;
import com.bumptech.glide.Glide;
-import de.danoeh.antennapod.core.event.ServiceEvent;
-import de.danoeh.antennapod.core.util.IntentUtils;
-import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.Validate;
@@ -45,6 +42,7 @@ import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
import de.danoeh.antennapod.core.event.MessageEvent;
import de.danoeh.antennapod.core.event.ProgressEvent;
import de.danoeh.antennapod.core.event.QueueEvent;
+import de.danoeh.antennapod.core.event.ServiceEvent;
import de.danoeh.antennapod.core.feed.EventDistributor;
import de.danoeh.antennapod.core.feed.Feed;
import de.danoeh.antennapod.core.preferences.PlaybackPreferences;
@@ -55,7 +53,9 @@ import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.util.FeedItemUtil;
import de.danoeh.antennapod.core.util.Flavors;
+import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.StorageUtils;
+import de.danoeh.antennapod.core.util.gui.NotificationUtils;
import de.danoeh.antennapod.dialog.RatingDialog;
import de.danoeh.antennapod.dialog.RenameFeedDialog;
import de.danoeh.antennapod.fragment.AddFeedFragment;
@@ -130,7 +130,7 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
StorageUtils.checkStorageAvailability(this);
setContentView(R.layout.main);
- toolbar = (Toolbar) findViewById(R.id.toolbar);
+ toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -142,8 +142,8 @@ public class MainActivity extends CastEnabledActivity implements NavDrawerActivi
currentTitle = getTitle();
- drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
- navList = (ListView) findViewById(R.id.nav_list);
+ drawerLayout = findViewById(R.id.drawer_layout);
+ navList = findViewById(R.id.nav_list);
navDrawer = findViewById(R.id.nav_layout);
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close);
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 be9d60c93..9c8999927 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
@@ -231,7 +231,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
Log.d(TAG, "onCreate()");
StorageUtils.checkStorageAvailability(this);
- orientation = getResources().getConfiguration().orientation;
getWindow().setFormat(PixelFormat.TRANSPARENT);
}
@@ -265,15 +264,10 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
private void onBufferUpdate(float progress) {
if (sbPosition != null) {
- sbPosition.setSecondaryProgress((int) progress * sbPosition.getMax());
+ sbPosition.setSecondaryProgress((int) (progress * sbPosition.getMax()));
}
}
- /**
- * Current screen orientation.
- */
- private int orientation;
-
@Override
protected void onStart() {
super.onStart();
@@ -803,13 +797,13 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
void setupGUI() {
setContentView(getContentViewResourceId());
- sbPosition = (SeekBar) findViewById(R.id.sbPosition);
- txtvPosition = (TextView) findViewById(R.id.txtvPosition);
+ sbPosition = findViewById(R.id.sbPosition);
+ txtvPosition = findViewById(R.id.txtvPosition);
SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE);
showTimeLeft = prefs.getBoolean(PREF_SHOW_TIME_LEFT, false);
Log.d("timeleft", showTimeLeft ? "true" : "false");
- txtvLength = (TextView) findViewById(R.id.txtvLength);
+ txtvLength = findViewById(R.id.txtvLength);
if (txtvLength != null) {
txtvLength.setOnClickListener(v -> {
showTimeLeft = !showTimeLeft;
@@ -833,18 +827,18 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
});
}
- butRev = (ImageButton) findViewById(R.id.butRev);
- txtvRev = (TextView) findViewById(R.id.txtvRev);
+ butRev = findViewById(R.id.butRev);
+ txtvRev = findViewById(R.id.txtvRev);
if (txtvRev != null) {
txtvRev.setText(String.valueOf(UserPreferences.getRewindSecs()));
}
- butPlay = (ImageButton) findViewById(R.id.butPlay);
- butFF = (ImageButton) findViewById(R.id.butFF);
- txtvFF = (TextView) findViewById(R.id.txtvFF);
+ butPlay = findViewById(R.id.butPlay);
+ butFF = findViewById(R.id.butFF);
+ txtvFF = findViewById(R.id.txtvFF);
if (txtvFF != null) {
txtvFF.setText(String.valueOf(UserPreferences.getFastForwardSecs()));
}
- butSkip = (ImageButton) findViewById(R.id.butSkip);
+ butSkip = findViewById(R.id.butSkip);
// SEEKBAR SETUP
@@ -992,7 +986,7 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
}
@Override
- public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
+ public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
if (requestCode == REQUEST_CODE_STORAGE) {
if (grantResults.length <= 0 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this, R.string.needs_storage_permission, Toast.LENGTH_LONG).show();
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 49a0e898b..7d79f0a57 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerInfoActivity.java
@@ -227,18 +227,18 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
@Override
protected void setupGUI() {
super.setupGUI();
- Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
+ Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
findViewById(R.id.shadow).setVisibility(View.GONE);
- AppBarLayout appBarLayout = (AppBarLayout) findViewById(R.id.appBar);
+ AppBarLayout appBarLayout = findViewById(R.id.appBar);
float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 4, getResources().getDisplayMetrics());
appBarLayout.setElevation(px);
}
- drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
- navList = (ListView) findViewById(R.id.nav_list);
+ drawerLayout = findViewById(R.id.drawer_layout);
+ navList = findViewById(R.id.nav_list);
navDrawer = findViewById(R.id.nav_layout);
drawerToggle = new ActionBarDrawerToggle(this, drawerLayout, R.string.drawer_open, R.string.drawer_close);
@@ -274,14 +274,14 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
startActivity(new Intent(MediaplayerInfoActivity.this, PreferenceActivity.class));
});
- butPlaybackSpeed = (Button) findViewById(R.id.butPlaybackSpeed);
- butCastDisconnect = (ImageButton) findViewById(R.id.butCastDisconnect);
+ butPlaybackSpeed = findViewById(R.id.butPlaybackSpeed);
+ butCastDisconnect = findViewById(R.id.butCastDisconnect);
- pager = (ViewPager) findViewById(R.id.pager);
+ pager = findViewById(R.id.pager);
pagerAdapter = new MediaplayerInfoPagerAdapter(getSupportFragmentManager(), media);
pagerAdapter.setController(controller);
pager.setAdapter(pagerAdapter);
- CirclePageIndicator pageIndicator = (CirclePageIndicator) findViewById(R.id.page_indicator);
+ CirclePageIndicator pageIndicator = findViewById(R.id.page_indicator);
pageIndicator.setViewPager(pager);
loadLastFragment();
pager.onSaveInstanceState();
@@ -357,7 +357,7 @@ public abstract class MediaplayerInfoActivity extends MediaplayerActivity implem
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- return drawerToggle != null && drawerToggle.onOptionsItemSelected(item) || super.onOptionsItemSelected(item);
+ return (drawerToggle != null && drawerToggle.onOptionsItemSelected(item)) || super.onOptionsItemSelected(item);
}
@Override
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java
index 063da8555..68a57dd91 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java
@@ -145,7 +145,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
feedUrl = getIntent().getStringExtra(ARG_FEEDURL);
} else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND)
|| TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) {
- feedUrl = (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND))
+ feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND)
? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString();
if (actionBar != null) {
actionBar.setTitle(R.string.add_feed_label);
@@ -307,7 +307,7 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
}
private void parseFeed() {
- if (feed == null || feed.getFile_url() == null && feed.isDownloaded()) {
+ if (feed == null || (feed.getFile_url() == null && feed.isDownloaded())) {
throw new IllegalStateException("feed must be non-null and downloaded when parseFeed is called");
}
Log.d(TAG, "Parsing feed");
@@ -380,20 +380,20 @@ public class OnlineFeedViewActivity extends AppCompatActivity {
this.feed = feed;
this.selectedDownloadUrl = feed.getDownload_url();
EventDistributor.getInstance().register(listener);
- ListView listView = (ListView) findViewById(R.id.listview);
+ ListView listView = findViewById(R.id.listview);
LayoutInflater inflater = LayoutInflater.from(this);
View header = inflater.inflate(R.layout.onlinefeedview_header, listView, false);
listView.addHeaderView(header);
listView.setAdapter(new FeedItemlistDescriptionAdapter(this, 0, feed.getItems()));
- ImageView cover = (ImageView) header.findViewById(R.id.imgvCover);
- TextView title = (TextView) header.findViewById(R.id.txtvTitle);
- TextView author = (TextView) header.findViewById(R.id.txtvAuthor);
- TextView description = (TextView) header.findViewById(R.id.txtvDescription);
- Spinner spAlternateUrls = (Spinner) header.findViewById(R.id.spinnerAlternateUrls);
+ ImageView cover = header.findViewById(R.id.imgvCover);
+ TextView title = header.findViewById(R.id.txtvTitle);
+ TextView author = header.findViewById(R.id.txtvAuthor);
+ TextView description = header.findViewById(R.id.txtvDescription);
+ Spinner spAlternateUrls = header.findViewById(R.id.spinnerAlternateUrls);
- subscribeButton = (Button) header.findViewById(R.id.butSubscribe);
+ subscribeButton = header.findViewById(R.id.butSubscribe);
if (StringUtils.isNotBlank(feed.getImageUrl())) {
Glide.with(this)
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java
index cd375a65a..72759c59c 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java
@@ -39,9 +39,9 @@ public class OpmlFeedChooserActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.opml_selection);
- butConfirm = (Button) findViewById(R.id.butConfirm);
- butCancel = (Button) findViewById(R.id.butCancel);
- feedlist = (ListView) findViewById(R.id.feedlist);
+ butConfirm = findViewById(R.id.butConfirm);
+ butCancel = findViewById(R.id.butCancel);
+ feedlist = findViewById(R.id.feedlist);
feedlist.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
listAdapter = new ArrayAdapter<>(this,
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java
index ed7ab5d34..a63d3b735 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportFromPathActivity.java
@@ -36,16 +36,16 @@ public class OpmlImportFromPathActivity extends OpmlImportBaseActivity {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.opml_import);
- final TextView txtvHeaderExplanation1 = (TextView) findViewById(R.id.txtvHeadingExplanation1);
- final TextView txtvExplanation1 = (TextView) findViewById(R.id.txtvExplanation1);
- final TextView txtvHeaderExplanation2 = (TextView) findViewById(R.id.txtvHeadingExplanation2);
- final TextView txtvExplanation2 = (TextView) findViewById(R.id.txtvExplanation2);
- final TextView txtvHeaderExplanation3 = (TextView) findViewById(R.id.txtvHeadingExplanation3);
+ final TextView txtvHeaderExplanation1 = findViewById(R.id.txtvHeadingExplanation1);
+ final TextView txtvExplanation1 = findViewById(R.id.txtvExplanation1);
+ final TextView txtvHeaderExplanation2 = findViewById(R.id.txtvHeadingExplanation2);
+ final TextView txtvExplanation2 = findViewById(R.id.txtvExplanation2);
+ final TextView txtvHeaderExplanation3 = findViewById(R.id.txtvHeadingExplanation3);
- Button butChooseFilesystem = (Button) findViewById(R.id.butChooseFileFromFilesystem);
+ Button butChooseFilesystem = findViewById(R.id.butChooseFileFromFilesystem);
butChooseFilesystem.setOnClickListener(v -> chooseFileFromFilesystem());
- Button butChooseExternal = (Button) findViewById(R.id.butChooseFileFromExternal);
+ Button butChooseExternal = findViewById(R.id.butChooseFileFromExternal);
butChooseExternal.setOnClickListener(v -> chooseFileFromExternal());
int nextOption = 1;
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportHolder.java b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportHolder.java
index b01cf43e4..dc5570dc0 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportHolder.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/OpmlImportHolder.java
@@ -14,6 +14,8 @@ import de.danoeh.antennapod.core.export.opml.OpmlElement;
*/
public class OpmlImportHolder {
+ private OpmlImportHolder(){}
+
private static ArrayList<OpmlElement> readElements;
public static ArrayList<OpmlElement> getReadElements() {
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 3f005fe36..452e91bd3 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/PreferenceActivity.java
@@ -12,11 +12,11 @@ import android.view.MenuItem;
import android.view.ViewGroup;
import android.widget.FrameLayout;
-import java.lang.ref.WeakReference;
-
-import com.bytehamster.lib.preferencesearch.SearchPreference;
import com.bytehamster.lib.preferencesearch.SearchPreferenceResult;
import com.bytehamster.lib.preferencesearch.SearchPreferenceResultListener;
+
+import java.lang.ref.WeakReference;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.preferences.PreferenceController;
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java
index 73b495a42..ef1850d92 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/SplashActivity.java
@@ -9,6 +9,7 @@ import android.support.annotation.Nullable;
import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.app.AppCompatActivity;
import android.widget.ProgressBar;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.storage.PodDBAdapter;
import rx.Completable;
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/StatisticsActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/StatisticsActivity.java
index b2ff43c43..d2a70b695 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/StatisticsActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/StatisticsActivity.java
@@ -53,9 +53,9 @@ public class StatisticsActivity extends AppCompatActivity
prefs = getSharedPreferences(PREF_NAME, MODE_PRIVATE);
countAll = prefs.getBoolean(PREF_COUNT_ALL, false);
- totalTimeTextView = (TextView) findViewById(R.id.total_time);
- feedStatisticsList = (ListView) findViewById(R.id.statistics_list);
- progressBar = (ProgressBar) findViewById(R.id.progressBar);
+ totalTimeTextView = findViewById(R.id.total_time);
+ feedStatisticsList = findViewById(R.id.statistics_list);
+ progressBar = findViewById(R.id.progressBar);
listAdapter = new StatisticsListAdapter(this);
listAdapter.setCountAll(countAll);
feedStatisticsList.setAdapter(listAdapter);
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java
index a2a49f54e..20e34cc52 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/StorageErrorActivity.java
@@ -42,7 +42,7 @@ public class StorageErrorActivity extends AppCompatActivity {
setContentView(R.layout.storage_error);
- Button btnChooseDataFolder = (Button) findViewById(R.id.btnChooseDataFolder);
+ Button btnChooseDataFolder = findViewById(R.id.btnChooseDataFolder);
btnChooseDataFolder.setOnClickListener(v -> {
if (Build.VERSION_CODES.KITKAT <= Build.VERSION.SDK_INT &&
Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
index ea408c650..78cc15b2c 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
@@ -23,6 +23,10 @@ import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.SeekBar;
+
+import java.lang.ref.WeakReference;
+import java.util.concurrent.atomic.AtomicBoolean;
+
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.feed.MediaType;
import de.danoeh.antennapod.core.preferences.UserPreferences;
@@ -32,9 +36,6 @@ import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil;
import de.danoeh.antennapod.core.util.playback.Playable;
import de.danoeh.antennapod.view.AspectRatioVideoView;
-import java.lang.ref.WeakReference;
-import java.util.concurrent.atomic.AtomicBoolean;
-
/**
* Activity for playing video files.
*/
@@ -142,11 +143,11 @@ public class VideoplayerActivity extends MediaplayerActivity {
}
super.setupGUI();
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- controls = (LinearLayout) findViewById(R.id.controls);
- videoOverlay = (LinearLayout) findViewById(R.id.overlay);
- videoview = (AspectRatioVideoView) findViewById(R.id.videoview);
- videoframe = (FrameLayout) findViewById(R.id.videoframe);
- progressIndicator = (ProgressBar) findViewById(R.id.progressIndicator);
+ controls = findViewById(R.id.controls);
+ videoOverlay = findViewById(R.id.overlay);
+ videoview = findViewById(R.id.videoview);
+ videoframe = findViewById(R.id.videoframe);
+ progressIndicator = findViewById(R.id.progressIndicator);
videoview.getHolder().addCallback(surfaceHolderCallback);
videoframe.setOnTouchListener(onVideoviewTouched);
videoOverlay.setOnTouchListener((view, motionEvent) -> true); // To suppress touches directly below the slider
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 8f447ac90..8fcdb4371 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
@@ -45,8 +45,6 @@ import de.danoeh.antennapod.core.service.GpodnetSyncService;
public class GpodnetAuthenticationActivity extends AppCompatActivity {
private static final String TAG = "GpodnetAuthActivity";
- private static final String CURRENT_STEP = "current_step";
-
private ViewFlipper viewFlipper;
private static final int STEP_DEFAULT = -1;
@@ -72,7 +70,7 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
setContentView(R.layout.gpodnetauth_activity);
service = new GpodnetService();
- viewFlipper = (ViewFlipper) findViewById(R.id.viewflipper);
+ viewFlipper = findViewById(R.id.viewflipper);
LayoutInflater inflater = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
views = new View[]{
@@ -109,11 +107,11 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
}
private void setupLoginView(View view) {
- final EditText username = (EditText) view.findViewById(R.id.etxtUsername);
- final EditText password = (EditText) view.findViewById(R.id.etxtPassword);
- final Button login = (Button) view.findViewById(R.id.butLogin);
- final TextView txtvError = (TextView) view.findViewById(R.id.txtvError);
- final ProgressBar progressBar = (ProgressBar) view.findViewById(R.id.progBarLogin);
+ final EditText username = view.findViewById(R.id.etxtUsername);
+ final EditText password = view.findViewById(R.id.etxtPassword);
+ final Button login = view.findViewById(R.id.butLogin);
+ final TextView txtvError = view.findViewById(R.id.txtvError);
+ final ProgressBar progressBar = view.findViewById(R.id.progBarLogin);
password.setOnEditorActionListener((v, actionID, event) ->
actionID == EditorInfo.IME_ACTION_GO && login.performClick());
@@ -177,13 +175,13 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
}
private void setupDeviceView(View view) {
- final EditText deviceID = (EditText) view.findViewById(R.id.etxtDeviceID);
- final EditText caption = (EditText) view.findViewById(R.id.etxtCaption);
- final Button createNewDevice = (Button) view.findViewById(R.id.butCreateNewDevice);
- final Button chooseDevice = (Button) view.findViewById(R.id.butChooseExistingDevice);
- final TextView txtvError = (TextView) view.findViewById(R.id.txtvError);
- final ProgressBar progBarCreateDevice = (ProgressBar) view.findViewById(R.id.progbarCreateDevice);
- final Spinner spinnerDevices = (Spinner) view.findViewById(R.id.spinnerChooseDevice);
+ final EditText deviceID = view.findViewById(R.id.etxtDeviceID);
+ final EditText caption = view.findViewById(R.id.etxtCaption);
+ final Button createNewDevice = view.findViewById(R.id.butCreateNewDevice);
+ final Button chooseDevice = view.findViewById(R.id.butChooseExistingDevice);
+ final TextView txtvError = view.findViewById(R.id.txtvError);
+ final ProgressBar progBarCreateDevice = view.findViewById(R.id.progbarCreateDevice);
+ final Spinner spinnerDevices = view.findViewById(R.id.spinnerChooseDevice);
// load device list
@@ -348,8 +346,8 @@ public class GpodnetAuthenticationActivity extends AppCompatActivity {
}
private void setupFinishView(View view) {
- final Button sync = (Button) view.findViewById(R.id.butSyncNow);
- final Button back = (Button) view.findViewById(R.id.butGoMainscreen);
+ final Button sync = view.findViewById(R.id.butSyncNow);
+ final Button back = view.findViewById(R.id.butGoMainscreen);
sync.setOnClickListener(v -> {
GpodnetSyncService.sendSyncIntent(GpodnetAuthenticationActivity.this);
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 11526a35d..18116420d 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java
@@ -77,24 +77,24 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter<AllEpisodesR
View view = LayoutInflater.from(parent.getContext())
.inflate(R.layout.new_episodes_listitem, parent, false);
Holder holder = new Holder(view);
- holder.container = (FrameLayout) view.findViewById(R.id.container);
- holder.content = (LinearLayout) view.findViewById(R.id.content);
- holder.placeholder = (TextView) view.findViewById(R.id.txtvPlaceholder);
- holder.title = (TextView) view.findViewById(R.id.txtvTitle);
+ holder.container = view.findViewById(R.id.container);
+ holder.content = view.findViewById(R.id.content);
+ holder.placeholder = view.findViewById(R.id.txtvPlaceholder);
+ holder.title = view.findViewById(R.id.txtvTitle);
if(Build.VERSION.SDK_INT >= 23) {
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
}
- holder.pubDate = (TextView) view
+ holder.pubDate = view
.findViewById(R.id.txtvPublished);
holder.statusUnread = view.findViewById(R.id.statusUnread);
- holder.butSecondary = (ImageButton) view
+ holder.butSecondary = view
.findViewById(R.id.butSecondaryAction);
- holder.queueStatus = (ImageView) view
+ holder.queueStatus = view
.findViewById(R.id.imgvInPlaylist);
- holder.progress = (ProgressBar) view
+ holder.progress = view
.findViewById(R.id.pbar_progress);
- holder.cover = (ImageView) view.findViewById(R.id.imgvCover);
- holder.txtvDuration = (TextView) view.findViewById(R.id.txtvDuration);
+ holder.cover = view.findViewById(R.id.imgvCover);
+ holder.txtvDuration = view.findViewById(R.id.txtvDuration);
holder.item = null;
holder.mainActivityRef = mainActivityRef;
// so we can grab this later
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java
index cbd089d4c..c3fac7e18 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/ChaptersListAdapter.java
@@ -57,12 +57,12 @@ public class ChaptersListAdapter extends ArrayAdapter<Chapter> {
convertView = inflater.inflate(R.layout.simplechapter_item, parent, false);
holder.view = convertView;
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
defaultTextColor = holder.title.getTextColors().getDefaultColor();
- holder.start = (TextView) convertView.findViewById(R.id.txtvStart);
- holder.link = (TextView) convertView.findViewById(R.id.txtvLink);
- holder.duration = (TextView) convertView.findViewById(R.id.txtvDuration);
- holder.butPlayChapter = (ImageButton) convertView.findViewById(R.id.butPlayChapter);
+ holder.start = convertView.findViewById(R.id.txtvStart);
+ holder.link = convertView.findViewById(R.id.txtvLink);
+ holder.duration = convertView.findViewById(R.id.txtvDuration);
+ holder.butPlayChapter = convertView.findViewById(R.id.butPlayChapter);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java
index 08b2908ac..1286d9dc7 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/DefaultActionButtonCallback.java
@@ -1,13 +1,12 @@
package de.danoeh.antennapod.adapter;
import android.content.Context;
+import android.support.annotation.NonNull;
import android.content.Intent;
import android.widget.Toast;
import com.afollestad.materialdialogs.MaterialDialog;
-import de.danoeh.antennapod.core.util.IntentUtils;
-import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
import org.apache.commons.lang3.Validate;
import de.danoeh.antennapod.R;
@@ -21,8 +20,10 @@ import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.storage.DownloadRequestException;
import de.danoeh.antennapod.core.storage.DownloadRequester;
+import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.NetworkUtils;
+import de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter;
/**
* Default implementation of an ActionButtonCallback
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java
index 163366c3c..789c01a26 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadLogAdapter.java
@@ -49,15 +49,15 @@ public class DownloadLogAdapter extends BaseAdapter {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.downloadlog_item, parent, false);
- holder.icon = (IconTextView) convertView.findViewById(R.id.txtvIcon);
- holder.retry = (IconButton) convertView.findViewById(R.id.btnRetry);
- holder.date = (TextView) convertView.findViewById(R.id.txtvDate);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
+ holder.icon = convertView.findViewById(R.id.txtvIcon);
+ holder.retry = convertView.findViewById(R.id.btnRetry);
+ holder.date = convertView.findViewById(R.id.txtvDate);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
if(Build.VERSION.SDK_INT >= 23) {
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
}
- holder.type = (TextView) convertView.findViewById(R.id.txtvType);
- holder.reason = (TextView) convertView.findViewById(R.id.txtvReason);
+ holder.type = convertView.findViewById(R.id.txtvType);
+ holder.reason = convertView.findViewById(R.id.txtvReason);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java
index 52a78c82d..cd636af43 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java
@@ -62,16 +62,16 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.downloaded_episodeslist_item,
parent, false);
- holder.imageView = (ImageView) convertView.findViewById(R.id.imgvImage);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
+ holder.imageView = convertView.findViewById(R.id.imgvImage);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
if(Build.VERSION.SDK_INT >= 23) {
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
}
- holder.txtvSize = (TextView) convertView.findViewById(R.id.txtvSize);
- holder.queueStatus = (ImageView) convertView.findViewById(R.id.imgvInPlaylist);
- holder.pubDate = (TextView) convertView
+ holder.txtvSize = convertView.findViewById(R.id.txtvSize);
+ holder.queueStatus = convertView.findViewById(R.id.imgvInPlaylist);
+ holder.pubDate = convertView
.findViewById(R.id.txtvPublished);
- holder.butSecondary = (ImageButton) convertView
+ holder.butSecondary = convertView
.findViewById(R.id.butSecondaryAction);
convertView.setTag(holder);
} else {
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java
index a8c60c19e..b85d1d35d 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadlistAdapter.java
@@ -59,14 +59,14 @@ public class DownloadlistAdapter extends BaseAdapter {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.downloadlist_item, parent, false);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.downloaded = (TextView) convertView
+ holder.title = convertView.findViewById(R.id.txtvTitle);
+ holder.downloaded = convertView
.findViewById(R.id.txtvDownloaded);
- holder.percent = (TextView) convertView
+ holder.percent = convertView
.findViewById(R.id.txtvPercent);
- holder.progbar = (ProgressBar) convertView
+ holder.progbar = convertView
.findViewById(R.id.progProgress);
- holder.butSecondary = (ImageButton) convertView
+ holder.butSecondary = convertView
.findViewById(R.id.butSecondaryAction);
convertView.setTag(holder);
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
index cf3dd8b09..738a0a636 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java
@@ -90,24 +90,24 @@ public class FeedItemlistAdapter extends BaseAdapter {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.feeditemlist_item, parent, false);
- holder.container = (LinearLayout) convertView
+ holder.container = convertView
.findViewById(R.id.container);
- holder.title = (TextView) convertView.findViewById(R.id.txtvItemname);
+ holder.title = convertView.findViewById(R.id.txtvItemname);
if(Build.VERSION.SDK_INT >= 23) {
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
}
- holder.lenSize = (TextView) convertView
+ holder.lenSize = convertView
.findViewById(R.id.txtvLenSize);
- holder.butAction = (ImageButton) convertView
+ holder.butAction = convertView
.findViewById(R.id.butSecondaryAction);
- holder.published = (TextView) convertView
+ holder.published = convertView
.findViewById(R.id.txtvPublished);
- holder.inPlaylist = (ImageView) convertView
+ holder.inPlaylist = convertView
.findViewById(R.id.imgvInPlaylist);
- holder.type = (ImageView) convertView.findViewById(R.id.imgvType);
+ holder.type = convertView.findViewById(R.id.imgvType);
holder.statusUnread = convertView
.findViewById(R.id.statusUnread);
- holder.episodeProgress = (ProgressBar) convertView
+ holder.episodeProgress = convertView
.findViewById(R.id.pbar_episode_progress);
convertView.setTag(holder);
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java
index 5b205e91f..c10bb7638 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java
@@ -34,9 +34,9 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> {
LayoutInflater inflater = (LayoutInflater) getContext()
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.itemdescription_listitem, parent, false);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.pubDate = (TextView) convertView.findViewById(R.id.txtvPubDate);
- holder.description = (TextView) convertView.findViewById(R.id.txtvDescription);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
+ holder.pubDate = convertView.findViewById(R.id.txtvPubDate);
+ holder.description = convertView.findViewById(R.id.txtvDescription);
convertView.setTag(holder);
} else {
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
index eaff1eb12..fbf6b804a 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java
@@ -213,7 +213,7 @@ public class NavListAdapter extends BaseAdapter
v = getFeedView(position, convertView, parent);
}
if (v != null && viewType != VIEW_TYPE_SECTION_DIVIDER) {
- TextView txtvTitle = (TextView) v.findViewById(R.id.txtvTitle);
+ TextView txtvTitle = v.findViewById(R.id.txtvTitle);
if (position == itemAccess.getSelectedItemIndex()) {
txtvTitle.setTypeface(null, Typeface.BOLD);
} else {
@@ -236,9 +236,9 @@ public class NavListAdapter extends BaseAdapter
convertView = inflater.inflate(R.layout.nav_listitem, parent, false);
- holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.count = (TextView) convertView.findViewById(R.id.txtvCount);
+ holder.image = convertView.findViewById(R.id.imgvCover);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
+ holder.count = convertView.findViewById(R.id.txtvCount);
convertView.setTag(holder);
} else {
holder = (NavHolder) convertView.getTag();
@@ -326,10 +326,10 @@ public class NavListAdapter extends BaseAdapter
convertView = inflater.inflate(R.layout.nav_feedlistitem, parent, false);
- holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.failure = (IconTextView) convertView.findViewById(R.id.itxtvFailure);
- holder.count = (TextView) convertView.findViewById(R.id.txtvCount);
+ holder.image = convertView.findViewById(R.id.imgvCover);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
+ holder.failure = convertView.findViewById(R.id.itxtvFailure);
+ holder.count = convertView.findViewById(R.id.txtvCount);
convertView.setTag(holder);
} else {
holder = (FeedHolder) convertView.getTag();
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java
index 87b5b5e9a..8a19dcaaf 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java
@@ -26,7 +26,6 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.joanzapata.iconify.Iconify;
-import de.danoeh.antennapod.core.util.ThemeUtils;
import org.apache.commons.lang3.ArrayUtils;
import java.lang.ref.WeakReference;
@@ -42,6 +41,7 @@ import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.DateUtils;
import de.danoeh.antennapod.core.util.LongList;
import de.danoeh.antennapod.core.util.NetworkUtils;
+import de.danoeh.antennapod.core.util.ThemeUtils;
import de.danoeh.antennapod.fragment.ItemFragment;
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
@@ -135,19 +135,19 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter<QueueRecyclerAdap
public ViewHolder(View v) {
super(v);
- container = (FrameLayout) v.findViewById(R.id.container);
- dragHandle = (ImageView) v.findViewById(R.id.drag_handle);
- placeholder = (TextView) v.findViewById(R.id.txtvPlaceholder);
- cover = (ImageView) v.findViewById(R.id.imgvCover);
- title = (TextView) v.findViewById(R.id.txtvTitle);
+ container = v.findViewById(R.id.container);
+ dragHandle = v.findViewById(R.id.drag_handle);
+ placeholder = v.findViewById(R.id.txtvPlaceholder);
+ cover = v.findViewById(R.id.imgvCover);
+ title = v.findViewById(R.id.txtvTitle);
if(Build.VERSION.SDK_INT >= 23) {
title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
}
- pubDate = (TextView) v.findViewById(R.id.txtvPubDate);
- progressLeft = (TextView) v.findViewById(R.id.txtvProgressLeft);
- progressRight = (TextView) v.findViewById(R.id.txtvProgressRight);
- butSecondary = (ImageButton) v.findViewById(R.id.butSecondaryAction);
- progressBar = (ProgressBar) v.findViewById(R.id.progressBar);
+ pubDate = v.findViewById(R.id.txtvPubDate);
+ progressLeft = v.findViewById(R.id.txtvProgressLeft);
+ progressRight = v.findViewById(R.id.txtvProgressRight);
+ butSecondary = v.findViewById(R.id.butSecondaryAction);
+ progressBar = v.findViewById(R.id.progressBar);
v.setTag(this);
v.setOnClickListener(this);
v.setOnCreateContextMenuListener(this);
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java
index e2c31f0e8..45cb4af87 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java
@@ -62,13 +62,13 @@ public class SearchlistAdapter extends BaseAdapter {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.searchlist_item, parent, false);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
if(Build.VERSION.SDK_INT >= 23) {
holder.title.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
}
- holder.cover = (ImageView) convertView
+ holder.cover = convertView
.findViewById(R.id.imgvFeedimage);
- holder.subtitle = (TextView) convertView
+ holder.subtitle = convertView
.findViewById(R.id.txtvSubtitle);
convertView.setTag(holder);
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java
index d60f4406a..31e82dbe0 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java
@@ -63,9 +63,9 @@ public class StatisticsListAdapter extends BaseAdapter {
convertView = inflater.inflate(R.layout.statistics_listitem, parent, false);
- holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.time = (TextView) convertView.findViewById(R.id.txtvTime);
+ holder.image = convertView.findViewById(R.id.imgvCover);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
+ holder.time = convertView.findViewById(R.id.txtvTime);
convertView.setTag(holder);
} else {
holder = (StatisticsHolder) convertView.getTag();
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java
index 0a5c6a947..e890d34dd 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java
@@ -90,9 +90,9 @@ public class SubscriptionsAdapter extends BaseAdapter implements AdapterView.OnI
LayoutInflater layoutInflater =
(LayoutInflater) mainActivityRef.get().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = layoutInflater.inflate(R.layout.subscription_item, parent, false);
- holder.feedTitle = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.imageView = (ImageView) convertView.findViewById(R.id.imgvCover);
- holder.count = (TriangleLabelView) convertView.findViewById(R.id.triangleCountView);
+ holder.feedTitle = convertView.findViewById(R.id.txtvTitle);
+ holder.imageView = convertView.findViewById(R.id.imgvCover);
+ holder.count = convertView.findViewById(R.id.triangleCountView);
convertView.setTag(holder);
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java
index 490114492..06c80e173 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java
@@ -41,10 +41,10 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.gpodnet_podcast_listitem, parent, false);
- holder.image = (ImageView) convertView.findViewById(R.id.imgvCover);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.subscribers = (TextView) convertView.findViewById(R.id.txtvSubscribers);
- holder.url = (TextView) convertView.findViewById(R.id.txtvUrl);
+ holder.image = convertView.findViewById(R.id.imgvCover);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
+ holder.subscribers = convertView.findViewById(R.id.txtvSubscribers);
+ holder.url = convertView.findViewById(R.id.txtvUrl);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
diff --git a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java
index b4eadefb5..52fca792e 100644
--- a/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java
+++ b/app/src/main/java/de/danoeh/antennapod/adapter/gpodnet/TagListAdapter.java
@@ -34,8 +34,8 @@ public class TagListAdapter extends ArrayAdapter<GpodnetTag> {
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = inflater.inflate(R.layout.gpodnet_tag_listitem, parent, false);
- holder.title = (TextView) convertView.findViewById(R.id.txtvTitle);
- holder.usage = (TextView) convertView.findViewById(R.id.txtvUsage);
+ holder.title = convertView.findViewById(R.id.txtvTitle);
+ holder.usage = convertView.findViewById(R.id.txtvUsage);
convertView.setTag(holder);
} else {
holder = (Holder) convertView.getTag();
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 79c9b63b4..905fc60d6 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
@@ -185,9 +185,9 @@ public class ItunesAdapter extends ArrayAdapter<ItunesAdapter.Podcast> {
* @param view GridView cell
*/
PodcastViewHolder(View view){
- coverView = (ImageView) view.findViewById(R.id.imgvCover);
- titleView = (TextView) view.findViewById(R.id.txtvTitle);
- urlView = (TextView) view.findViewById(R.id.txtvUrl);
+ coverView = view.findViewById(R.id.imgvCover);
+ titleView = view.findViewById(R.id.txtvTitle);
+ urlView = view.findViewById(R.id.txtvUrl);
}
}
}
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 d2498955c..4138738f6 100644
--- a/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java
+++ b/app/src/main/java/de/danoeh/antennapod/config/ClientConfigurator.java
@@ -8,6 +8,8 @@ import de.danoeh.antennapod.core.ClientConfig;
*/
class ClientConfigurator {
+ private ClientConfigurator(){}
+
static {
ClientConfig.USER_AGENT = "AntennaPod/" + BuildConfig.VERSION_NAME;
ClientConfig.applicationCallbacks = new ApplicationCallbacksImpl();
diff --git a/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java b/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java
index 83dd3fe9c..eb70d8e0b 100644
--- a/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java
+++ b/app/src/main/java/de/danoeh/antennapod/config/PlaybackServiceCallbacksImpl.java
@@ -2,7 +2,6 @@ package de.danoeh.antennapod.config;
import android.content.Context;
import android.content.Intent;
-
import android.os.Build;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.AudioplayerActivity;
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java
index 6f9e221ec..2c41b8cb8 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/AuthenticationDialog.java
@@ -35,11 +35,11 @@ public abstract class AuthenticationDialog extends Dialog {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.authentication_dialog);
- final EditText etxtUsername = (EditText) findViewById(R.id.etxtUsername);
- final EditText etxtPassword = (EditText) findViewById(R.id.etxtPassword);
- final CheckBox saveUsernamePassword = (CheckBox) findViewById(R.id.chkSaveUsernamePassword);
- final Button butConfirm = (Button) findViewById(R.id.butConfirm);
- final Button butCancel = (Button) findViewById(R.id.butCancel);
+ final EditText etxtUsername = findViewById(R.id.etxtUsername);
+ final EditText etxtPassword = findViewById(R.id.etxtPassword);
+ final CheckBox saveUsernamePassword = findViewById(R.id.chkSaveUsernamePassword);
+ final Button butConfirm = findViewById(R.id.butConfirm);
+ final Button butCancel = findViewById(R.id.butCancel);
if (titleRes != 0) {
setTitle(titleRes);
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java
index 93425949c..c28342374 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/AutoFlattrPreferenceDialog.java
@@ -29,9 +29,9 @@ public class AutoFlattrPreferenceDialog {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
@SuppressLint("InflateParams") View view = activity.getLayoutInflater().inflate(R.layout.autoflattr_preference_dialog, null);
- final CheckBox chkAutoFlattr = (CheckBox) view.findViewById(R.id.chkAutoFlattr);
- final SeekBar skbPercent = (SeekBar) view.findViewById(R.id.skbPercent);
- final TextView txtvStatus = (TextView) view.findViewById(R.id.txtvStatus);
+ 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());
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 d1ee926ac..07a64cde8 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java
@@ -1,5 +1,6 @@
package de.danoeh.antennapod.dialog;
+import android.app.AlertDialog;
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@@ -84,7 +85,7 @@ public class EpisodesApplyActionFragment extends Fragment {
Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.episodes_apply_action_fragment, container, false);
- mListView = (ListView) view.findViewById(android.R.id.list);
+ mListView = view.findViewById(android.R.id.list);
mListView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);
mListView.setOnItemClickListener((ListView, view1, position, rowId) -> {
long id = episodes.get(position).getId();
@@ -95,6 +96,28 @@ public class EpisodesApplyActionFragment extends Fragment {
}
refreshCheckboxes();
});
+ mListView.setOnItemLongClickListener((adapterView, view12, position, id) -> {
+ new AlertDialog.Builder(getActivity())
+ .setItems(R.array.batch_long_press_options, (dialogInterface, item) -> {
+ int direction;
+ if (item == 0) {
+ direction = -1;
+ } else {
+ direction = 1;
+ }
+
+ int currentPosition = position + direction;
+ while (currentPosition >= 0 && currentPosition < episodes.size()) {
+ long id1 = episodes.get(currentPosition).getId();
+ if (!checkedIds.contains(id1)) {
+ checkedIds.add(id1);
+ }
+ currentPosition += direction;
+ }
+ refreshCheckboxes();
+ }).show();
+ return true;
+ });
for(FeedItem episode : episodes) {
titles.add(episode.getTitle());
@@ -106,7 +129,7 @@ public class EpisodesApplyActionFragment extends Fragment {
checkAll();
int lastVisibleDiv = 0;
- btnAddToQueue = (Button) view.findViewById(R.id.btnAddToQueue);
+ btnAddToQueue = view.findViewById(R.id.btnAddToQueue);
if((actions & ACTION_QUEUE) != 0) {
btnAddToQueue.setOnClickListener(v -> queueChecked());
lastVisibleDiv = R.id.divider1;
@@ -114,7 +137,7 @@ public class EpisodesApplyActionFragment extends Fragment {
btnAddToQueue.setVisibility(View.GONE);
view.findViewById(R.id.divider1).setVisibility(View.GONE);
}
- btnMarkAsPlayed = (Button) view.findViewById(R.id.btnMarkAsPlayed);
+ btnMarkAsPlayed = view.findViewById(R.id.btnMarkAsPlayed);
if((actions & ACTION_MARK_PLAYED) != 0) {
btnMarkAsPlayed.setOnClickListener(v -> markedCheckedPlayed());
lastVisibleDiv = R.id.divider2;
@@ -122,7 +145,7 @@ public class EpisodesApplyActionFragment extends Fragment {
btnMarkAsPlayed.setVisibility(View.GONE);
view.findViewById(R.id.divider2).setVisibility(View.GONE);
}
- btnMarkAsUnplayed = (Button) view.findViewById(R.id.btnMarkAsUnplayed);
+ btnMarkAsUnplayed = view.findViewById(R.id.btnMarkAsUnplayed);
if((actions & ACTION_MARK_UNPLAYED) != 0) {
btnMarkAsUnplayed.setOnClickListener(v -> markedCheckedUnplayed());
lastVisibleDiv = R.id.divider3;
@@ -130,7 +153,7 @@ public class EpisodesApplyActionFragment extends Fragment {
btnMarkAsUnplayed.setVisibility(View.GONE);
view.findViewById(R.id.divider3).setVisibility(View.GONE);
}
- btnDownload = (Button) view.findViewById(R.id.btnDownload);
+ btnDownload = view.findViewById(R.id.btnDownload);
if((actions & ACTION_DOWNLOAD) != 0) {
btnDownload.setOnClickListener(v -> downloadChecked());
lastVisibleDiv = R.id.divider4;
@@ -138,7 +161,7 @@ public class EpisodesApplyActionFragment extends Fragment {
btnDownload.setVisibility(View.GONE);
view.findViewById(R.id.divider4).setVisibility(View.GONE);
}
- btnDelete = (Button) view.findViewById(R.id.btnDelete);
+ btnDelete = view.findViewById(R.id.btnDelete);
if((actions & ACTION_REMOVE) != 0) {
btnDelete.setOnClickListener(v -> deleteChecked());
} else {
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java
index e64f1e08b..933ced0f9 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/GpodnetSetHostnameDialog.java
@@ -17,6 +17,9 @@ import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
* Creates a dialog that lets the user change the hostname for the gpodder.net service.
*/
public class GpodnetSetHostnameDialog {
+
+ private GpodnetSetHostnameDialog(){}
+
private static final String TAG = "GpodnetSetHostnameDialog";
public static AlertDialog createDialog(final Context context) {
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java
index b9276982a..8f15e78e5 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java
@@ -34,7 +34,6 @@ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import rx.Observable;
-import rx.Subscriber;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
@@ -102,7 +101,7 @@ public class ProxyDialog {
.autoDismiss(false)
.build();
View view = dialog.getCustomView();
- spType = (Spinner) view.findViewById(R.id.spType);
+ spType = view.findViewById(R.id.spType);
String[] types = { Proxy.Type.DIRECT.name(), Proxy.Type.HTTP.name() };
ArrayAdapter<String> adapter = new ArrayAdapter<>(context,
android.R.layout.simple_spinner_item, types);
@@ -110,22 +109,22 @@ public class ProxyDialog {
spType.setAdapter(adapter);
ProxyConfig proxyConfig = UserPreferences.getProxyConfig();
spType.setSelection(adapter.getPosition(proxyConfig.type.name()));
- etHost = (EditText) view.findViewById(R.id.etHost);
+ etHost = view.findViewById(R.id.etHost);
if(!TextUtils.isEmpty(proxyConfig.host)) {
etHost.setText(proxyConfig.host);
}
etHost.addTextChangedListener(requireTestOnChange);
- etPort = (EditText) view.findViewById(R.id.etPort);
+ etPort = view.findViewById(R.id.etPort);
if(proxyConfig.port > 0) {
etPort.setText(String.valueOf(proxyConfig.port));
}
etPort.addTextChangedListener(requireTestOnChange);
- etUsername = (EditText) view.findViewById(R.id.etUsername);
+ etUsername = view.findViewById(R.id.etUsername);
if(!TextUtils.isEmpty(proxyConfig.username)) {
etUsername.setText(proxyConfig.username);
}
etUsername.addTextChangedListener(requireTestOnChange);
- etPassword = (EditText) view.findViewById(R.id.etPassword);
+ etPassword = view.findViewById(R.id.etPassword);
if(!TextUtils.isEmpty(proxyConfig.password)) {
etPassword.setText(proxyConfig.username);
}
@@ -146,7 +145,7 @@ public class ProxyDialog {
enableSettings(false);
}
});
- txtvMessage = (TextView) view.findViewById(R.id.txtvMessage);
+ txtvMessage = view.findViewById(R.id.txtvMessage);
checkValidity();
return dialog;
}
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/RatingDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/RatingDialog.java
index 72000170e..ece184035 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/RatingDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/RatingDialog.java
@@ -17,6 +17,8 @@ import de.danoeh.antennapod.R;
public class RatingDialog {
+ private RatingDialog(){}
+
private static final String TAG = RatingDialog.class.getSimpleName();
private static final int AFTER_DAYS = 7;
diff --git a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
index be7850495..4b8601ec6 100644
--- a/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
+++ b/app/src/main/java/de/danoeh/antennapod/dialog/SleepTimerDialog.java
@@ -61,11 +61,11 @@ public abstract class SleepTimerDialog {
dialog = builder.build();
View view = dialog.getView();
- etxtTime = (EditText) view.findViewById(R.id.etxtTime);
- spTimeUnit = (Spinner) view.findViewById(R.id.spTimeUnit);
- cbShakeToReset = (CheckBox) view.findViewById(R.id.cbShakeToReset);
- cbVibrate = (CheckBox) view.findViewById(R.id.cbVibrate);
- chAutoEnable = (CheckBox) view.findViewById(R.id.chAutoEnable);
+ etxtTime = view.findViewById(R.id.etxtTime);
+ spTimeUnit = view.findViewById(R.id.spTimeUnit);
+ cbShakeToReset = view.findViewById(R.id.cbShakeToReset);
+ cbVibrate = view.findViewById(R.id.cbVibrate);
+ chAutoEnable = view.findViewById(R.id.chAutoEnable);
etxtTime.setText(SleepTimerPreferences.lastTimerValue());
etxtTime.addTextChangedListener(new TextWatcher() {
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 a243ddcdc..ee2373da8 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/AddFeedFragment.java
@@ -32,18 +32,18 @@ public class AddFeedFragment extends Fragment {
super.onCreateView(inflater, container, savedInstanceState);
View root = inflater.inflate(R.layout.addfeed, container, false);
- final EditText etxtFeedurl = (EditText) root.findViewById(R.id.etxtFeedurl);
+ final EditText etxtFeedurl = root.findViewById(R.id.etxtFeedurl);
Bundle args = getArguments();
if (args != null && args.getString(ARG_FEED_URL) != null) {
etxtFeedurl.setText(args.getString(ARG_FEED_URL));
}
- Button butSearchITunes = (Button) root.findViewById(R.id.butSearchItunes);
- Button butBrowserGpoddernet = (Button) root.findViewById(R.id.butBrowseGpoddernet);
- Button butSearchFyyd = (Button) root.findViewById(R.id.butSearchFyyd);
- Button butOpmlImport = (Button) root.findViewById(R.id.butOpmlImport);
- Button butConfirm = (Button) root.findViewById(R.id.butConfirm);
+ 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);
final MainActivity activity = (MainActivity) getActivity();
activity.getSupportActionBar().setTitle(R.string.add_feed_label);
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 497891dbd..ff7af97f6 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/AllEpisodesFragment.java
@@ -313,7 +313,7 @@ public class AllEpisodesFragment extends Fragment {
View root = inflater.inflate(fragmentResource, container, false);
- recyclerView = (RecyclerView) root.findViewById(android.R.id.list);
+ recyclerView = root.findViewById(android.R.id.list);
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
@@ -323,7 +323,7 @@ public class AllEpisodesFragment extends Fragment {
recyclerView.setHasFixedSize(true);
recyclerView.addItemDecoration(new HorizontalDividerItemDecoration.Builder(getActivity()).build());
- progLoading = (ProgressBar) root.findViewById(R.id.progLoading);
+ progLoading = root.findViewById(R.id.progLoading);
if (!itemsLoaded) {
progLoading.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 f6d503b29..7c28ba21f 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/CompletedDownloadsFragment.java
@@ -1,8 +1,6 @@
package de.danoeh.antennapod.fragment;
import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.util.Log;
@@ -12,9 +10,6 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
-import com.joanzapata.iconify.IconDrawable;
-import com.joanzapata.iconify.fonts.FontAwesomeIcons;
-
import java.util.List;
import de.danoeh.antennapod.R;
@@ -22,7 +17,6 @@ import de.danoeh.antennapod.activity.MainActivity;
import de.danoeh.antennapod.adapter.DownloadedEpisodesListAdapter;
import de.danoeh.antennapod.core.feed.EventDistributor;
import de.danoeh.antennapod.core.feed.FeedItem;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBWriter;
import de.danoeh.antennapod.core.util.FeedItemUtil;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java
index 1b3691f6f..5a061c7e6 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java
@@ -23,7 +23,6 @@ import de.danoeh.antennapod.core.util.playback.Playable;
public class CoverFragment extends Fragment implements MediaplayerInfoContentFragment {
private static final String TAG = "CoverFragment";
- private static final String ARG_PLAYABLE = "arg.playable";
private Playable media;
@@ -50,9 +49,9 @@ public class CoverFragment extends Fragment implements MediaplayerInfoContentFra
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
root = inflater.inflate(R.layout.cover_fragment, container, false);
- txtvPodcastTitle = (TextView) root.findViewById(R.id.txtvPodcastTitle);
- txtvEpisodeTitle = (TextView) root.findViewById(R.id.txtvEpisodeTitle);
- imgvCover = (ImageView) root.findViewById(R.id.imgvCover);
+ txtvPodcastTitle = root.findViewById(R.id.txtvPodcastTitle);
+ txtvEpisodeTitle = root.findViewById(R.id.txtvEpisodeTitle);
+ imgvCover = root.findViewById(R.id.imgvCover);
return root;
}
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 ae9c60f65..a5eaa161f 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadLogFragment.java
@@ -12,10 +12,10 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ListView;
+import android.widget.TextView;
import java.util.List;
-import android.widget.TextView;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.adapter.DownloadLogAdapter;
import de.danoeh.antennapod.core.feed.EventDistributor;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java
index 9c4d00e31..aa6029c84 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/DownloadsFragment.java
@@ -38,12 +38,12 @@ public class DownloadsFragment extends Fragment {
super.onCreateView(inflater, container, savedInstanceState);
View root = inflater.inflate(R.layout.pager_fragment, container, false);
- viewPager = (ViewPager)root.findViewById(R.id.viewpager);
+ viewPager = root.findViewById(R.id.viewpager);
DownloadsPagerAdapter pagerAdapter = new DownloadsPagerAdapter(getChildFragmentManager(), getResources());
viewPager.setAdapter(pagerAdapter);
// Give the TabLayout the ViewPager
- tabLayout = (TabLayout) root.findViewById(R.id.sliding_tabs);
+ tabLayout = root.findViewById(R.id.sliding_tabs);
tabLayout.setupWithViewPager(viewPager);
return root;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java
index 417ecff89..0610bfd24 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/EpisodesFragment.java
@@ -46,11 +46,11 @@ public class EpisodesFragment extends Fragment {
((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.episodes_label);
View rootView = inflater.inflate(R.layout.pager_fragment, container, false);
- viewPager = (ViewPager)rootView.findViewById(R.id.viewpager);
+ viewPager = rootView.findViewById(R.id.viewpager);
viewPager.setAdapter(new EpisodesPagerAdapter(getChildFragmentManager(), getResources()));
// Give the TabLayout the ViewPager
- tabLayout = (TabLayout) rootView.findViewById(R.id.sliding_tabs);
+ tabLayout = rootView.findViewById(R.id.sliding_tabs);
tabLayout.setupWithViewPager(viewPager);
return rootView;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
index bdc133132..46f67cefc 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java
@@ -21,10 +21,10 @@ import de.danoeh.antennapod.R;
import de.danoeh.antennapod.core.feed.MediaType;
import de.danoeh.antennapod.core.glide.ApGlideSettings;
import de.danoeh.antennapod.core.service.playback.PlaybackService;
-import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.playback.Playable;
import de.danoeh.antennapod.core.util.playback.PlaybackController;
import rx.Single;
+import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
@@ -42,6 +42,7 @@ public class ExternalPlayerFragment extends Fragment {
private TextView mFeedName;
private ProgressBar mProgressBar;
private PlaybackController controller;
+ private Subscription subscription;
public ExternalPlayerFragment() {
super();
@@ -52,12 +53,12 @@ public class ExternalPlayerFragment extends Fragment {
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.external_player_fragment,
container, false);
- fragmentLayout = (ViewGroup) root.findViewById(R.id.fragmentLayout);
- imgvCover = (ImageView) root.findViewById(R.id.imgvCover);
- txtvTitle = (TextView) root.findViewById(R.id.txtvTitle);
- butPlay = (ImageButton) root.findViewById(R.id.butPlay);
- mFeedName = (TextView) root.findViewById(R.id.txtvAuthor);
- mProgressBar = (ProgressBar) root.findViewById(R.id.episodeProgress);
+ fragmentLayout = root.findViewById(R.id.fragmentLayout);
+ imgvCover = root.findViewById(R.id.imgvCover);
+ txtvTitle = root.findViewById(R.id.txtvTitle);
+ butPlay = root.findViewById(R.id.butPlay);
+ mFeedName = root.findViewById(R.id.txtvAuthor);
+ mProgressBar = root.findViewById(R.id.episodeProgress);
fragmentLayout.setOnClickListener(v -> {
Log.d(TAG, "layoutInfo was clicked");
@@ -82,7 +83,7 @@ public class ExternalPlayerFragment extends Fragment {
super.onActivityCreated(savedInstanceState);
controller = setupPlaybackController();
butPlay.setOnClickListener(v -> {
- if(controller != null) {
+ if (controller != null) {
controller.playPause();
}
});
@@ -143,6 +144,9 @@ public class ExternalPlayerFragment extends Fragment {
if (controller != null) {
controller.release();
}
+ if (subscription != null) {
+ subscription.unsubscribe();
+ }
}
@Override
@@ -163,7 +167,7 @@ public class ExternalPlayerFragment extends Fragment {
controller = setupPlaybackController();
if (butPlay != null) {
butPlay.setOnClickListener(v -> {
- if(controller != null) {
+ if (controller != null) {
controller.playPause();
}
});
@@ -178,7 +182,10 @@ public class ExternalPlayerFragment extends Fragment {
return false;
}
- Single.create(subscriber -> subscriber.onSuccess(controller.getMedia()))
+ if (subscription != null) {
+ subscription.unsubscribe();
+ }
+ subscription = Single.create(subscriber -> subscriber.onSuccess(controller.getMedia()))
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(media -> updateUi((Playable) media));
@@ -208,15 +215,10 @@ public class ExternalPlayerFragment extends Fragment {
butPlay.setVisibility(View.VISIBLE);
}
} else {
- Log.w(TAG, "loadMediaInfo was called while the media object of playbackService was null!");
+ Log.w(TAG, "loadMediaInfo was called while the media object of playbackService was null!");
}
}
- private String getPositionString(int position, int duration) {
- return Converter.getDurationStringLong(position) + " / "
- + Converter.getDurationStringLong(duration);
- }
-
public PlaybackController getPlaybackControllerTestingOnly() {
return controller;
}
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 6ee9ce467..80c66077e 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/FyydSearchFragment.java
@@ -75,7 +75,7 @@ public class FyydSearchFragment extends Fragment {
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View root = inflater.inflate(R.layout.fragment_itunes_search, container, false);
- gridView = (GridView) root.findViewById(R.id.gridView);
+ gridView = root.findViewById(R.id.gridView);
adapter = new ItunesAdapter(getActivity(), new ArrayList<>());
gridView.setAdapter(adapter);
@@ -87,10 +87,10 @@ public class FyydSearchFragment extends Fragment {
intent.putExtra(OnlineFeedViewActivity.ARG_TITLE, podcast.title);
startActivity(intent);
});
- progressBar = (ProgressBar) root.findViewById(R.id.progressBar);
- txtvError = (TextView) root.findViewById(R.id.txtvError);
- butRetry = (Button) root.findViewById(R.id.butRetry);
- txtvEmpty = (TextView) root.findViewById(android.R.id.empty);
+ 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;
}
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 4500452c2..ed9df0544 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java
@@ -35,8 +35,6 @@ import com.bumptech.glide.request.RequestOptions;
import com.joanzapata.iconify.Iconify;
import com.joanzapata.iconify.widget.IconButton;
-import de.danoeh.antennapod.core.service.playback.PlaybackService;
-import de.danoeh.antennapod.core.util.NetworkUtils;
import org.apache.commons.lang3.ArrayUtils;
import java.util.List;
@@ -54,16 +52,17 @@ import de.danoeh.antennapod.core.feed.FeedMedia;
import de.danoeh.antennapod.core.glide.ApGlideSettings;
import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.service.download.Downloader;
+import de.danoeh.antennapod.core.service.playback.PlaybackService;
import de.danoeh.antennapod.core.storage.DBReader;
import de.danoeh.antennapod.core.storage.DBTasks;
import de.danoeh.antennapod.core.storage.DBWriter;
-import de.danoeh.antennapod.core.storage.DownloadRequestException;
import de.danoeh.antennapod.core.storage.DownloadRequester;
import de.danoeh.antennapod.core.util.Converter;
import de.danoeh.antennapod.core.util.DateUtils;
import de.danoeh.antennapod.core.util.Flavors;
import de.danoeh.antennapod.core.util.IntentUtils;
import de.danoeh.antennapod.core.util.LongList;
+import de.danoeh.antennapod.core.util.NetworkUtils;
import de.danoeh.antennapod.core.util.ShareUtils;
import de.danoeh.antennapod.core.util.playback.Timeline;
import de.danoeh.antennapod.menuhandler.FeedItemMenuHandler;
@@ -167,25 +166,25 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
super.onCreateView(inflater, container, savedInstanceState);
View layout = inflater.inflate(R.layout.feeditem_fragment, container, false);
- root = (ViewGroup) layout.findViewById(R.id.content_root);
+ root = layout.findViewById(R.id.content_root);
- LinearLayout header = (LinearLayout) root.findViewById(R.id.header);
+ LinearLayout header = root.findViewById(R.id.header);
if(feedItems.length > 0) {
header.setOnTouchListener((v, event) -> headerGestureDetector.onTouchEvent(event));
}
- txtvPodcast = (TextView) layout.findViewById(R.id.txtvPodcast);
+ txtvPodcast = layout.findViewById(R.id.txtvPodcast);
txtvPodcast.setOnClickListener(v -> openPodcast());
- txtvTitle = (TextView) layout.findViewById(R.id.txtvTitle);
+ txtvTitle = layout.findViewById(R.id.txtvTitle);
if(Build.VERSION.SDK_INT >= 23) {
txtvTitle.setHyphenationFrequency(Layout.HYPHENATION_FREQUENCY_FULL);
}
- txtvDuration = (TextView) layout.findViewById(R.id.txtvDuration);
- txtvPublished = (TextView) layout.findViewById(R.id.txtvPublished);
+ txtvDuration = layout.findViewById(R.id.txtvDuration);
+ txtvPublished = layout.findViewById(R.id.txtvPublished);
if (Build.VERSION.SDK_INT >= 14) { // ellipsize is causing problems on old versions, see #448
txtvTitle.setEllipsize(TextUtils.TruncateAt.END);
}
- webvDescription = (WebView) layout.findViewById(R.id.webvDescription);
+ webvDescription = layout.findViewById(R.id.webvDescription);
if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark ||
UserPreferences.getTheme() == R.style.Theme_AntennaPod_TrueBlack) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
@@ -217,12 +216,12 @@ public class ItemFragment extends Fragment implements OnSwipeGesture {
});
registerForContextMenu(webvDescription);
- imgvCover = (ImageView) layout.findViewById(R.id.imgvCover);
+ imgvCover = layout.findViewById(R.id.imgvCover);
imgvCover.setOnClickListener(v -> openPodcast());
- progbarDownload = (ProgressBar) layout.findViewById(R.id.progbarDownload);
- progbarLoading = (ProgressBar) layout.findViewById(R.id.progbarLoading);
- butAction1 = (IconButton) layout.findViewById(R.id.butAction1);
- butAction2 = (IconButton) layout.findViewById(R.id.butAction2);
+ progbarDownload = layout.findViewById(R.id.progbarDownload);
+ progbarLoading = layout.findViewById(R.id.progbarLoading);
+ butAction1 = layout.findViewById(R.id.butAction1);
+ butAction2 = layout.findViewById(R.id.butAction2);
butAction1.setOnClickListener(v -> {
if (item == null) {
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 c11c12c7a..b20b864f9 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java
@@ -4,8 +4,6 @@ import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.res.TypedArray;
-import android.graphics.Color;
import android.graphics.LightingColorFilter;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
@@ -29,16 +27,15 @@ import com.bumptech.glide.Glide;
import com.bumptech.glide.request.RequestOptions;
import com.joanzapata.iconify.IconDrawable;
import com.joanzapata.iconify.Iconify;
-import com.joanzapata.iconify.fonts.FontAwesomeIcons;
import com.joanzapata.iconify.widget.IconTextView;
-import de.danoeh.antennapod.activity.FeedSettingsActivity;
import org.apache.commons.lang3.Validate;
import java.util.List;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.FeedInfoActivity;
+import de.danoeh.antennapod.activity.FeedSettingsActivity;
import de.danoeh.antennapod.activity.MainActivity;
import de.danoeh.antennapod.adapter.DefaultActionButtonCallback;
import de.danoeh.antennapod.adapter.FeedItemlistAdapter;
@@ -56,7 +53,6 @@ import de.danoeh.antennapod.core.feed.FeedItemFilter;
import de.danoeh.antennapod.core.feed.FeedMedia;
import de.danoeh.antennapod.core.glide.ApGlideSettings;
import de.danoeh.antennapod.core.glide.FastBlurTransformation;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.service.download.DownloadService;
import de.danoeh.antennapod.core.service.download.Downloader;
import de.danoeh.antennapod.core.storage.DBReader;
@@ -418,13 +414,10 @@ public class ItemlistFragment extends ListFragment {
}
- private boolean insideOnFragmentLoaded = false;
-
private void onFragmentLoaded() {
if(!isVisible()) {
return;
}
- insideOnFragmentLoaded = true;
if (adapter == null) {
setListAdapter(null);
setupHeaderView();
@@ -441,9 +434,6 @@ public class ItemlistFragment extends ListFragment {
if (feed != null && feed.getNextPageLink() == null && listFooter != null) {
getListView().removeFooterView(listFooter.getRoot());
}
-
- insideOnFragmentLoaded = false;
-
}
private void refreshHeaderView() {
@@ -487,14 +477,14 @@ public class ItemlistFragment extends ListFragment {
View header = inflater.inflate(R.layout.feeditemlist_header, lv, false);
lv.addHeaderView(header);
- txtvTitle = (TextView) header.findViewById(R.id.txtvTitle);
- TextView txtvAuthor = (TextView) header.findViewById(R.id.txtvAuthor);
- imgvBackground = (ImageView) header.findViewById(R.id.imgvBackground);
- imgvCover = (ImageView) header.findViewById(R.id.imgvCover);
- ImageButton butShowInfo = (ImageButton) header.findViewById(R.id.butShowInfo);
- ImageButton butShowSettings = (ImageButton) header.findViewById(R.id.butShowSettings);
- txtvInformation = (TextView) header.findViewById(R.id.txtvInformation);
- txtvFailure = (IconTextView) header.findViewById(R.id.txtvFailure);
+ txtvTitle = header.findViewById(R.id.txtvTitle);
+ TextView txtvAuthor = header.findViewById(R.id.txtvAuthor);
+ imgvBackground = header.findViewById(R.id.imgvBackground);
+ imgvCover = header.findViewById(R.id.imgvCover);
+ ImageButton butShowInfo = header.findViewById(R.id.butShowInfo);
+ ImageButton butShowSettings = header.findViewById(R.id.butShowSettings);
+ txtvInformation = header.findViewById(R.id.txtvInformation);
+ txtvFailure = header.findViewById(R.id.txtvFailure);
txtvTitle.setText(feed.getTitle());
txtvAuthor.setText(feed.getAuthor());
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 08610c1f3..57cbdc9c3 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItunesSearchFragment.java
@@ -109,7 +109,7 @@ public class ItunesSearchFragment extends Fragment {
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View root = inflater.inflate(R.layout.fragment_itunes_search, container, false);
- gridView = (GridView) root.findViewById(R.id.gridView);
+ gridView = root.findViewById(R.id.gridView);
adapter = new ItunesAdapter(getActivity(), new ArrayList<>());
gridView.setAdapter(adapter);
@@ -170,10 +170,10 @@ public class ItunesSearchFragment extends Fragment {
});
}
});
- progressBar = (ProgressBar) root.findViewById(R.id.progressBar);
- txtvError = (TextView) root.findViewById(R.id.txtvError);
- butRetry = (Button) root.findViewById(R.id.butRetry);
- txtvEmpty = (TextView) root.findViewById(android.R.id.empty);
+ 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);
loadToplist();
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 f5fdd4f9c..c6db974c1 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/QueueFragment.java
@@ -380,8 +380,8 @@ public class QueueFragment extends Fragment {
((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.queue_label);
View root = inflater.inflate(R.layout.queue_fragment, container, false);
- infoBar = (TextView) root.findViewById(R.id.info_bar);
- recyclerView = (RecyclerView) root.findViewById(R.id.recyclerView);
+ infoBar = root.findViewById(R.id.info_bar);
+ recyclerView = root.findViewById(R.id.recyclerView);
RecyclerView.ItemAnimator animator = recyclerView.getItemAnimator();
if (animator instanceof SimpleItemAnimator) {
((SimpleItemAnimator) animator).setSupportsChangeAnimations(false);
@@ -487,16 +487,16 @@ public class QueueFragment extends Fragment {
private void reallyMoved(int from, int to) {
// Write drag operation to database
- Log.d(TAG, "Write to database move(" + dragFrom + ", " + dragTo + ")");
- DBWriter.moveQueueItem(dragFrom, dragTo, true);
+ Log.d(TAG, "Write to database move(" + from + ", " + to + ")");
+ DBWriter.moveQueueItem(from, to, true);
}
}
);
itemTouchHelper.attachToRecyclerView(recyclerView);
- txtvEmpty = (TextView) root.findViewById(android.R.id.empty);
+ txtvEmpty = root.findViewById(android.R.id.empty);
txtvEmpty.setVisibility(View.GONE);
- progLoading = (ProgressBar) root.findViewById(R.id.progLoading);
+ progLoading = root.findViewById(R.id.progLoading);
progLoading.setVisibility(View.VISIBLE);
return root;
@@ -537,8 +537,8 @@ public class QueueFragment extends Fragment {
for(FeedItem item : queue) {
if(item.getMedia() != null) {
timeLeft +=
- (item.getMedia().getDuration() - item.getMedia().getPosition())
- / playbackSpeed;
+ (long) ((item.getMedia().getDuration() - item.getMedia().getPosition())
+ / playbackSpeed);
}
}
info += " \u2022 ";
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 aec2bb536..36a9c5ba8 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java
@@ -1,7 +1,6 @@
package de.danoeh.antennapod.fragment;
import android.content.DialogInterface;
-import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
@@ -16,7 +15,6 @@ import android.widget.GridView;
import de.danoeh.antennapod.R;
import de.danoeh.antennapod.activity.MainActivity;
-import de.danoeh.antennapod.activity.MediaplayerInfoActivity;
import de.danoeh.antennapod.adapter.SubscriptionsAdapter;
import de.danoeh.antennapod.core.asynctask.FeedRemover;
import de.danoeh.antennapod.core.dialog.ConfirmationDialog;
@@ -70,7 +68,7 @@ public class SubscriptionFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.fragment_subscriptions, container, false);
- subscriptionGridLayout = (GridView) root.findViewById(R.id.subscriptions_grid);
+ subscriptionGridLayout = root.findViewById(R.id.subscriptions_grid);
registerForContextMenu(subscriptionGridLayout);
return root;
}
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java
index b48027668..4dc114f9b 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/GpodnetMainFragment.java
@@ -31,12 +31,12 @@ public class GpodnetMainFragment extends Fragment {
super.onCreateView(inflater, container, savedInstanceState);
View root = inflater.inflate(R.layout.pager_fragment, container, false);
- viewPager = (ViewPager)root.findViewById(R.id.viewpager);
+ viewPager = root.findViewById(R.id.viewpager);
GpodnetPagerAdapter pagerAdapter = new GpodnetPagerAdapter(getChildFragmentManager(), getResources());
viewPager.setAdapter(pagerAdapter);
// Give the TabLayout the ViewPager
- tabLayout = (TabLayout) root.findViewById(R.id.sliding_tabs);
+ tabLayout = root.findViewById(R.id.sliding_tabs);
tabLayout.setupWithViewPager(viewPager);
return root;
diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java
index 055358c64..49851ebb4 100644
--- a/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java
+++ b/app/src/main/java/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java
@@ -78,10 +78,10 @@ public abstract class PodcastListFragment extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.gpodnet_podcast_list, container, false);
- gridView = (GridView) root.findViewById(R.id.gridView);
- progressBar = (ProgressBar) root.findViewById(R.id.progressBar);
- txtvError = (TextView) root.findViewById(R.id.txtvError);
- butRetry = (Button) root.findViewById(R.id.butRetry);
+ gridView = root.findViewById(R.id.gridView);
+ progressBar = root.findViewById(R.id.progressBar);
+ txtvError = root.findViewById(R.id.txtvError);
+ butRetry = root.findViewById(R.id.butRetry);
gridView.setOnItemClickListener((parent, view, position, id) ->
onPodcastSelected((GpodnetPodcast) gridView.getAdapter().getItem(position)));
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 ab7d0e7c6..bd4fe9bcf 100644
--- a/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java
+++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/FeedMenuHandler.java
@@ -30,6 +30,9 @@ import de.danoeh.antennapod.core.util.ShareUtils;
* Handles interactions with the FeedItemMenu.
*/
public class FeedMenuHandler {
+
+ private FeedMenuHandler(){ }
+
private static final String TAG = "FeedMenuHandler";
public static boolean onCreateOptionsMenu(MenuInflater inflater, Menu menu) {
diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java
index 66e229bdd..7b9fcad9b 100644
--- a/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java
+++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java
@@ -19,7 +19,7 @@ public class MenuItemUtils extends de.danoeh.antennapod.core.menuhandler.MenuIte
public static void adjustTextColor(Context context, SearchView sv) {
if(Build.VERSION.SDK_INT < 14) {
- EditText searchEditText = (EditText) sv.findViewById(R.id.search_src_text);
+ EditText searchEditText = sv.findViewById(R.id.search_src_text);
if (UserPreferences.getTheme() == de.danoeh.antennapod.R.style.Theme_AntennaPod_Dark
|| UserPreferences.getTheme() == R.style.Theme_AntennaPod_TrueBlack) {
searchEditText.setTextColor(Color.WHITE);
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java b/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java
index e500267fe..b810cbfa6 100644
--- a/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java
+++ b/app/src/main/java/de/danoeh/antennapod/preferences/MasterSwitchPreference.java
@@ -9,6 +9,7 @@ import android.support.v7.preference.PreferenceViewHolder;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
+
import de.danoeh.antennapod.R;
public class MasterSwitchPreference extends SwitchPreference {
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java b/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java
index 20b07e486..50e76838c 100644
--- a/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java
+++ b/app/src/main/java/de/danoeh/antennapod/preferences/NumberPickerPreference.java
@@ -8,6 +8,7 @@ import android.util.AttributeSet;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
+
import de.danoeh.antennapod.R;
public class NumberPickerPreference extends Preference {
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java
index c55117ecc..1d93afad9 100644
--- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java
+++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java
@@ -36,24 +36,9 @@ import android.widget.ListView;
import android.widget.Toast;
import com.afollestad.materialdialogs.MaterialDialog;
-
import com.bytehamster.lib.preferencesearch.SearchConfiguration;
import com.bytehamster.lib.preferencesearch.SearchPreference;
-import de.danoeh.antennapod.activity.AboutActivity;
-import de.danoeh.antennapod.activity.ImportExportActivity;
-import de.danoeh.antennapod.activity.MediaplayerActivity;
-import de.danoeh.antennapod.activity.OpmlImportFromPathActivity;
-import de.danoeh.antennapod.activity.PreferenceActivity;
-import de.danoeh.antennapod.activity.StatisticsActivity;
-import de.danoeh.antennapod.core.export.html.HtmlWriter;
-import de.danoeh.antennapod.core.export.opml.OpmlWriter;
-import de.danoeh.antennapod.core.service.GpodnetSyncService;
-import de.danoeh.antennapod.dialog.AuthenticationDialog;
-import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog;
-import de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog;
-import de.danoeh.antennapod.dialog.ProxyDialog;
-import de.danoeh.antennapod.dialog.VariableSpeedDialog;
-import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil;
+
import org.apache.commons.lang3.ArrayUtils;
import java.io.File;
@@ -67,14 +52,29 @@ import java.util.concurrent.TimeUnit;
import de.danoeh.antennapod.CrashReportWriter;
import de.danoeh.antennapod.R;
+import de.danoeh.antennapod.activity.AboutActivity;
import de.danoeh.antennapod.activity.DirectoryChooserActivity;
+import de.danoeh.antennapod.activity.ImportExportActivity;
import de.danoeh.antennapod.activity.MainActivity;
+import de.danoeh.antennapod.activity.MediaplayerActivity;
+import de.danoeh.antennapod.activity.OpmlImportFromPathActivity;
+import de.danoeh.antennapod.activity.PreferenceActivity;
+import de.danoeh.antennapod.activity.StatisticsActivity;
import de.danoeh.antennapod.asynctask.ExportWorker;
import de.danoeh.antennapod.core.export.ExportWriter;
+import de.danoeh.antennapod.core.export.html.HtmlWriter;
+import de.danoeh.antennapod.core.export.opml.OpmlWriter;
import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
import de.danoeh.antennapod.core.preferences.UserPreferences;
+import de.danoeh.antennapod.core.service.GpodnetSyncService;
import de.danoeh.antennapod.core.util.flattr.FlattrUtils;
+import de.danoeh.antennapod.core.util.gui.PictureInPictureUtil;
+import de.danoeh.antennapod.dialog.AuthenticationDialog;
+import de.danoeh.antennapod.dialog.AutoFlattrPreferenceDialog;
import de.danoeh.antennapod.dialog.ChooseDataFolderDialog;
+import de.danoeh.antennapod.dialog.GpodnetSetHostnameDialog;
+import de.danoeh.antennapod.dialog.ProxyDialog;
+import de.danoeh.antennapod.dialog.VariableSpeedDialog;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
@@ -227,6 +227,9 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc
return true;
});
+ if (Build.VERSION.SDK_INT >= 26) {
+ ui.findPreference(UserPreferences.PREF_EXPANDED_NOTIFICATION).setVisible(false);
+ }
}
private void setupStorageScreen() {
diff --git a/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java b/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java
index 75cbd8b5a..03958508d 100644
--- a/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java
+++ b/app/src/main/java/de/danoeh/antennapod/spa/SPAUtil.java
@@ -33,7 +33,7 @@ public class SPAUtil {
* sent before.
*/
public static synchronized boolean sendSPAppsQueryFeedsIntent(Context context) {
- if (context == null) throw new IllegalArgumentException("context = null");
+ assert context != null : "context = null";
final Context appContext = context.getApplicationContext();
if (appContext == null) {
Log.wtf(TAG, "Unable to get application context");
diff --git a/app/src/main/play/de/listing/fulldescription b/app/src/main/play/de/listing/fulldescription
index e5d7ec72a..0e09c5c29 100644
--- a/app/src/main/play/de/listing/fulldescription
+++ b/app/src/main/play/de/listing/fulldescription
@@ -1,4 +1,4 @@
-AntennaPod ist ein Podcast-Manager und -Player, der Dir unmittelbar Zugriff auf Millionen von freien und bezahlten Podcasts ermöglicht, angefangen von unabhängigen Podcastern zu großen Rundfunkanstalten oder Hörfunksendern wie BBC, NPR und CNN. Abonniere, importiere und exportiere deine Feeds mühelos mit Hilfe des iTunes-Verzeichnisses, OPML-Dateien oder einfachen RSS-URLs. Reduziere Aufwand, Stromverbrauch und Datenverbrauch durch die Kontrolle der Downloads (bestimmte Uhrzeiten, Intervalle, WiFi-Netze) und des Löschens von Episoden (basierend auf deinen Favoriten und weiteren Einstellungen).<br>
+AntennaPod ist ein Podcast-Manager und -Player, der Dir unmittelbar Zugriff auf Millionen von freien und kostenpflichtigen Podcasts ermöglicht, angefangen von unabhängigen Podcastern bis hin zu großen Rundfunkanstalten wie BBC, NPR und CNN. Abonniere, importiere und exportiere deine Feeds mühelos mit Hilfe des iTunes-Verzeichnisses, OPML-Dateien oder einfachen RSS-URLs. Reduziere Aufwand, Stromverbrauch und Datenverbrauch durch die Kontrolle der Downloads (bestimmte Uhrzeiten, Intervalle, WiFi-Netze) und des Löschens von Episoden (basierend auf deinen Favoriten und weiteren Einstellungen).<br>
Aber am wichtigsten: Downloade, streame oder füge Episoden zur Abspielliste hinzu und genieße sie mit einstellbarer Abspielgeschwindigkeit, Unterstützung von Kapiteln und Schlummerfunktion. Mit Flattr kannst du den Podcastern sogar deine Wertschätzung zeigen.
AntennaPod ist, von Podcast-Enthusiasten gemacht, frei im Sinne des Wortes: Open Source, keine Kosten, keine Werbung.
@@ -24,7 +24,7 @@ STEUER DAS SYSTEM<br>
&#8226; Passe das Aussehen mit dem hellen oder dunklen Theme an<br>
&#8226; Sichere deine Abonnements mit gPodder.net oder über den OPML-Export
-<b>Trete der AntennaPod-Community bei!</b><br>
+<b>Tritt der AntennaPod-Community bei!</b><br>
AntennaPod wird aktiv von Freiwilligen weiterentwickelt. Auch du kannst bei der Entwicklung mit Quellcode oder Kommentaren mitwirken!
Wir verwenden GitHub für Funktionswünsche (Feature Requests), Fehlerberichte (Bug Reports) und zum Beisteuern von Code (Code Contributions).
diff --git a/app/src/main/res/xml/preferences.xml b/app/src/main/res/xml/preferences.xml
index dfc2f4b1a..f45847e54 100644
--- a/app/src/main/res/xml/preferences.xml
+++ b/app/src/main/res/xml/preferences.xml
@@ -8,7 +8,7 @@
<Preference
android:key="prefScreenInterface"
android:title="@string/user_interface_label"
- android:icon="?attr/type_video" />
+ android:icon="?attr/ic_cellphone_text" />
<Preference
android:key="prefScreenPlayback"