[mobile] fix bug

pull/123/head
FongMi 3 years ago
parent 15aacdc4e1
commit 9ece618b62
  1. 12
      app/src/mobile/java/com/fongmi/android/tv/ui/activity/DetailActivity.java
  2. 70
      app/src/mobile/res/layout/fragment_vod.xml

@ -188,7 +188,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
mPlayers = new Players().init();
mR1 = this::hideControl;
mR2 = this::setTraffic;
mR3 = this::setSensor;
mR3 = this::setRotate;
checkOrientation();
setRecyclerView();
setVideoView();
@ -414,7 +414,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
setR1Callback();
setLock(!isLock());
mBinding.control.lock.setImageResource(isLock() ? R.drawable.ic_lock_on : R.drawable.ic_lock_off);
setRequestedOrientation(isLock() ? (ResUtil.isLand(this) ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT) : ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
setRequestedOrientation(isLock() ? (ResUtil.isLand(this) ? ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT) : ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
}
private void onFull() {
@ -545,7 +545,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
private void enterFullscreen() {
mBinding.control.full.setImageResource(R.drawable.ic_full_off);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE);
getIjk().getSubtitleView().setTextSize(TypedValue.COMPLEX_UNIT_SP, 16);
mBinding.video.setLayoutParams(new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT));
setFullscreen(true);
@ -554,7 +554,7 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
private void exitFullscreen() {
mBinding.control.full.setImageResource(R.drawable.ic_full_on);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT);
getIjk().getSubtitleView().setTextSize(TypedValue.COMPLEX_UNIT_SP, 14);
mBinding.video.setLayoutParams(mFrameParams);
App.post(mR3, 2000);
@ -621,8 +621,8 @@ public class DetailActivity extends BaseActivity implements CustomKeyDownVod.Lis
App.post(mR2, Constant.INTERVAL_TRAFFIC);
}
private void setSensor() {
if (!isLock()) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
private void setRotate() {
if (!isLock()) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
}
private void setR1Callback() {

@ -1,54 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_scrollFlags="scroll|enterAlways" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/type"
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/title"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:paddingBottom="12dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/adapter_type" />
android:background="@color/transparent"
android:elevation="0dp"
app:elevation="0dp">
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="@string/app_name"
android:textColor="@color/white"
android:textSize="20sp"
android:textStyle="bold"
app:layout_scrollFlags="scroll|enterAlways" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/type"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="horizontal"
android:paddingStart="8dp"
android:paddingTop="12dp"
android:paddingEnd="8dp"
android:paddingBottom="12dp"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
tools:listitem="@layout/adapter_type" />
</com.google.android.material.appbar.AppBarLayout>
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/type"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/filter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="16dp"
android:visibility="gone"
app:backgroundTint="@color/blue_500"
app:layout_anchor="@id/pager"
app:layout_anchorGravity="end|bottom"
app:layout_behavior=".ui.custom.CustomFabBehavior"
app:srcCompat="@drawable/ic_filter"
app:tint="@color/white"
@ -58,12 +64,12 @@
android:id="@+id/link"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_margin="16dp"
app:backgroundTint="@color/blue_500"
app:layout_anchor="@id/pager"
app:layout_anchorGravity="end|bottom"
app:layout_behavior=".ui.custom.CustomFabBehavior"
app:srcCompat="@drawable/ic_link"
app:tint="@color/white" />
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Loading…
Cancel
Save