|
167 | 167 | import org.schabi.newpipe.player.helper.PlaybackParameterDialog; |
168 | 168 | import org.schabi.newpipe.player.helper.PlayerDataSource; |
169 | 169 | import org.schabi.newpipe.player.helper.PlayerHelper; |
| 170 | +import org.schabi.newpipe.player.listeners.view.PlaybackSpeedListener; |
| 171 | +import org.schabi.newpipe.player.listeners.view.QualityTextListener; |
170 | 172 | import org.schabi.newpipe.player.playback.CustomTrackSelector; |
171 | 173 | import org.schabi.newpipe.player.playback.MediaSourceManager; |
172 | 174 | import org.schabi.newpipe.player.playback.PlaybackListener; |
@@ -530,9 +532,12 @@ private void initPlayer(final boolean playOnReady) { |
530 | 532 | } |
531 | 533 |
|
532 | 534 | private void initListeners() { |
| 535 | + binding.qualityTextView.setOnClickListener( |
| 536 | + new QualityTextListener(this, qualityPopupMenu)); |
| 537 | + binding.playbackSpeed.setOnClickListener( |
| 538 | + new PlaybackSpeedListener(this, playbackSpeedPopupMenu)); |
| 539 | + |
533 | 540 | binding.playbackSeekBar.setOnSeekBarChangeListener(this); |
534 | | - binding.playbackSpeed.setOnClickListener(this); |
535 | | - binding.qualityTextView.setOnClickListener(this); |
536 | 541 | binding.captionTextView.setOnClickListener(this); |
537 | 542 | binding.resizeTextView.setOnClickListener(this); |
538 | 543 | binding.playbackLiveSync.setOnClickListener(this); |
@@ -1926,7 +1931,7 @@ public void hideControls(final long duration, final long delay) { |
1926 | 1931 | }, delay); |
1927 | 1932 | } |
1928 | 1933 |
|
1929 | | - private void showHideShadow(final boolean show, final long duration) { |
| 1934 | + public void showHideShadow(final boolean show, final long duration) { |
1930 | 1935 | animate(binding.playbackControlsShadow, show, duration, AnimationType.ALPHA, 0, null); |
1931 | 1936 | animate(binding.playerTopShadow, show, duration, AnimationType.ALPHA, 0, null); |
1932 | 1937 | animate(binding.playerBottomShadow, show, duration, AnimationType.ALPHA, 0, null); |
@@ -3742,11 +3747,7 @@ public void onClick(final View v) { |
3742 | 3747 | if (DEBUG) { |
3743 | 3748 | Log.d(TAG, "onClick() called with: v = [" + v + "]"); |
3744 | 3749 | } |
3745 | | - if (v.getId() == binding.qualityTextView.getId()) { |
3746 | | - onQualitySelectorClicked(); |
3747 | | - } else if (v.getId() == binding.playbackSpeed.getId()) { |
3748 | | - onPlaybackSpeedClicked(); |
3749 | | - } else if (v.getId() == binding.resizeTextView.getId()) { |
| 3750 | + if (v.getId() == binding.resizeTextView.getId()) { |
3750 | 3751 | onResizeClicked(); |
3751 | 3752 | } else if (v.getId() == binding.captionTextView.getId()) { |
3752 | 3753 | onCaptionClicked(); |
@@ -4446,6 +4447,10 @@ public boolean isSomePopupMenuVisible() { |
4446 | 4447 | return isSomePopupMenuVisible; |
4447 | 4448 | } |
4448 | 4449 |
|
| 4450 | + public void setSomePopupMenuVisible(final boolean somePopupMenuVisible) { |
| 4451 | + isSomePopupMenuVisible = somePopupMenuVisible; |
| 4452 | + } |
| 4453 | + |
4449 | 4454 | public ImageButton getPlayPauseButton() { |
4450 | 4455 | return binding.playPauseButton; |
4451 | 4456 | } |
@@ -4527,6 +4532,11 @@ public ExpandableSurfaceView getSurfaceView() { |
4527 | 4532 | public PlayQueueAdapter getPlayQueueAdapter() { |
4528 | 4533 | return playQueueAdapter; |
4529 | 4534 | } |
| 4535 | + |
| 4536 | + public PlayerBinding getBinding() { |
| 4537 | + return binding; |
| 4538 | + } |
| 4539 | + |
4530 | 4540 | //endregion |
4531 | 4541 |
|
4532 | 4542 |
|
|
0 commit comments