From 2dbcae1576a570b0e17a5bd389c749eafd24bdfb Mon Sep 17 00:00:00 2001 From: egsavage Date: Sun, 7 Oct 2018 21:32:42 -0400 Subject: Optimize imports --- .../antennapod/activity/FeedInfoActivity.java | 9 ++++-- .../antennapod/activity/FeedSettingsActivity.java | 2 ++ .../antennapod/activity/ImportExportActivity.java | 8 ++++-- .../danoeh/antennapod/activity/MainActivity.java | 6 ++-- .../antennapod/activity/PreferenceActivity.java | 6 ++-- .../danoeh/antennapod/activity/SplashActivity.java | 1 + .../antennapod/activity/VideoplayerActivity.java | 7 +++-- .../adapter/DefaultActionButtonCallback.java | 5 ++-- .../antennapod/adapter/QueueRecyclerAdapter.java | 2 +- .../config/PlaybackServiceCallbacksImpl.java | 1 - .../de/danoeh/antennapod/dialog/ProxyDialog.java | 1 - .../fragment/CompletedDownloadsFragment.java | 6 ---- .../antennapod/fragment/DownloadLogFragment.java | 2 +- .../danoeh/antennapod/fragment/ItemFragment.java | 5 ++-- .../antennapod/fragment/ItemlistFragment.java | 7 +---- .../antennapod/fragment/SubscriptionFragment.java | 2 -- .../preferences/MasterSwitchPreference.java | 1 + .../preferences/NumberPickerPreference.java | 1 + .../preferences/PreferenceController.java | 32 +++++++++++----------- 19 files changed, 50 insertions(+), 54 deletions(-) (limited to 'app/src/main/java') 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 6b1272b01..f4c74d161 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -16,8 +16,14 @@ import android.view.View; import android.widget.ImageView; import android.widget.TextView; import android.widget.Toast; + import com.bumptech.glide.Glide; 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; @@ -30,9 +36,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; 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 b500cda87..eea47c363 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java @@ -25,7 +25,9 @@ import android.widget.RadioButton; import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; + import com.bumptech.glide.Glide; + import de.danoeh.antennapod.R; import de.danoeh.antennapod.core.dialog.ConfirmationDialog; import de.danoeh.antennapod.core.dialog.DownloadRequestErrorDialogCreator; 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..6e3e2794d 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; 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/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index ea408c650..5f5cd9519 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. */ 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/QueueRecyclerAdapter.java b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java index ee14cb70a..c407d3bb3 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java @@ -25,7 +25,6 @@ import android.widget.TextView; import com.bumptech.glide.Glide; import com.joanzapata.iconify.Iconify; -import de.danoeh.antennapod.core.util.ThemeUtils; import org.apache.commons.lang3.ArrayUtils; import java.lang.ref.WeakReference; @@ -41,6 +40,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; 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/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java index b9276982a..4a5c61c86 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; 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/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/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 5075d022a..250964301 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -34,8 +34,6 @@ import com.bumptech.glide.Glide; 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; @@ -53,16 +51,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; 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 dbea23aeb..55c32dbdf 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; @@ -26,18 +24,16 @@ import android.widget.RelativeLayout; import android.widget.TextView; import com.bumptech.glide.Glide; -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; @@ -55,7 +51,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; 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..6e7e1d2b2 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; 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 e1fcc43c5..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; -- cgit v1.2.3 From a52f1ba34f917aa3cbaf0aff661d6ba64607a32d Mon Sep 17 00:00:00 2001 From: egsavage Date: Sun, 7 Oct 2018 22:04:44 -0400 Subject: Remove redundant type casts --- .../danoeh/antennapod/activity/AboutActivity.java | 4 +-- .../activity/DirectoryChooserActivity.java | 10 ++++---- .../activity/DownloadAuthenticationActivity.java | 10 ++++---- .../antennapod/activity/FeedInfoActivity.java | 20 +++++++-------- .../antennapod/activity/FeedSettingsActivity.java | 24 ++++++++--------- .../antennapod/activity/FlattrAuthActivity.java | 6 ++--- .../danoeh/antennapod/activity/MainActivity.java | 6 ++--- .../antennapod/activity/MediaplayerActivity.java | 18 ++++++------- .../activity/MediaplayerInfoActivity.java | 16 ++++++------ .../activity/OnlineFeedViewActivity.java | 14 +++++----- .../activity/OpmlFeedChooserActivity.java | 6 ++--- .../activity/OpmlImportFromPathActivity.java | 14 +++++----- .../antennapod/activity/StatisticsActivity.java | 6 ++--- .../antennapod/activity/StorageErrorActivity.java | 2 +- .../antennapod/activity/VideoplayerActivity.java | 10 ++++---- .../gpoddernet/GpodnetAuthenticationActivity.java | 30 +++++++++++----------- .../adapter/AllEpisodesRecycleAdapter.java | 20 +++++++-------- .../antennapod/adapter/ChaptersListAdapter.java | 10 ++++---- .../antennapod/adapter/DownloadLogAdapter.java | 12 ++++----- .../adapter/DownloadedEpisodesListAdapter.java | 12 ++++----- .../antennapod/adapter/DownloadlistAdapter.java | 10 ++++---- .../antennapod/adapter/FeedItemlistAdapter.java | 16 ++++++------ .../adapter/FeedItemlistDescriptionAdapter.java | 6 ++--- .../danoeh/antennapod/adapter/NavListAdapter.java | 16 ++++++------ .../antennapod/adapter/QueueRecyclerAdapter.java | 20 +++++++-------- .../antennapod/adapter/SearchlistAdapter.java | 6 ++--- .../antennapod/adapter/StatisticsListAdapter.java | 6 ++--- .../antennapod/adapter/SubscriptionsAdapter.java | 6 ++--- .../adapter/gpodnet/PodcastListAdapter.java | 8 +++--- .../antennapod/adapter/gpodnet/TagListAdapter.java | 4 +-- .../antennapod/adapter/itunes/ItunesAdapter.java | 6 ++--- .../antennapod/dialog/AuthenticationDialog.java | 10 ++++---- .../dialog/AutoFlattrPreferenceDialog.java | 6 ++--- .../dialog/EpisodesApplyActionFragment.java | 12 ++++----- .../de/danoeh/antennapod/dialog/ProxyDialog.java | 12 ++++----- .../danoeh/antennapod/dialog/SleepTimerDialog.java | 10 ++++---- .../antennapod/fragment/AddFeedFragment.java | 12 ++++----- .../antennapod/fragment/AllEpisodesFragment.java | 4 +-- .../danoeh/antennapod/fragment/CoverFragment.java | 6 ++--- .../antennapod/fragment/DownloadsFragment.java | 4 +-- .../antennapod/fragment/EpisodesFragment.java | 4 +-- .../fragment/ExternalPlayerFragment.java | 12 ++++----- .../antennapod/fragment/FyydSearchFragment.java | 10 ++++---- .../danoeh/antennapod/fragment/ItemFragment.java | 24 ++++++++--------- .../antennapod/fragment/ItemlistFragment.java | 16 ++++++------ .../antennapod/fragment/ItunesSearchFragment.java | 10 ++++---- .../danoeh/antennapod/fragment/QueueFragment.java | 8 +++--- .../antennapod/fragment/SubscriptionFragment.java | 2 +- .../fragment/gpodnet/GpodnetMainFragment.java | 4 +-- .../fragment/gpodnet/PodcastListFragment.java | 8 +++--- .../antennapod/menuhandler/MenuItemUtils.java | 2 +- .../java/de/danoeh/antennapod/spa/SPAUtil.java | 2 +- 52 files changed, 266 insertions(+), 266 deletions(-) (limited to 'app/src/main/java') 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 f4c74d161..c533adc10 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedInfoActivity.java @@ -85,22 +85,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 eea47c363..dcce63a44 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/FeedSettingsActivity.java @@ -113,27 +113,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/MainActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java index 6e3e2794d..f506921d2 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MainActivity.java @@ -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 637198784..9c8999927 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -797,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; @@ -827,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 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 ce9bbb955..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(); 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 b5cc1c931..feae7d402 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/OnlineFeedViewActivity.java @@ -379,20 +379,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/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 5f5cd9519..78cc15b2c 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -143,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 81e51e304..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 @@ -70,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[]{ @@ -107,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()); @@ -175,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 @@ -346,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 9739b999b..a431a47db 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/AllEpisodesRecycleAdapter.java @@ -76,24 +76,24 @@ public class AllEpisodesRecycleAdapter extends RecyclerView.Adapter= 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 { 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/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 51e1271d9..014e43ee7 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java @@ -61,16 +61,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 { 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 2daa5e70f..5adf662b3 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -212,7 +212,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 { @@ -235,9 +235,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(); @@ -325,10 +325,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 c407d3bb3..3ad9dc79c 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/QueueRecyclerAdapter.java @@ -134,19 +134,19 @@ public class QueueRecyclerAdapter extends RecyclerView.Adapter= 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 beb62b3bb..74c0d6473 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SearchlistAdapter.java @@ -61,13 +61,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 50255c11f..d1f1d85bc 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/StatisticsListAdapter.java @@ -62,9 +62,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 bb76ab501..9230967ab 100644 --- a/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java +++ b/app/src/main/java/de/danoeh/antennapod/adapter/SubscriptionsAdapter.java @@ -89,9 +89,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 aea3d583f..9cc0e36cf 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 @@ -40,10 +40,10 @@ public class PodcastListAdapter extends ArrayAdapter { .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 { .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 e493a2ecc..14389d289 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 @@ -182,9 +182,9 @@ public class ItunesAdapter extends ArrayAdapter { * @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/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 7f054f5dd..07a64cde8 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/EpisodesApplyActionFragment.java @@ -85,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(); @@ -129,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; @@ -137,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; @@ -145,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; @@ -153,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; @@ -161,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/ProxyDialog.java b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java index 4a5c61c86..8f15e78e5 100644 --- a/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java +++ b/app/src/main/java/de/danoeh/antennapod/dialog/ProxyDialog.java @@ -101,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 adapter = new ArrayAdapter<>(context, android.R.layout.simple_spinner_item, types); @@ -109,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); } @@ -145,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/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/CoverFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java index 128c5f6bf..0230c9036 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/CoverFragment.java @@ -48,9 +48,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/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 9e8c9731e..2055c560e 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -52,12 +52,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"); 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 250964301..c1d9bb9ab 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -165,25 +165,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) { @@ -215,12 +215,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 55c32dbdf..bc38af9f3 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -475,14 +475,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 00b4d9eee..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); @@ -494,9 +494,9 @@ public class QueueFragment extends Fragment { ); 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; 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 6e7e1d2b2..36a9c5ba8 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/SubscriptionFragment.java @@ -68,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/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/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"); -- cgit v1.2.3