diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-03-28 21:16:27 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-03-28 21:16:27 +0100 |
commit | b2de7512f4c871e882760bfe8bffa27d10c1c68a (patch) | |
tree | 2cc17eb8cdcbb8bfdb79f5e32dfab47abe9acc59 /src/de/danoeh/antennapod/fragment | |
parent | 7dec032d2cfb8835e29cb939b596752380650dcb (diff) | |
download | AntennaPod-b2de7512f4c871e882760bfe8bffa27d10c1c68a.zip |
Replaced AppConfig.DEBUG with BuildConfig.DEBUG
Diffstat (limited to 'src/de/danoeh/antennapod/fragment')
10 files changed, 59 insertions, 81 deletions
diff --git a/src/de/danoeh/antennapod/fragment/CoverFragment.java b/src/de/danoeh/antennapod/fragment/CoverFragment.java index 791315719..0e1fe35e0 100644 --- a/src/de/danoeh/antennapod/fragment/CoverFragment.java +++ b/src/de/danoeh/antennapod/fragment/CoverFragment.java @@ -7,8 +7,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; - -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.AudioplayerActivity.AudioplayerContentFragment; import de.danoeh.antennapod.asynctask.ImageLoader; @@ -74,11 +73,11 @@ public class CoverFragment extends Fragment implements @Override public void onStart() { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "On Start"); super.onStart(); if (media != null) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Loading media info"); loadMediaInfo(); } else { diff --git a/src/de/danoeh/antennapod/fragment/EpisodesFragment.java b/src/de/danoeh/antennapod/fragment/EpisodesFragment.java index 6b228662f..3c79a8c10 100644 --- a/src/de/danoeh/antennapod/fragment/EpisodesFragment.java +++ b/src/de/danoeh/antennapod/fragment/EpisodesFragment.java @@ -10,8 +10,7 @@ import android.view.*; import android.view.ContextMenu.ContextMenuInfo; import android.widget.ExpandableListView; import android.widget.ExpandableListView.OnChildClickListener; - -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.ItemviewActivity; import de.danoeh.antennapod.activity.OrganizeQueueActivity; @@ -156,7 +155,7 @@ public class EpisodesFragment extends Fragment { @Override protected Void doInBackground(Void... voids) { - if (AppConfig.DEBUG) Log.d(TAG, "Starting to load list data"); + if (BuildConfig.DEBUG) Log.d(TAG, "Starting to load list data"); Context context = EpisodesFragment.this.getActivity(); if (context != null) { queueRef = DBReader.getQueue(context); @@ -169,7 +168,7 @@ public class EpisodesFragment extends Fragment { protected void onPostExecute(Void aVoid) { super.onPostExecute(aVoid); if (queueRef != null && unreadItemsRef != null) { - if (AppConfig.DEBUG) Log.d(TAG, "Done loading list data"); + if (BuildConfig.DEBUG) Log.d(TAG, "Done loading list data"); queue = queueRef; unreadItems = unreadItemsRef; if (adapter != null) { @@ -193,7 +192,7 @@ public class EpisodesFragment extends Fragment { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((EVENTS & arg) != 0) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Received contentUpdate Intent."); loadData(); } diff --git a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java index 56e6ee4b8..47cd3f244 100644 --- a/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java +++ b/src/de/danoeh/antennapod/fragment/ExternalPlayerFragment.java @@ -10,8 +10,7 @@ import android.view.ViewGroup; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.TextView; - -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.ImageLoader; import de.danoeh.antennapod.service.playback.PlaybackService; @@ -57,7 +56,7 @@ public class ExternalPlayerFragment extends Fragment { @Override public void onClick(View v) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "layoutInfo was clicked"); if (controller.getMedia() != null) { @@ -196,7 +195,7 @@ public class ExternalPlayerFragment extends Fragment { @Override public void onDestroy() { super.onDestroy(); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Fragment is about to be destroyed"); if (controller != null) { controller.release(); @@ -212,7 +211,7 @@ public class ExternalPlayerFragment extends Fragment { } private boolean loadMediaInfo() { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Loading media info"); if (controller.serviceAvailable()) { Playable media = controller.getMedia(); diff --git a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java index d0e07b194..0d2f0d079 100644 --- a/src/de/danoeh/antennapod/fragment/FeedlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/FeedlistFragment.java @@ -5,7 +5,6 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.os.AsyncTask; -import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v7.app.ActionBarActivity; @@ -13,7 +12,7 @@ import android.support.v7.view.ActionMode; import android.util.Log; import android.view.*; import android.widget.*; -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.FeedItemlistActivity; import de.danoeh.antennapod.adapter.FeedlistAdapter; @@ -85,7 +84,7 @@ public class FeedlistFragment extends Fragment implements @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Creating"); fla = new FeedlistAdapter(getActivity(), itemAccess); loadFeeds(); @@ -143,14 +142,14 @@ public class FeedlistFragment extends Fragment implements listView.setOnItemLongClickListener(this); listView.setAdapter(fla); listView.setEmptyView(emptyView); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Using ListView"); } else { gridView.setOnItemClickListener(this); gridView.setOnItemLongClickListener(this); gridView.setAdapter(fla); gridView.setEmptyView(emptyView); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Using GridView"); } setEmptyViewIfListIsEmpty(); @@ -159,7 +158,7 @@ public class FeedlistFragment extends Fragment implements @Override public void onResume() { super.onResume(); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Resuming"); EventDistributor.getInstance().register(contentUpdate); } @@ -183,7 +182,7 @@ public class FeedlistFragment extends Fragment implements @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((EVENTS & arg) != 0) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Received contentUpdate Intent."); loadFeeds(); } @@ -266,7 +265,7 @@ public class FeedlistFragment extends Fragment implements int position, long id) { Feed selection = fla.getItem(position); if (selection != null) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Selected Feed with title " + selection.getTitle()); if (mActionMode != null) { mActionMode.finish(); diff --git a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index c996f497e..48c544457 100644 --- a/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -1,39 +1,32 @@ package de.danoeh.antennapod.fragment; -import android.content.*; -import android.support.v4.app.Fragment; -import android.support.v7.app.ActionBarActivity; -import de.danoeh.antennapod.feed.FeedItem; -import de.danoeh.antennapod.storage.DBReader; -import de.danoeh.antennapod.util.ShownotesProvider; -import org.apache.commons.lang3.StringEscapeUtils; - import android.annotation.SuppressLint; import android.app.Activity; +import android.content.*; import android.content.res.TypedArray; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; +import android.support.v4.app.Fragment; +import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.util.TypedValue; -import android.view.ContextMenu; +import android.view.*; import android.view.ContextMenu.ContextMenuInfo; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; import android.webkit.WebSettings.LayoutAlgorithm; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.Toast; - -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; +import de.danoeh.antennapod.feed.FeedItem; import de.danoeh.antennapod.preferences.UserPreferences; +import de.danoeh.antennapod.storage.DBReader; import de.danoeh.antennapod.util.ShareUtils; +import de.danoeh.antennapod.util.ShownotesProvider; import de.danoeh.antennapod.util.playback.Playable; +import org.apache.commons.lang3.StringEscapeUtils; import java.util.concurrent.Callable; @@ -93,7 +86,7 @@ public class ItemDescriptionFragment extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Creating view"); webvDescription = new WebView(getActivity()); if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) { @@ -126,7 +119,7 @@ public class ItemDescriptionFragment extends Fragment { @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Page finished"); // Restoring the scroll position might not always work view.postDelayed(new Runnable() { @@ -153,14 +146,14 @@ public class ItemDescriptionFragment extends Fragment { @Override public void onAttach(Activity activity) { super.onAttach(activity); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Fragment attached"); } @Override public void onDetach() { super.onDetach(); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Fragment detached"); if (webViewLoader != null) { webViewLoader.cancel(true); @@ -170,7 +163,7 @@ public class ItemDescriptionFragment extends Fragment { @Override public void onDestroy() { super.onDestroy(); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Fragment destroyed"); if (webViewLoader != null) { webViewLoader.cancel(true); @@ -181,7 +174,7 @@ public class ItemDescriptionFragment extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Creating fragment"); Bundle args = getArguments(); saveState = args.getBoolean(ARG_SAVE_STATE, false); @@ -258,7 +251,7 @@ public class ItemDescriptionFragment extends Fragment { WebView.HitTestResult r = webvDescription.getHitTestResult(); if (r != null && r.getType() == WebView.HitTestResult.SRC_ANCHOR_TYPE) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Link of webview was long-pressed. Extra: " + r.getExtra()); @@ -352,7 +345,7 @@ public class ItemDescriptionFragment extends Fragment { ((ActionBarActivity) getActivity()) .setSupportProgressBarIndeterminateVisibility(false); } - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Webview loaded"); webViewLoader = null; } @@ -368,7 +361,7 @@ public class ItemDescriptionFragment extends Fragment { @Override protected Void doInBackground(Void... params) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Loading Webview"); try { Callable<String> shownotesLoadTask = shownotesProvider.loadShownotes(); @@ -407,13 +400,13 @@ public class ItemDescriptionFragment extends Fragment { private void savePreference() { if (saveState) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Saving preferences"); SharedPreferences prefs = getActivity().getSharedPreferences(PREF, Activity.MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); if (media != null && webvDescription != null) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Saving scroll position: " + webvDescription.getScrollY()); @@ -421,7 +414,7 @@ public class ItemDescriptionFragment extends Fragment { editor.putString(PREF_PLAYABLE_ID, media.getIdentifier() .toString()); } else { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "savePreferences was called while media or webview was null"); editor.putInt(PREF_SCROLL_Y, -1); @@ -433,7 +426,7 @@ public class ItemDescriptionFragment extends Fragment { private boolean restoreFromPreference() { if (saveState) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Restoring from preferences"); Activity activity = getActivity(); if (activity != null) { @@ -444,7 +437,7 @@ public class ItemDescriptionFragment extends Fragment { if (scrollY != -1 && media != null && id.equals(media.getIdentifier().toString()) && webvDescription != null) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Restored scroll Position: " + scrollY); webvDescription.scrollTo(webvDescription.getScrollX(), scrollY); diff --git a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java index 436210a70..e5845dd76 100644 --- a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -8,17 +8,11 @@ import android.os.Bundle; import android.support.v4.app.ListFragment; import android.support.v7.app.ActionBarActivity; import android.util.Log; -import android.view.ContextMenu; +import android.view.*; import android.view.ContextMenu.ContextMenuInfo; -import android.view.LayoutInflater; -import android.view.MenuInflater; -import android.view.View; -import android.view.ViewGroup; import android.widget.ListView; - import android.widget.TextView; - -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.ItemviewActivity; import de.danoeh.antennapod.adapter.ActionButtonCallback; @@ -34,7 +28,6 @@ import de.danoeh.antennapod.storage.DownloadRequester; import de.danoeh.antennapod.util.QueueAccess; import de.danoeh.antennapod.util.menuhandler.FeedItemMenuHandler; -import java.util.Iterator; import java.util.List; /** Displays a list of FeedItems. */ @@ -229,7 +222,7 @@ public class ItemlistFragment extends ListFragment { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((EVENTS & arg) != 0) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Received contentUpdate Intent."); if ((EventDistributor.DOWNLOAD_QUEUED & arg) != 0) { updateProgressBarVisibility(); diff --git a/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java b/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java index c6901ad17..53910b673 100644 --- a/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java +++ b/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java @@ -1,8 +1,5 @@ package de.danoeh.antennapod.fragment; -import java.util.ArrayList; -import java.util.List; - import android.annotation.SuppressLint; import android.app.AlertDialog; import android.content.Context; @@ -17,8 +14,7 @@ import android.view.View; import android.widget.AbsListView; import android.widget.AbsListView.OnScrollListener; import android.widget.ListView; - -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.MiroGuideChannelViewActivity; import de.danoeh.antennapod.adapter.MiroGuideChannelListAdapter; @@ -26,6 +22,9 @@ import de.danoeh.antennapod.miroguide.conn.MiroGuideException; import de.danoeh.antennapod.miroguide.conn.MiroGuideService; import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; +import java.util.ArrayList; +import java.util.List; + /** * Displays a list of MiroGuideChannel objects that were results of a certain * MiroGuideService query. If the user reaches the bottom of the list, more @@ -139,7 +138,7 @@ public class MiroGuideChannellistFragment extends ListFragment { int visibleItemCount, int totalItemCount) { int lastVisibleItem = firstVisibleItem + visibleItemCount; if (lastVisibleItem == totalItemCount) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) loadChannels(); } } @@ -177,13 +176,13 @@ public class MiroGuideChannellistFragment extends ListFragment { @Override protected void onCancelled() { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Channel loader was cancelled"); } @Override protected void onPostExecute(List<MiroGuideChannel> result) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Channel loading finished"); if (exception == null) { getListView().removeFooterView(footer); @@ -195,13 +194,13 @@ public class MiroGuideChannellistFragment extends ListFragment { // check if fragment should not send any more // queries if (result.size() < CHANNELS_PER_QUERY) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Query result was less than requested number of channels. Stopping to send any more queries"); stopLoading = true; } if (offset >= MAX_CHANNELS) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Maximum number of feeds has been reached. Stopping to send any more queries"); stopLoading = true; @@ -236,7 +235,7 @@ public class MiroGuideChannellistFragment extends ListFragment { @Override protected List<MiroGuideChannel> doInBackground( Void... params) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Background channel loader started"); MiroGuideService service = new MiroGuideService(); try { @@ -260,7 +259,7 @@ public class MiroGuideChannellistFragment extends ListFragment { } } } else { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Channels are already being loaded"); } } diff --git a/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java index d20cb63c4..d6524853f 100644 --- a/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java +++ b/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java @@ -4,13 +4,12 @@ import android.content.Context; import android.os.AsyncTask; import android.os.Bundle; import android.util.Log; -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.adapter.InternalFeedItemlistAdapter; import de.danoeh.antennapod.feed.EventDistributor; import de.danoeh.antennapod.feed.FeedItem; import de.danoeh.antennapod.storage.DBReader; -import java.util.Iterator; import java.util.List; public class PlaybackHistoryFragment extends ItemlistFragment { @@ -64,7 +63,7 @@ public class PlaybackHistoryFragment extends ItemlistFragment { @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((EventDistributor.PLAYBACK_HISTORY_UPDATE & arg) != 0) { - if (AppConfig.DEBUG) + if (BuildConfig.DEBUG) Log.d(TAG, "Received content update"); loadData(); } diff --git a/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java b/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java index 3014d28cc..4164429b2 100644 --- a/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java +++ b/src/de/danoeh/antennapod/fragment/gpodnet/PodcastListFragment.java @@ -10,7 +10,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.*; -import de.danoeh.antennapod.AppConfig; +import de.danoeh.antennapod.BuildConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.DefaultOnlineFeedViewActivity; import de.danoeh.antennapod.activity.OnlineFeedViewActivity; @@ -60,7 +60,7 @@ public abstract class PodcastListFragment extends Fragment { } protected void onPodcastSelected(GpodnetPodcast selection) { - if (AppConfig.DEBUG) Log.d(TAG, "Selected podcast: " + selection.toString()); + if (BuildConfig.DEBUG) Log.d(TAG, "Selected podcast: " + selection.toString()); Intent intent = new Intent(getActivity(), DefaultOnlineFeedViewActivity.class); intent.putExtra(OnlineFeedViewActivity.ARG_FEEDURL, selection.getUrl()); intent.putExtra(DefaultOnlineFeedViewActivity.ARG_TITLE, getString(R.string.gpodnet_main_label)); diff --git a/src/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java b/src/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java index 7007d0b9a..5717a74e7 100644 --- a/src/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java +++ b/src/de/danoeh/antennapod/fragment/gpodnet/PodcastTopListFragment.java @@ -1,7 +1,5 @@ package de.danoeh.antennapod.fragment.gpodnet; -import android.util.Log; -import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.gpoddernet.GpodnetService; import de.danoeh.antennapod.gpoddernet.GpodnetServiceException; import de.danoeh.antennapod.gpoddernet.model.GpodnetPodcast; |