summaryrefslogtreecommitdiff
path: root/vdrmanager
diff options
context:
space:
mode:
authorlado <herrlado@gmail.com>2012-01-20 17:34:57 +0100
committerlado <herrlado@gmail.com>2012-01-20 17:34:57 +0100
commitffa942ddb37fffbcab186c0782bda566ef674f71 (patch)
treefa4fd070cf9adf20778b3df57e95aa30624c3fed /vdrmanager
parent3864dc5d7cd5c6f7dd84c439351bae967125f77a (diff)
downloadvdr-manager-ffa942ddb37fffbcab186c0782bda566ef674f71.tar.gz
vdr-manager-ffa942ddb37fffbcab186c0782bda566ef674f71.tar.bz2
fix npe
Diffstat (limited to 'vdrmanager')
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java4
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java5
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java2
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java7
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java46
5 files changed, 57 insertions, 7 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
index e37caf2..e1b3723 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
@@ -191,6 +191,10 @@ public abstract class BaseEventListActivity<T extends Event> extends
// set menu title
final EventListItem item = adapter.getItem(info.position);
+ if(item.isHeader()){
+ return;
+ }
+
MenuItem mi = menu.findItem(R.id.epg_item_menu_live_tv);
if (item.isLive() && item.getStreamId() != null) {
mi.setVisible(true);
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java
index c435499..dea64c4 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseTimerEditActivity.java
@@ -103,6 +103,11 @@ public abstract class BaseTimerEditActivity<T extends Event> extends
// set menu title
final EventListItem item = adapter.getItem(info.position);
+
+ if(item.isHeader()){
+ return;
+ }
+
final EventFormatter formatter = new EventFormatter(item);
menu.setHeaderTitle(formatter.getTitle());
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java
index 008e249..02c0b65 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelAdapter.java
@@ -117,7 +117,7 @@ class ChannelAdapter extends BaseExpandableListAdapter implements Filterable// ,
return channels.size();
}
- public Object getGroup(int groupPosition) {
+ public String getGroup(int groupPosition) {
return groups.get(groupPosition);
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
index d685df7..f1ddc70 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/ChannelListActivity.java
@@ -225,10 +225,13 @@ public class ChannelListActivity extends
menu.setHeaderTitle(item.getName());
inflater.inflate(R.menu.channel_list_item_menu, menu);
} else if (type == ExpandableListView.PACKED_POSITION_TYPE_GROUP) {
- Channel grp = (Channel) adapter.getGroup(group);
+ /*
+ * http://projects.vdr-developer.org/issues/722
+ String grp = adapter.getGroup(group);
final MenuInflater infl = getMenuInflater();
- menu.setHeaderTitle(grp.getName());
+ menu.setHeaderTitle(grp);
infl.inflate(R.menu.channel_list_group_menu, menu);
+ */
}
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
index cb0f2ae..d39c94f 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
@@ -4,12 +4,14 @@ import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
+import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.SearchManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
+import android.os.Build;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.v4.view.PagerAdapter;
@@ -122,6 +124,37 @@ public class EpgDetailsActivity extends Activity implements OnClickListener,
public void startUpdate(View view) {
}
}
+
+ public void initActionBar() {
+ int api = Build.VERSION.SDK_INT;
+ if (api < 11) {
+ return;
+ }
+
+ ActionBar actionBar = getActionBar();
+ actionBar.setHomeButtonEnabled(true);
+ // actionBar.setDisplayShowHomeEnabled(false);
+ // actionBar.setDisplayShowTitleEnabled(false);
+ // View actionBarView =
+ // getLayoutInflater().inflate(R.layout.action_bar_custom_view, null);
+ // actionBar.setCustomView(actionBarView);
+ // actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+
+ // actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
+ // ArrayAdapter<String> mSpinnerAdapter = new ArrayAdapter<String>(this,
+ // android.R.layout.simple_spinner_dropdown_item);
+ // mSpinnerAdapter.add("A");
+ // actionBar.setListNavigationCallbacks(mSpinnerAdapter, new
+ // OnNavigationListener() {
+
+ // public boolean onNavigationItemSelected(int itemPosition, long
+ // itemId) {
+ // // TODO Auto-generated method stub
+ // return false;
+ // }
+ // });
+
+ }
@Override
protected void onCreate(final Bundle savedInstanceState) {
@@ -132,7 +165,9 @@ public class EpgDetailsActivity extends Activity implements OnClickListener,
Intent i = getIntent();
highlight = i.getStringExtra(Intents.HIGHLIGHT);
-
+
+ initActionBar();
+
// requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
// getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
// R.layout.titlebar);
@@ -140,6 +175,7 @@ public class EpgDetailsActivity extends Activity implements OnClickListener,
// Attach view
setContentView(R.layout.epgdetails);
+
// detector = new SimpleGestureFilter(this, this);
// state = (ImageView) findViewById(R.id.epg_timer_state);
@@ -190,9 +226,11 @@ public class EpgDetailsActivity extends Activity implements OnClickListener,
// TitlePageIndicator indicator = (TitlePageIndicator)
// findViewById(R.id.indicator);
pager.setAdapter(adapter);
- cEvent = epgs.get(counter);
- pager.setCurrentItem(counter);
- current = counter;
+ if(counter < epgs.size()){
+ cEvent = epgs.get(counter);
+ pager.setCurrentItem(counter);
+ current = counter;
+ }
// indicator.setViewPager(pager);
// publishEPG(epg);