summaryrefslogtreecommitdiff
path: root/src/de
diff options
context:
space:
mode:
Diffstat (limited to 'src/de')
-rw-r--r--src/de/podfetcher/FeedlistActivity.java18
-rw-r--r--src/de/podfetcher/PodcastApp.java12
-rw-r--r--src/de/podfetcher/PodfetcherActivity.java59
3 files changed, 64 insertions, 25 deletions
diff --git a/src/de/podfetcher/FeedlistActivity.java b/src/de/podfetcher/FeedlistActivity.java
new file mode 100644
index 000000000..2b906a7ca
--- /dev/null
+++ b/src/de/podfetcher/FeedlistActivity.java
@@ -0,0 +1,18 @@
+package de.podfetcher;
+
+import greendroid.app.GDListActivity;
+import android.os.Bundle;
+import android.view.View;
+import greendroid.widget.ActionBarItem.Type;
+
+public class FeedlistActivity extends GDListActivity {
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ addActionBarItem(Type.Add, R.id.action_bar_add);
+ addActionBarItem(Type.Refresh, R.id.action_bar_refresh);
+
+ }
+}
diff --git a/src/de/podfetcher/PodcastApp.java b/src/de/podfetcher/PodcastApp.java
index 59c68f6b8..94227b522 100644
--- a/src/de/podfetcher/PodcastApp.java
+++ b/src/de/podfetcher/PodcastApp.java
@@ -1,9 +1,11 @@
package de.podfetcher;
import de.podfetcher.feed.FeedManager;
+import de.podfetcher.FeedlistActivity;
import android.app.Application;
+import greendroid.app.GDApplication;
-public class PodcastApp extends Application {
+public class PodcastApp extends GDApplication {
private static PodcastApp singleton;
@@ -11,13 +13,17 @@ public class PodcastApp extends Application {
return singleton;
}
+ public Class<?> getHomeActivityClass() {
+ return PodfetcherActivity.class;
+ }
+
@Override
public void onCreate() {
super.onCreate();
singleton = this;
- FeedManager manager = FeedManager.getInstance();
- manager.loadDBData(getApplicationContext());
+ //FeedManager manager = FeedManager.getInstance();
+ //manager.loadDBData(getApplicationContext());
}
diff --git a/src/de/podfetcher/PodfetcherActivity.java b/src/de/podfetcher/PodfetcherActivity.java
index 9cb4f9cfc..199091c0c 100644
--- a/src/de/podfetcher/PodfetcherActivity.java
+++ b/src/de/podfetcher/PodfetcherActivity.java
@@ -6,36 +6,51 @@ import org.xml.sax.SAXException;
import de.podfetcher.feed.*;
import de.podfetcher.storage.DownloadRequester;
-import android.app.Activity;
+import greendroid.app.GDListActivity;
+import greendroid.widget.ItemAdapter;
+import greendroid.widget.item.TextItem;
+import greendroid.widget.item.Item;
+import greendroid.widget.ActionBar;
+import greendroid.widget.ActionBar.Type;
+import greendroid.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
+import android.widget.ListView;
import android.os.Bundle;
+import android.content.Intent;
-public class PodfetcherActivity extends Activity {
- /** Called when the activity is first created. */
+public class PodfetcherActivity extends GDListActivity {
+
+ public PodfetcherActivity() {
+ super(ActionBar.Type.Normal);
+ }
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
-
- final DownloadRequester requester = DownloadRequester.getInstance();
- final FeedHandler handler = new FeedHandler();
- final FeedManager manager = FeedManager.getInstance();
-
- final Button button = (Button)findViewById(R.id.testbutton);
- final EditText edittext = (EditText)findViewById(R.id.textedit);
-
-
+
+
+ // Add navigation menu
+ ItemAdapter adapter = new ItemAdapter(this);
+ adapter.add(createListItem(R.string.feeds_label, FeedlistActivity.class));
+ adapter.add(new TextItem("Settings"));
+
+ setListAdapter(adapter);
+
- button.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- final String s = edittext.getText().toString();
- manager.addFeed(v.getContext(), s);
- edittext.setText("Receiving...");
-
- }
- });
-
}
+
+ private TextItem createListItem(int id, Class<?> _class) {
+ final TextItem item = new TextItem(getString(id));
+ item.setTag(_class);
+ return item;
+ }
+
+ @Override
+ protected void onListItemClick(ListView l, View v, int position, long id) {
+ final TextItem item = (TextItem) l.getAdapter().getItem(position);
+ Intent intent = new Intent(PodfetcherActivity.this, (Class<?>) item.getTag());
+ intent.putExtra(ActionBarActivity.GD_ACTION_BAR_TITLE, item.text);
+ startActivity(intent);
+ }
}