diff --git a/app/build.gradle b/app/build.gradle index a536b275a..69f97b5ac 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,7 +17,7 @@ android { leanback { dimension "mode" versionCode 70 - versionName "1.7.0" + versionName "20230321#1" } mobile { dimension "mode" diff --git a/app/src/main/java/com/fongmi/android/tv/bean/Depot.java b/app/src/main/java/com/fongmi/android/tv/bean/Depot.java new file mode 100644 index 000000000..65ad94f61 --- /dev/null +++ b/app/src/main/java/com/fongmi/android/tv/bean/Depot.java @@ -0,0 +1,33 @@ +package com.fongmi.android.tv.bean; + +import android.text.TextUtils; + +import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; +import com.google.gson.reflect.TypeToken; + +import java.lang.reflect.Type; +import java.util.Collections; +import java.util.List; + +public class Depot { + + @SerializedName("url") + private String url; + @SerializedName("name") + private String name; + + public static List arrayFrom(String str) { + Type listType = new TypeToken>() {}.getType(); + List items = new Gson().fromJson(str, listType); + return items == null ? Collections.emptyList() : items; + } + + public String getUrl() { + return TextUtils.isEmpty(url) ? "" : url; + } + + public String getName() { + return TextUtils.isEmpty(name) ? getUrl() : name; + } +}