summaryrefslogtreecommitdiff
path: root/vdrmanager/src
diff options
context:
space:
mode:
Diffstat (limited to 'vdrmanager/src')
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/app/Intents.java2
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java12
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java9
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java24
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java9
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java18
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java13
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java10
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java6
-rw-r--r--vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java9
10 files changed, 76 insertions, 36 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/app/Intents.java b/vdrmanager/src/de/bjusystems/vdrmanager/app/Intents.java
index f5740e1..72feb99 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/app/Intents.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/app/Intents.java
@@ -14,4 +14,6 @@ public interface Intents {
public static final String EMPTY_CONFIG = "EMPTY_CONFIG";
+ public static final String CURRENT_EPG = "CURRENT_EPG";
+
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java
index 0d23964..17edd42 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventAdapter.java
@@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import android.content.Context;
+import android.text.TextUtils;
import android.util.Pair;
import android.view.LayoutInflater;
import android.view.View;
@@ -215,13 +216,14 @@ abstract class BaseEventAdapter<T extends EventListItem> extends
itemHolder.title.setText(title);
itemHolder.shortText.setText(shortText);
- if (hideDescription == false) {
+ if (TextUtils.isEmpty(formatter.getDescription()) == false
+ && hideDescription == false) {
Pair<Boolean, CharSequence> desc = Utils.highlight2(
formatter.getDescription(), highlight);
- if (desc.first == true) {
- itemHolder.description.setVisibility(View.VISIBLE);
- itemHolder.description.setText(desc.second);
- }
+ itemHolder.description.setVisibility(View.VISIBLE);
+ itemHolder.description.setText(desc.second);
+ } else {
+ itemHolder.description.setVisibility(View.GONE);
}
// TODO better render of duration
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
index 6e943b5..3557630 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/BaseEventListActivity.java
@@ -125,8 +125,9 @@ public abstract class BaseEventListActivity<T extends Event> extends
*
* @param event
*/
- protected void prepareDetailsViewData(final EventListItem event) {
+ protected int prepareDetailsViewData(final EventListItem event, int pos) {
+ return 0;
}
/*
@@ -305,15 +306,15 @@ public abstract class BaseEventListActivity<T extends Event> extends
return;
}
- prepareDetailsViewData(item);
+ int current = prepareDetailsViewData(item, position);
// show details
final Intent intent = new Intent(this, EpgDetailsActivity.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT
- | Intent.FLAG_ACTIVITY_SINGLE_TOP);
+ // | Intent.FLAG_ACTIVITY_SINGLE_TOP);
if (highlight != null) {
intent.putExtra(Intents.HIGHLIGHT, highlight);
}
+ intent.putExtra(Intents.CURRENT_EPG, current);
startActivityForResult(intent,
TimerDetailsActivity.REQUEST_CODE_TIMER_MODIFIED);
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
index 2675722..9a031e1 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgDetailsActivity.java
@@ -139,6 +139,7 @@ public class EpgDetailsActivity extends ICSBaseActivity implements
Intent i = getIntent();
highlight = i.getStringExtra(Intents.HIGHLIGHT);
+ final int preselect = i.getIntExtra(Intents.CURRENT_EPG, 0);
initActionBar();
@@ -189,16 +190,19 @@ public class EpgDetailsActivity extends ICSBaseActivity implements
return (Void) null;
}
- for (Event e : epgs) {
- if (epg.equals(e)) {
- break;
- }
- counter++;
- }
-
- if (counter == epgs.size()) {// not found?
- epgs.add(0, cEvent);
- counter = 0;
+ // for (Event e : epgs) {
+ // if (epg.equals(e)) {
+ // break;
+ //}
+ //counter++;
+ //}
+
+ //if (counter == epgs.size()) {// not found?
+ //epgs.add(0, cEvent);
+ //counter = 0;
+ //}
+ if(preselect < epgs.size()){
+ counter = preselect;
}
return (Void) null;
}
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java
index b0122aa..1662903 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EpgSearchListActivity.java
@@ -206,10 +206,17 @@ public class EpgSearchListActivity extends BaseTimerEditActivity<Epg> implements
}
@Override
- protected void prepareDetailsViewData(final EventListItem item) {
+ protected int prepareDetailsViewData(final EventListItem item, int position) {
final VdrManagerApp app = (VdrManagerApp) getApplication();
app.setCurrentEvent(item.getEvent());
app.setCurrentEpgList(CACHE);
+ for(int i = 0; i < position; ++i){
+ if(CACHE.get(i) == item.getEvent()){
+ return i;
+ }
+ }
+
+ return 0;
}
@Override
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java
index 1d4a385..c9281ae 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/EventEpgListActivity.java
@@ -38,7 +38,7 @@ import de.bjusystems.vdrmanager.utils.svdrp.SvdrpEvent;
/**
* This class is used for showing what's current running on all channels
- *
+ *
* @author bju
*/
public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
@@ -282,7 +282,7 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
private static final ArrayList<Epg> EMPTY = new ArrayList<Epg>(0);
private ArrayList<Epg> getCache() {
- if(currentChannel == null){
+ if (currentChannel == null) {
return EMPTY;
}
final ArrayList<Epg> arrayList = EpgCache.CACHE.get(currentChannel
@@ -326,7 +326,7 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
/*
* (non-Javadoc) TODO this method also should be used in startEpgQuery on
* cache hit
- *
+ *
* @see de.bjusystems.vdrmanager.gui.BaseEpgListActivity#finishedSuccess()
*/
@Override
@@ -395,10 +395,18 @@ public class EventEpgListActivity extends BaseTimerEditActivity<Epg> implements
}
@Override
- protected void prepareDetailsViewData(final EventListItem item) {
+ protected int prepareDetailsViewData(final EventListItem item, int position) {
final VdrManagerApp app = (VdrManagerApp) getApplication();
app.setCurrentEvent(item.getEvent());
- app.setCurrentEpgList(getCache());
+ ArrayList<Epg> cache = getCache();
+ app.setCurrentEpgList(cache);
+ for (int i = 0; i < position; ++i) {
+ if (cache.get(i) == item.getEvent()) {
+ return i;
+ }
+ }
+
+ return 0;
}
@Override
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java
index b8c248d..a03b09c 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java
@@ -205,9 +205,18 @@ public class RecordingListActivity extends BaseEventListActivity<Recording>
}
@Override
- protected void prepareDetailsViewData(final EventListItem event) {
+ protected int prepareDetailsViewData(final EventListItem event, int position) {
getApp().setCurrentEvent(event.getEvent());
- getApp().setCurrentEpgList(CACHEget(currentFolder));
+ List<Recording> cachEget = CACHEget(currentFolder);
+ getApp().setCurrentEpgList(cachEget);
+
+ for(int i = 0; i < position; ++i){
+ if(cachEget.get(i) == event.getEvent()){
+ return i;
+ }
+ }
+
+ return 0;
}
@Override
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java
index ed323d0..7d5b89d 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEpgListActivity.java
@@ -337,12 +337,18 @@ OnItemClickListener, OnItemSelectedListener, OnTimeSetListener {
}
@Override
- protected void prepareDetailsViewData(final EventListItem item) {
+ protected int prepareDetailsViewData(final EventListItem item, int position) {
final VdrManagerApp app = (VdrManagerApp) getApplication();
-
// remember event for details view and timer things
app.setCurrentEvent(item.getEvent());
app.setCurrentEpgList(CACHE);
+ for(int i = 0; i < position; ++i){
+ if(CACHE.get(i) == item.getEvent()){
+ return i;
+ }
+ }
+
+ return 0;
}
@Override
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java
index e377137..53bc690 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimeEventAdapter.java
@@ -1,12 +1,10 @@
package de.bjusystems.vdrmanager.gui;
import android.content.Context;
-import android.view.View;
import de.bjusystems.vdrmanager.R;
import de.bjusystems.vdrmanager.data.Event;
import de.bjusystems.vdrmanager.data.EventFormatter;
import de.bjusystems.vdrmanager.data.EventListItem;
-import de.bjusystems.vdrmanager.data.Timer;
public class TimeEventAdapter extends BaseEventAdapter<EventListItem> {
@@ -14,10 +12,6 @@ public class TimeEventAdapter extends BaseEventAdapter<EventListItem> {
super(context, R.layout.epg_event_item);
}
- public void sortItems() {
- // sortItemsByChannel();
- }
-
@Override
protected EventFormatter getEventFormatter(Event event) {
return new EventFormatter(event, true);
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java
index fb1a1c6..57882ad 100644
--- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java
+++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/TimerListActivity.java
@@ -113,11 +113,18 @@ OnItemClickListener {
* .vdrmanager.data.EventListItem)
*/
@Override
- protected void prepareDetailsViewData(final EventListItem item) {
+ protected int prepareDetailsViewData(final EventListItem item, int position) {
final VdrManagerApp app = (VdrManagerApp) getApplication();
// remember event for details view and timer things
app.setCurrentEvent(item.getEvent());
app.setCurrentEpgList(CACHE);
+ for(int i = 0; i < position; ++i){
+ if(CACHE.get(i) == item.getEvent()){
+ return i;
+ }
+ }
+
+ return 0;
}
protected Comparator<Timer> getTimeComparator(final boolean reverse) {