From 894ea27df2a14a9bc467b473632ee6e3e913d82b Mon Sep 17 00:00:00 2001 From: Mauricio Colli Date: Sun, 9 Jul 2017 22:38:47 -0300 Subject: [PATCH] Fix issues #596 --- .../newpipe/player/MainVideoPlayer.java | 2 +- .../schabi/newpipe/player/VideoPlayer.java | 14 ++++++---- app/src/main/res/layout/player_popup.xml | 28 ++++++++++--------- app/src/main/res/values-sw600dp/dimens.xml | 2 +- app/src/main/res/values/dimens.xml | 2 +- 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java index 7e20d4940..547d6447e 100644 --- a/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/MainVideoPlayer.java @@ -266,7 +266,7 @@ public class MainVideoPlayer extends Activity { animateView(playerImpl.getControlsRoot(), true, 300, 0, new Runnable() { @Override public void run() { - if (getCurrentState() == STATE_PLAYING && !playerImpl.isQualityMenuVisible()) { + if (getCurrentState() == STATE_PLAYING && !playerImpl.isSomePopupMenuVisible()) { hideControls(300, DEFAULT_CONTROLS_HIDE_TIME); } } diff --git a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java index a8db51c40..c16acd766 100644 --- a/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java +++ b/app/src/main/java/org/schabi/newpipe/player/VideoPlayer.java @@ -109,7 +109,7 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer. private ValueAnimator controlViewAnimator; private Handler controlsVisibilityHandler = new Handler(); - private boolean isQualityPopupMenuVisible = false; + private boolean isSomePopupMenuVisible = false; private boolean qualityChanged = false; private int qualityPopupMenuGroupId = 69; private PopupMenu qualityPopupMenu; @@ -467,19 +467,19 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer. } /** - * Called when the quality selector is dismissed + * Called when some popup menu is dismissed */ @Override public void onDismiss(PopupMenu menu) { if (DEBUG) Log.d(TAG, "onDismiss() called with: menu = [" + menu + "]"); - isQualityPopupMenuVisible = false; + isSomePopupMenuVisible = false; qualityTextView.setText(getSelectedVideoStream().resolution); } public void onQualitySelectorClicked() { if (DEBUG) Log.d(TAG, "onQualitySelectorClicked() called"); qualityPopupMenu.show(); - isQualityPopupMenuVisible = true; + isSomePopupMenuVisible = true; showControls(300); VideoStream videoStream = getSelectedVideoStream(); @@ -490,6 +490,8 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer. private void onPlaybackSpeedClicked() { if (DEBUG) Log.d(TAG, "onPlaybackSpeedClicked() called"); playbackSpeedPopupMenu.show(); + isSomePopupMenuVisible = true; + showControls(300); } /*////////////////////////////////////////////////////////////////////////// @@ -592,8 +594,8 @@ public abstract class VideoPlayer extends BasePlayer implements SimpleExoPlayer. controlViewAnimator.start(); } - public boolean isQualityMenuVisible() { - return isQualityPopupMenuVisible; + public boolean isSomePopupMenuVisible() { + return isSomePopupMenuVisible; } public void showControlsThenHide() { diff --git a/app/src/main/res/layout/player_popup.xml b/app/src/main/res/layout/player_popup.xml index b8869463a..fb3d6920e 100644 --- a/app/src/main/res/layout/player_popup.xml +++ b/app/src/main/res/layout/player_popup.xml @@ -6,8 +6,8 @@ android:layout_height="match_parent" android:background="@android:color/black" android:gravity="center" - tools:layout_width="@dimen/popup_default_width" - tools:layout_height="101.25dp"> + tools:layout_height="84dp" + tools:layout_width="@dimen/popup_minimum_width"> + android:paddingTop="4dp" + tools:ignore="RtlHardcoded"> + tools:ignore="RtlHardcoded,RtlSymmetry" + tools:text="1080p60"/> + android:textStyle="bold" + tools:ignore="RelativeOverlap,RtlHardcoded,RtlSymmetry" + tools:text="1.75x"/> + android:weightSum="5.5"> + tools:visibility="gone"/> \ No newline at end of file diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml index 8ab553bb6..724e16681 100644 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ b/app/src/main/res/values-sw600dp/dimens.xml @@ -1,7 +1,7 @@ 230dp - 140dp + 160dp 18sp diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 5fe9e47aa..e52165651 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -18,7 +18,7 @@ 2sp 180dp - 120dp + 150dp 16sp