Eric Kok
7 years ago
committed by
GitHub
12 changed files with 438 additions and 118 deletions
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
package org.transdroid.daemon.Deluge; |
||||
|
||||
import android.os.Parcel; |
||||
import android.os.Parcelable; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
|
||||
import org.transdroid.core.gui.remoterss.data.RemoteRssChannel; |
||||
import org.transdroid.core.gui.remoterss.data.RemoteRssItem; |
||||
|
||||
/** |
||||
* Deluge implementation of RemoteRssChannel. |
||||
* |
||||
* @author alonalbert |
||||
*/ |
||||
class DelugeRemoteRssChannel extends RemoteRssChannel { |
||||
|
||||
private final String label; |
||||
private final String downloadLocation; |
||||
private final String moveCompleted; |
||||
|
||||
DelugeRemoteRssChannel( |
||||
int id, |
||||
String name, |
||||
String link, |
||||
long lastUpdated, |
||||
String label, String downloadLocation, String moveCompleted, List<RemoteRssItem> items) { |
||||
this.label = label; |
||||
this.downloadLocation = downloadLocation; |
||||
this.moveCompleted = moveCompleted; |
||||
this.id = id; |
||||
this.name = name; |
||||
this.link = link; |
||||
this.lastUpdated = lastUpdated; |
||||
this.items = items; |
||||
} |
||||
|
||||
private DelugeRemoteRssChannel(Parcel in) { |
||||
id = in.readInt(); |
||||
name = in.readString(); |
||||
link = in.readString(); |
||||
lastUpdated = in.readLong(); |
||||
label = in.readString(); |
||||
downloadLocation = in.readString(); |
||||
moveCompleted = in.readString(); |
||||
|
||||
items = new ArrayList<>(); |
||||
in.readList(items, DelugeRemoteRssItem.class.getClassLoader()); |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public void writeToParcel(Parcel dest, int flags) { |
||||
dest.writeInt(id); |
||||
dest.writeString(name); |
||||
dest.writeString(link); |
||||
dest.writeLong(lastUpdated); |
||||
dest.writeString(label); |
||||
dest.writeString(downloadLocation); |
||||
dest.writeString(moveCompleted); |
||||
dest.writeList(items); |
||||
} |
||||
|
||||
public String getLabel() { |
||||
return label; |
||||
} |
||||
|
||||
public String getDownloadLocation() { |
||||
return downloadLocation; |
||||
} |
||||
|
||||
public String getMoveCompleted() { |
||||
return moveCompleted; |
||||
} |
||||
|
||||
public static final Parcelable.Creator<DelugeRemoteRssChannel> CREATOR = new Parcelable.Creator<DelugeRemoteRssChannel>() { |
||||
public DelugeRemoteRssChannel createFromParcel(Parcel in) { |
||||
return new DelugeRemoteRssChannel(in); |
||||
} |
||||
public DelugeRemoteRssChannel[] newArray(int size) { |
||||
return new DelugeRemoteRssChannel[size]; |
||||
} |
||||
}; |
||||
} |
@ -0,0 +1,47 @@
@@ -0,0 +1,47 @@
|
||||
package org.transdroid.daemon.Deluge; |
||||
|
||||
import android.os.Parcel; |
||||
import android.os.Parcelable; |
||||
|
||||
import java.util.Date; |
||||
|
||||
import org.transdroid.core.gui.remoterss.data.RemoteRssItem; |
||||
|
||||
/** |
||||
* Deluge implementation of RemoteRssItem. |
||||
* |
||||
* @author alonalbert |
||||
*/ |
||||
class DelugeRemoteRssItem extends RemoteRssItem { |
||||
DelugeRemoteRssItem(String title, String link, String sourceName, Date timestamp) { |
||||
this.title = title; |
||||
this.link = link; |
||||
this.sourceName = sourceName; |
||||
this.timestamp = timestamp; |
||||
} |
||||
|
||||
private DelugeRemoteRssItem(Parcel in) { |
||||
title = in.readString(); |
||||
link = in.readString(); |
||||
sourceName = in.readString(); |
||||
timestamp = (Date) in.readSerializable(); |
||||
} |
||||
|
||||
@Override |
||||
public void writeToParcel(Parcel dest, int flags) { |
||||
dest.writeString(title); |
||||
dest.writeString(link); |
||||
dest.writeString(sourceName); |
||||
dest.writeSerializable(timestamp); |
||||
} |
||||
|
||||
public static final Parcelable.Creator<DelugeRemoteRssItem> CREATOR = new Parcelable.Creator<DelugeRemoteRssItem>() { |
||||
public DelugeRemoteRssItem createFromParcel(Parcel in) { |
||||
return new DelugeRemoteRssItem(in); |
||||
} |
||||
|
||||
public DelugeRemoteRssItem[] newArray(int size) { |
||||
return new DelugeRemoteRssItem[size]; |
||||
} |
||||
}; |
||||
} |
Loading…
Reference in new issue