blob: bbebd3fa577d363c3eccae7ed95ab87b67f17dbc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
|
package ml.docilealligator.infinityforreddit.post;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import ml.docilealligator.infinityforreddit.subreddit.Flair;
public class RedditGalleryPayload {
@SerializedName("sr")
public String subredditName;
@SerializedName("submit_type")
public String submitType;
@SerializedName("api_type")
public String apiType = "json";
@SerializedName("show_error_list")
public boolean showErrorList = true;
public String title;
public String text;
@SerializedName("spoiler")
public boolean isSpoiler;
@SerializedName("nsfw")
public boolean isNSFW;
public String kind = "self";
@SerializedName("original_content")
public boolean originalContent = false;
@SerializedName("post_to_twitter")
public boolean postToTwitter = false;
@SerializedName("sendreplies")
public boolean sendReplies;
@SerializedName("validate_on_submit")
public boolean validateOnSubmit = true;
@SerializedName("flair_id")
public String flairId;
@SerializedName("flair_text")
public String flairText;
public ArrayList<Item> items;
public RedditGalleryPayload(String subredditName, String submitType, String title, String text,
boolean isSpoiler, boolean isNSFW, boolean sendReplies, Flair flair, ArrayList<Item> items) {
this.subredditName = subredditName;
this.submitType = submitType;
this.title = title;
this.text = text;
this.isSpoiler = isSpoiler;
this.isNSFW = isNSFW;
this.sendReplies = sendReplies;
if (flair != null) {
flairId = flair.getId();
flairText = flair.getText();
}
this.items = items;
}
public static class Item implements Parcelable {
public String caption;
@SerializedName("outbound_url")
public String outboundUrl;
@SerializedName("media_id")
public String mediaId;
public Item(String caption, String outboundUrl, String mediaId) {
this.caption = caption;
this.outboundUrl = outboundUrl;
this.mediaId = mediaId;
}
protected Item(Parcel in) {
caption = in.readString();
outboundUrl = in.readString();
mediaId = in.readString();
}
public static final Creator<Item> CREATOR = new Creator<Item>() {
@Override
public Item createFromParcel(Parcel in) {
return new Item(in);
}
@Override
public Item[] newArray(int size) {
return new Item[size];
}
};
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeString(caption);
parcel.writeString(outboundUrl);
parcel.writeString(mediaId);
}
public String getCaption() {
return caption;
}
public void setCaption(String caption) {
this.caption = caption == null ? "" : caption;
}
public String getOutboundUrl() {
return outboundUrl;
}
public void setOutboundUrl(String outboundUrl) {
this.outboundUrl = outboundUrl;
}
}
}
|