|
|
|
|
@ -183,6 +183,10 @@ public class DetailActivity extends BaseActivity implements Clock.Callback, Cust |
|
|
|
|
return mBinding.ijk; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isReplay() { |
|
|
|
|
return Prefers.getReset() == 1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isFromCollect() { |
|
|
|
|
return getCallingActivity() != null && getCallingActivity().getShortClassName().contains(CollectActivity.class.getSimpleName()); |
|
|
|
|
} |
|
|
|
|
@ -247,12 +251,14 @@ public class DetailActivity extends BaseActivity implements Clock.Callback, Cust |
|
|
|
|
mBinding.control.action.loop.setOnClickListener(view -> onLoop()); |
|
|
|
|
mBinding.control.action.scale.setOnClickListener(view -> onScale()); |
|
|
|
|
mBinding.control.action.speed.setOnClickListener(view -> onSpeed()); |
|
|
|
|
mBinding.control.action.reset.setOnClickListener(view -> onReset()); |
|
|
|
|
mBinding.control.action.player.setOnClickListener(view -> onPlayer()); |
|
|
|
|
mBinding.control.action.decode.setOnClickListener(view -> onDecode()); |
|
|
|
|
mBinding.control.action.ending.setOnClickListener(view -> onEnding()); |
|
|
|
|
mBinding.control.action.opening.setOnClickListener(view -> onOpening()); |
|
|
|
|
mBinding.control.action.episodes.setOnClickListener(view -> onEpisodes()); |
|
|
|
|
mBinding.control.action.speed.setOnLongClickListener(view -> onSpeedLong()); |
|
|
|
|
mBinding.control.action.reset.setOnLongClickListener(view -> onResetToggle()); |
|
|
|
|
mBinding.control.action.ending.setOnLongClickListener(view -> onEndingReset()); |
|
|
|
|
mBinding.control.action.opening.setOnLongClickListener(view -> onOpeningReset()); |
|
|
|
|
mBinding.video.setOnTouchListener((view, event) -> mKeyDown.onTouchEvent(event)); |
|
|
|
|
@ -281,6 +287,7 @@ public class DetailActivity extends BaseActivity implements Clock.Callback, Cust |
|
|
|
|
mBinding.control.action.player.setText(mPlayers.getPlayerText()); |
|
|
|
|
getExo().setVisibility(mPlayers.isExo() ? View.VISIBLE : View.GONE); |
|
|
|
|
getIjk().setVisibility(mPlayers.isIjk() ? View.VISIBLE : View.GONE); |
|
|
|
|
mBinding.control.action.reset.setText(ResUtil.getStringArray(R.array.select_reset)[Prefers.getReset()]); |
|
|
|
|
mBinding.video.addOnLayoutChangeListener((view, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> mPiP.update(getActivity(), view)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -570,10 +577,20 @@ public class DetailActivity extends BaseActivity implements Clock.Callback, Cust |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onReset() { |
|
|
|
|
onReset(isReplay()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onReset(boolean replay) { |
|
|
|
|
Clock.get().setCallback(null); |
|
|
|
|
if (mFlagAdapter.getItemCount() == 0) return; |
|
|
|
|
if (mEpisodeAdapter.getItemCount() == 0) return; |
|
|
|
|
getPlayer(getFlag(), getEpisode(), true); |
|
|
|
|
getPlayer(getFlag(), getEpisode(), replay); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean onResetToggle() { |
|
|
|
|
Prefers.putReset(Math.abs(Prefers.getReset() - 1)); |
|
|
|
|
mBinding.control.action.reset.setText(ResUtil.getStringArray(R.array.select_reset)[Prefers.getReset()]); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void onPlayer() { |
|
|
|
|
@ -866,7 +883,7 @@ public class DetailActivity extends BaseActivity implements Clock.Callback, Cust |
|
|
|
|
|
|
|
|
|
private void checkEnded() { |
|
|
|
|
if (mBinding.control.action.loop.isActivated()) { |
|
|
|
|
onReset(); |
|
|
|
|
onReset(true); |
|
|
|
|
} else { |
|
|
|
|
checkNext(); |
|
|
|
|
} |
|
|
|
|
|