From faa23de4de8ee1bfe3addf0cd7a2c92935a940bf Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Thu, 28 Feb 2013 21:10:26 +0100 Subject: Added default getView() implementation for itemlistadapter --- .../adapter/AbstractFeedItemlistAdapter.java | 39 ---- .../adapter/DefaultFeedItemlistAdapter.java | 136 +++++++++++++ .../antennapod/adapter/FeedItemlistAdapter.java | 221 --------------------- .../adapter/InternalFeedItemlistAdapter.java | 215 ++++++++++++++++++++ .../antennapod/fragment/ItemlistFragment.java | 18 +- .../fragment/PlaybackHistoryFragment.java | 9 +- 6 files changed, 365 insertions(+), 273 deletions(-) delete mode 100644 src/de/danoeh/antennapod/adapter/AbstractFeedItemlistAdapter.java create mode 100644 src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java delete mode 100644 src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java create mode 100644 src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java (limited to 'src/de/danoeh/antennapod') diff --git a/src/de/danoeh/antennapod/adapter/AbstractFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/AbstractFeedItemlistAdapter.java deleted file mode 100644 index 6f4cf7c29..000000000 --- a/src/de/danoeh/antennapod/adapter/AbstractFeedItemlistAdapter.java +++ /dev/null @@ -1,39 +0,0 @@ -package de.danoeh.antennapod.adapter; - -import android.widget.BaseAdapter; -import de.danoeh.antennapod.feed.FeedItem; - -public abstract class AbstractFeedItemlistAdapter extends BaseAdapter { - - ItemAccess itemAccess; - - public AbstractFeedItemlistAdapter(ItemAccess itemAccess) { - super(); - if (itemAccess == null) { - throw new IllegalArgumentException("itemAccess must not be null"); - } - this.itemAccess = itemAccess; - } - - @Override - public int getCount() { - return itemAccess.getCount(); - - } - - @Override - public long getItemId(int position) { - return position; - } - - @Override - public FeedItem getItem(int position) { - return itemAccess.getItem(position); - } - - public static interface ItemAccess { - int getCount(); - - FeedItem getItem(int position); - } -} diff --git a/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java new file mode 100644 index 000000000..5e8dca005 --- /dev/null +++ b/src/de/danoeh/antennapod/adapter/DefaultFeedItemlistAdapter.java @@ -0,0 +1,136 @@ +package de.danoeh.antennapod.adapter; + +import java.text.DateFormat; + +import android.content.Context; +import android.content.res.TypedArray; +import android.text.format.DateUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.View.OnClickListener; +import android.widget.Adapter; +import android.widget.BaseAdapter; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.TextView; +import de.danoeh.antennapod.R; +import de.danoeh.antennapod.adapter.InternalFeedItemlistAdapter.Holder; +import de.danoeh.antennapod.feed.FeedItem; +import de.danoeh.antennapod.feed.FeedManager; +import de.danoeh.antennapod.feed.MediaType; +import de.danoeh.antennapod.storage.DownloadRequester; +import de.danoeh.antennapod.util.Converter; +import de.danoeh.antennapod.util.ThemeUtils; + +public class DefaultFeedItemlistAdapter extends BaseAdapter { + + ItemAccess itemAccess; + private Context context; + + public DefaultFeedItemlistAdapter(Context context, ItemAccess itemAccess) { + super(); + this.context = context; + if (itemAccess == null) { + throw new IllegalArgumentException("itemAccess must not be null"); + } + this.itemAccess = itemAccess; + } + + @Override + public int getCount() { + return itemAccess.getCount(); + + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public FeedItem getItem(int position) { + return itemAccess.getItem(position); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + Holder holder; + final FeedItem item = getItem(position); + + if (convertView == null) { + holder = new Holder(); + LayoutInflater inflater = (LayoutInflater) context + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.default_feeditemlist_item, null); + holder.title = (TextView) convertView + .findViewById(R.id.txtvItemname); + holder.lenSize = (TextView) convertView + .findViewById(R.id.txtvLenSize); + + holder.published = (TextView) convertView + .findViewById(R.id.txtvPublished); + holder.type = (ImageView) convertView.findViewById(R.id.imgvType); + convertView.setTag(holder); + + } else { + holder = (Holder) convertView.getTag(); + } + if (!(getItemViewType(position) == Adapter.IGNORE_ITEM_VIEW_TYPE)) { + convertView.setVisibility(View.VISIBLE); + holder.title.setText(item.getTitle()); + holder.published.setText(convertView.getResources().getString( + R.string.published_prefix) + + DateUtils.formatSameDayTime(item.getPubDate().getTime(), + System.currentTimeMillis(), DateFormat.MEDIUM, + DateFormat.SHORT)); + + if (item.getMedia() == null) { + holder.type.setVisibility(View.GONE); + holder.lenSize.setVisibility(View.GONE); + } else { + holder.lenSize.setVisibility(View.VISIBLE); + holder.lenSize.setText(convertView.getResources().getString( + R.string.size_prefix) + + Converter.byteToString(item.getMedia().getSize())); + + TypedArray typeDrawables = context + .obtainStyledAttributes(new int[] { R.attr.type_audio, + R.attr.type_video }); + MediaType mediaType = item.getMedia().getMediaType(); + if (mediaType == MediaType.AUDIO) { + holder.type.setImageDrawable(typeDrawables.getDrawable(0)); + holder.type.setVisibility(View.VISIBLE); + } else if (mediaType == MediaType.VIDEO) { + holder.type.setImageDrawable(typeDrawables.getDrawable(1)); + holder.type.setVisibility(View.VISIBLE); + } else { + holder.type.setImageBitmap(null); + holder.type.setVisibility(View.GONE); + } + } + + } else { + convertView.setVisibility(View.GONE); + } + return convertView; + } + + protected static class Holder { + TextView title; + TextView published; + TextView lenSize; + ImageView type; + + } + + public static interface ItemAccess { + int getCount(); + + FeedItem getItem(int position); + } + + protected Context getContext() { + return context; + } +} diff --git a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java deleted file mode 100644 index 0dda5d035..000000000 --- a/src/de/danoeh/antennapod/adapter/FeedItemlistAdapter.java +++ /dev/null @@ -1,221 +0,0 @@ -package de.danoeh.antennapod.adapter; - -import java.text.DateFormat; - -import android.content.Context; -import android.content.res.TypedArray; -import android.text.format.DateUtils; -import android.view.LayoutInflater; -import android.view.View; -import android.view.View.OnClickListener; -import android.view.ViewGroup; -import android.widget.Adapter; -import android.widget.ImageButton; -import android.widget.ImageView; -import android.widget.TextView; -import de.danoeh.antennapod.R; -import de.danoeh.antennapod.feed.FeedItem; -import de.danoeh.antennapod.feed.FeedManager; -import de.danoeh.antennapod.feed.MediaType; -import de.danoeh.antennapod.storage.DownloadRequester; -import de.danoeh.antennapod.util.Converter; -import de.danoeh.antennapod.util.ThemeUtils; - -public class FeedItemlistAdapter extends AbstractFeedItemlistAdapter { - - private Context context; - - private ActionButtonCallback callback; - private boolean showFeedtitle; - private int selectedItemIndex; - - public static final int SELECTION_NONE = -1; - - public FeedItemlistAdapter(Context context, - AbstractFeedItemlistAdapter.ItemAccess itemAccess, - ActionButtonCallback callback, boolean showFeedtitle) { - super(itemAccess); - this.context = context; - this.callback = callback; - this.showFeedtitle = showFeedtitle; - this.selectedItemIndex = SELECTION_NONE; - } - - @Override - public View getView(final int position, View convertView, ViewGroup parent) { - Holder holder; - final FeedItem item = getItem(position); - - if (convertView == null) { - holder = new Holder(); - LayoutInflater inflater = (LayoutInflater) context - .getSystemService(Context.LAYOUT_INFLATER_SERVICE); - convertView = inflater.inflate(R.layout.feeditemlist_item, null); - holder.title = (TextView) convertView - .findViewById(R.id.txtvItemname); - holder.lenSize = (TextView) convertView - .findViewById(R.id.txtvLenSize); - holder.butAction = (ImageButton) convertView - .findViewById(R.id.butAction); - holder.published = (TextView) convertView - .findViewById(R.id.txtvPublished); - holder.inPlaylist = (ImageView) convertView - .findViewById(R.id.imgvInPlaylist); - holder.downloaded = (ImageView) convertView - .findViewById(R.id.imgvDownloaded); - holder.type = (ImageView) convertView.findViewById(R.id.imgvType); - holder.downloading = (ImageView) convertView - .findViewById(R.id.imgvDownloading); - if (showFeedtitle) { - holder.feedtitle = (TextView) convertView - .findViewById(R.id.txtvFeedname); - } - holder.statusPlaying = (View) convertView - .findViewById(R.id.statusPlaying); - holder.statusUnread = (View) convertView - .findViewById(R.id.statusUnread); - holder.statusInProgress = (TextView) convertView - .findViewById(R.id.statusInProgress); - - convertView.setTag(holder); - } else { - holder = (Holder) convertView.getTag(); - } - if (!(getItemViewType(position) == Adapter.IGNORE_ITEM_VIEW_TYPE)) { - convertView.setVisibility(View.VISIBLE); - if (position == selectedItemIndex) { - convertView.setBackgroundColor(convertView.getResources() - .getColor(ThemeUtils.getSelectionBackgroundColor())); - } else { - convertView.setBackgroundResource(0); - } - - holder.title.setText(item.getTitle()); - if (showFeedtitle) { - holder.feedtitle.setVisibility(View.VISIBLE); - holder.feedtitle.setText(item.getFeed().getTitle()); - } - - FeedItem.State state = item.getState(); - switch (state) { - case PLAYING: - holder.statusPlaying.setVisibility(View.VISIBLE); - holder.statusUnread.setVisibility(View.GONE); - holder.statusInProgress.setVisibility(View.GONE); - break; - case IN_PROGRESS: - holder.statusPlaying.setVisibility(View.GONE); - holder.statusUnread.setVisibility(View.GONE); - holder.statusInProgress.setVisibility(View.VISIBLE); - holder.statusInProgress.setText(Converter - .getDurationStringLong(item.getMedia().getPosition())); - break; - case NEW: - holder.statusPlaying.setVisibility(View.GONE); - holder.statusUnread.setVisibility(View.VISIBLE); - holder.statusInProgress.setVisibility(View.GONE); - break; - default: - holder.statusPlaying.setVisibility(View.GONE); - holder.statusUnread.setVisibility(View.GONE); - holder.statusInProgress.setVisibility(View.GONE); - break; - } - - holder.published.setText(convertView.getResources().getString( - R.string.published_prefix) - + DateUtils.formatSameDayTime(item.getPubDate().getTime(), - System.currentTimeMillis(), DateFormat.MEDIUM, - DateFormat.SHORT)); - - if (item.getMedia() == null) { - holder.downloaded.setVisibility(View.GONE); - holder.downloading.setVisibility(View.GONE); - holder.inPlaylist.setVisibility(View.GONE); - holder.type.setVisibility(View.GONE); - holder.lenSize.setVisibility(View.GONE); - } else { - holder.lenSize.setVisibility(View.VISIBLE); - if (FeedManager.getInstance().isInQueue(item)) { - holder.inPlaylist.setVisibility(View.VISIBLE); - } else { - holder.inPlaylist.setVisibility(View.GONE); - } - if (item.getMedia().isDownloaded()) { - holder.lenSize.setText(convertView.getResources() - .getString(R.string.length_prefix) - + Converter.getDurationStringLong(item.getMedia() - .getDuration())); - holder.downloaded.setVisibility(View.VISIBLE); - } else { - holder.lenSize - .setText(convertView.getResources().getString( - R.string.size_prefix) - + Converter.byteToString(item.getMedia() - .getSize())); - holder.downloaded.setVisibility(View.GONE); - } - - if (DownloadRequester.getInstance().isDownloadingFile( - item.getMedia())) { - holder.downloading.setVisibility(View.VISIBLE); - } else { - holder.downloading.setVisibility(View.GONE); - } - - TypedArray typeDrawables = context.obtainStyledAttributes( - new int[] { R.attr.type_audio, R.attr.type_video }); - MediaType mediaType = item.getMedia().getMediaType(); - if (mediaType == MediaType.AUDIO) { - holder.type.setImageDrawable(typeDrawables.getDrawable(0)); - holder.type.setVisibility(View.VISIBLE); - } else if (mediaType == MediaType.VIDEO) { - holder.type.setImageDrawable(typeDrawables.getDrawable(1)); - holder.type.setVisibility(View.VISIBLE); - } else { - holder.type.setImageBitmap(null); - holder.type.setVisibility(View.GONE); - } - } - - holder.butAction.setFocusable(false); - holder.butAction.setOnClickListener(new OnClickListener() { - - @Override - public void onClick(View v) { - callback.onActionButtonPressed(item); - } - }); - - } else { - convertView.setVisibility(View.GONE); - } - return convertView; - - } - - static class Holder { - TextView title; - TextView feedtitle; - TextView published; - TextView lenSize; - ImageView inPlaylist; - ImageView downloaded; - ImageView type; - ImageView downloading; - ImageButton butAction; - View statusUnread; - View statusPlaying; - TextView statusInProgress; - } - - public int getSelectedItemIndex() { - return selectedItemIndex; - } - - public void setSelectedItemIndex(int selectedItemIndex) { - this.selectedItemIndex = selectedItemIndex; - notifyDataSetChanged(); - } - -} diff --git a/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java new file mode 100644 index 000000000..c8d41b10e --- /dev/null +++ b/src/de/danoeh/antennapod/adapter/InternalFeedItemlistAdapter.java @@ -0,0 +1,215 @@ +package de.danoeh.antennapod.adapter; + +import java.text.DateFormat; + +import android.content.Context; +import android.content.res.TypedArray; +import android.text.format.DateUtils; +import android.view.LayoutInflater; +import android.view.View; +import android.view.View.OnClickListener; +import android.view.ViewGroup; +import android.widget.Adapter; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.TextView; +import de.danoeh.antennapod.R; +import de.danoeh.antennapod.feed.FeedItem; +import de.danoeh.antennapod.feed.FeedManager; +import de.danoeh.antennapod.feed.MediaType; +import de.danoeh.antennapod.storage.DownloadRequester; +import de.danoeh.antennapod.util.Converter; +import de.danoeh.antennapod.util.ThemeUtils; + +/** List adapter for items of feeds that the user has already subscribed to. */ +public class InternalFeedItemlistAdapter extends DefaultFeedItemlistAdapter { + + private ActionButtonCallback callback; + private boolean showFeedtitle; + private int selectedItemIndex; + + public static final int SELECTION_NONE = -1; + + public InternalFeedItemlistAdapter(Context context, + DefaultFeedItemlistAdapter.ItemAccess itemAccess, + ActionButtonCallback callback, boolean showFeedtitle) { + super(context, itemAccess); + this.callback = callback; + this.showFeedtitle = showFeedtitle; + this.selectedItemIndex = SELECTION_NONE; + } + + @Override + public View getView(final int position, View convertView, ViewGroup parent) { + Holder holder; + final FeedItem item = getItem(position); + + if (convertView == null) { + holder = new Holder(); + LayoutInflater inflater = (LayoutInflater) getContext() + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + convertView = inflater.inflate(R.layout.feeditemlist_item, null); + holder.title = (TextView) convertView + .findViewById(R.id.txtvItemname); + holder.lenSize = (TextView) convertView + .findViewById(R.id.txtvLenSize); + holder.butAction = (ImageButton) convertView + .findViewById(R.id.butAction); + holder.published = (TextView) convertView + .findViewById(R.id.txtvPublished); + holder.inPlaylist = (ImageView) convertView + .findViewById(R.id.imgvInPlaylist); + holder.downloaded = (ImageView) convertView + .findViewById(R.id.imgvDownloaded); + holder.type = (ImageView) convertView.findViewById(R.id.imgvType); + holder.downloading = (ImageView) convertView + .findViewById(R.id.imgvDownloading); + if (showFeedtitle) { + holder.feedtitle = (TextView) convertView + .findViewById(R.id.txtvFeedname); + } + holder.statusPlaying = (View) convertView + .findViewById(R.id.statusPlaying); + holder.statusUnread = (View) convertView + .findViewById(R.id.statusUnread); + holder.statusInProgress = (TextView) convertView + .findViewById(R.id.statusInProgress); + + convertView.setTag(holder); + } else { + holder = (Holder) convertView.getTag(); + } + if (!(getItemViewType(position) == Adapter.IGNORE_ITEM_VIEW_TYPE)) { + convertView.setVisibility(View.VISIBLE); + if (position == selectedItemIndex) { + convertView.setBackgroundColor(convertView.getResources() + .getColor(ThemeUtils.getSelectionBackgroundColor())); + } else { + convertView.setBackgroundResource(0); + } + + holder.title.setText(item.getTitle()); + if (showFeedtitle) { + holder.feedtitle.setVisibility(View.VISIBLE); + holder.feedtitle.setText(item.getFeed().getTitle()); + } + + FeedItem.State state = item.getState(); + switch (state) { + case PLAYING: + holder.statusPlaying.setVisibility(View.VISIBLE); + holder.statusUnread.setVisibility(View.GONE); + holder.statusInProgress.setVisibility(View.GONE); + break; + case IN_PROGRESS: + holder.statusPlaying.setVisibility(View.GONE); + holder.statusUnread.setVisibility(View.GONE); + holder.statusInProgress.setVisibility(View.VISIBLE); + holder.statusInProgress.setText(Converter + .getDurationStringLong(item.getMedia().getPosition())); + break; + case NEW: + holder.statusPlaying.setVisibility(View.GONE); + holder.statusUnread.setVisibility(View.VISIBLE); + holder.statusInProgress.setVisibility(View.GONE); + break; + default: + holder.statusPlaying.setVisibility(View.GONE); + holder.statusUnread.setVisibility(View.GONE); + holder.statusInProgress.setVisibility(View.GONE); + break; + } + + holder.published.setText(convertView.getResources().getString( + R.string.published_prefix) + + DateUtils.formatSameDayTime(item.getPubDate().getTime(), + System.currentTimeMillis(), DateFormat.MEDIUM, + DateFormat.SHORT)); + + if (item.getMedia() == null) { + holder.downloaded.setVisibility(View.GONE); + holder.downloading.setVisibility(View.GONE); + holder.inPlaylist.setVisibility(View.GONE); + holder.type.setVisibility(View.GONE); + holder.lenSize.setVisibility(View.GONE); + } else { + holder.lenSize.setVisibility(View.VISIBLE); + if (FeedManager.getInstance().isInQueue(item)) { + holder.inPlaylist.setVisibility(View.VISIBLE); + } else { + holder.inPlaylist.setVisibility(View.GONE); + } + if (item.getMedia().isDownloaded()) { + holder.lenSize.setText(convertView.getResources() + .getString(R.string.length_prefix) + + Converter.getDurationStringLong(item.getMedia() + .getDuration())); + holder.downloaded.setVisibility(View.VISIBLE); + } else { + holder.lenSize + .setText(convertView.getResources().getString( + R.string.size_prefix) + + Converter.byteToString(item.getMedia() + .getSize())); + holder.downloaded.setVisibility(View.GONE); + } + + if (DownloadRequester.getInstance().isDownloadingFile( + item.getMedia())) { + holder.downloading.setVisibility(View.VISIBLE); + } else { + holder.downloading.setVisibility(View.GONE); + } + + TypedArray typeDrawables = getContext().obtainStyledAttributes( + new int[] { R.attr.type_audio, R.attr.type_video }); + MediaType mediaType = item.getMedia().getMediaType(); + if (mediaType == MediaType.AUDIO) { + holder.type.setImageDrawable(typeDrawables.getDrawable(0)); + holder.type.setVisibility(View.VISIBLE); + } else if (mediaType == MediaType.VIDEO) { + holder.type.setImageDrawable(typeDrawables.getDrawable(1)); + holder.type.setVisibility(View.VISIBLE); + } else { + holder.type.setImageBitmap(null); + holder.type.setVisibility(View.GONE); + } + } + + holder.butAction.setFocusable(false); + holder.butAction.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + callback.onActionButtonPressed(item); + } + }); + + } else { + convertView.setVisibility(View.GONE); + } + return convertView; + + } + + static class Holder extends DefaultFeedItemlistAdapter.Holder { + TextView feedtitle; + ImageView inPlaylist; + ImageView downloaded; + ImageView downloading; + ImageButton butAction; + View statusUnread; + View statusPlaying; + TextView statusInProgress; + } + + public int getSelectedItemIndex() { + return selectedItemIndex; + } + + public void setSelectedItemIndex(int selectedItemIndex) { + this.selectedItemIndex = selectedItemIndex; + notifyDataSetChanged(); + } + +} diff --git a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java index 9e9389838..484a1f9f6 100644 --- a/src/de/danoeh/antennapod/fragment/ItemlistFragment.java +++ b/src/de/danoeh/antennapod/fragment/ItemlistFragment.java @@ -17,9 +17,9 @@ import com.actionbarsherlock.app.SherlockListFragment; import de.danoeh.antennapod.AppConfig; import de.danoeh.antennapod.R; import de.danoeh.antennapod.activity.ItemviewActivity; -import de.danoeh.antennapod.adapter.AbstractFeedItemlistAdapter; +import de.danoeh.antennapod.adapter.DefaultFeedItemlistAdapter; import de.danoeh.antennapod.adapter.ActionButtonCallback; -import de.danoeh.antennapod.adapter.FeedItemlistAdapter; +import de.danoeh.antennapod.adapter.InternalFeedItemlistAdapter; import de.danoeh.antennapod.dialog.DownloadRequestErrorDialogCreator; import de.danoeh.antennapod.feed.EventDistributor; import de.danoeh.antennapod.feed.Feed; @@ -42,11 +42,11 @@ public class ItemlistFragment extends SherlockListFragment { public static final String EXTRA_SELECTED_FEEDITEM = "extra.de.danoeh.antennapod.activity.selected_feeditem"; public static final String ARGUMENT_FEED_ID = "argument.de.danoeh.antennapod.feed_id"; - protected AbstractFeedItemlistAdapter fila; + protected InternalFeedItemlistAdapter fila; protected FeedManager manager = FeedManager.getInstance(); protected DownloadRequester requester = DownloadRequester.getInstance(); - private AbstractFeedItemlistAdapter.ItemAccess itemAccess; + private DefaultFeedItemlistAdapter.ItemAccess itemAccess; private Feed feed; @@ -56,7 +56,7 @@ public class ItemlistFragment extends SherlockListFragment { /** Argument for FeeditemlistAdapter */ protected boolean showFeedtitle; - public ItemlistFragment(AbstractFeedItemlistAdapter.ItemAccess itemAccess, + public ItemlistFragment(DefaultFeedItemlistAdapter.ItemAccess itemAccess, boolean showFeedtitle) { super(); this.itemAccess = itemAccess; @@ -96,7 +96,7 @@ public class ItemlistFragment extends SherlockListFragment { long feedId = getArguments().getLong(ARGUMENT_FEED_ID); final Feed feed = FeedManager.getInstance().getFeed(feedId); this.feed = feed; - itemAccess = new AbstractFeedItemlistAdapter.ItemAccess() { + itemAccess = new DefaultFeedItemlistAdapter.ItemAccess() { @Override public FeedItem getItem(int position) { @@ -111,8 +111,8 @@ public class ItemlistFragment extends SherlockListFragment { } } - protected AbstractFeedItemlistAdapter createListAdapter() { - return new FeedItemlistAdapter(getActivity(), itemAccess, + protected InternalFeedItemlistAdapter createListAdapter() { + return new InternalFeedItemlistAdapter(getActivity(), itemAccess, adapterCallback, showFeedtitle); } @@ -253,7 +253,7 @@ public class ItemlistFragment extends SherlockListFragment { return handled; } - public AbstractFeedItemlistAdapter getListAdapter() { + public InternalFeedItemlistAdapter getListAdapter() { return fila; } diff --git a/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java b/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java index 5c4750acd..637b6121b 100644 --- a/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java +++ b/src/de/danoeh/antennapod/fragment/PlaybackHistoryFragment.java @@ -3,7 +3,8 @@ package de.danoeh.antennapod.fragment; import android.os.Bundle; import android.util.Log; import de.danoeh.antennapod.AppConfig; -import de.danoeh.antennapod.adapter.AbstractFeedItemlistAdapter; +import de.danoeh.antennapod.adapter.DefaultFeedItemlistAdapter; +import de.danoeh.antennapod.adapter.InternalFeedItemlistAdapter; import de.danoeh.antennapod.feed.EventDistributor; import de.danoeh.antennapod.feed.FeedItem; import de.danoeh.antennapod.feed.FeedManager; @@ -12,7 +13,7 @@ public class PlaybackHistoryFragment extends ItemlistFragment { private static final String TAG = "PlaybackHistoryFragment"; public PlaybackHistoryFragment() { - super(new AbstractFeedItemlistAdapter.ItemAccess() { + super(new DefaultFeedItemlistAdapter.ItemAccess() { @Override public FeedItem getItem(int position) { @@ -40,7 +41,7 @@ public class PlaybackHistoryFragment extends ItemlistFragment { } private EventDistributor.EventListener historyUpdate = new EventDistributor.EventListener() { - + @Override public void update(EventDistributor eventDistributor, Integer arg) { if ((EventDistributor.PLAYBACK_HISTORY_UPDATE & arg) != 0) { @@ -48,7 +49,7 @@ public class PlaybackHistoryFragment extends ItemlistFragment { Log.d(TAG, "Received content update"); fila.notifyDataSetChanged(); } - + } }; -- cgit v1.2.3