diff --git a/app/src/main/java/com/github/catvod/bean/Vod.java b/app/src/main/java/com/github/catvod/bean/Vod.java index 17d4c54a..c986d8a9 100644 --- a/app/src/main/java/com/github/catvod/bean/Vod.java +++ b/app/src/main/java/com/github/catvod/bean/Vod.java @@ -30,6 +30,8 @@ public class Vod { private String vodPlayUrl; @SerializedName("vod_tag") private String vodTag; + @SerializedName("style") + private Style style; public Vod() { } @@ -47,6 +49,14 @@ public class Vod { setVodRemarks(vodRemarks); } + public Vod(String vodId, String vodName, String vodPic, String vodRemarks, Style style) { + setVodId(vodId); + setVodName(vodName); + setVodPic(vodPic); + setVodRemarks(vodRemarks); + setStyle(style); + } + public Vod(String vodId, String vodName, String vodPic, String vodRemarks, boolean folder) { setVodId(vodId); setVodName(vodName); @@ -110,4 +120,45 @@ public class Vod { public void setVodTag(String vodTag) { this.vodTag = vodTag; } + + public void setStyle(Style style) { + this.style = style; + } + + public static class Style { + + @SerializedName("type") + private String type; + @SerializedName("ratio") + private Float ratio; + + public static Style rect() { + return rect(0.75f); + } + + public static Style rect(float ratio) { + return new Style("rect", ratio); + } + + public static Style oval() { + return new Style("oval", 1.0f); + } + + public static Style full() { + return new Style("full"); + } + + public static Style list() { + return new Style("list"); + } + + public Style(String type) { + this.type = type; + } + + public Style(String type, Float ratio) { + this.type = type; + this.ratio = ratio; + } + } }