blob: 2b07f9d56692a77eccec378cc4ee3cfa0483ba26 (
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
|
package ml.docilealligator.infinityforreddit.customtheme;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import com.google.gson.Gson;
import com.google.gson.JsonParseException;
import com.google.gson.annotations.SerializedName;
public class OnlineCustomThemeMetadata implements Parcelable {
public int id;
public String name;
public String username;
@SerializedName("primary_color")
public String colorPrimary;
protected OnlineCustomThemeMetadata(Parcel in) {
id = in.readInt();
name = in.readString();
username = in.readString();
colorPrimary = in.readString();
}
public static final Creator<OnlineCustomThemeMetadata> CREATOR = new Creator<>() {
@Override
public OnlineCustomThemeMetadata createFromParcel(Parcel in) {
return new OnlineCustomThemeMetadata(in);
}
@Override
public OnlineCustomThemeMetadata[] newArray(int size) {
return new OnlineCustomThemeMetadata[size];
}
};
public static OnlineCustomThemeMetadata fromJson(String json) throws JsonParseException {
Gson gson = new Gson();
return gson.fromJson(json, OnlineCustomThemeMetadata.class);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(@NonNull Parcel dest, int flags) {
dest.writeInt(id);
dest.writeString(name);
dest.writeString(username);
dest.writeString(colorPrimary);
}
}
|