直播添加EPG支持

pull/50/head
Roinlong 4 years ago
parent 1584a3e274
commit 141425f935
  1. 5
      .idea/jarRepositories.xml
  2. 1
      .idea/misc.xml
  3. 10
      .idea/runConfigurations.xml
  4. 254
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java
  5. 96
      app/src/main/java/com/github/tvbox/osc/ui/adapter/MyEpgAdapter.java
  6. 53
      app/src/main/java/com/github/tvbox/osc/ui/tv/widget/ChannelListView.java
  7. 6
      app/src/main/res/drawable/bg_channel_list.xml
  8. 13
      app/src/main/res/drawable/item_bg_selector_left.xml
  9. 12
      app/src/main/res/drawable/item_bg_selector_right.xml
  10. 7
      app/src/main/res/drawable/item_right_bg.xml
  11. 27
      app/src/main/res/drawable/shape_user_search.xml
  12. 579
      app/src/main/res/layout/activity_live_play.xml
  13. 3
      app/src/main/res/values/colors.xml
  14. 12
      app/src/main/res/values/styles.xml
  15. 2
      gradle.properties

@ -46,5 +46,10 @@
<option name="name" value="maven2" />
<option name="url" value="http://9xi4o.tk/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="maven2" />
<option name="name" value="maven2" />
<option name="url" value="http://home.jundie.top:81/xwalk/maven2" />
</remote-repository>
</component>
</project>

@ -42,7 +42,6 @@
</map>
</option>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

@ -4,13 +4,17 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.IntEvaluator;
import android.animation.ObjectAnimator;
import android.os.CountDownTimer;
import android.os.Handler;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
@ -33,10 +37,15 @@ import com.github.tvbox.osc.ui.adapter.LiveChannelGroupAdapter;
import com.github.tvbox.osc.ui.adapter.LiveChannelItemAdapter;
import com.github.tvbox.osc.ui.adapter.LiveSettingGroupAdapter;
import com.github.tvbox.osc.ui.adapter.LiveSettingItemAdapter;
import com.github.tvbox.osc.ui.adapter.MyEpgAdapter;
import com.github.tvbox.osc.ui.dialog.LivePasswordDialog;
import com.github.tvbox.osc.ui.tv.widget.ChannelListView;
import com.github.tvbox.osc.ui.tv.widget.Epginfo;
import com.github.tvbox.osc.ui.tv.widget.ViewObj;
import com.github.tvbox.osc.util.FastClickCheckUtil;
import com.github.tvbox.osc.util.HawkConfig;
import com.github.tvbox.osc.util.urlhttp.CallBackUtil;
import com.github.tvbox.osc.util.urlhttp.UrlHttpUtil;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.lzy.okgo.OkGo;
@ -46,10 +55,16 @@ import com.orhanobut.hawk.Hawk;
import com.owen.tvrecyclerview.widget.TvRecyclerView;
import com.owen.tvrecyclerview.widget.V7LinearLayoutManager;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Hashtable;
import java.util.List;
import java.util.Locale;
@ -78,16 +93,56 @@ public class LivePlayActivity extends BaseActivity {
private LiveSettingItemAdapter liveSettingItemAdapter;
private List<LiveSettingGroup> liveSettingGroupList = new ArrayList<>();
public static int currentChannelGroupIndex = 0;
private Handler mHandler = new Handler();
private List<LiveChannelGroup> liveChannelGroupList = new ArrayList<>();
private int currentChannelGroupIndex = 0;
private int currentLiveChannelIndex = -1;
private int currentLiveChangeSourceTimes = 0;
private LiveChannelItem currentLiveChannelItem = null;
private LivePlayerManager livePlayerManager = new LivePlayerManager();
private ArrayList<Integer> channelGroupPasswordConfirmed = new ArrayList<>();
//EPG by 龍
private static LiveChannelItem channel_Name = null;
private static Hashtable hsEpg = new Hashtable();
private ChannelListView mRightEpgList;
private CountDownTimer countDownTimer;
private CountDownTimer countDownTimerRightTop;
private View ll_right_top_loading;
private View ll_right_top_huikan;
private View tv_tiploading;
private View divLoadEpg;
private View divLoadEpgleft;
RelativeLayout ll_epg;
TextView tv_channelnum;
TextView tip_chname;
TextView tip_epg1;
TextView tip_epg2;
TextView tv_srcinfo;
TextView tv_curepg_left;
TextView tv_nextepg_left;
private MyEpgAdapter myAdapter;
private TextView tv_right_top_tipnetspeed;
private TextView tv_right_top_channel_name;
private TextView tv_right_top_epg_name;
private TextView tv_right_top_type;
private ImageView iv_circle_bg;
private TextView tv_netspeedinfo;
private TextView tv_ad ;
private TextView tv_voluminfo ;
private TextView tv_shownum ;
private TextView txtNoEpg ;
private ImageView iv_back_bg;
private ObjectAnimator objectAnimator;
private ObjectAnimator objectAnimator2;
@Override
protected int getLayoutResID() {
return R.layout.activity_live_play;
@ -108,6 +163,37 @@ public class LivePlayActivity extends BaseActivity {
tvTime = findViewById(R.id.tvTime);
tvNetSpeed = findViewById(R.id.tvNetSpeed);
//EPG findViewById by 龍
tip_chname = (TextView) findViewById(R.id.tv_channel_bar_name);//底部名称
tv_channelnum = (TextView) findViewById(R.id.tv_channel_bottom_number); //底部数字
tip_epg1 = (TextView) findViewById(R.id.tv_current_program_time);//底部EPG当前节目信息
tip_epg2 = (TextView) findViewById(R.id.tv_next_program_time);//底部EPG当下个节目信息
tv_srcinfo = (TextView) findViewById(R.id.tv_source);//线路状态
tv_curepg_left = (TextView) findViewById(R.id.tv_current_program);//当前节目
tv_nextepg_left= (TextView) findViewById(R.id.tv_current_program);//下一节目
ll_epg = (RelativeLayout) findViewById(R.id.ll_epg);
tv_right_top_tipnetspeed = (TextView)findViewById(R.id.tv_right_top_tipnetspeed);
tv_right_top_channel_name = (TextView)findViewById(R.id.tv_right_top_channel_name);
tv_right_top_epg_name = (TextView)findViewById(R.id.tv_right_top_epg_name);
tv_right_top_type = (TextView)findViewById(R.id.tv_right_top_type);
iv_circle_bg = (ImageView) findViewById(R.id.iv_circle_bg);
iv_back_bg = (ImageView) findViewById(R.id.iv_back_bg);
tv_tiploading= (View) findViewById(R.id.ll_right_top_loading);
tv_shownum = (TextView) findViewById(R.id.tv_shownum);
txtNoEpg = (TextView) findViewById(R.id.txtNoEpg);
ll_right_top_loading = findViewById(R.id.ll_right_top_loading);
ll_right_top_huikan = findViewById(R.id.ll_right_top_huikan);
mRightEpgList = (ChannelListView) findViewById(R.id.lv_epg);
divLoadEpg = (View) findViewById(R.id.divLoadEpg);
divLoadEpgleft = (View) findViewById(R.id.divLoadEpgleft);
//右上角图片旋转
objectAnimator = ObjectAnimator.ofFloat(iv_circle_bg,"rotation", 360.0f);
objectAnimator.setDuration(5000);
objectAnimator.setRepeatCount(-1);
objectAnimator.start();
initVideoView();
initChannelGroupView();
initLiveChannelView();
@ -116,6 +202,163 @@ public class LivePlayActivity extends BaseActivity {
initLiveChannelList();
initLiveSettingGroupList();
}
//获取EPG并存储 // 百川epg DIYP epg 51zmt epg ------- 自建EPG格式输出格式请参考 51zmt
private List<Epginfo> epgdata = new ArrayList<>();
//显示侧边EPG
private void showEpg(ArrayList<Epginfo> arrayList){
if (arrayList != null && arrayList.size() > 0) {
epgdata = arrayList;
int i=-1;
int size = epgdata.size() - 1;
while (size >= 0) {
if (new Date().compareTo(((Epginfo) epgdata.get(size)).startdateTime) >= 0) {
break;
}
size--;
}
i = size;
mRightEpgList.pos = i;
myAdapter = new MyEpgAdapter( epgdata,this,i);
mRightEpgList.setAdapter(myAdapter);
mRightEpgList.setSelection(i);
}else{
Epginfo epgbcinfo = new Epginfo("暂无节目信息", "00:00", "23:59");
arrayList.add(epgbcinfo);
epgdata=arrayList;
myAdapter = new MyEpgAdapter( epgdata,this,0);
mRightEpgList.setAdapter(myAdapter);
}
}
public void getEpg() {
final String channelName = channel_Name.getChannelName();
Date date = new Date();
SimpleDateFormat timeFormat = new SimpleDateFormat("yyyy-MM-dd");
String epgStringAddress ="http://epg.51zmt.top:8000/api/diyp/?ch=";
UrlHttpUtil.get(epgStringAddress + URLEncoder.encode(channelName.replace("+", "[add]").toString()) + "&date=" + timeFormat.format(date), new CallBackUtil.CallBackString() {
public void onFailure(int i, String str) {
}
public void onResponse(String paramString) {
ArrayList arrayList = new ArrayList();
Log.d("返回的EPG信息", paramString);
try {
if (paramString.contains("epg_data")) {
final JSONArray jSONArray = new JSONObject(paramString).optJSONArray("epg_data");
if (jSONArray != null)
for (int b = 0; b < jSONArray.length(); b++) {
JSONObject jSONObject = jSONArray.getJSONObject(b);
Epginfo epgbcinfo = new Epginfo(jSONObject.optString("title"), jSONObject.optString("start"), jSONObject.optString("end"));
arrayList.add(epgbcinfo);
Log.d("测试2", jSONObject.optString("title") + jSONObject.optString("start") + jSONObject.optString("end"));
}
}
} catch (JSONException jSONException) {
jSONException.printStackTrace();
}
showEpg(arrayList);
if (!hsEpg.contains(channelName))
hsEpg.put(channelName, arrayList);
showBottomEpg();
}
});
}
//显示底部EPG
private void showBottomEpg() {
if (channel_Name.getChannelName() != null) {
findViewById(R.id.ll_epg).setVisibility(View.VISIBLE);
((TextView) findViewById(R.id.tv_channel_bar_name)).setText(channel_Name.getChannelName());
((TextView) findViewById(R.id.tv_channel_bottom_number)).setText("" + channel_Name.getChannelNum());
((TextView) findViewById(R.id.tv_current_program_time)).setText("咦,暂无信息");
((TextView) findViewById(R.id.tv_current_program_name)).setText("");
((TextView) findViewById(R.id.tv_next_program_time)).setText("开源测试软件,请勿商用以及播放违法内容!!!!");
((TextView) findViewById(R.id.tv_next_program_name)).setText("");
if (hsEpg.containsKey(channel_Name.getChannelName())) {
ArrayList arrayList = (ArrayList) hsEpg.get(channel_Name.getChannelName());
if (arrayList != null && arrayList.size() > 0) {
int size = arrayList.size() - 1;
while (size >= 0) {
if (new Date().compareTo(((Epginfo) arrayList.get(size)).startdateTime) >= 0) {
((TextView) findViewById(R.id.tv_current_program_time)).setText(((Epginfo) arrayList.get(size)).start + "--"+ ((Epginfo) arrayList.get(size)).end);
((TextView) findViewById(R.id.tv_current_program_name)).setText(((Epginfo) arrayList.get(size)).title);
if (size != arrayList.size() - 1) {
((TextView) findViewById(R.id.tv_next_program_time)).setText(((Epginfo) arrayList.get(size + 1)).start + "--"+ ((Epginfo) arrayList.get(size)).end);
((TextView) findViewById(R.id.tv_next_program_name)).setText(((Epginfo) arrayList.get(size + 1)).title);
}
break;
} else {
size--;
}
}
}
} else {
getEpg();
}
if (countDownTimer != null) {
countDownTimer.cancel();
}
countDownTimer = new CountDownTimer(10000, 1000) {//底部epg隐藏时间设定
public void onTick(long j) {
}
public void onFinish() {
findViewById(R.id.ll_epg).setVisibility(View.GONE);
}
};
countDownTimer.start();
if (channel_Name == null || channel_Name.getSourceNum() <= 0) {
((TextView) findViewById(R.id.tv_source)).setText("1/1");
} else {
((TextView) findViewById(R.id.tv_source)).setText("[线路"+(channel_Name.getSourceIndex() + 1) + "/" + channel_Name.getSourceNum()+"]");
}
tv_right_top_channel_name.setText(channel_Name.getChannelName());
tv_right_top_epg_name.setText(channel_Name.getChannelName());
ll_right_top_loading.setVisibility(View.VISIBLE);
if (countDownTimerRightTop != null) {
countDownTimerRightTop.cancel();
}
countDownTimerRightTop = new CountDownTimer(10000, 1000) {
public void onTick(long j) {
}
public void onFinish() {
ll_right_top_loading.setVisibility(View.GONE);
}
};
mHandler.post(mUpdateNetSpeedRun);
tv_right_top_tipnetspeed.setVisibility(View.VISIBLE);
}
countDownTimerRightTop.start();
}
//频道列表
public void divLoadEpgRight(View view) {
mRightEpgList.setVisibility(View.VISIBLE);
mChannelGroupView.setVisibility(View.GONE);
divLoadEpgleft.setVisibility(View.VISIBLE);
divLoadEpg.setVisibility(View.GONE);
}
//频道列表
public void divLoadEpgLeft(View view) {
mRightEpgList.setVisibility(View.GONE);
mChannelGroupView.setVisibility(View.VISIBLE);
divLoadEpgleft.setVisibility(View.GONE);
divLoadEpg.setVisibility(View.VISIBLE);
}
@Override
public void onBackPressed() {
@ -298,7 +541,7 @@ public class LivePlayActivity extends BaseActivity {
private boolean playChannel(int channelGroupIndex, int liveChannelIndex, boolean changeSource) {
if ((channelGroupIndex == currentChannelGroupIndex && liveChannelIndex == currentLiveChannelIndex && !changeSource)
|| (changeSource && currentLiveChannelItem.getSourceNum() == 1)) {
showChannelInfo();
// showChannelInfo();
return true;
}
mVideoView.release();
@ -309,8 +552,12 @@ public class LivePlayActivity extends BaseActivity {
Hawk.put(HawkConfig.LIVE_CHANNEL, currentLiveChannelItem.getChannelName());
livePlayerManager.getLiveChannelPlayer(mVideoView, currentLiveChannelItem.getChannelName());
}
channel_Name = currentLiveChannelItem;
getEpg();
mVideoView.setUrl(currentLiveChannelItem.getUrl());
showChannelInfo();
// showChannelInfo();
mVideoView.start();
return true;
}
@ -937,6 +1184,7 @@ public class LivePlayActivity extends BaseActivity {
public void run() {
if (mVideoView == null) return;
tvNetSpeed.setText(String.format("%.2fMB/s", (float)mVideoView.getTcpSpeed() / 1024.0 / 1024.0));
tv_right_top_tipnetspeed.setText(String.format("%.2fKB/s",(float)mVideoView.getTcpSpeed()/1024.0));
mHandler.postDelayed(this, 1000);
}
};

@ -0,0 +1,96 @@
package com.github.tvbox.osc.ui.adapter;
import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.github.tvbox.osc.R;
import com.github.tvbox.osc.ui.tv.widget.AudioWaveView;
import com.github.tvbox.osc.ui.tv.widget.Epginfo;
import java.util.Date;
import java.util.List;
public class MyEpgAdapter extends BaseAdapter {
private List<Epginfo> data;
private Context context;
public static float fontSize=20;
private int defaultSelection = 0;
private int defaultShiyiSelection = 0;
public MyEpgAdapter(List<Epginfo> data, Context context, int i ) {
this.data = data;
this.context = context;
this.defaultSelection = i;
}
public void setSelection(int i) {
this.defaultSelection = i;
notifyDataSetChanged();
}
public void setShiyiSelection(int i) {
this.defaultShiyiSelection = i;
notifyDataSetChanged();
}
public void setFontSize(float f) {
fontSize = f;
notifyDataSetChanged();
}
@Override
public int getCount() {
return data.size();
}
@Override
public Object getItem(int i) {
return null;
}
@Override
public long getItemId(int i) {
return i;
}
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if(view ==null){
view = LayoutInflater.from(context).inflate(R.layout.epglist_item,viewGroup,false);
}
TextView textview = (TextView)view.findViewById(R.id.tv_epg_name);
TextView timeview = (TextView)view.findViewById(R.id.tv_epg_time);
AudioWaveView wqddg_AudioWaveView = (AudioWaveView)view.findViewById(R.id.wqddg_AudioWaveView);
wqddg_AudioWaveView.setVisibility(View.GONE);
if(i < data.size()){
textview.setText(data.get(i).title);
timeview.setText(data.get(i).start + "--" + data.get(i).end);
textview.setTextColor(Color.WHITE) ;
timeview.setTextColor(Color.WHITE) ;
Log.e("roinlong", "getView: "+ i);
if(i == this.defaultSelection){
wqddg_AudioWaveView.setVisibility(View.VISIBLE);
textview.setTextColor(Color.rgb(0, 153, 255)) ;
timeview.setTextColor(Color.rgb(0, 153, 255)) ;
textview.setFreezesText(true);
timeview.setFreezesText(true);
}else {
wqddg_AudioWaveView.setVisibility(View.GONE);
}
}
return view;
}
}

@ -0,0 +1,53 @@
package com.github.tvbox.osc.ui.tv.widget;
import android.content.Context;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.widget.ListView;
import com.github.tvbox.osc.ui.activity.LivePlayActivity;
public class ChannelListView extends ListView {
DataChangedListener dataChangedListener;
public int pos= LivePlayActivity.currentChannelGroupIndex;
private int y;
public ChannelListView(Context context) {
super(context);
}
public ChannelListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ChannelListView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public void setSelect(int position,int y) {
super.setSelection(position);
pos=position;
this.y=y;
}
@Override
protected void onFocusChanged(boolean gainFocus, int direction,
Rect previouslyFocusedRect) {
super.onFocusChanged(gainFocus, direction, previouslyFocusedRect);
if (gainFocus) {
setSelectionFromTop(pos, y);
}
}
@Override
protected void handleDataChanged() {
super.handleDataChanged();
if(dataChangedListener!=null)dataChangedListener.onSuccess();
}
public void setDataChangedListener(DataChangedListener dataChangedListener) {
this.dataChangedListener = dataChangedListener;
}
public interface DataChangedListener{
public void onSuccess();
}
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#cc181e28" />
<corners android:radius="30px" />
</shape>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="true"
android:drawable="@drawable/item_right_bg" />
<item
android:state_pressed="true"
android:drawable="@drawable/item_right_bg" />
<item
android:state_focused="true"
android:drawable="@drawable/item_right_bg" />
</selector>

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_selected="true"
android:drawable="@drawable/item_right_bg" />
<item
android:state_pressed="true"
android:drawable="@drawable/item_right_bg" />
<item
android:state_focused="true"
android:drawable="@drawable/item_right_bg" />
</selector>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/title_fouse_n"/>
<corners android:radius="10dp"/>
<stroke android:width="0dp"
android:color="@color/title_fouse_n"/>
</shape>

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="true">
<shape>
<corners android:radius="10mm" />
<solid android:color="@color/color_80FF0057"/>
</shape>
</item>
<item android:state_focused="false" android:state_pressed="true">
<shape>
<corners android:radius="10mm" />
<solid android:color="@color/color_80FF0057"/>
</shape>
</item>
<item android:state_focused="true">
<shape>
<corners android:radius="10mm" />
<solid android:color="@color/color_80FF0057"/>
</shape>
</item>
<item android:state_focused="false" android:state_pressed="false">
<shape>
<corners android:radius="10mm" />
<solid android:color="@color/color_6C3D3D3D"/>
</shape>
</item>
</selector>

@ -7,57 +7,218 @@
<xyz.doikki.videoplayer.player.VideoView
android:id="@+id/mVideoView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
android:layout_height="match_parent" >
<LinearLayout
android:id="@+id/tvLeftChannnelListLayout"
android:layout_width="421mm"
android:layout_height="match_parent"
android:layout_marginLeft="-421mm"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="visible" >
<LinearLayout
android:id="@+id/tvLeftChannnelListLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_margin="0dp"
android:baselineAligned="false"
android:orientation="horizontal"
android:padding="0dp">
<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mGroupGridView"
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"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="10mm" />
<LinearLayout
android:id="@+id/ll_typeSelect"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="20dp"
android:background="@drawable/bg_channel_list"
android:baselineAligned="false"
android:padding="0dp">
<View
android:layout_width="1mm"
android:layout_height="match_parent"
android:background="@color/color_FFFFFF"
android:layout_gravity="center_horizontal" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:orientation="horizontal">
<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mChannelGridView"
android:layout_width="240mm"
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"
app:tv_selectedItemIsCentered="true"
app:tv_verticalSpacingWithMargins="10mm" />
</LinearLayout>
<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mGroupGridView"
android:layout_width="@dimen/vs_240"
android:layout_height="wrap_content"
android:divider="@null"
android:fadeScrollbars="false"
android:listSelector="@drawable/item_bg_selector_left"
android:padding="10dp"
android:scrollbars="none" />
</LinearLayout>
<LinearLayout
android:id="@+id/divLoadEpgleft"
style="@style/epg_window_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:focusable="true"
android:onClick="divLoadEpgLeft"
android:orientation="vertical"
android:visibility="gone">
<TextView
android:id="@+id/tv_arrow0"
android:layout_width="20dp"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="divLoadEpgLeft"
android:paddingBottom="5dp"
android:shadowColor="#CC000000"
android:shadowDx="5.0"
android:shadowRadius="5.0"
android:text="更 多"
android:textColor="@color/color_FFFFFF"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_arrow2"
android:layout_width="20dp"
android:layout_height="20dp"
android:gravity="center|left"
android:onClick="divLoadEpgLeft"
android:paddingLeft="-5dp"
android:paddingTop="5dp"
android:src="@drawable/scrollviewleft" />
<TextView
android:id="@+id/tv_arrow3"
android:layout_width="20dp"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="divLoadEpgLeft"
android:paddingTop="5dp"
android:shadowColor="#CC000000"
android:shadowDx="5.0"
android:shadowRadius="5.0"
android:text="节 目"
android:textColor="@color/color_FFFFFF"
android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_margin="1dp"
android:background="#FF333333" />
<com.owen.tvrecyclerview.widget.TvRecyclerView
android:id="@+id/mChannelGridView"
android:layout_width="@dimen/vs_280"
android:layout_height="match_parent"
android:divider="@null"
android:fadeScrollbars="false"
android:focusable="true"
android:listSelector="@drawable/item_bg_selector_right"
android:padding="5dp"
android:scrollbars="none" />
<LinearLayout
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_margin="2dp"
android:background="#FF333333" />
<LinearLayout
<FrameLayout
android:id="@+id/divEPG"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:orientation="horizontal">
<com.github.tvbox.osc.ui.tv.widget.ChannelListView
android:id="@+id/lv_epg"
android:layout_width="@dimen/vs_340"
android:layout_height="match_parent"
android:divider="@null"
android:fadeScrollbars="false"
android:listSelector="@drawable/item_bg_selector_right"
android:padding="3dp"
android:scrollbars="none"
android:visibility="gone" />
<TextView
android:id="@+id/txtNoEpg"
android:layout_width="@dimen/vs_360"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_marginTop="50px"
android:gravity="center"
android:paddingLeft="5dp"
android:text="暂无节目信息…"
android:textColor="@color/color_FF0057"
android:visibility="gone" />
<LinearLayout
android:id="@+id/divLoadEpg"
style="@style/epg_window_btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:onClick="divLoadEpgRight"
android:orientation="vertical">
<TextView
android:id="@+id/tv_arrow"
android:layout_width="20dp"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="divLoadEpgRight"
android:paddingBottom="5dp"
android:shadowColor="#CC000000"
android:shadowDx="5.0"
android:shadowRadius="5.0"
android:text="节 目"
android:textColor="@color/color_FFFFFF"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_arrow"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:layout_marginLeft="1dp"
android:gravity="center|left"
android:onClick="divLoadEpgRight"
android:paddingTop="5dp"
android:src="@drawable/scrollview" />
<TextView
android:id="@+id/tv_arrow2"
android:layout_width="20dp"
android:layout_height="match_parent"
android:gravity="center"
android:onClick="divLoadEpgRight"
android:paddingTop="5dp"
android:shadowColor="#CC000000"
android:shadowDx="5.0"
android:shadowRadius="5.0"
android:text="信 息"
android:textColor="@color/color_FFFFFF"
android:textStyle="bold" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
</LinearLayout>
</xyz.doikki.videoplayer.player.VideoView>
<!--添加EPG显示,更改样式 by 龍-->
<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:background="@drawable/bg_channel_list"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="visible" >
@ -65,7 +226,6 @@
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"
@ -85,7 +245,6 @@
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"
@ -136,4 +295,338 @@
android:textColor="@android:color/white"
android:textSize="22mm"
android:visibility="gone" />
<!--频道序号显示-->
<RelativeLayout
android:layout_gravity="bottom|center"
android:gravity="center_vertical"
android:id="@+id/ll_epg"
android:paddingBottom="5dp"
android:layout_width="@dimen/vs_960"
android:layout_height="@dimen/vs_200">
<View
android:id="@+id/view_bg"
android:background="@drawable/shape_user_focus"
android:layout_width="wrap_content"
android:layout_height="@dimen/vs_128"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true" />
<TextView
android:id="@+id/tv_channel_bottom_number"
android:layout_width="@dimen/vs_200"
android:layout_height="wrap_content"
android:layout_above="@+id/view_line"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_gravity="center"
android:layout_marginLeft="20mm"
android:layout_marginTop="5mm"
android:layout_marginBottom="-14dp"
android:ellipsize="marquee"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:shadowColor="#CC000000"
android:shadowDx="5.0"
android:shadowRadius="5.0"
android:singleLine="true"
android:text="10"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_100"
android:textStyle="bold" />
<com.github.tvbox.osc.ui.tv.widget.MarqueeTextView
android:id="@+id/tv_channel_bar_name"
android:layout_width="@dimen/vs_200"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/tv_channel_bottom_number"
android:layout_alignLeft="@+id/tv_channel_bottom_number"
android:layout_alignEnd="@+id/tv_channel_bottom_number"
android:layout_alignRight="@+id/tv_channel_bottom_number"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:layout_marginStart="5dp"
android:layout_marginLeft="5dp"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="10dp"
android:ellipsize="marquee"
android:gravity="center"
android:paddingTop="5dp"
android:singleLine="true"
android:text="CCTV 高清"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_34" />
<TextView
android:id="@+id/tv_current_program"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/view_bg"
android:layout_marginLeft="@dimen/vs_40"
android:layout_marginTop="@dimen/vs_50"
android:layout_toRightOf="@+id/tv_channel_bottom_number"
android:gravity="center"
android:text=""
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_26" />
<com.github.tvbox.osc.ui.tv.widget.MarqueeTextView
android:textSize="@dimen/ts_26"
android:textColor="@color/color_FFFFFF"
android:ellipsize="marquee"
android:id="@+id/tv_current_program_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="暂无信息"
android:singleLine="true"
android:layout_toRightOf="@+id/tv_current_program"
android:layout_alignTop="@+id/tv_current_program" />
<com.github.tvbox.osc.ui.tv.widget.MarqueeTextView
android:id="@+id/tv_current_program_name"
android:layout_width="@dimen/vs_400"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_current_program"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_marginStart="26px"
android:layout_marginLeft="26px"
android:layout_marginEnd="@dimen/vs_20"
android:layout_marginRight="@dimen/vs_20"
android:layout_toRightOf="@+id/tv_current_program_time"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:paddingRight="@dimen/vs_20"
android:singleLine="true"
android:text=""
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_26" />
<View
android:id="@+id/view_line"
android:background="@color/color_FFFFFF"
android:layout_width="wrap_content"
android:layout_height="1px"
android:layout_marginTop="16px"
android:layout_alignLeft="@+id/tv_current_program"
android:layout_alignBottom="@+id/tv_current_program_name" />
<TextView
android:textSize="@dimen/ts_26"
android:textColor="@color/color_FFFFFF"
android:id="@+id/tv_next_program"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/vs_10"
android:text=""
android:layout_alignLeft="@+id/tv_current_program"
android:layout_alignBottom="@+id/view_line"
android:layout_alignParentBottom="true" />
<com.github.tvbox.osc.ui.tv.widget.MarqueeTextView
android:textSize="@dimen/ts_26"
android:textColor="@color/color_FFFFFF"
android:id="@+id/tv_next_program_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="暂无信息"
android:singleLine="true"
android:ellipsize="marquee"
android:layout_toRightOf="@+id/tv_next_program"
android:layout_alignTop="@+id/tv_next_program" />
<com.github.tvbox.osc.ui.tv.widget.MarqueeTextView
android:id="@+id/tv_next_program_name"
android:layout_width="@dimen/vs_400"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tv_next_program"
android:layout_alignEnd="@+id/tv_current_program_name"
android:layout_alignRight="@+id/tv_current_program_name"
android:layout_marginStart="26px"
android:layout_marginLeft="26px"
android:layout_marginEnd="@dimen/vs_0"
android:layout_marginRight="@dimen/vs_0"
android:layout_toRightOf="@+id/tv_next_program_time"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:paddingRight="@dimen/vs_20"
android:singleLine="true"
android:text=""
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_26" />
<TextView
android:id="@+id/tv_source"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/view_bg"
android:layout_marginRight="@dimen/vs_20"
android:layout_marginTop="@dimen/vs_10"
android:layout_marginBottom="@dimen/vs_10"
android:layout_alignParentRight="true"
android:text="源 1/1"
android:textColor="@color/color_FFFFFF"
android:textSize="@dimen/ts_26" />
</RelativeLayout>
<TextView
android:id="@+id/tv_shownum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|top"
android:layout_margin="20dp"
android:paddingTop="8dp"/>
<!--时间显示-->
<TextView
android:id="@+id/tv_showTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|top"
android:layout_margin="20dp"
android:paddingTop="8dp"/>
<!--右上角加载动画-->
<LinearLayout
android:layout_gravity="center|left|top"
android:orientation="vertical"
android:id="@+id/ll_loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<!--右上角回看状态栏-->
<RelativeLayout
android:layout_gravity="center|left|bottom"
android:orientation="vertical"
android:id="@+id/ll_right_top_huikan"
android:visibility="gone"
android:background="@drawable/shape_thumb_bottom_name"
android:layout_width="290px"
android:layout_height="100px"
android:layout_marginTop="40px"
android:layout_marginRight="50px"
android:minWidth="270px">
<ImageView
android:id="@+id/iv_back_bg"
android:layout_width="90px"
android:layout_height="90px"
android:layout_marginLeft="10px"
android:src="@drawable/app_icon"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true" />
<TextView
android:id="@+id/tv_right_top_epg_name"
android:layout_width="170px"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="10dp"
android:layout_toEndOf="@+id/iv_back_bg"
android:layout_toRightOf="@+id/iv_back_bg"
android:ellipsize="marquee"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:paddingStart="10px"
android:paddingTop="15px"
android:singleLine="true"
android:text="测试频道"
android:textColor="#FFFCFFFF"
android:textSize="30px"
android:paddingLeft="10px" />
<TextView
android:id="@+id/tv_right_top_type"
android:layout_width="170px"
android:layout_height="wrap_content"
android:layout_alignStart="@+id/tv_right_top_epg_name"
android:layout_alignLeft="@+id/tv_right_top_epg_name"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:layout_gravity="center"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginRight="10dp"
android:layout_marginEnd="0dp"
android:gravity="center"
android:paddingStart="20px"
android:paddingBottom="10px"
android:singleLine="true"
android:text="回看中"
android:textColor="#FFFCFFFF"
android:textSize="24px"
android:paddingLeft="20px" />
</RelativeLayout>
<!--右上角动态状态栏-->
<RelativeLayout
android:layout_gravity="center|right|top"
android:orientation="vertical"
android:id="@+id/ll_right_top_loading"
android:background="@drawable/shape_user_search"
android:layout_width="@dimen/vs_240"
android:layout_height="@dimen/vs_70"
android:layout_marginTop="25mm"
android:layout_marginRight="25mm"
android:minWidth="270px">
<ImageView
android:id="@+id/iv_circle_bg"
android:layout_width="@dimen/vs_40"
android:layout_height="@dimen/vs_40"
android:layout_marginRight="@dimen/vs_10"
android:src="@drawable/app_icon"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" />
<ImageView
android:layout_width="@dimen/vs_40"
android:layout_height="@dimen/vs_40"
android:layout_margin="@dimen/vs_10"
android:layout_alignLeft="@+id/iv_circle_bg"
android:layout_alignTop="@+id/iv_circle_bg"
android:layout_alignRight="@+id/iv_circle_bg"
android:layout_alignBottom="@+id/iv_circle_bg" />
<com.github.tvbox.osc.ui.tv.widget.MarqueeTextView
android:id="@+id/tv_right_top_channel_name"
android:layout_width="@dimen/vs_150"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginEnd="@dimen/vs_5"
android:layout_marginRight="@dimen/vs_5"
android:layout_toStartOf="@+id/iv_circle_bg"
android:layout_toLeftOf="@+id/iv_circle_bg"
android:ellipsize="marquee"
android:gravity="center"
android:marqueeRepeatLimit="marquee_forever"
android:singleLine="true"
android:text="测试频道"
android:textColor="#FFFCFFFF"
android:textSize="@dimen/vs_30" />
<TextView
android:id="@+id/tv_right_top_tipnetspeed"
android:layout_width="@dimen/vs_150"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_gravity="center"
android:layout_marginEnd="@dimen/vs_5"
android:layout_marginRight="@dimen/vs_5"
android:layout_toStartOf="@+id/iv_circle_bg"
android:layout_toLeftOf="@+id/iv_circle_bg"
android:gravity="center"
android:singleLine="true"
android:text="11Kb/s"
android:textColor="#FFFCFFFF"
android:textSize="@dimen/vs_20" />
</RelativeLayout>
</FrameLayout>

@ -3,6 +3,7 @@
<color name="color_6200EE">#6200EE</color>
<color name="color_3700B3">#3700B3</color>
<color name="color_03DAC5">#03DAC5</color>
<color name="title_fouse_n">#ffce7900</color>
<color name="color_1890FF">#1890FF</color>
<color name="color_FFB800">#FF6600</color>
<color name="color_00FF0A">#00FF0A</color>
@ -29,4 +30,6 @@
<color name="color_33FFFFFF">#33ffffff</color>
<color name="color_99FFFFFF">#4D000000</color>
<color name="color_59353744">#59353744</color>
<color name="color_80FF0057">#66FF0057</color>
</resources>

@ -39,4 +39,16 @@
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowFullscreen">true</item>
</style>
<style name="epg_window_btn">
<item name="android:gravity">center</item>
<item name="android:background">@drawable/item_bg_selector_right</item>
<item name="android:paddingLeft">0dip</item>
<item name="android:paddingRight">0dip</item>
<item name="android:focusable">true</item>
<item name="android:focusableInTouchMode">true</item>
<item name="android:clickable">true</item>
<item name="android:drawablePadding">10.0dip</item>
<item name="android:radius">10dp</item>
</style>
</resources>

@ -6,7 +6,7 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx2048m
org.gradle.jvmargs=-Xmx1560m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

Loading…
Cancel
Save