diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2012-08-04 13:27:15 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2012-08-04 13:27:15 +0200 |
commit | a05470300d0cba400aa58e5eddd9db3112ccf38e (patch) | |
tree | dab333f0d0a881e3e71bdc9687123c31ded8a0ae /src/de/danoeh/antennapod | |
parent | b91a04fc8c7289e7586a9f02ddcc81c23bb8f2de (diff) | |
download | AntennaPod-a05470300d0cba400aa58e5eddd9db3112ccf38e.zip |
Renamed MiroChannel and MiroItem to MiroGuideChannel and MiroGuideItem
Diffstat (limited to 'src/de/danoeh/antennapod')
-rw-r--r-- | src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java | 6 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/adapter/MiroGuideChannelListAdapter.java | 8 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java | 8 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/asynctask/FeedImageLoader.java | 4 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/asynctask/MiroGuideThumbnailDownloader.java | 6 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java | 20 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/miroguide/con/MiroGuideService.java | 32 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/miroguide/model/MiroGuideChannel.java (renamed from src/de/danoeh/antennapod/miroguide/model/MiroChannel.java) | 12 | ||||
-rw-r--r-- | src/de/danoeh/antennapod/miroguide/model/MiroGuideItem.java (renamed from src/de/danoeh/antennapod/miroguide/model/MiroItem.java) | 4 |
9 files changed, 50 insertions, 50 deletions
diff --git a/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java b/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java index 102dd92ca..507818468 100644 --- a/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java +++ b/src/de/danoeh/antennapod/activity/MiroGuideChannelViewActivity.java @@ -22,8 +22,8 @@ import de.danoeh.antennapod.adapter.MiroGuideItemlistAdapter; import de.danoeh.antennapod.feed.FeedManager; import de.danoeh.antennapod.miroguide.con.MiroGuideException; import de.danoeh.antennapod.miroguide.con.MiroGuideService; -import de.danoeh.antennapod.miroguide.model.MiroChannel; -import de.danoeh.antennapod.miroguide.model.MiroItem; +import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; +import de.danoeh.antennapod.miroguide.model.MiroGuideItem; import de.danoeh.antennapod.storage.DownloadRequester; public class MiroGuideChannelViewActivity extends SherlockActivity { @@ -40,7 +40,7 @@ public class MiroGuideChannelViewActivity extends SherlockActivity { private long channelId; private String channelUrl; - private MiroChannel channel; + private MiroGuideChannel channel; @Override protected void onPause() { diff --git a/src/de/danoeh/antennapod/adapter/MiroGuideChannelListAdapter.java b/src/de/danoeh/antennapod/adapter/MiroGuideChannelListAdapter.java index 3275ea9d1..872f7533a 100644 --- a/src/de/danoeh/antennapod/adapter/MiroGuideChannelListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/MiroGuideChannelListAdapter.java @@ -11,19 +11,19 @@ import android.widget.ImageView; import android.widget.TextView; import de.danoeh.antennapod.R; import de.danoeh.antennapod.asynctask.FeedImageLoader; -import de.danoeh.antennapod.miroguide.model.MiroChannel; +import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; -public class MiroGuideChannelListAdapter extends ArrayAdapter<MiroChannel> { +public class MiroGuideChannelListAdapter extends ArrayAdapter<MiroGuideChannel> { public MiroGuideChannelListAdapter(Context context, int textViewResourceId, - List<MiroChannel> objects) { + List<MiroGuideChannel> objects) { super(context, textViewResourceId, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { Holder holder; - MiroChannel channel = getItem(position); + MiroGuideChannel channel = getItem(position); // Inflate Layout if (convertView == null) { diff --git a/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java index d0d3d43a9..4cee0a64a 100644 --- a/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/MiroGuideItemlistAdapter.java @@ -11,19 +11,19 @@ import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import de.danoeh.antennapod.R; -import de.danoeh.antennapod.miroguide.model.MiroItem; +import de.danoeh.antennapod.miroguide.model.MiroGuideItem; -public class MiroGuideItemlistAdapter extends ArrayAdapter<MiroItem> { +public class MiroGuideItemlistAdapter extends ArrayAdapter<MiroGuideItem> { public MiroGuideItemlistAdapter(Context context, int textViewResourceId, - List<MiroItem> objects) { + List<MiroGuideItem> objects) { super(context, textViewResourceId, objects); } @Override public View getView(int position, View convertView, ViewGroup parent) { Holder holder; - MiroItem item = getItem(position); + MiroGuideItem item = getItem(position); // Inflate Layout if (convertView == null) { diff --git a/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java b/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java index 39013cdac..c2686d9cf 100644 --- a/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java +++ b/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java @@ -17,7 +17,7 @@ import de.danoeh.antennapod.PodcastApp; import de.danoeh.antennapod.R; import de.danoeh.antennapod.feed.FeedImage; import de.danoeh.antennapod.feed.FeedManager; -import de.danoeh.antennapod.miroguide.model.MiroChannel; +import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; import de.danoeh.antennapod.storage.DownloadRequester; /** Caches and loads FeedImage bitmaps in the background */ @@ -135,7 +135,7 @@ public class FeedImageLoader { } } - public void loadMiroGuideThumbnail(MiroChannel channel, ImageView target) { + public void loadMiroGuideThumbnail(MiroGuideChannel channel, ImageView target) { if (channel.getThumbnailUrl() != null) { Bitmap bitmap = getBitmapFromThumbnailCache(channel .getThumbnailUrl()); diff --git a/src/de/danoeh/antennapod/asynctask/MiroGuideThumbnailDownloader.java b/src/de/danoeh/antennapod/asynctask/MiroGuideThumbnailDownloader.java index febe309ed..121fe5f49 100644 --- a/src/de/danoeh/antennapod/asynctask/MiroGuideThumbnailDownloader.java +++ b/src/de/danoeh/antennapod/asynctask/MiroGuideThumbnailDownloader.java @@ -13,7 +13,7 @@ import android.util.Log; import android.widget.ImageView; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.PodcastApp; -import de.danoeh.antennapod.miroguide.model.MiroChannel; +import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; import de.danoeh.antennapod.util.BitmapDecoder; /** Downlods thumbnails from the MiroGuide and stores them in a DiskLruCache */ @@ -22,10 +22,10 @@ public class MiroGuideThumbnailDownloader extends BitmapDecodeWorkerTask { private Exception exception; - private MiroChannel miroChannel; + private MiroGuideChannel miroChannel; public MiroGuideThumbnailDownloader(Handler handler, ImageView target, - MiroChannel miroChannel, int length) { + MiroGuideChannel miroChannel, int length) { super(handler, target, miroChannel.getThumbnailUrl(), length); this.miroChannel = miroChannel; } diff --git a/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java b/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java index bb9643829..0c7f2425c 100644 --- a/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java +++ b/src/de/danoeh/antennapod/fragment/MiroGuideChannellistFragment.java @@ -26,10 +26,10 @@ import de.danoeh.antennapod.adapter.MiroGuideChannelListAdapter; import de.danoeh.antennapod.asynctask.FeedImageLoader; import de.danoeh.antennapod.miroguide.con.MiroGuideException; import de.danoeh.antennapod.miroguide.con.MiroGuideService; -import de.danoeh.antennapod.miroguide.model.MiroChannel; +import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; /** - * Displays a list of MiroChannel objects that were results of a certain + * Displays a list of MiroGuideChannel objects that were results of a certain * MiroGuideService query. If the user reaches the bottom of the list, more * entries will be loaded until all entries have been loaded or the maximum * number of channels has been reached. @@ -44,7 +44,7 @@ public class MiroGuideChannellistFragment extends SherlockListFragment { private static final int MAX_CHANNELS = 200; private static final int CHANNELS_PER_QUERY = MiroGuideService.DEFAULT_CHANNEL_LIMIT; - private ArrayList<MiroChannel> channels; + private ArrayList<MiroGuideChannel> channels; private MiroGuideChannelListAdapter listAdapter; private int offset; @@ -61,7 +61,7 @@ public class MiroGuideChannellistFragment extends SherlockListFragment { private String filterValue; private String sort; - private AsyncTask<Void, Void, List<MiroChannel>> channelLoader; + private AsyncTask<Void, Void, List<MiroGuideChannel>> channelLoader; /** * Creates a new instance of Channellist fragment. @@ -98,7 +98,7 @@ public class MiroGuideChannellistFragment extends SherlockListFragment { super.onCreate(savedInstanceState); offset = 0; - channels = new ArrayList<MiroChannel>(); + channels = new ArrayList<MiroGuideChannel>(); Bundle args = getArguments(); filter = args.getString(ARG_FILTER); @@ -160,7 +160,7 @@ public class MiroGuideChannellistFragment extends SherlockListFragment { public void onListItemClick(ListView l, View v, int position, long id) { super.onListItemClick(l, v, position, id); if (listAdapter != null) { - MiroChannel selection = listAdapter.getItem(position); + MiroGuideChannel selection = listAdapter.getItem(position); Intent launchIntent = new Intent(getActivity(), MiroGuideChannelViewActivity.class); launchIntent.putExtra(MiroGuideChannelViewActivity.EXTRA_CHANNEL_ID, @@ -176,7 +176,7 @@ public class MiroGuideChannellistFragment extends SherlockListFragment { if (!isLoadingChannels) { if (!stopLoading) { isLoadingChannels = true; - channelLoader = new AsyncTask<Void, Void, List<MiroChannel>>() { + channelLoader = new AsyncTask<Void, Void, List<MiroGuideChannel>>() { private MiroGuideException exception; @Override @@ -186,12 +186,12 @@ public class MiroGuideChannellistFragment extends SherlockListFragment { } @Override - protected void onPostExecute(List<MiroChannel> result) { + protected void onPostExecute(List<MiroGuideChannel> result) { if (AppConfig.DEBUG) Log.d(TAG, "Channel loading finished"); if (exception == null) { getListView().removeFooterView(footer); - for (MiroChannel channel : result) { + for (MiroGuideChannel channel : result) { channels.add(channel); } listAdapter.notifyDataSetChanged(); @@ -238,7 +238,7 @@ public class MiroGuideChannellistFragment extends SherlockListFragment { } @Override - protected List<MiroChannel> doInBackground(Void... params) { + protected List<MiroGuideChannel> doInBackground(Void... params) { if (AppConfig.DEBUG) Log.d(TAG, "Background channel loader started"); MiroGuideService service = new MiroGuideService(); diff --git a/src/de/danoeh/antennapod/miroguide/con/MiroGuideService.java b/src/de/danoeh/antennapod/miroguide/con/MiroGuideService.java index 8779207eb..1013f466d 100644 --- a/src/de/danoeh/antennapod/miroguide/con/MiroGuideService.java +++ b/src/de/danoeh/antennapod/miroguide/con/MiroGuideService.java @@ -11,8 +11,8 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; -import de.danoeh.antennapod.miroguide.model.MiroChannel; -import de.danoeh.antennapod.miroguide.model.MiroItem; +import de.danoeh.antennapod.miroguide.model.MiroGuideChannel; +import de.danoeh.antennapod.miroguide.model.MiroGuideItem; /** Provides methods to communicate with the Miroguide API on an abstract level. */ @@ -62,19 +62,19 @@ public class MiroGuideService { return result; } - /** Get a list of MiroChannel objects without their items. */ - public List<MiroChannel> getChannelList(String filter, String filterValue, + /** Get a list of MiroGuideChannel objects without their items. */ + public List<MiroGuideChannel> getChannelList(String filter, String filterValue, String sort, int limit, int offset) throws MiroGuideException { JSONArray resultArray = connector.getArrayResponse(connector .createGetChannelsUri(filter, filterValue, sort, Integer.toString(limit), Integer.toString(offset))); int resultLen = resultArray.length(); - List<MiroChannel> channels = new ArrayList<MiroChannel>(resultLen); + List<MiroGuideChannel> channels = new ArrayList<MiroGuideChannel>(resultLen); for (int i = 0; i < resultLen; i++) { JSONObject content = null; try { content = resultArray.getJSONObject(i); - MiroChannel channel = extractMiroChannel(content, false); + MiroGuideChannel channel = extractMiroChannel(content, false); channels.add(channel); } catch (JSONException e) { e.printStackTrace(); @@ -90,10 +90,10 @@ public class MiroGuideService { * * @throws MiroGuideException */ - public MiroChannel getChannel(long id) throws MiroGuideException { + public MiroGuideChannel getChannel(long id) throws MiroGuideException { JSONObject resultObject = connector.getSingleObjectResponse(connector .createGetChannelUri(Long.toString(id))); - MiroChannel result = null; + MiroGuideChannel result = null; try { result = extractMiroChannel(resultObject, true); } catch (JSONException e) { @@ -104,12 +104,12 @@ public class MiroGuideService { } /** - * Get a MiroChannel object from it's JSON source. The itemlist of the + * Get a MiroGuideChannel object from it's JSON source. The itemlist of the * channel can be included or excluded * * @throws JSONException */ - private MiroChannel extractMiroChannel(JSONObject content, boolean withItems) + private MiroGuideChannel extractMiroChannel(JSONObject content, boolean withItems) throws JSONException { long id = content.getLong("id"); String name = content.getString("name"); @@ -118,28 +118,28 @@ public class MiroGuideService { String downloadUrl = content.getString("url"); String websiteUrl = content.getString("website_url"); if (!withItems) { - return new MiroChannel(id, name, thumbnailUrl, downloadUrl, + return new MiroGuideChannel(id, name, thumbnailUrl, downloadUrl, websiteUrl, description); } else { JSONArray itemData = content.getJSONArray("item"); int numItems = itemData.length(); - ArrayList<MiroItem> items = new ArrayList<MiroItem>(numItems); + ArrayList<MiroGuideItem> items = new ArrayList<MiroGuideItem>(numItems); for (int i = 0; i < numItems; i++) { items.add(extractMiroItem(itemData.getJSONObject(i))); } - return new MiroChannel(id, name, thumbnailUrl, downloadUrl, + return new MiroGuideChannel(id, name, thumbnailUrl, downloadUrl, websiteUrl, description, items); } } - /** Get a MiroItem from its JSON source. */ - private MiroItem extractMiroItem(JSONObject content) throws JSONException { + /** Get a MiroGuideItem from its JSON source. */ + private MiroGuideItem extractMiroItem(JSONObject content) throws JSONException { Date date = parseMiroItemDate(content.getString("date")); String description = content.getString("description"); String name = content.getString("name"); String url = content.getString("url"); - return new MiroItem(name, description, date, url); + return new MiroGuideItem(name, description, date, url); } private Date parseMiroItemDate(String s) { diff --git a/src/de/danoeh/antennapod/miroguide/model/MiroChannel.java b/src/de/danoeh/antennapod/miroguide/model/MiroGuideChannel.java index 87812052b..f5d62d2e8 100644 --- a/src/de/danoeh/antennapod/miroguide/model/MiroChannel.java +++ b/src/de/danoeh/antennapod/miroguide/model/MiroGuideChannel.java @@ -2,16 +2,16 @@ package de.danoeh.antennapod.miroguide.model; import java.util.ArrayList; -public class MiroChannel { +public class MiroGuideChannel { private long id; private String name; private String thumbnailUrl; private String downloadUrl; private String websiteUrl; private String description; - private ArrayList<MiroItem> items; + private ArrayList<MiroGuideItem> items; - public MiroChannel(long id, String name, String thumbnailUrl, + public MiroGuideChannel(long id, String name, String thumbnailUrl, String downloadUrl, String websiteUrl, String description) { super(); this.id = id; @@ -22,9 +22,9 @@ public class MiroChannel { this.description = description; } - public MiroChannel(long id, String name, String thumbnailUrl, + public MiroGuideChannel(long id, String name, String thumbnailUrl, String downloadUrl, String websiteUrl, String description, - ArrayList<MiroItem> items) { + ArrayList<MiroGuideItem> items) { super(); this.id = id; this.name = name; @@ -64,7 +64,7 @@ public class MiroChannel { return description; } - public ArrayList<MiroItem> getItems() { + public ArrayList<MiroGuideItem> getItems() { return items; } diff --git a/src/de/danoeh/antennapod/miroguide/model/MiroItem.java b/src/de/danoeh/antennapod/miroguide/model/MiroGuideItem.java index 64a96dcf4..89a2250df 100644 --- a/src/de/danoeh/antennapod/miroguide/model/MiroItem.java +++ b/src/de/danoeh/antennapod/miroguide/model/MiroGuideItem.java @@ -2,13 +2,13 @@ package de.danoeh.antennapod.miroguide.model; import java.util.Date; -public class MiroItem { +public class MiroGuideItem { private String name; private String description; private Date date; private String url; - public MiroItem(String name, String description, Date date, String url) { + public MiroGuideItem(String name, String description, Date date, String url) { super(); this.name = name; this.description = description; |