Merge pull request #124 from CatVodTVOfficial/dev

Dev
pull/1/head
DreamDSTR 4 years ago committed by GitHub
commit 3f56ec44c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      app/src/main/java/com/github/tvbox/osc/ui/activity/LivePlayActivity.java

@ -11,6 +11,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
@ -18,6 +19,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.github.tvbox.osc.R; import com.github.tvbox.osc.R;
import com.github.tvbox.osc.api.ApiConfig; import com.github.tvbox.osc.api.ApiConfig;
import com.github.tvbox.osc.base.App;
import com.github.tvbox.osc.base.BaseActivity; import com.github.tvbox.osc.base.BaseActivity;
import com.github.tvbox.osc.bean.ChannelGroup; import com.github.tvbox.osc.bean.ChannelGroup;
import com.github.tvbox.osc.bean.LiveChannel; import com.github.tvbox.osc.bean.LiveChannel;
@ -189,7 +191,8 @@ public class LivePlayActivity extends BaseActivity {
@Override @Override
public void onItemClick(TvRecyclerView parent, View itemView, int position) { public void onItemClick(TvRecyclerView parent, View itemView, int position) {
if (selectedGroupIndex == currentGroupIndex && position == currentChannelIndex) return; if (selectedGroupIndex == currentGroupIndex && position == currentChannelIndex)
return;
if (playChannel(position, false)) { if (playChannel(position, false)) {
mHandler.post(mHideChannelListRun); mHandler.post(mHideChannelListRun);
} }
@ -201,7 +204,8 @@ public class LivePlayActivity extends BaseActivity {
@Override @Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
FastClickCheckUtil.check(view); FastClickCheckUtil.check(view);
if (selectedGroupIndex == currentGroupIndex && position == currentChannelIndex) return; if (selectedGroupIndex == currentGroupIndex && position == currentChannelIndex)
return;
if (playChannel(position, false)) { if (playChannel(position, false)) {
mHandler.post(mHideChannelListRun); mHandler.post(mHideChannelListRun);
} }
@ -312,8 +316,7 @@ public class LivePlayActivity extends BaseActivity {
if (list.size() == 1 && list.get(0).getGroupName().startsWith("http://127.0.0.1")) { if (list.size() == 1 && list.get(0).getGroupName().startsWith("http://127.0.0.1")) {
showLoading(); showLoading();
loadProxyLives(list.get(0).getGroupName()); loadProxyLives(list.get(0).getGroupName());
} } else {
else {
channelGroupList.clear(); channelGroupList.clear();
channelGroupList.addAll(list); channelGroupList.addAll(list);
showSuccess(); showSuccess();
@ -334,7 +337,11 @@ public class LivePlayActivity extends BaseActivity {
List<LiveChannel> list = new ArrayList<>(); List<LiveChannel> list = new ArrayList<>();
JsonArray livesArray = new Gson().fromJson(response.body(), JsonArray.class); JsonArray livesArray = new Gson().fromJson(response.body(), JsonArray.class);
loadLives(livesArray); loadLives(livesArray);
if (channelGroupList == null || channelGroupList.size() == 0) {
Toast.makeText(App.getInstance(), "频道列表为空", Toast.LENGTH_SHORT).show();
finish();
return;
}
mHandler.post(new Runnable() { mHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {

Loading…
Cancel
Save