live setting support, to be continued

pull/1/head
haha459862 4 years ago
parent 3f56ec44c1
commit 18c2b25cfd
  1. 62
      app/src/main/java/com/github/tvbox/osc/api/ApiConfig.java
  2. 58
      app/src/main/java/com/github/tvbox/osc/bean/ChannelGroup.java
  3. 39
      app/src/main/java/com/github/tvbox/osc/bean/LiveChannelGroup.java
  4. 51
      app/src/main/java/com/github/tvbox/osc/bean/LiveChannelItem.java
  5. 33
      app/src/main/java/com/github/tvbox/osc/bean/LiveSettingGroup.java
  6. 36
      app/src/main/java/com/github/tvbox/osc/bean/LiveSettingItem.java
  7. 17
      app/src/main/java/com/github/tvbox/osc/player/controller/BoxVideoController.java
  8. 1044
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java
  9. 34
      app/src/main/java/com/github/tvbox/osc/ui/adapter/ChannelGroupAdapter.java
  10. 38
      app/src/main/java/com/github/tvbox/osc/ui/adapter/LiveChannelAdapter.java
  11. 55
      app/src/main/java/com/github/tvbox/osc/ui/adapter/LiveChannelGroupAdapter.java
  12. 62
      app/src/main/java/com/github/tvbox/osc/ui/adapter/LiveChannelItemAdapter.java
  13. 59
      app/src/main/java/com/github/tvbox/osc/ui/adapter/LiveSettingGroupAdapter.java
  14. 70
      app/src/main/java/com/github/tvbox/osc/ui/adapter/LiveSettingItemAdapter.java
  15. 9
      app/src/main/java/com/github/tvbox/osc/util/HawkConfig.java
  16. 67
      app/src/main/res/layout/activity_live_play.xml
  17. 2
      app/src/main/res/layout/item_live_channel.xml
  18. 2
      app/src/main/res/layout/item_live_channel_group.xml
  19. 24
      app/src/main/res/layout/item_live_setting.xml
  20. 24
      app/src/main/res/layout/item_live_setting_group.xml

@ -8,9 +8,9 @@ import android.util.Base64;
import com.github.catvod.crawler.JarLoader;
import com.github.catvod.crawler.Spider;
import com.github.tvbox.osc.base.App;
import com.github.tvbox.osc.bean.ChannelGroup;
import com.github.tvbox.osc.bean.LiveChannelGroup;
import com.github.tvbox.osc.bean.IJKCode;
import com.github.tvbox.osc.bean.LiveChannel;
import com.github.tvbox.osc.bean.LiveChannelItem;
import com.github.tvbox.osc.bean.ParseBean;
import com.github.tvbox.osc.bean.SourceBean;
import com.github.tvbox.osc.server.ControlManager;
@ -50,7 +50,7 @@ public class ApiConfig {
private LinkedHashMap<String, SourceBean> sourceBeanList;
private SourceBean mHomeSource;
private ParseBean mDefaultParse;
private List<ChannelGroup> channelGroupList;
private List<LiveChannelGroup> liveChannelGroupList;
private List<ParseBean> parseBeanList;
private List<String> vipParseFlags;
private List<IJKCode> ijkCodes;
@ -63,7 +63,7 @@ public class ApiConfig {
private ApiConfig() {
sourceBeanList = new LinkedHashMap<>();
channelGroupList = new ArrayList<>();
liveChannelGroupList = new ArrayList<>();
parseBeanList = new ArrayList<>();
}
@ -279,7 +279,7 @@ public class ApiConfig {
setDefaultParse(parseBeanList.get(0));
}
// 直播源
channelGroupList.clear(); //修复从后台切换重复加载频道列表
liveChannelGroupList.clear(); //修复从后台切换重复加载频道列表
try {
String lives = infoJson.get("lives").getAsJsonArray().toString();
int index = lives.indexOf("proxy://");
@ -298,9 +298,9 @@ public class ApiConfig {
url = url.replace(extUrl, extUrlFix);
}
}
ChannelGroup channelGroup = new ChannelGroup();
channelGroup.setGroupName(url);
channelGroupList.add(channelGroup);
LiveChannelGroup liveChannelGroup = new LiveChannelGroup();
liveChannelGroup.setGroupName(url);
liveChannelGroupList.add(liveChannelGroup);
} else {
loadLives(infoJson.get("lives").getAsJsonArray());
}
@ -343,23 +343,40 @@ public class ApiConfig {
}
public void loadLives(JsonArray livesArray) {
liveChannelGroupList.clear();
int groupIndex = 0;
int channelIndex = 0;
int channelNum = 0;
for (JsonElement groupElement : livesArray) {
ChannelGroup channelGroup = new ChannelGroup();
channelGroup.setLiveChannels(new ArrayList<LiveChannel>());
channelGroup.setGroupNum(groupIndex++);
channelGroup.setGroupName(((JsonObject) groupElement).get("group").getAsString().trim());
LiveChannelGroup liveChannelGroup = new LiveChannelGroup();
liveChannelGroup.setLiveChannels(new ArrayList<LiveChannelItem>());
liveChannelGroup.setGroupIndex(groupIndex++);
liveChannelGroup.setGroupName(((JsonObject) groupElement).get("group").getAsString().trim());
channelIndex = 0;
for (JsonElement channelElement : ((JsonObject) groupElement).get("channels").getAsJsonArray()) {
JsonObject obj = (JsonObject) channelElement;
LiveChannel liveChannel = new LiveChannel();
liveChannel.setChannelName(obj.get("name").getAsString().trim());
liveChannel.setChannelNum(channelIndex++);
LiveChannelItem liveChannelItem = new LiveChannelItem();
liveChannelItem.setChannelName(obj.get("name").getAsString().trim());
liveChannelItem.setChannelIndex(channelIndex++);
liveChannelItem.setChannelNum(++channelNum);
ArrayList<String> urls = DefaultConfig.safeJsonStringList(obj, "urls");
liveChannel.setChannelUrls(urls);
channelGroup.getLiveChannels().add(liveChannel);
ArrayList<String> sourceNames = new ArrayList<>();
ArrayList<String> sourceUrls = new ArrayList<>();
int sourceIndex = 1;
for (String url : urls) {
String[] splitText = url.split("\\$", 2);
sourceUrls.add(splitText[0]);
if (splitText.length > 1)
sourceNames.add(splitText[1]);
else
sourceNames.add("源" + Integer.toString(sourceIndex));
sourceIndex++;
}
liveChannelItem.setChannelSourceNames(sourceNames);
liveChannelItem.setChannelUrls(sourceUrls);
liveChannelGroup.getLiveChannels().add(liveChannelItem);
}
channelGroupList.add(channelGroup);
liveChannelGroupList.add(liveChannelGroup);
}
}
@ -436,13 +453,8 @@ public class ApiConfig {
return mHomeSource == null ? emptyHome : mHomeSource;
}
public List<ChannelGroup> getChannelGroupList() {
return channelGroupList;
}
public void setChannelGroupList(List<ChannelGroup> list) {
channelGroupList.clear();
channelGroupList.addAll(list);
public List<LiveChannelGroup> getChannelGroupList() {
return liveChannelGroupList;
}
public List<IJKCode> getIjkCodes() {

@ -1,58 +0,0 @@
package com.github.tvbox.osc.bean;
import java.util.ArrayList;
public class ChannelGroup {
/**
* num : 1
* name : 央视频道
* password : 频道密码
*/
private int groupNum;
private String groupName;
private String groupPassword;
private ArrayList<LiveChannel> liveChannels;
private boolean isSelected = false;
private boolean isFocused = false;
public int getGroupNum() {
return groupNum;
}
public void setGroupNum(int groupNum) {
this.groupNum = groupNum;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public ArrayList<LiveChannel> getLiveChannels() {
return liveChannels;
}
public void setLiveChannels(ArrayList<LiveChannel> liveChannels) {
this.liveChannels = liveChannels;
}
public boolean isSelected() {
return isSelected;
}
public void setSelected(boolean selected) {
isSelected = selected;
}
public boolean isFocused() {
return isFocused;
}
public void setFocused(boolean focused) {
isFocused = focused;
}
}

@ -0,0 +1,39 @@
package com.github.tvbox.osc.bean;
import java.util.ArrayList;
public class LiveChannelGroup {
/**
* groupIndex : 分组索引号
* groupName : 分组名称
* password : 分组密码
*/
private int groupIndex;
private String groupName;
private String groupPassword;
private ArrayList<LiveChannelItem> liveChannelItems;
public int getGroupIndex() {
return groupIndex;
}
public void setGroupIndex(int groupIndex) {
this.groupIndex = groupIndex;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public ArrayList<LiveChannelItem> getLiveChannels() {
return liveChannelItems;
}
public void setLiveChannels(ArrayList<LiveChannelItem> liveChannelItems) {
this.liveChannelItems = liveChannelItems;
}
}

@ -7,22 +7,31 @@ import java.util.ArrayList;
* @date :2021/1/12
* @description:
*/
public class LiveChannel {
public class LiveChannelItem {
/**
* channelNum : 1
* channelName : CCTV-1 综合
* channelUrl : http://117.148.187.37/PLTV/88888888/224/3221226154/index.m3u8
* channelLogo : https://upload.wikimedia.org/wikipedia/zh/6/65/CCTV-1_Logo.png
* channelIndex : 频道索引号
* channelNum : 频道名称
* channelSourceNames : 频道源名称
* channelUrls : 频道源地址
* sourceIndex : 频道源索引
* sourceNum : 频道源总数
*/
private int channelIndex;
private int channelNum;
private String channelName;
private ArrayList<String> channelSourceNames;
private ArrayList<String> channelUrls;
private boolean isSelected = false;
private boolean isFocused = false;
public int sourceIndex = 0;
public int sourceNum = 0;
public void setChannelIndex(int channelIndex) {
this.channelIndex = channelIndex;
}
public int getChannelIndex() {
return channelIndex;
}
public void setChannelNum(int channelNum) {
this.channelNum = channelNum;
}
@ -39,7 +48,9 @@ public class LiveChannel {
return channelName;
}
public ArrayList<String> getChannelUrls() { return channelUrls; }
public ArrayList<String> getChannelUrls() {
return channelUrls;
}
public void setChannelUrls(ArrayList<String> channelUrls) {
this.channelUrls = channelUrls;
@ -54,6 +65,10 @@ public class LiveChannel {
if (sourceIndex == sourceNum) sourceIndex = 0;
}
public void setSourceIndex(int sourceIndex) {
this.sourceIndex = sourceIndex;
}
public int getSourceIndex() {
return sourceIndex;
}
@ -62,21 +77,19 @@ public class LiveChannel {
return channelUrls.get(sourceIndex);
}
public boolean isSelected() {
return isSelected;
public int getSourceNum() {
return sourceNum;
}
public void setSelected(boolean b) {
isSelected = b;
public ArrayList<String> getChannelSourceNames() {
return channelSourceNames;
}
public int getSourceNum() { return sourceNum; }
public boolean isFocused() {
return isFocused;
public void setChannelSourceNames(ArrayList<String> channelSourceNames) {
this.channelSourceNames = channelSourceNames;
}
public void setFocused(boolean focused) {
isFocused = focused;
public String getSourceName() {
return channelSourceNames.get(sourceIndex);
}
}

@ -0,0 +1,33 @@
package com.github.tvbox.osc.bean;
import java.util.ArrayList;
public class LiveSettingGroup {
private int groupIndex;
private String groupName;
private ArrayList<LiveSettingItem> liveSettingItems;
public int getGroupIndex() {
return groupIndex;
}
public void setGroupIndex(int groupIndex) {
this.groupIndex = groupIndex;
}
public String getGroupName() {
return groupName;
}
public void setGroupName(String groupName) {
this.groupName = groupName;
}
public ArrayList<LiveSettingItem> getLiveSettingItems() {
return liveSettingItems;
}
public void setLiveSettingItems(ArrayList<LiveSettingItem> liveSettingItems) {
this.liveSettingItems = liveSettingItems;
}
}

@ -0,0 +1,36 @@
package com.github.tvbox.osc.bean;
/**
* @author pj567
* @date :2021/1/12
* @description:
*/
public class LiveSettingItem {
private int itemIndex;
private String itemName;
private boolean itemSelected = false;
public int getItemIndex() {
return itemIndex;
}
public void setItemIndex(int itemIndex) {
this.itemIndex = itemIndex;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public boolean isItemSelected() {
return itemSelected;
}
public void setItemSelected(boolean itemSelected) {
this.itemSelected = itemSelected;
}
}

@ -214,4 +214,21 @@ public class BoxVideoController extends GestureVideoController implements View.O
}
simSeekPosition = position;
}
private OnScreenLongPressListener screenLongPressListener;
public interface OnScreenLongPressListener {
void longPress();
}
public void setScreenLongPressListener(OnScreenLongPressListener screenLongPressListener) {
this.screenLongPressListener = screenLongPressListener;
}
@Override
public void onLongPress(MotionEvent e) {
if (screenLongPressListener != null)
screenLongPressListener.longPress();
super.onLongPress(e);
}
}

@ -1,34 +0,0 @@
package com.github.tvbox.osc.ui.adapter;
import android.graphics.Color;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.bean.ChannelGroup;
import java.util.ArrayList;
/**
* @author pj567
* @date :2021/1/12
* @description:
*/
public class ChannelGroupAdapter extends BaseQuickAdapter<ChannelGroup, BaseViewHolder> {
public ChannelGroupAdapter() {
super(R.layout.item_channel_group, new ArrayList<>());
}
@Override
protected void convert(BaseViewHolder holder, ChannelGroup item) {
TextView tvGroupName = holder.getView(R.id.tvGroupName);
tvGroupName.setText(item.getGroupName());
if (item.isSelected() && !item.isFocused()) {
tvGroupName.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
} else {
tvGroupName.setTextColor(Color.WHITE);
}
}
}

@ -1,38 +0,0 @@
package com.github.tvbox.osc.ui.adapter;
import android.graphics.Color;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.bean.LiveChannel;
import java.util.ArrayList;
/**
* @author pj567
* @date :2021/1/12
* @description:
*/
public class LiveChannelAdapter extends BaseQuickAdapter<LiveChannel, BaseViewHolder> {
public LiveChannelAdapter() {
super(R.layout.item_live_channel, new ArrayList<>());
}
@Override
protected void convert(BaseViewHolder helper, LiveChannel item) {
TextView tvChannelNum = helper.getView(R.id.tvChannelNum);
TextView tvChannel = helper.getView(R.id.tvChannel);
tvChannelNum.setText(String.format("%s", item.getChannelNum()));
tvChannel.setText(item.getChannelName());
if (item.isSelected() && !item.isFocused()) {
tvChannelNum.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
tvChannel.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
}
else{
tvChannelNum.setTextColor(Color.WHITE);
tvChannel.setTextColor(Color.WHITE);
}
}
}

@ -0,0 +1,55 @@
package com.github.tvbox.osc.ui.adapter;
import android.graphics.Color;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.bean.LiveChannelGroup;
import java.util.ArrayList;
/**
* @author pj567
* @date :2021/1/12
* @description:
*/
public class LiveChannelGroupAdapter extends BaseQuickAdapter<LiveChannelGroup, BaseViewHolder> {
private int selectedGroupIndex = -1;
private int focusedGroupIndex = -1;
public LiveChannelGroupAdapter() {
super(R.layout.item_live_channel_group, new ArrayList<>());
}
@Override
protected void convert(BaseViewHolder holder, LiveChannelGroup item) {
TextView tvGroupName = holder.getView(R.id.tvChannelGroupName);
tvGroupName.setText(item.getGroupName());
int groupIndex = item.getGroupIndex();
if (groupIndex == selectedGroupIndex && groupIndex != focusedGroupIndex) {
tvGroupName.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
} else {
tvGroupName.setTextColor(Color.WHITE);
}
}
public void setSelectedGroupIndex(int selectedGroupIndex) {
int preSelectedGroupIndex = this.selectedGroupIndex;
this.selectedGroupIndex = selectedGroupIndex;
if (preSelectedGroupIndex != -1)
notifyItemChanged(preSelectedGroupIndex);
if (this.selectedGroupIndex != -1)
notifyItemChanged(this.selectedGroupIndex);
}
public void setFocusedGroupIndex(int focusedGroupIndex) {
this.focusedGroupIndex = focusedGroupIndex;
if (this.focusedGroupIndex != -1)
notifyItemChanged(this.focusedGroupIndex);
else if (this.selectedGroupIndex != -1)
notifyItemChanged(this.selectedGroupIndex);
}
}

@ -0,0 +1,62 @@
package com.github.tvbox.osc.ui.adapter;
import android.graphics.Color;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.bean.LiveChannelItem;
import java.util.ArrayList;
/**
* @author pj567
* @date :2021/1/12
* @description:
*/
public class LiveChannelItemAdapter extends BaseQuickAdapter<LiveChannelItem, BaseViewHolder> {
private int selectedChannelIndex = -1;
private int focusedChannelIndex = -1;
public LiveChannelItemAdapter() {
super(R.layout.item_live_channel, new ArrayList<>());
}
@Override
protected void convert(BaseViewHolder holder, LiveChannelItem item) {
TextView tvChannelNum = holder.getView(R.id.tvChannelNum);
TextView tvChannel = holder.getView(R.id.tvChannelName);
tvChannelNum.setText(String.format("%s", item.getChannelNum()));
tvChannel.setText(item.getChannelName());
int channelIndex = item.getChannelIndex();
if (channelIndex == selectedChannelIndex && channelIndex != focusedChannelIndex) {
tvChannelNum.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
tvChannel.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
}
else{
tvChannelNum.setTextColor(Color.WHITE);
tvChannel.setTextColor(Color.WHITE);
}
}
public void setSelectedChannelIndex(int selectedChannelIndex) {
int preSelectedChannelIndex = this.selectedChannelIndex;
this.selectedChannelIndex = selectedChannelIndex;
if (preSelectedChannelIndex != -1)
notifyItemChanged(preSelectedChannelIndex);
if (this.selectedChannelIndex != -1)
notifyItemChanged(this.selectedChannelIndex);
}
public void setFocusedChannelIndex(int focusedChannelIndex) {
int preFocusedChannelIndex = this.focusedChannelIndex;
this.focusedChannelIndex = focusedChannelIndex;
if (preFocusedChannelIndex != -1)
notifyItemChanged(preFocusedChannelIndex);
if (this.focusedChannelIndex != -1)
notifyItemChanged(this.focusedChannelIndex);
else if (this.selectedChannelIndex != -1)
notifyItemChanged(this.selectedChannelIndex);
}
}

@ -0,0 +1,59 @@
package com.github.tvbox.osc.ui.adapter;
import android.graphics.Color;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.bean.LiveSettingGroup;
import java.util.ArrayList;
/**
* @author pj567
* @date :2021/1/12
* @description:
*/
public class LiveSettingGroupAdapter extends BaseQuickAdapter<LiveSettingGroup, BaseViewHolder> {
private int selectedGroupIndex = -1;
private int focusedGroupIndex = -1;
public LiveSettingGroupAdapter() {
super(R.layout.item_live_setting_group, new ArrayList<>());
}
@Override
protected void convert(BaseViewHolder holder, LiveSettingGroup group) {
TextView tvGroupName = holder.getView(R.id.tvSettingGroupName);
tvGroupName.setText(group.getGroupName());
int groupIndex = group.getGroupIndex();
if (groupIndex == selectedGroupIndex && groupIndex != focusedGroupIndex) {
tvGroupName.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
} else {
tvGroupName.setTextColor(Color.WHITE);
}
}
public void setSelectedGroupIndex(int selectedGroupIndex) {
int preSelectedGroupIndex = this.selectedGroupIndex;
this.selectedGroupIndex = selectedGroupIndex;
if (preSelectedGroupIndex != -1)
notifyItemChanged(preSelectedGroupIndex);
if (this.selectedGroupIndex != -1)
notifyItemChanged(this.selectedGroupIndex);
}
public int getSelectedGroupIndex() {
return selectedGroupIndex;
}
public void setFocusedGroupIndex(int focusedGroupIndex) {
this.focusedGroupIndex = focusedGroupIndex;
if (this.focusedGroupIndex != -1)
notifyItemChanged(this.focusedGroupIndex);
else if (this.selectedGroupIndex != -1)
notifyItemChanged(this.selectedGroupIndex);
}
}

@ -0,0 +1,70 @@
package com.github.tvbox.osc.ui.adapter;
import android.graphics.Color;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.bean.LiveSettingItem;
import java.util.ArrayList;
/**
* @author pj567
* @date :2021/1/12
* @description:
*/
public class LiveSettingItemAdapter extends BaseQuickAdapter<LiveSettingItem, BaseViewHolder> {
private int focusedItemIndex = -1;
public LiveSettingItemAdapter() {
super(R.layout.item_live_setting, new ArrayList<>());
}
@Override
protected void convert(BaseViewHolder holder, LiveSettingItem item) {
TextView tvItemName = holder.getView(R.id.tvSettingItemName);
tvItemName.setText(item.getItemName());
int itemIndex = item.getItemIndex();
if (item.isItemSelected() && itemIndex != focusedItemIndex) {
tvItemName.setTextColor(mContext.getResources().getColor(R.color.color_1890FF));
} else {
tvItemName.setTextColor(Color.WHITE);
}
}
public void selectItem(int selectedItemIndex, boolean select, boolean unselectPreItemIndex) {
if (unselectPreItemIndex) {
int preSelectedItemIndex = getSelectedItemIndex();
if (preSelectedItemIndex != -1) {
getData().get(preSelectedItemIndex).setItemSelected(false);
notifyItemChanged(preSelectedItemIndex);
}
}
if (selectedItemIndex != -1) {
getData().get(selectedItemIndex).setItemSelected(select);
notifyItemChanged(selectedItemIndex);
}
}
public void setFocusedItemIndex(int focusedItemIndex) {
int preFocusItemIndex = this.focusedItemIndex;
this.focusedItemIndex = focusedItemIndex;
if (preFocusItemIndex != -1)
notifyItemChanged(preFocusItemIndex);
if (this.focusedItemIndex != -1)
notifyItemChanged(this.focusedItemIndex);
else
notifyDataSetChanged();
}
public int getSelectedItemIndex() {
for (LiveSettingItem item : getData()) {
if (item.isItemSelected())
return item.getItemIndex();
}
return -1;
}
}

@ -13,7 +13,6 @@ public class HawkConfig {
public static final String DEBUG_OPEN = "debug_open";
public static final String PARSE_WEBVIEW = "parse_webview"; // true 系统 false xwalk
public static final String IJK_CODEC = "ijk_codec";
public static final String LIVE_CHANNEL = "last_live_channel_name";
public static final String PLAY_TYPE = "play_type";//0 系统;1 ijk;2 exo
public static final String PLAY_RENDER = "play_render"; //0 texture 2
public static final String PLAY_SCALE = "play_scale"; //0 texture 2
@ -21,4 +20,12 @@ public class HawkConfig {
public static final String DOH_URL = "doh_url";
public static final String HOME_REC = "home_rec"; // 0 豆瓣热播 1 数据源推荐 2 历史
public static final String SEARCH_VIEW = "search_view"; // 0 列表 1 缩略图
public static final String LIVE_CHANNEL = "last_live_channel_name";
public static final String LIVE_PLAYER_TYPE = "live_player_type";
public static final String LIVE_PLAYER_SCALE = "live_player_scale";
public static final String LIVE_CHANNEL_REVERSE = "live_channel_reverse";
public static final String LIVE_CROSS_GROUP = "live_cross_group";
public static final String LIVE_CONNECT_TIMEOUT = "live_connect_timeout";
public static final String LIVE_SHOW_NET_SPEED = "live_show_net_speed";
public static final String LIVE_SHOW_TIME = "live_show_time";
}

@ -10,7 +10,7 @@
android:layout_height="match_parent" />
<LinearLayout
android:id="@+id/tvLeftLinearLayout"
android:id="@+id/tvLeftChannnelListLayout"
android:layout_width="421mm"
android:layout_height="match_parent"
android:layout_marginLeft="-421mm"
@ -51,9 +51,54 @@
app:tv_verticalSpacingWithMargins="10mm" />
</LinearLayout>
<LinearLayout
android:id="@+id/tvRightSettingLayout"
android:layout_width="361mm"
android:layout_height="match_parent"
android:layout_marginRight="-361mm"
android:layout_gravity="right"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="visible" >
<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mSettingItemView"
android:layout_width="180mm"
android:layout_height="match_parent"
android:background="@color/color_66000000"
android:paddingLeft="5mm"
android:paddingTop="10mm"
android:paddingRight="5mm"
android:paddingBottom="10mm"
android:visibility="visible"
android:gravity= "center"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="10mm" />
<View
android:layout_width="1mm"
android:layout_height="match_parent"
android:background="@color/color_FFFFFF"
android:layout_gravity="center_horizontal" />
<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mSettingGroupView"
android:layout_width="180mm"
android:layout_height="match_parent"
android:background="@color/color_66000000"
android:paddingLeft="5mm"
android:paddingTop="10mm"
android:paddingRight="5mm"
android:paddingBottom="10mm"
android:visibility="visible"
android:gravity= "center"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="10mm" />
</LinearLayout>
<TextView
android:id="@+id/tvChannel"
android:layout_width="100mm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="30mm"
@ -66,22 +111,4 @@
android:textSize="36mm"
android:textStyle="bold"
android:visibility="gone" />
<TextView
android:id="@+id/tvHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_marginRight="30mm"
android:layout_marginBottom="30mm"
android:background="@drawable/shape_live_channel_num"
android:gravity="center"
android:paddingLeft="10mm"
android:paddingTop="5mm"
android:paddingRight="10mm"
android:paddingBottom="5mm"
android:text="上下键换台,数字键跳台,左右键切换播放源"
android:textColor="@android:color/white"
android:textSize="24mm"
android:textStyle="bold" />
</FrameLayout>

@ -23,7 +23,7 @@
android:textSize="22mm" />
<TextView
android:id="@+id/tvChannel"
android:id="@+id/tvChannelName"
android:layout_width="0mm"
android:layout_height="60mm"
android:layout_weight="1"

@ -10,7 +10,7 @@
android:orientation="horizontal">
<TextView
android:id="@+id/tvGroupName"
android:id="@+id/tvChannelGroupName"
android:layout_width="0mm"
android:layout_height="60mm"
android:layout_weight="1"

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:layout_marginBottom="10mm"
android:layout_gravity="center"
android:background="@drawable/shape_live_focus"
android:focusable="true"
android:focusableInTouchMode="false"
android:orientation="horizontal">
<TextView
android:id="@+id/tvSettingItemName"
android:layout_width="0mm"
android:layout_height="60mm"
android:layout_weight="1"
android:ellipsize="marquee"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="22mm" />
</LinearLayout>

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10mm"
android:layout_marginBottom="10mm"
android:layout_gravity="center"
android:background="@drawable/shape_live_focus"
android:focusable="true"
android:focusableInTouchMode="false"
android:orientation="horizontal">
<TextView
android:id="@+id/tvSettingGroupName"
android:layout_width="0mm"
android:layout_height="60mm"
android:layout_weight="1"
android:ellipsize="marquee"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:textColor="@android:color/white"
android:textSize="22mm" />
</LinearLayout>
Loading…
Cancel
Save