diff options
author | lado <herrlado@gmail.com> | 2011-10-20 14:53:01 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-20 14:53:01 +0200 |
commit | dc54116f8e2cd76c9d6ea3373fe75f64e61dc2e9 (patch) | |
tree | a0d83bcd477d28a28e74f78e76f567655cb7efa9 /vdrmanager/src/de | |
parent | 3b7807d4f061c6711c22b52be7ef34bc4f210b74 (diff) | |
download | vdr-manager-dc54116f8e2cd76c9d6ea3373fe75f64e61dc2e9.tar.gz vdr-manager-dc54116f8e2cd76c9d6ea3373fe75f64e61dc2e9.tar.bz2 |
bug fix with share in list views
Diffstat (limited to 'vdrmanager/src/de')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java | 40 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java | 3 |
2 files changed, 23 insertions, 20 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java index f240aa3..e8dd66b 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java @@ -38,12 +38,13 @@ import de.bjusystems.vdrmanager.utils.svdrp.SvdrpException; * */ public abstract class BaseEventListActivity<T extends Event> extends - BaseActivity implements OnItemClickListener,SvdrpAsyncListener<T>, + BaseActivity implements OnItemClickListener, SvdrpAsyncListener<T>, SimpleGestureListener { public static final int MENU_GROUP_SHARE = 90; - + public static final int MENU_SHARE = 90; + private SimpleGestureFilter detector; protected EpgClient epgClient; @@ -66,7 +67,6 @@ public abstract class BaseEventListActivity<T extends Event> extends protected List<Event> results = new ArrayList<Event>(); - @Override protected void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -82,8 +82,6 @@ public abstract class BaseEventListActivity<T extends Event> extends .getParcelableExtra(Intents.CURRENT_CHANNEL); } - - /* * (non-Javadoc) * @@ -104,7 +102,6 @@ public abstract class BaseEventListActivity<T extends Event> extends } - /* * (non-Javadoc) * @@ -117,18 +114,23 @@ public abstract class BaseEventListActivity<T extends Event> extends .getMenuInfo(); final EventListItem event = adapter.getItem(info.position); + int itemId = item.getItemId(); + + switch (itemId) { - switch (item.getItemId()) { case R.id.epg_item_menu_live_tv: { Utils.stream(this, event); break; } - case MENU_REFRESH: + case MENU_SHARE: { Utils.shareEvent(this, event); break; } + default: + return super.onContextItemSelected(item); + } - return true; + return true; } /* @@ -167,18 +169,18 @@ public abstract class BaseEventListActivity<T extends Event> extends final ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); - //if (v.getId() == R.id.whatson_list) { - final AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; + // if (v.getId() == R.id.whatson_list) { + final AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo; - // set menu title - final EventListItem item = adapter.getItem(info.position); - - if (item.isLive()) { - menu.findItem(R.id.epg_item_menu_live_tv).setVisible(true); - } + // set menu title + final EventListItem item = adapter.getItem(info.position); + + if (item.isLive()) { + menu.findItem(R.id.epg_item_menu_live_tv).setVisible(true); + } menu.add(MENU_GROUP_SHARE, MENU_SHARE, 0, R.string.share); - //} + // } } @@ -349,7 +351,6 @@ public abstract class BaseEventListActivity<T extends Event> extends } } - protected void say(int res) { Toast.makeText(this, res, Toast.LENGTH_SHORT).show(); } @@ -358,5 +359,4 @@ public abstract class BaseEventListActivity<T extends Event> extends Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); } - } diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java index 6c5cb66..b194b22 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java @@ -115,6 +115,9 @@ public class RecordingListActivity extends BaseEventListActivity<Recording> say("Sorry, not yet. It would be. File -> "+ rec.getFileName()); break; } + + default: + return super.onContextItemSelected(item); } return true; } |