diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-07-05 21:12:50 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-07-05 21:12:50 +0200 |
commit | 16caf87e2b01a288420d655e2cd151f7cf576749 (patch) | |
tree | 5d74111ac58f6890c5657128af78f718e084fc34 /src | |
parent | 4f8c934595f5d2aa01b642d7d4489de3ad25df39 (diff) | |
download | AntennaPod-16caf87e2b01a288420d655e2cd151f7cf576749.zip |
Reduced number of lint warnings
Diffstat (limited to 'src')
26 files changed, 53 insertions, 35 deletions
diff --git a/src/com/aocate/media/MediaPlayer.java b/src/com/aocate/media/MediaPlayer.java index 995dbbc51..04ecd58a9 100644 --- a/src/com/aocate/media/MediaPlayer.java +++ b/src/com/aocate/media/MediaPlayer.java @@ -32,6 +32,8 @@ import android.os.Message; import android.os.Handler.Callback; import android.util.Log; +import de.danoeh.antennapod.BuildConfig; + public class MediaPlayer { public interface OnBufferingUpdateListener { public abstract void onBufferingUpdate(MediaPlayer arg0, int percent); @@ -309,7 +311,7 @@ public class MediaPlayer { Log.d(MP_TAG, "this.mpi is not a ServiceBackedMediaPlayer, but we couldn't use it anyway 321"); return false; } else { - assert (this.mpi instanceof ServiceBackedMediaPlayer); + if (BuildConfig.DEBUG && !(this.mpi instanceof ServiceBackedMediaPlayer)) throw new AssertionError(); if (this.useService && isPrestoLibraryInstalled()) { // We should be using the service, and we are. Great! Log.d(MP_TAG, "We could be using a ServiceBackedMediaPlayer and we are 327"); diff --git a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java index abd383152..54a22ec0b 100644 --- a/src/de/danoeh/antennapod/activity/AudioplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/AudioplayerActivity.java @@ -124,7 +124,6 @@ public class AudioplayerActivity extends MediaplayerActivity implements ItemDesc @Override protected void onCreate(Bundle savedInstanceState) { - requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); super.onCreate(savedInstanceState); getSupportActionBar().setDisplayShowTitleEnabled(false); detachedFragments = new Fragment[NUM_CONTENT_FRAGMENTS]; diff --git a/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java b/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java index c129d89ed..e89f8d05c 100644 --- a/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java +++ b/src/de/danoeh/antennapod/activity/DefaultOnlineFeedViewActivity.java @@ -101,7 +101,7 @@ public class DefaultOnlineFeedViewActivity extends OnlineFeedViewActivity { ListView listView = (ListView) findViewById(R.id.listview); LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View header = inflater.inflate(R.layout.onlinefeedview_header, null); + View header = inflater.inflate(R.layout.onlinefeedview_header, listView, false); listView.addHeaderView(header); listView.setAdapter(new FeedItemlistDescriptionAdapter(this, 0, feed.getItems())); diff --git a/src/de/danoeh/antennapod/activity/MainActivity.java b/src/de/danoeh/antennapod/activity/MainActivity.java index 257bea82d..b1dad0934 100644 --- a/src/de/danoeh/antennapod/activity/MainActivity.java +++ b/src/de/danoeh/antennapod/activity/MainActivity.java @@ -71,7 +71,7 @@ public class MainActivity extends ActionBarActivity { public void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTheme()); super.onCreate(savedInstanceState); - requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); + supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); StorageUtils.checkStorageAvailability(this); setContentView(R.layout.main); setVolumeControlStream(AudioManager.STREAM_MUSIC); diff --git a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java index c2d8d2c79..13e7b8a82 100644 --- a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -15,6 +15,7 @@ import android.util.Log; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; +import android.view.Window; import android.widget.ImageButton; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; @@ -170,6 +171,10 @@ public abstract class MediaplayerActivity extends ActionBarActivity protected void onCreate(Bundle savedInstanceState) { chooseTheme(); super.onCreate(savedInstanceState); + + // subclasses might use this feature + supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); + if (BuildConfig.DEBUG) Log.d(TAG, "Creating Activity"); StorageUtils.checkStorageAvailability(this); diff --git a/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java b/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java index 5f2ea0401..e09941abf 100644 --- a/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java +++ b/src/de/danoeh/antennapod/activity/OpmlFeedChooserActivity.java @@ -103,11 +103,11 @@ public class OpmlFeedChooserActivity extends ActionBarActivity { super.onCreateOptionsMenu(menu); MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.select_all_item, Menu.NONE, R.string.select_all_label), - MenuItem.SHOW_AS_ACTION_IF_ROOM); + MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); MenuItemCompat.setShowAsAction(menu.add(Menu.NONE, R.id.deselect_all_item, Menu.NONE, R.string.deselect_all_label), - MenuItem.SHOW_AS_ACTION_IF_ROOM); + MenuItemCompat.SHOW_AS_ACTION_IF_ROOM); return true; } diff --git a/src/de/danoeh/antennapod/activity/PreferenceActivity.java b/src/de/danoeh/antennapod/activity/PreferenceActivity.java index 77ec579ed..e588ce290 100644 --- a/src/de/danoeh/antennapod/activity/PreferenceActivity.java +++ b/src/de/danoeh/antennapod/activity/PreferenceActivity.java @@ -69,7 +69,7 @@ public class PreferenceActivity extends android.preference.PreferenceActivity { super.onCreate(savedInstanceState); if (android.os.Build.VERSION.SDK_INT >= 11) { - ActionBar ab = getActionBar(); + @SuppressLint("AppCompatMethod") ActionBar ab = getActionBar(); if (ab != null) { ab.setDisplayHomeAsUpEnabled(true); } diff --git a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java index c45a3d162..46fa98c49 100644 --- a/src/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -6,14 +6,19 @@ import android.graphics.drawable.ColorDrawable; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; +import android.support.v4.view.WindowCompat; import android.util.Log; import android.util.Pair; -import android.view.*; +import android.view.MotionEvent; +import android.view.SurfaceHolder; +import android.view.View; +import android.view.WindowManager; import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.widget.LinearLayout; import android.widget.ProgressBar; import android.widget.SeekBar; + import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.MediaType; @@ -48,7 +53,7 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void onCreate(Bundle savedInstanceState) { if (Build.VERSION.SDK_INT >= 11) { - requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY); + supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); } getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); super.onCreate(savedInstanceState); @@ -126,7 +131,8 @@ public class VideoplayerActivity extends MediaplayerActivity { Pair<Integer, Integer> videoSize = controller.getVideoSize(); if (videoSize != null && videoSize.first > 0 && videoSize.second > 0) { - if (BuildConfig.DEBUG) Log.d(TAG, "Width,height of video: " + videoSize.first + ", " + videoSize.second); + if (BuildConfig.DEBUG) + Log.d(TAG, "Width,height of video: " + videoSize.first + ", " + videoSize.second); videoview.setVideoSize(videoSize.first, videoSize.second); } else { Log.e(TAG, "Could not determine video size"); @@ -304,6 +310,7 @@ public class VideoplayerActivity extends MediaplayerActivity { progressIndicator.setVisibility(View.INVISIBLE); } + @SuppressLint("NewApi") private void showVideoControls() { videoOverlay.setVisibility(View.VISIBLE); butPlay.setVisibility(View.VISIBLE); @@ -318,6 +325,7 @@ public class VideoplayerActivity extends MediaplayerActivity { } } + @SuppressLint("NewApi") private void hideVideoControls() { final Animation animation = AnimationUtils.loadAnimation(this, R.anim.fade_out); diff --git a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java index 05048f079..cb6dc41cf 100644 --- a/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java +++ b/src/de/danoeh/antennapod/activity/gpoddernet/GpodnetAuthenticationActivity.java @@ -67,9 +67,9 @@ public class GpodnetAuthenticationActivity extends ActionBarActivity { LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); views = new View[]{ - inflater.inflate(R.layout.gpodnetauth_credentials, null), - inflater.inflate(R.layout.gpodnetauth_device, null), - inflater.inflate(R.layout.gpodnetauth_finish, null) + inflater.inflate(R.layout.gpodnetauth_credentials, viewFlipper, false), + inflater.inflate(R.layout.gpodnetauth_device, viewFlipper, false), + inflater.inflate(R.layout.gpodnetauth_finish, viewFlipper, false) }; for (View view : views) { viewFlipper.addView(view); diff --git a/src/de/danoeh/antennapod/adapter/ChapterListAdapter.java b/src/de/danoeh/antennapod/adapter/ChapterListAdapter.java index 72ad6774f..c12de6ebd 100644 --- a/src/de/danoeh/antennapod/adapter/ChapterListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/ChapterListAdapter.java @@ -51,7 +51,7 @@ public class ChapterListAdapter extends ArrayAdapter<Chapter> { LayoutInflater inflater = (LayoutInflater) getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.simplechapter_item, null); + convertView = inflater.inflate(R.layout.simplechapter_item, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); defaultTextColor = holder.title.getTextColors().getDefaultColor(); holder.start = (TextView) convertView.findViewById(R.id.txtvStart); diff --git a/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java b/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java index e97d69494..2cc216227 100644 --- a/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java +++ b/src/de/danoeh/antennapod/adapter/DownloadLogAdapter.java @@ -34,7 +34,7 @@ public class DownloadLogAdapter extends BaseAdapter { holder = new Holder(); LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.downloadlog_item, null); + convertView = inflater.inflate(R.layout.downloadlog_item, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.type = (TextView) convertView.findViewById(R.id.txtvType); holder.date = (TextView) convertView.findViewById(R.id.txtvDate); diff --git a/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java index 0bf770df2..33b11774f 100644 --- a/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/DownloadedEpisodesListAdapter.java @@ -54,7 +54,7 @@ public class DownloadedEpisodesListAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.downloaded_episodeslist_item, - null); + parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.pubDate = (TextView) convertView .findViewById(R.id.txtvPublished); diff --git a/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java b/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java index fa2e5a0a7..658af9e4e 100644 --- a/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/DownloadlistAdapter.java @@ -56,7 +56,7 @@ public class DownloadlistAdapter extends BaseAdapter { holder = new Holder(); LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.downloadlist_item, null); + convertView = inflater.inflate(R.layout.downloadlist_item, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.message = (TextView) convertView .findViewById(R.id.txtvMessage); diff --git a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java index 9a7b607aa..5e857c131 100644 --- a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java @@ -72,7 +72,7 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.external_itemlist_item, - null); + parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.feedTitle = (TextView) convertView .findViewById(R.id.txtvFeedname); @@ -225,7 +225,7 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter { View convertView, ViewGroup parent) { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.feeditemlist_header, null); + convertView = inflater.inflate(R.layout.feeditemlist_header, parent, false); TextView headerTitle = (TextView) convertView .findViewById(0); ImageButton actionButton = (ImageButton) convertView diff --git a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java index c4a16d4db..357b5f8b4 100644 --- a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java @@ -67,7 +67,7 @@ public class FeedItemlistAdapter extends BaseAdapter { holder = new Holder(); LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.feeditemlist_item, null); + convertView = inflater.inflate(R.layout.feeditemlist_item, parent, false); holder.title = (TextView) convertView .findViewById(R.id.txtvItemname); holder.lenSize = (TextView) convertView diff --git a/src/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java b/src/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java index 5fb204b26..c2c2285ac 100644 --- a/src/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java +++ b/src/de/danoeh/antennapod/adapter/FeedItemlistDescriptionAdapter.java @@ -12,7 +12,7 @@ import de.danoeh.antennapod.feed.FeedItem; import java.util.List; /** - * Created by daniel on 24.08.13. + * List adapter for showing a list of FeedItems with their title and description. */ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> { @@ -31,7 +31,7 @@ public class FeedItemlistDescriptionAdapter extends ArrayAdapter<FeedItem> { holder = new Holder(); LayoutInflater inflater = (LayoutInflater) getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.itemdescription_listitem, null); + convertView = inflater.inflate(R.layout.itemdescription_listitem, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.description = (TextView) convertView.findViewById(R.id.txtvDescription); diff --git a/src/de/danoeh/antennapod/adapter/NavListAdapter.java b/src/de/danoeh/antennapod/adapter/NavListAdapter.java index 536bf80e3..9676372fb 100644 --- a/src/de/danoeh/antennapod/adapter/NavListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/NavListAdapter.java @@ -110,7 +110,7 @@ public class NavListAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.nav_listitem, null); + convertView = inflater.inflate(R.layout.nav_listitem, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.count = (TextView) convertView.findViewById(R.id.txtvCount); @@ -154,7 +154,7 @@ public class NavListAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.nav_section_item, null); + convertView = inflater.inflate(R.layout.nav_section_item, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); convertView.setTag(holder); @@ -179,7 +179,7 @@ public class NavListAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.nav_feedlistitem, null); + convertView = inflater.inflate(R.layout.nav_feedlistitem, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.image = (ImageView) convertView.findViewById(R.id.imgvCover); diff --git a/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java index 555a334f6..07fd3e6b1 100644 --- a/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/NewEpisodesListAdapter.java @@ -62,7 +62,7 @@ public class NewEpisodesListAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.new_episodes_listitem, - null); + parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.pubDate = (TextView) convertView .findViewById(R.id.txtvPublished); diff --git a/src/de/danoeh/antennapod/adapter/QueueListAdapter.java b/src/de/danoeh/antennapod/adapter/QueueListAdapter.java index ecce1b473..f671ba5c6 100644 --- a/src/de/danoeh/antennapod/adapter/QueueListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/QueueListAdapter.java @@ -57,7 +57,7 @@ public class QueueListAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.queue_listitem, - null); + parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.butSecondary = (ImageButton) convertView .findViewById(R.id.butSecondaryAction); diff --git a/src/de/danoeh/antennapod/adapter/SearchlistAdapter.java b/src/de/danoeh/antennapod/adapter/SearchlistAdapter.java index 5c6af3943..ecfbb4660 100644 --- a/src/de/danoeh/antennapod/adapter/SearchlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/SearchlistAdapter.java @@ -55,7 +55,7 @@ public class SearchlistAdapter extends BaseAdapter { LayoutInflater inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.searchlist_item, null); + convertView = inflater.inflate(R.layout.searchlist_item, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.cover = (ImageView) convertView .findViewById(R.id.imgvFeedimage); diff --git a/src/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java b/src/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java index 795b17917..f20232a6f 100644 --- a/src/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/gpodnet/PodcastListAdapter.java @@ -38,7 +38,7 @@ public class PodcastListAdapter extends ArrayAdapter<GpodnetPodcast> { LayoutInflater inflater = (LayoutInflater) getContext() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.gpodnet_podcast_listitem, null); + convertView = inflater.inflate(R.layout.gpodnet_podcast_listitem, parent, false); holder.title = (TextView) convertView.findViewById(R.id.txtvTitle); holder.description = (TextView) convertView.findViewById(R.id.txtvDescription); holder.image = (ImageView) convertView.findViewById(R.id.imgvCover); diff --git a/src/de/danoeh/antennapod/dialog/FeedItemDialog.java b/src/de/danoeh/antennapod/dialog/FeedItemDialog.java index 4a130af6e..9d94f14e1 100644 --- a/src/de/danoeh/antennapod/dialog/FeedItemDialog.java +++ b/src/de/danoeh/antennapod/dialog/FeedItemDialog.java @@ -1,5 +1,6 @@ package de.danoeh.antennapod.dialog; +import android.annotation.TargetApi; import android.app.Dialog; import android.content.ActivityNotFoundException; import android.content.Context; @@ -95,6 +96,7 @@ public class FeedItemDialog extends Dialog { && UserPreferences.getTheme() != R.style.Theme_AntennaPod_Dark; } + @TargetApi(Build.VERSION_CODES.HONEYCOMB) @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java index 5d0b1bec8..bd5d73c36 100644 --- a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -322,10 +322,11 @@ public class ItemlistFragment extends ListFragment { Log.e(TAG, "Unable to setup listview: listView = null or feed = null"); return; } + ListView lv = getListView(); LayoutInflater inflater = (LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE); - View header = inflater.inflate(R.layout.feeditemlist_header, null); - getListView().addHeaderView(header); + View header = inflater.inflate(R.layout.feeditemlist_header, lv, false); + lv.addHeaderView(header); TextView txtvTitle = (TextView) header.findViewById(R.id.txtvTitle); TextView txtvAuthor = (TextView) header.findViewById(R.id.txtvAuthor); diff --git a/src/de/danoeh/antennapod/util/DuckType.java b/src/de/danoeh/antennapod/util/DuckType.java index 0dfc01508..163110418 100644 --- a/src/de/danoeh/antennapod/util/DuckType.java +++ b/src/de/danoeh/antennapod/util/DuckType.java @@ -6,6 +6,8 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import de.danoeh.antennapod.BuildConfig; + /** * Allows "duck typing" or dynamic invocation based on method signature rather * than type hierarchy. In other words, rather than checking whether something @@ -63,7 +65,7 @@ public class DuckType { */ @SuppressWarnings({ "rawtypes", "unchecked" }) public <T> T to(Class iface) { - assert iface.isInterface() : "cannot coerce object to a class, must be an interface"; + if (BuildConfig.DEBUG && !iface.isInterface()) throw new AssertionError("cannot coerce object to a class, must be an interface"); if (isA(iface)) { return (T) iface.cast(objectToCoerce); } diff --git a/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java b/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java index 2dfd6a544..85994b152 100644 --- a/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java +++ b/src/instrumentationTest/de/test/antennapod/ui/MainActivityTest.java @@ -66,8 +66,7 @@ public class MainActivityTest extends ActivityInstrumentationTestCase2<MainActiv public void testClickNavDrawer() throws Exception { uiTestUtils.addLocalFeedData(false); - - final View home = solo.getView(android.R.id.home); + final View home = solo.getView(R.id.home); // all episodes solo.waitForView(android.R.id.list); diff --git a/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java b/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java index 835973560..719d43a73 100644 --- a/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java +++ b/src/instrumentationTest/de/test/antennapod/ui/PlaybackTest.java @@ -78,7 +78,7 @@ public class PlaybackTest extends ActivityInstrumentationTestCase2<MainActivity> private void startLocalPlaybackFromQueue() { assertTrue(solo.waitForActivity(MainActivity.class)); - solo.clickOnView(solo.getView(android.R.id.home)); + solo.clickOnView(solo.getView(R.id.home)); solo.clickOnText(solo.getString(R.string.queue_label)); assertTrue(solo.waitForView(solo.getView(R.id.butSecondaryAction))); solo.clickOnImageButton(0); |