|
|
|
|
@ -1,13 +1,11 @@ |
|
|
|
|
package com.fongmi.android.tv.bean; |
|
|
|
|
|
|
|
|
|
import android.text.TextUtils; |
|
|
|
|
import android.widget.ImageView; |
|
|
|
|
|
|
|
|
|
import androidx.annotation.StringRes; |
|
|
|
|
|
|
|
|
|
import com.fongmi.android.tv.App; |
|
|
|
|
import com.fongmi.android.tv.R; |
|
|
|
|
import com.fongmi.android.tv.utils.ImgUtil; |
|
|
|
|
import com.fongmi.android.tv.utils.ResUtil; |
|
|
|
|
import com.google.gson.annotations.SerializedName; |
|
|
|
|
import com.google.gson.reflect.TypeToken; |
|
|
|
|
@ -21,8 +19,6 @@ public class Group { |
|
|
|
|
|
|
|
|
|
@SerializedName("channel") |
|
|
|
|
private List<Channel> channel; |
|
|
|
|
@SerializedName("logo") |
|
|
|
|
private String logo; |
|
|
|
|
@SerializedName("name") |
|
|
|
|
private String name; |
|
|
|
|
@SerializedName("pass") |
|
|
|
|
@ -74,14 +70,6 @@ public class Group { |
|
|
|
|
this.channel = channel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getLogo() { |
|
|
|
|
return TextUtils.isEmpty(logo) ? "" : logo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void setLogo(String logo) { |
|
|
|
|
this.logo = logo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getName() { |
|
|
|
|
return TextUtils.isEmpty(name) ? "" : name; |
|
|
|
|
} |
|
|
|
|
@ -130,10 +118,6 @@ public class Group { |
|
|
|
|
return isKeep(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void loadLogo(ImageView view) { |
|
|
|
|
ImgUtil.loadLive(getLogo(), view); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public int find(int number) { |
|
|
|
|
return getChannel().lastIndexOf(Channel.create(number)); |
|
|
|
|
} |
|
|
|
|
@ -148,11 +132,6 @@ public class Group { |
|
|
|
|
else getChannel().get(index).getUrls().addAll(channel.getUrls()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Group live(Live live) { |
|
|
|
|
if (!getLogo().startsWith("http")) setLogo(live.getLogo().replace("{name}", getName()).replace("{logo}", getLogo())); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Channel find(Channel channel) { |
|
|
|
|
int index = getChannel().indexOf(channel); |
|
|
|
|
if (index != -1) return getChannel().get(index); |
|
|
|
|
|