|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
package com.github.tvbox.osc.ui.activity; |
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint; |
|
|
|
|
import android.content.DialogInterface; |
|
|
|
|
import android.content.Intent; |
|
|
|
|
import android.graphics.Rect; |
|
|
|
|
@ -61,6 +62,7 @@ import org.json.JSONObject; |
|
|
|
|
import java.net.URLEncoder; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.concurrent.ExecutorService; |
|
|
|
|
import java.util.concurrent.Executors; |
|
|
|
|
|
|
|
|
|
@ -71,6 +73,7 @@ import me.jessyan.autosize.utils.AutoSizeUtils; |
|
|
|
|
* @date :2020/12/22 |
|
|
|
|
* @description: |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
public class DetailActivity extends BaseActivity { |
|
|
|
|
private LinearLayout llLayout; |
|
|
|
|
private FragmentContainerView llPlayerFragmentContainer; |
|
|
|
|
@ -156,6 +159,7 @@ public class DetailActivity extends BaseActivity { |
|
|
|
|
tvPlay.setText("全屏"); |
|
|
|
|
} |
|
|
|
|
tvSort.setOnClickListener(new View.OnClickListener() { |
|
|
|
|
@SuppressLint("NotifyDataSetChanged") |
|
|
|
|
@Override |
|
|
|
|
public void onClick(View v) { |
|
|
|
|
if (vodInfo != null && vodInfo.seriesMap.size() > 0) { |
|
|
|
|
@ -254,7 +258,7 @@ public class DetailActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onItemPreSelected(TvRecyclerView parent, View itemView, int position) { |
|
|
|
|
|
|
|
|
|
seriesSelect = false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -272,21 +276,20 @@ public class DetailActivity extends BaseActivity { |
|
|
|
|
public void onItemClick(BaseQuickAdapter adapter, View view, int position) { |
|
|
|
|
FastClickCheckUtil.check(view); |
|
|
|
|
if (vodInfo != null && vodInfo.seriesMap.get(vodInfo.playFlag).size() > 0) { |
|
|
|
|
// boolean reload = false;
|
|
|
|
|
boolean reload = false; |
|
|
|
|
if (vodInfo.playIndex != position) { |
|
|
|
|
seriesAdapter.getData().get(vodInfo.playIndex).selected = false; |
|
|
|
|
seriesAdapter.notifyItemChanged(vodInfo.playIndex); |
|
|
|
|
seriesAdapter.getData().get(position).selected = true; |
|
|
|
|
seriesAdapter.notifyItemChanged(position); |
|
|
|
|
vodInfo.playIndex = position; |
|
|
|
|
// reload = true;
|
|
|
|
|
reload=true; |
|
|
|
|
} |
|
|
|
|
seriesAdapter.getData().get(vodInfo.playIndex).selected = true; |
|
|
|
|
seriesAdapter.notifyItemChanged(vodInfo.playIndex); |
|
|
|
|
//选集全屏 想选集不全屏的注释下面一行
|
|
|
|
|
if (showPreview && !fullWindows) toggleFullPreview(); |
|
|
|
|
// if (!showPreview || reload) jumpToPlay();
|
|
|
|
|
jumpToPlay(); |
|
|
|
|
if (!showPreview || reload) jumpToPlay(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
@ -508,8 +511,8 @@ public class DetailActivity extends BaseActivity { |
|
|
|
|
|
|
|
|
|
private String searchTitle = ""; |
|
|
|
|
private boolean hadQuickStart = false; |
|
|
|
|
private List<Movie.Video> quickSearchData = new ArrayList<>(); |
|
|
|
|
private List<String> quickSearchWord = new ArrayList<>(); |
|
|
|
|
private final List<Movie.Video> quickSearchData = new ArrayList<>(); |
|
|
|
|
private final List<String> quickSearchWord = new ArrayList<>(); |
|
|
|
|
private ExecutorService searchExecutorService = null; |
|
|
|
|
|
|
|
|
|
private void switchSearchWord(String word) { |
|
|
|
|
@ -684,9 +687,9 @@ public class DetailActivity extends BaseActivity { |
|
|
|
|
boolean fullWindows = false; |
|
|
|
|
ViewGroup.LayoutParams windowsPreview = null; |
|
|
|
|
ViewGroup.LayoutParams windowsFull = null; |
|
|
|
|
ViewGroup playerParent = null; |
|
|
|
|
View playerRoot = null; |
|
|
|
|
ViewGroup llLayoutParent = null; |
|
|
|
|
// ViewGroup playerParent = null;
|
|
|
|
|
// View playerRoot = null;
|
|
|
|
|
// ViewGroup llLayoutParent = null;
|
|
|
|
|
|
|
|
|
|
void toggleFullPreview() { |
|
|
|
|
if (windowsPreview == null) { |
|
|
|
|
@ -695,26 +698,26 @@ public class DetailActivity extends BaseActivity { |
|
|
|
|
if (windowsFull == null) { |
|
|
|
|
windowsFull = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); |
|
|
|
|
} |
|
|
|
|
if (playerRoot == null) |
|
|
|
|
playerRoot = (View) llPlayerFragmentContainer.findViewById(R.id.mVideoView).getParent(); |
|
|
|
|
|
|
|
|
|
if (playerParent == null) { |
|
|
|
|
playerParent = (ViewGroup) playerRoot.getParent(); |
|
|
|
|
} |
|
|
|
|
if (llLayoutParent == null) |
|
|
|
|
llLayoutParent = (ViewGroup) llLayout.getParent(); |
|
|
|
|
|
|
|
|
|
fullWindows = !fullWindows; |
|
|
|
|
// llPlayerFragmentContainer.setLayoutParams(fullWindows ? windowsFull : windowsPreview);
|
|
|
|
|
if (fullWindows) { |
|
|
|
|
playerParent.removeView(playerRoot); |
|
|
|
|
((ViewGroup) getWindow().getDecorView()).addView(playerRoot); |
|
|
|
|
llLayoutParent.removeView(llLayout); |
|
|
|
|
} else { |
|
|
|
|
((ViewGroup) getWindow().getDecorView()).removeView(playerRoot); |
|
|
|
|
playerParent.addView(playerRoot); |
|
|
|
|
llLayoutParent.addView(llLayout); |
|
|
|
|
} |
|
|
|
|
// if (playerRoot == null)
|
|
|
|
|
// playerRoot = (View) llPlayerFragmentContainer.findViewById(R.id.mVideoView).getParent();
|
|
|
|
|
//
|
|
|
|
|
// if (playerParent == null) {
|
|
|
|
|
// playerParent = (ViewGroup) playerRoot.getParent();
|
|
|
|
|
// }
|
|
|
|
|
// if (llLayoutParent == null)
|
|
|
|
|
// llLayoutParent = (ViewGroup) llLayout.getParent();
|
|
|
|
|
|
|
|
|
|
// if (fullWindows) {
|
|
|
|
|
// playerParent.removeView(playerRoot);
|
|
|
|
|
// ((ViewGroup) getWindow().getDecorView()).addView(playerRoot);
|
|
|
|
|
// llLayoutParent.removeView(llLayout);
|
|
|
|
|
// } else {
|
|
|
|
|
// ((ViewGroup) getWindow().getDecorView()).removeView(playerRoot);
|
|
|
|
|
// playerParent.addView(playerRoot);
|
|
|
|
|
// llLayoutParent.addView(llLayout);
|
|
|
|
|
// }
|
|
|
|
|
llPlayerFragmentContainerBlock.setVisibility(fullWindows ? View.GONE : View.VISIBLE); |
|
|
|
|
llPlayerFragmentContainer.setLayoutParams(fullWindows ? windowsFull : windowsPreview); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|