修复直播换源闪退

pull/68/head
Roinlong 3 years ago
parent 151624dd61
commit eb4bc85590
  1. 5
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java
  2. 11
      app/src/main/java/com/github/tvbox/osc/ui/adapter/LiveEpgAdapter.java

@ -503,10 +503,9 @@ public class LivePlayActivity extends BaseActivity {
if (countDownTimer != null) {
countDownTimer.cancel();
}
countDownTimer = new CountDownTimer(10000, 1000) {//底部epg隐藏时间设定
countDownTimer = new CountDownTimer(5000, 1000) {//底部epg隐藏时间设定
public void onTick(long j) {
}
public void onFinish() {
findViewById(R.id.ll_epg).setVisibility(View.GONE);
}
@ -913,7 +912,7 @@ public class LivePlayActivity extends BaseActivity {
mRightEpgList.setOnItemListener(new TvRecyclerView.OnItemListener() {
@Override
public void onItemPreSelected(TvRecyclerView parent, View itemView, int position) {
epgListAdapter.setFocusedEpgIndex(-1);;
epgListAdapter.setFocusedEpgIndex(-1);
}
@Override

@ -113,22 +113,19 @@ public class LiveEpgAdapter extends BaseQuickAdapter<Epginfo, BaseViewHolder> {
public void setSelectedEpgIndex(int selectedEpgIndex) {
if (selectedEpgIndex == this.selectedEpgIndex) return;
int preSelectedIndex = this.selectedEpgIndex;
this.selectedEpgIndex = selectedEpgIndex;
if (preSelectedIndex != -1)
notifyItemChanged(preSelectedIndex);
if (this.selectedEpgIndex != -1)
notifyItemChanged(this.selectedEpgIndex);
}
public int getFocusedEpgIndex() {
return focusedEpgIndex;
}
public void setFocusedEpgIndex(int focusedEpgIndex) {
int preSelectedIndex = this.selectedEpgIndex;
this.focusedEpgIndex = focusedEpgIndex;
if (preSelectedIndex != -1)
notifyItemChanged(preSelectedIndex);
else if (this.focusedEpgIndex != -1)
if (this.focusedEpgIndex != -1)
notifyItemChanged(this.focusedEpgIndex);
}
}

Loading…
Cancel
Save