mirror of
				https://github.com/TeamNewPipe/NewPipe
				synced 2025-10-31 15:23:00 +00:00 
			
		
		
		
	Merge pull request #8377 from iTrooz/vol_slider
Make volume progress bar match system volume when we start sliding
This commit is contained in:
		| @@ -126,6 +126,14 @@ public class PlayerGestureListener | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void onScrollMainVolume(final float distanceX, final float distanceY) { |     private void onScrollMainVolume(final float distanceX, final float distanceY) { | ||||||
|  |         // If we just started sliding, change the progress bar to match the system volume | ||||||
|  |         if (player.getVolumeRelativeLayout().getVisibility() != View.VISIBLE) { | ||||||
|  |             final float volumePercent = player | ||||||
|  |                     .getAudioReactor().getVolume() / (float) maxVolume; | ||||||
|  |             player.getVolumeProgressBar().setProgress( | ||||||
|  |                     (int) (volumePercent * player.getMaxGestureLength())); | ||||||
|  |         } | ||||||
|  |  | ||||||
|         player.getVolumeProgressBar().incrementProgressBy((int) distanceY); |         player.getVolumeProgressBar().incrementProgressBy((int) distanceY); | ||||||
|         final float currentProgressPercent = (float) player |         final float currentProgressPercent = (float) player | ||||||
|                 .getVolumeProgressBar().getProgress() / player.getMaxGestureLength(); |                 .getVolumeProgressBar().getProgress() / player.getMaxGestureLength(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Robin
					Robin