mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 07:13:00 +00:00 
			
		
		
		
	Lint: 'if' replaceable with 'switch'
This commit is contained in:
		| @@ -1346,19 +1346,24 @@ public final class VideoDetailFragment | ||||
|         broadcastReceiver = new BroadcastReceiver() { | ||||
|             @Override | ||||
|             public void onReceive(final Context context, final Intent intent) { | ||||
|                 if (intent.getAction().equals(ACTION_SHOW_MAIN_PLAYER)) { | ||||
|                 switch (intent.getAction()) { | ||||
|                     case ACTION_SHOW_MAIN_PLAYER: | ||||
|                         bottomSheetBehavior.setState(BottomSheetBehavior.STATE_EXPANDED); | ||||
|                 } else if (intent.getAction().equals(ACTION_HIDE_MAIN_PLAYER)) { | ||||
|                         break; | ||||
|                     case ACTION_HIDE_MAIN_PLAYER: | ||||
|                         bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); | ||||
|                 } else if (intent.getAction().equals(ACTION_PLAYER_STARTED)) { | ||||
|                         break; | ||||
|                     case ACTION_PLAYER_STARTED: | ||||
|                         // If the state is not hidden we don't need to show the mini player | ||||
|                         if (bottomSheetBehavior.getState() == BottomSheetBehavior.STATE_HIDDEN) { | ||||
|                             bottomSheetBehavior.setState(BottomSheetBehavior.STATE_COLLAPSED); | ||||
|                         } | ||||
|                         // Rebound to the service if it was closed via notification or mini player | ||||
|                         if (!PlayerHolder.bound) { | ||||
|                         PlayerHolder.startService(App.getApp(), false, VideoDetailFragment.this); | ||||
|                             PlayerHolder.startService( | ||||
|                                     App.getApp(), false, VideoDetailFragment.this); | ||||
|                         } | ||||
|                         break; | ||||
|                 } | ||||
|             } | ||||
|         }; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 TacoTheDank
					TacoTheDank