summaryrefslogtreecommitdiff
path: root/src/de/podfetcher/fragment
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2012-06-16 17:18:37 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2012-06-16 17:18:37 +0200
commitf9b0d1d318ed7e96fbc71dab8197937e02c0302c (patch)
treed6f5ccf7776230b39ced2029f2052338c2e8874b /src/de/podfetcher/fragment
parentd539786af67f07044b31febb369abe69dbf8e486 (diff)
downloadAntennaPod-f9b0d1d318ed7e96fbc71dab8197937e02c0302c.zip
Moved Feeditemlist into Fragment
Diffstat (limited to 'src/de/podfetcher/fragment')
-rw-r--r--src/de/podfetcher/fragment/FeedItemlistFragment.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/de/podfetcher/fragment/FeedItemlistFragment.java b/src/de/podfetcher/fragment/FeedItemlistFragment.java
new file mode 100644
index 000000000..3081a95c5
--- /dev/null
+++ b/src/de/podfetcher/fragment/FeedItemlistFragment.java
@@ -0,0 +1,56 @@
+package de.podfetcher.fragment;
+
+import java.util.ArrayList;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.ListView;
+
+import com.actionbarsherlock.app.SherlockListFragment;
+
+import de.podfetcher.activity.ItemviewActivity;
+import de.podfetcher.adapter.FeedItemlistAdapter;
+import de.podfetcher.feed.FeedItem;
+import de.podfetcher.feed.FeedManager;
+
+public class FeedItemlistFragment extends SherlockListFragment {
+ private static final String TAG = "FeedItemlistFragment";
+ public static final String EXTRA_SELECTED_FEEDITEM = "extra.de.podfetcher.activity.selected_feeditem";
+
+ private FeedItemlistAdapter fila;
+ private FeedManager manager;
+
+ /** The feed which the activity displays */
+ private ArrayList<FeedItem> items;
+
+ public FeedItemlistFragment(ArrayList<FeedItem> items) {
+ super();
+ this.items = items;
+ manager = FeedManager.getInstance();
+ }
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ fila = new FeedItemlistAdapter(getActivity(), 0, items);
+ setListAdapter(fila);
+
+
+ }
+
+ @Override
+ public void onListItemClick(ListView l, View v, int position, long id) {
+ FeedItem selection = fila.getItem(position);
+ Intent showItem = new Intent(getActivity(), ItemviewActivity.class);
+ showItem.putExtra(FeedlistFragment.EXTRA_SELECTED_FEED, selection.getFeed().getId());
+ showItem.putExtra(EXTRA_SELECTED_FEEDITEM, selection.getId());
+
+ startActivity(showItem);
+ }
+
+ public void onButActionClicked(View v) {
+ Log.d(TAG, "Button clicked");
+ }
+}