@@ -2348,7 +2348,8 @@ private void onShuffleOrRepeatModeChanged() {
2348
2348
NotificationUtil .getInstance ().createNotificationIfNeededAndUpdate (this , false );
2349
2349
}
2350
2350
2351
- private void setRepeatModeButton (final AppCompatImageButton imageButton , final int repeatMode ) {
2351
+ private void setRepeatModeButton (final AppCompatImageButton imageButton ,
2352
+ @ RepeatMode final int repeatMode ) {
2352
2353
switch (repeatMode ) {
2353
2354
case REPEAT_MODE_OFF :
2354
2355
imageButton .setImageResource (R .drawable .exo_controls_repeat_off );
@@ -2362,7 +2363,7 @@ private void setRepeatModeButton(final AppCompatImageButton imageButton, final i
2362
2363
}
2363
2364
}
2364
2365
2365
- private void setShuffleButton (final ImageButton button , final boolean shuffled ) {
2366
+ private void setShuffleButton (@ NonNull final ImageButton button , final boolean shuffled ) {
2366
2367
button .setImageAlpha (shuffled ? 255 : 77 );
2367
2368
}
2368
2369
//endregion
@@ -2387,7 +2388,7 @@ boolean isMuted() {
2387
2388
return !exoPlayerIsNull () && simpleExoPlayer .getVolume () == 0 ;
2388
2389
}
2389
2390
2390
- private void setMuteButton (final ImageButton button , final boolean isMuted ) {
2391
+ private void setMuteButton (@ NonNull final ImageButton button , final boolean isMuted ) {
2391
2392
button .setImageDrawable (AppCompatResources .getDrawable (context , isMuted
2392
2393
? R .drawable .ic_volume_off : R .drawable .ic_volume_up ));
2393
2394
}
@@ -2876,7 +2877,7 @@ private void saveStreamProgressState(final long progressMillis) {
2876
2877
databaseUpdateDisposable
2877
2878
.add (recordManager .saveStreamState (currentMetadata .getMetadata (), progressMillis )
2878
2879
.observeOn (AndroidSchedulers .mainThread ())
2879
- .doOnError (( e ) -> {
2880
+ .doOnError (e -> {
2880
2881
if (DEBUG ) {
2881
2882
e .printStackTrace ();
2882
2883
}
@@ -3386,7 +3387,7 @@ private void buildPlaybackSpeedMenu() {
3386
3387
playbackSpeedPopupMenu .setOnDismissListener (this );
3387
3388
}
3388
3389
3389
- private void buildCaptionMenu (final List <String > availableLanguages ) {
3390
+ private void buildCaptionMenu (@ NonNull final List <String > availableLanguages ) {
3390
3391
if (captionPopupMenu == null ) {
3391
3392
return ;
3392
3393
}
@@ -3454,7 +3455,7 @@ private void buildCaptionMenu(final List<String> availableLanguages) {
3454
3455
* Called when an item of the quality selector or the playback speed selector is selected.
3455
3456
*/
3456
3457
@ Override
3457
- public boolean onMenuItemClick (final MenuItem menuItem ) {
3458
+ public boolean onMenuItemClick (@ NonNull final MenuItem menuItem ) {
3458
3459
if (DEBUG ) {
3459
3460
Log .d (TAG , "onMenuItemClick() called with: "
3460
3461
+ "menuItem = [" + menuItem + "], "
@@ -3491,7 +3492,7 @@ public boolean onMenuItemClick(final MenuItem menuItem) {
3491
3492
* Called when some popup menu is dismissed.
3492
3493
*/
3493
3494
@ Override
3494
- public void onDismiss (final PopupMenu menu ) {
3495
+ public void onDismiss (@ Nullable final PopupMenu menu ) {
3495
3496
if (DEBUG ) {
3496
3497
Log .d (TAG , "onDismiss() called with: menu = [" + menu + "]" );
3497
3498
}
@@ -3544,7 +3545,7 @@ private void onCaptionClicked() {
3544
3545
isSomePopupMenuVisible = true ;
3545
3546
}
3546
3547
3547
- private void setPlaybackQuality (final String quality ) {
3548
+ private void setPlaybackQuality (@ Nullable final String quality ) {
3548
3549
videoResolver .setPlaybackQuality (quality );
3549
3550
}
3550
3551
//endregion
@@ -3568,7 +3569,7 @@ private void setupSubtitleView() {
3568
3569
final int minimumLength = Math .min (metrics .heightPixels , metrics .widthPixels );
3569
3570
final float captionRatioInverse = 20f + 4f * (1.0f - captionScale );
3570
3571
binding .subtitleView .setFixedTextSize (
3571
- TypedValue .COMPLEX_UNIT_PX , ( float ) minimumLength / captionRatioInverse );
3572
+ TypedValue .COMPLEX_UNIT_PX , minimumLength / captionRatioInverse );
3572
3573
}
3573
3574
binding .subtitleView .setApplyEmbeddedStyles (captionStyle == CaptionStyleCompat .DEFAULT );
3574
3575
binding .subtitleView .setStyle (captionStyle );
@@ -3845,7 +3846,7 @@ void onResizeClicked() {
3845
3846
}
3846
3847
3847
3848
@ Override // exoplayer listener
3848
- public void onVideoSizeChanged (final VideoSize videoSize ) {
3849
+ public void onVideoSizeChanged (@ NonNull final VideoSize videoSize ) {
3849
3850
if (DEBUG ) {
3850
3851
Log .d (TAG , "onVideoSizeChanged() called with: "
3851
3852
+ "width / height = [" + videoSize .width + " / " + videoSize .height
@@ -3959,7 +3960,7 @@ private void setInitialGestureValues() {
3959
3960
}
3960
3961
}
3961
3962
3962
- private int distanceFromCloseButton (final MotionEvent popupMotionEvent ) {
3963
+ private int distanceFromCloseButton (@ NonNull final MotionEvent popupMotionEvent ) {
3963
3964
final int closeOverlayButtonX = closeOverlayBinding .closeButton .getLeft ()
3964
3965
+ closeOverlayBinding .closeButton .getWidth () / 2 ;
3965
3966
final int closeOverlayButtonY = closeOverlayBinding .closeButton .getTop ()
@@ -3978,7 +3979,7 @@ private float getClosingRadius() {
3978
3979
return buttonRadius * 1.2f ;
3979
3980
}
3980
3981
3981
- public boolean isInsideClosingRadius (final MotionEvent popupMotionEvent ) {
3982
+ public boolean isInsideClosingRadius (@ NonNull final MotionEvent popupMotionEvent ) {
3982
3983
return distanceFromCloseButton (popupMotionEvent ) <= getClosingRadius ();
3983
3984
}
3984
3985
//endregion
@@ -4098,6 +4099,7 @@ private void notifyProgressUpdateToListeners(final int currentProgress,
4098
4099
}
4099
4100
}
4100
4101
4102
+ @ Nullable
4101
4103
public AppCompatActivity getParentActivity () {
4102
4104
// ! instanceof ViewGroup means that view was added via windowManager for Popup
4103
4105
if (binding == null || !(binding .getRoot ().getParent () instanceof ViewGroup )) {
0 commit comments