Added GUI sketches, fixed a bug in the FeedManager

This commit is contained in:
Daniel Oeh 2012-05-28 16:38:51 +02:00
parent 0cecd82550
commit 2df0fb4774
4 changed files with 11 additions and 5 deletions

3
.gitignore vendored
View File

@ -21,3 +21,6 @@ local.properties
# Eclipse project files # Eclipse project files
.classpath .classpath
.project .project
# other
*.odg#

View File

@ -227,7 +227,9 @@ public class FeedManager {
item.setLink(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_LINK))); item.setLink(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_LINK)));
item.setDescription(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_DESCRIPTION))); item.setDescription(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_DESCRIPTION)));
item.setPubDate(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_PUBDATE))); item.setPubDate(itemlistCursor.getString(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_PUBDATE)));
item.setMedia(adapter.getFeedMedia(itemlistCursor.getLong(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_MEDIA)))); item.setMedia(adapter.getFeedMedia(
itemlistCursor.getLong(
itemlistCursor.getColumnIndex(PodDBAdapter.KEY_MEDIA)), item));
item.setRead((itemlistCursor.getInt(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_READ)) > 0) ? true : false); item.setRead((itemlistCursor.getInt(itemlistCursor.getColumnIndex(PodDBAdapter.KEY_READ)) > 0) ? true : false);
items.add(item); items.add(item);

View File

@ -5,8 +5,7 @@ public class FeedMedia extends FeedFile{
private long position; private long position;
private long size; // File size in Byte private long size; // File size in Byte
private String mime_type; private String mime_type;
private FeedItem item;
private FeedItem item; // TODO remove
public FeedMedia(FeedItem i, String download_url, long size, String mime_type) { public FeedMedia(FeedItem i, String download_url, long size, String mime_type) {
this.item = i; this.item = i;
@ -15,10 +14,11 @@ public class FeedMedia extends FeedFile{
this.mime_type = mime_type; this.mime_type = mime_type;
} }
public FeedMedia(long id, long length, long position, long size, String mime_type, public FeedMedia(long id, FeedItem item, long length, long position, long size, String mime_type,
String file_url, String download_url) { String file_url, String download_url) {
super(); super();
this.id = id; this.id = id;
this.item = item;
this.length = length; this.length = length;
this.position = position; this.position = position;
this.size = size; this.size = size;

View File

@ -269,7 +269,7 @@ public class PodDBAdapter {
return c; return c;
} }
public FeedMedia getFeedMedia(long row_index) throws SQLException{ public FeedMedia getFeedMedia(long row_index, FeedItem owner) throws SQLException{
open(); open();
Cursor cursor = db.query(TABLE_NAME_FEED_MEDIA, null, KEY_ID + "=?", Cursor cursor = db.query(TABLE_NAME_FEED_MEDIA, null, KEY_ID + "=?",
new String[]{String.valueOf(row_index)}, null, null, null); new String[]{String.valueOf(row_index)}, null, null, null);
@ -278,6 +278,7 @@ public class PodDBAdapter {
throw new SQLException("No FeedMedia found at index: " + row_index); throw new SQLException("No FeedMedia found at index: " + row_index);
} }
FeedMedia media = new FeedMedia(row_index, FeedMedia media = new FeedMedia(row_index,
owner,
cursor.getLong(cursor.getColumnIndex(KEY_LENGTH)), cursor.getLong(cursor.getColumnIndex(KEY_LENGTH)),
cursor.getLong(cursor.getColumnIndex(KEY_POSITION)), cursor.getLong(cursor.getColumnIndex(KEY_POSITION)),
cursor.getLong(cursor.getColumnIndex(KEY_SIZE)), cursor.getLong(cursor.getColumnIndex(KEY_SIZE)),