diff options
author | lado <herrlado@gmail.com> | 2011-10-06 02:42:35 +0200 |
---|---|---|
committer | lado <herrlado@gmail.com> | 2011-10-06 02:42:35 +0200 |
commit | 2d0486330d8d8a87ecdc228dd0e01626c541dbe3 (patch) | |
tree | 7d8316d323d24dc7fd7bb79d2fef00a6513c798d /vdrmanager/src/de | |
parent | fb30d4e62153b45c38d756521123d3c64548990d (diff) | |
download | vdr-manager-2d0486330d8d8a87ecdc228dd0e01626c541dbe3.tar.gz vdr-manager-2d0486330d8d8a87ecdc228dd0e01626c541dbe3.tar.bz2 |
print daily header and init stop with star-1 minutes
Diffstat (limited to 'vdrmanager/src/de')
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java | 2 | ||||
-rw-r--r-- | vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java index c3e418f..b0722f7 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/data/Recording.java @@ -9,7 +9,7 @@ public class Recording extends BaseEvent{ super(null); final String[] words = line.split(":"); start = new Date(Long.parseLong(words[0])*1000); - stop = new Date(Long.parseLong(words[0] + 1000 * 60 * 60 * 2)*1000); + stop = new Date(start.getTime() - 1000 * 1 * 60); channelName = words[2]; title = words[3]; shortText = words[4]; diff --git a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java index d1a2169..1d1f288 100644 --- a/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java +++ b/vdrmanager/src/de/bjusystems/vdrmanager/gui/RecordingListActivity.java @@ -1,5 +1,7 @@ package de.bjusystems.vdrmanager.gui; +import java.util.Calendar; + import android.content.Intent; import android.os.Bundle; import android.view.ContextMenu; @@ -13,11 +15,13 @@ import android.widget.ListView; import android.widget.Toast; import de.bjusystems.vdrmanager.R; import de.bjusystems.vdrmanager.app.VdrManagerApp; +import de.bjusystems.vdrmanager.data.Epg; import de.bjusystems.vdrmanager.data.EventFormatter; import de.bjusystems.vdrmanager.data.EventListItem; import de.bjusystems.vdrmanager.data.Recording; import de.bjusystems.vdrmanager.data.Timer; import de.bjusystems.vdrmanager.tasks.DeleteTimerTask; +import de.bjusystems.vdrmanager.utils.date.DateFormatter; import de.bjusystems.vdrmanager.utils.svdrp.RecordingClient; import de.bjusystems.vdrmanager.utils.svdrp.SvdrpAsyncListener; import de.bjusystems.vdrmanager.utils.svdrp.SvdrpAsyncTask; @@ -48,7 +52,7 @@ public class RecordingListActivity extends BaseActivity implements setContentView(getMainLayout()); // create an adapter - adapter = new TimeEventAdapter(this); + adapter = new RecordingAdapter(this); // attach adapter to ListView final ListView listView = (ListView) findViewById(R.id.recording_list); @@ -187,7 +191,16 @@ public class RecordingListActivity extends BaseActivity implements break; case FINISHED_SUCCESS: adapter.clear(); + Calendar cal = Calendar.getInstance(); + int day = -1; for (final Recording rec : recordingClient.getResults()) { + cal.setTime(rec.getStart()); + int eday = cal.get(Calendar.DAY_OF_YEAR); + if (eday != day) { + day = eday; + adapter.add(new EventListItem(new DateFormatter(cal) + .getDailyHeader())); + } adapter.add(new EventListItem(rec)); } // adapter.sortItems(); |