diff options
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java | 11 | ||||
-rw-r--r-- | app/src/main/res/layout/videoplayer_activity.xml | 32 | ||||
-rw-r--r-- | core/src/main/res/values-v11/dimens.xml | 4 | ||||
-rw-r--r-- | core/src/main/res/values/dimens.xml | 2 |
4 files changed, 30 insertions, 19 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index d625f21da..25bcfd931 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -54,6 +54,7 @@ public class VideoplayerActivity extends MediaplayerActivity { @Override protected void onCreate(Bundle savedInstanceState) { getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN); supportRequestWindowFeature(WindowCompat.FEATURE_ACTION_BAR_OVERLAY); // has to be called before setting layout content super.onCreate(savedInstanceState); getSupportActionBar().setBackgroundDrawable(new ColorDrawable(0x80000000)); @@ -116,6 +117,9 @@ public class VideoplayerActivity extends MediaplayerActivity { videoview.getHolder().addCallback(surfaceHolderCallback); videoview.setOnTouchListener(onVideoviewTouched); + if (Build.VERSION.SDK_INT >= 16) { + videoview.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION); + } setupVideoControlsToggler(); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); @@ -333,10 +337,9 @@ public class VideoplayerActivity extends MediaplayerActivity { butPlay.startAnimation(animation); } if (Build.VERSION.SDK_INT >= 14) { - videoview.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE); - getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN - | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION); - + int videoviewFlag = (Build.VERSION.SDK_INT >= 16) ? View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION : 0; + getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN + | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | videoviewFlag); } videoOverlay.setVisibility(View.GONE); butPlay.setVisibility(View.GONE); diff --git a/app/src/main/res/layout/videoplayer_activity.xml b/app/src/main/res/layout/videoplayer_activity.xml index a0335305f..4dfab0479 100644 --- a/app/src/main/res/layout/videoplayer_activity.xml +++ b/app/src/main/res/layout/videoplayer_activity.xml @@ -1,31 +1,32 @@ <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/black" + android:orientation="vertical"> <de.danoeh.antennapod.view.AspectRatioVideoView android:id="@+id/videoview" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_gravity="center"/> + android:layout_gravity="center" /> <ProgressBar android:id="@+id/progressIndicator" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:visibility="invisible" - android:indeterminateOnly="true"/> + android:indeterminateOnly="true" + android:visibility="invisible" /> <ImageButton android:id="@+id/butPlay" - android:contentDescription="@string/pause_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:background="@drawable/overlay_button_circle_background" - android:src="@drawable/ic_av_pause_circle_outline_80dp"/> + android:contentDescription="@string/pause_label" + android:src="@drawable/ic_av_pause_circle_outline_80dp" /> <LinearLayout android:id="@+id/overlay" @@ -39,8 +40,8 @@ android:id="@+id/timecontrol" android:layout_width="match_parent" android:layout_height="50dp" - android:paddingTop="8dp" - android:layout_marginBottom="4dp"> + android:layout_marginBottom="4dp" + android:paddingTop="8dp"> <TextView android:id="@+id/txtvPosition" @@ -52,9 +53,9 @@ android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="4dp" + android:text="@string/position_default_label" android:textColor="@color/white" - android:textStyle="bold" - android:text="@string/position_default_label"/> + android:textStyle="bold" /> <TextView android:id="@+id/txtvLength" @@ -66,9 +67,10 @@ android:layout_marginLeft="8dp" android:layout_marginRight="8dp" android:layout_marginTop="4dp" + android:paddingRight="@dimen/navigation_bar_width" + android:text="@string/position_default_label" android:textColor="@color/white" - android:textStyle="bold" - android:text="@string/position_default_label"/> + android:textStyle="bold" /> <SeekBar android:id="@+id/sbPosition" @@ -76,7 +78,7 @@ android:layout_height="wrap_content" android:layout_toLeftOf="@+id/txtvLength" android:layout_toRightOf="@+id/txtvPosition" - android:max="500"/> + android:max="500" /> </RelativeLayout> </LinearLayout> diff --git a/core/src/main/res/values-v11/dimens.xml b/core/src/main/res/values-v11/dimens.xml new file mode 100644 index 000000000..62423fc1b --- /dev/null +++ b/core/src/main/res/values-v11/dimens.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="navigation_bar_width">42dp</dimen> +</resources>
\ No newline at end of file diff --git a/core/src/main/res/values/dimens.xml b/core/src/main/res/values/dimens.xml index 38c14b024..37a17f3df 100644 --- a/core/src/main/res/values/dimens.xml +++ b/core/src/main/res/values/dimens.xml @@ -33,4 +33,6 @@ <dimen name="listitem_icon_leftpadding">16dp</dimen> <dimen name="listitem_icon_rightpadding">16dp</dimen> + <dimen name="navigation_bar_width">0dp</dimen> + </resources>
\ No newline at end of file |