Skip to content

Commit

Permalink
Update DetailActivity.java
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanglyt committed Jul 25, 2022
1 parent ab9d9f4 commit ddea8cf
Showing 1 changed file with 23 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Rect;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
Expand Down Expand Up @@ -463,15 +465,15 @@ public void refresh(RefreshEvent event) {
if (event.obj instanceof Integer) {
int index = (int) event.obj;
// if (index != vodInfo.playIndex) {
seriesAdapter.getData().get(vodInfo.playIndex).selected = false;
seriesAdapter.notifyItemChanged(vodInfo.playIndex);
seriesAdapter.getData().get(index).selected = true;
seriesAdapter.notifyItemChanged(index);
mGridView.setSelection(index);
vodInfo.playIndex = index;
//保存历史
insertVod(sourceKey, vodInfo);
// }
seriesAdapter.getData().get(vodInfo.playIndex).selected = false;
seriesAdapter.notifyItemChanged(vodInfo.playIndex);
seriesAdapter.getData().get(index).selected = true;
seriesAdapter.notifyItemChanged(index);
mGridView.setSelection(index);
vodInfo.playIndex = index;
//保存历史
insertVod(sourceKey, vodInfo);
// }
} else if (event.obj instanceof JSONObject) {
vodInfo.playerCfg = ((JSONObject) event.obj).toString();
//保存历史
Expand Down Expand Up @@ -658,6 +660,18 @@ public boolean dispatchKeyEvent(KeyEvent event) {
return super.dispatchKeyEvent(event);
}

@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
if (showPreview && !fullWindows) {
Rect editTextRect = new Rect();
llPlayerFragmentContainerBlock.getHitRect(editTextRect);
if (editTextRect.contains((int) ev.getX(), (int) ev.getY())) {
return true;
}
}
return super.dispatchTouchEvent(ev);
}

// preview
boolean showPreview = true; // true 开启 false 关闭
boolean fullWindows = false;
Expand Down

0 comments on commit ddea8cf

Please sign in to comment.