@@ -2348,7 +2348,8 @@ private void onShuffleOrRepeatModeChanged() {
23482348 NotificationUtil .getInstance ().createNotificationIfNeededAndUpdate (this , false );
23492349 }
23502350
2351- private void setRepeatModeButton (final AppCompatImageButton imageButton , final int repeatMode ) {
2351+ private void setRepeatModeButton (final AppCompatImageButton imageButton ,
2352+ @ RepeatMode final int repeatMode ) {
23522353 switch (repeatMode ) {
23532354 case REPEAT_MODE_OFF :
23542355 imageButton .setImageResource (R .drawable .exo_controls_repeat_off );
@@ -2362,7 +2363,7 @@ private void setRepeatModeButton(final AppCompatImageButton imageButton, final i
23622363 }
23632364 }
23642365
2365- private void setShuffleButton (final ImageButton button , final boolean shuffled ) {
2366+ private void setShuffleButton (@ NonNull final ImageButton button , final boolean shuffled ) {
23662367 button .setImageAlpha (shuffled ? 255 : 77 );
23672368 }
23682369 //endregion
@@ -2387,7 +2388,7 @@ boolean isMuted() {
23872388 return !exoPlayerIsNull () && simpleExoPlayer .getVolume () == 0 ;
23882389 }
23892390
2390- private void setMuteButton (final ImageButton button , final boolean isMuted ) {
2391+ private void setMuteButton (@ NonNull final ImageButton button , final boolean isMuted ) {
23912392 button .setImageDrawable (AppCompatResources .getDrawable (context , isMuted
23922393 ? R .drawable .ic_volume_off : R .drawable .ic_volume_up ));
23932394 }
@@ -2876,7 +2877,7 @@ private void saveStreamProgressState(final long progressMillis) {
28762877 databaseUpdateDisposable
28772878 .add (recordManager .saveStreamState (currentMetadata .getMetadata (), progressMillis )
28782879 .observeOn (AndroidSchedulers .mainThread ())
2879- .doOnError (( e ) -> {
2880+ .doOnError (e -> {
28802881 if (DEBUG ) {
28812882 e .printStackTrace ();
28822883 }
@@ -3386,7 +3387,7 @@ private void buildPlaybackSpeedMenu() {
33863387 playbackSpeedPopupMenu .setOnDismissListener (this );
33873388 }
33883389
3389- private void buildCaptionMenu (final List <String > availableLanguages ) {
3390+ private void buildCaptionMenu (@ NonNull final List <String > availableLanguages ) {
33903391 if (captionPopupMenu == null ) {
33913392 return ;
33923393 }
@@ -3454,7 +3455,7 @@ private void buildCaptionMenu(final List<String> availableLanguages) {
34543455 * Called when an item of the quality selector or the playback speed selector is selected.
34553456 */
34563457 @ Override
3457- public boolean onMenuItemClick (final MenuItem menuItem ) {
3458+ public boolean onMenuItemClick (@ NonNull final MenuItem menuItem ) {
34583459 if (DEBUG ) {
34593460 Log .d (TAG , "onMenuItemClick() called with: "
34603461 + "menuItem = [" + menuItem + "], "
@@ -3491,7 +3492,7 @@ public boolean onMenuItemClick(final MenuItem menuItem) {
34913492 * Called when some popup menu is dismissed.
34923493 */
34933494 @ Override
3494- public void onDismiss (final PopupMenu menu ) {
3495+ public void onDismiss (@ Nullable final PopupMenu menu ) {
34953496 if (DEBUG ) {
34963497 Log .d (TAG , "onDismiss() called with: menu = [" + menu + "]" );
34973498 }
@@ -3544,7 +3545,7 @@ private void onCaptionClicked() {
35443545 isSomePopupMenuVisible = true ;
35453546 }
35463547
3547- private void setPlaybackQuality (final String quality ) {
3548+ private void setPlaybackQuality (@ Nullable final String quality ) {
35483549 videoResolver .setPlaybackQuality (quality );
35493550 }
35503551 //endregion
@@ -3568,7 +3569,7 @@ private void setupSubtitleView() {
35683569 final int minimumLength = Math .min (metrics .heightPixels , metrics .widthPixels );
35693570 final float captionRatioInverse = 20f + 4f * (1.0f - captionScale );
35703571 binding .subtitleView .setFixedTextSize (
3571- TypedValue .COMPLEX_UNIT_PX , ( float ) minimumLength / captionRatioInverse );
3572+ TypedValue .COMPLEX_UNIT_PX , minimumLength / captionRatioInverse );
35723573 }
35733574 binding .subtitleView .setApplyEmbeddedStyles (captionStyle == CaptionStyleCompat .DEFAULT );
35743575 binding .subtitleView .setStyle (captionStyle );
@@ -3845,7 +3846,7 @@ void onResizeClicked() {
38453846 }
38463847
38473848 @ Override // exoplayer listener
3848- public void onVideoSizeChanged (final VideoSize videoSize ) {
3849+ public void onVideoSizeChanged (@ NonNull final VideoSize videoSize ) {
38493850 if (DEBUG ) {
38503851 Log .d (TAG , "onVideoSizeChanged() called with: "
38513852 + "width / height = [" + videoSize .width + " / " + videoSize .height
@@ -3959,7 +3960,7 @@ private void setInitialGestureValues() {
39593960 }
39603961 }
39613962
3962- private int distanceFromCloseButton (final MotionEvent popupMotionEvent ) {
3963+ private int distanceFromCloseButton (@ NonNull final MotionEvent popupMotionEvent ) {
39633964 final int closeOverlayButtonX = closeOverlayBinding .closeButton .getLeft ()
39643965 + closeOverlayBinding .closeButton .getWidth () / 2 ;
39653966 final int closeOverlayButtonY = closeOverlayBinding .closeButton .getTop ()
@@ -3978,7 +3979,7 @@ private float getClosingRadius() {
39783979 return buttonRadius * 1.2f ;
39793980 }
39803981
3981- public boolean isInsideClosingRadius (final MotionEvent popupMotionEvent ) {
3982+ public boolean isInsideClosingRadius (@ NonNull final MotionEvent popupMotionEvent ) {
39823983 return distanceFromCloseButton (popupMotionEvent ) <= getClosingRadius ();
39833984 }
39843985 //endregion
@@ -4098,6 +4099,7 @@ private void notifyProgressUpdateToListeners(final int currentProgress,
40984099 }
40994100 }
41004101
4102+ @ Nullable
41014103 public AppCompatActivity getParentActivity () {
41024104 // ! instanceof ViewGroup means that view was added via windowManager for Popup
41034105 if (binding == null || !(binding .getRoot ().getParent () instanceof ViewGroup )) {
0 commit comments