|
73 | 73 | import android.util.DisplayMetrics; |
74 | 74 | import android.util.Log; |
75 | 75 | import android.util.TypedValue; |
76 | | -import android.view.ContextThemeWrapper; |
77 | 76 | import android.view.Gravity; |
78 | 77 | import android.view.KeyEvent; |
79 | 78 | import android.view.LayoutInflater; |
|
89 | 88 | import android.widget.ImageButton; |
90 | 89 | import android.widget.ImageView; |
91 | 90 | import android.widget.LinearLayout; |
92 | | -import android.widget.PopupMenu; |
93 | 91 | import android.widget.ProgressBar; |
94 | 92 | import android.widget.RelativeLayout; |
95 | 93 | import android.widget.SeekBar; |
|
99 | 97 | import androidx.annotation.Nullable; |
100 | 98 | import androidx.appcompat.app.AppCompatActivity; |
101 | 99 | import androidx.appcompat.content.res.AppCompatResources; |
| 100 | +import androidx.appcompat.view.ContextThemeWrapper; |
102 | 101 | import androidx.appcompat.widget.AppCompatImageButton; |
| 102 | +import androidx.appcompat.widget.PopupMenu; |
103 | 103 | import androidx.core.content.ContextCompat; |
104 | 104 | import androidx.core.graphics.Insets; |
105 | 105 | import androidx.core.view.GestureDetectorCompat; |
@@ -3249,6 +3249,9 @@ public void closeItemsList() { |
3249 | 3249 | binding.itemsListPanel.setTranslationY( |
3250 | 3250 | -binding.itemsListPanel.getHeight() * 5); |
3251 | 3251 | }); |
| 3252 | + |
| 3253 | + // clear focus, otherwise a white rectangle remains on top of the player |
| 3254 | + binding.itemsListClose.clearFocus(); |
3252 | 3255 | binding.playPauseButton.requestFocus(); |
3253 | 3256 | } |
3254 | 3257 | } |
@@ -3855,24 +3858,23 @@ public boolean onKeyDown(final int keyCode) { |
3855 | 3858 | case KeyEvent.KEYCODE_DPAD_DOWN: |
3856 | 3859 | case KeyEvent.KEYCODE_DPAD_RIGHT: |
3857 | 3860 | case KeyEvent.KEYCODE_DPAD_CENTER: |
3858 | | - if (binding.getRoot().hasFocus() && !binding.playbackControlRoot.hasFocus()) { |
3859 | | - // do not interfere with focus in playlist etc. |
| 3861 | + if ((binding.getRoot().hasFocus() && !binding.playbackControlRoot.hasFocus()) |
| 3862 | + || isQueueVisible) { |
| 3863 | + // do not interfere with focus in playlist and play queue etc. |
3860 | 3864 | return false; |
3861 | 3865 | } |
3862 | 3866 |
|
3863 | 3867 | if (currentState == Player.STATE_BLOCKED) { |
3864 | 3868 | return true; |
3865 | 3869 | } |
3866 | 3870 |
|
3867 | | - if (!isControlsVisible()) { |
3868 | | - if (!isQueueVisible) { |
3869 | | - binding.playPauseButton.requestFocus(); |
3870 | | - } |
| 3871 | + if (isControlsVisible()) { |
| 3872 | + hideControls(DEFAULT_CONTROLS_DURATION, DPAD_CONTROLS_HIDE_TIME); |
| 3873 | + } else { |
| 3874 | + binding.playPauseButton.requestFocus(); |
3871 | 3875 | showControlsThenHide(); |
3872 | 3876 | showSystemUIPartially(); |
3873 | 3877 | return true; |
3874 | | - } else { |
3875 | | - hideControls(DEFAULT_CONTROLS_DURATION, DPAD_CONTROLS_HIDE_TIME); |
3876 | 3878 | } |
3877 | 3879 | break; |
3878 | 3880 | } |
|
0 commit comments