[mobile] add seek edge check

pull/123/head
FongMi 3 years ago
parent bc49e2ba0d
commit e480651b07
  1. 11
      app/src/main/java/com/fongmi/android/tv/App.java
  2. 4
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/DetailActivity.java
  3. 4
      app/src/mobile/java/com/fongmi/android/tv/ui/custom/CustomKeyDownVod.java
  4. 24
      app/src/mobile/res/layout/view_control_vod.xml

@ -103,4 +103,15 @@ public class App extends Application {
}
});
}
@Override
public String getPackageName() {
for (StackTraceElement element : Thread.currentThread().getStackTrace()) {
if (element.getClassName().equals("org.chromium.base.BuildInfo")) {
if (element.getMethodName().equals("getAll")) return "com.android.chrome";
break;
}
}
return super.getPackageName();
}
}

@ -577,6 +577,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
private void enterFullscreen() {
mBinding.video.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
mBinding.control.getRoot().setPadding(ResUtil.dp2px(24), ResUtil.dp2px(16), ResUtil.dp2px(24), 0);
getIjk().getSubtitleView().setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
mBinding.control.full.setImageResource(R.drawable.ic_control_full_off);
@ -587,10 +588,11 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
}
private void exitFullscreen() {
mBinding.control.getRoot().setPadding(ResUtil.dp2px(16), ResUtil.dp2px(16), ResUtil.dp2px(16), 0);
getIjk().getSubtitleView().setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
mBinding.control.full.setImageResource(R.drawable.ic_control_full_on);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT);
mBinding.episode.scrollToPosition(mEpisodeAdapter.getPosition());
mBinding.control.full.setImageResource(R.drawable.ic_control_full_on);
mBinding.video.setLayoutParams(mFrameParams);
App.post(mR3, 2000);
setFullscreen(false);

@ -32,7 +32,9 @@ public class CustomKeyDownVod extends GestureDetector.SimpleOnGestureListener {
@Override
public boolean onDown(@NonNull MotionEvent e) {
touch = true;
int width = ResUtil.getScreenWidthPx();
int edgeX = (int) Math.abs(e.getX() - width);
touch = e.getX() > 300 && edgeX > 300;
seek = false;
return true;
}

@ -3,15 +3,15 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_20">
android:background="@color/black_20"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp">
<LinearLayout
android:id="@+id/top"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:orientation="horizontal">
<LinearLayout
@ -63,7 +63,6 @@
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginStart="24dp"
android:gravity="center"
android:orientation="vertical">
@ -82,7 +81,6 @@
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginEnd="24dp"
android:gravity="center"
android:orientation="vertical">
@ -116,18 +114,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:clipChildren="false"
android:clipToPadding="false"
android:paddingStart="16dp"
android:paddingEnd="16dp"
tools:itemCount="1"
tools:listitem="@layout/adapter_parse" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:gravity="center_vertical"
android:orientation="horizontal">
@ -151,6 +143,7 @@
android:id="@+id/action"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:fillViewport="true"
android:scrollbars="none">
@ -158,13 +151,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="4dp"
android:clipChildren="false"
android:clipToPadding="false"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingStart="16dp"
android:paddingEnd="16dp">
android:orientation="horizontal">
<ImageView
android:id="@+id/prev"

Loading…
Cancel
Save