1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 16:40:32 +00:00

Fix initial brightness value

This commit is contained in:
Alexey Dubrov 2020-02-16 16:08:53 +03:00
parent ec45d4a729
commit 51f2efd48c
No known key found for this signature in database
GPG Key ID: 4F516863E4371E21

View File

@ -909,6 +909,14 @@ public final class MainVideoPlayer extends AppCompatActivity
final float currentVolumeNormalized = (float) getAudioReactor().getVolume() / getAudioReactor().getMaxVolume(); final float currentVolumeNormalized = (float) getAudioReactor().getVolume() / getAudioReactor().getMaxVolume();
volumeProgressBar.setProgress((int) (volumeProgressBar.getMax() * currentVolumeNormalized)); volumeProgressBar.setProgress((int) (volumeProgressBar.getMax() * currentVolumeNormalized));
} }
final float screenBrightness = getWindow().getAttributes().screenBrightness;
brightnessProgressBar.setProgress((int) (brightnessProgressBar.getMax() * screenBrightness));
if (DEBUG) Log.d(TAG, "setInitialGestureValues: volumeProgressBar.getProgress() ["
+ volumeProgressBar.getProgress() + "] "
+ "brightnessProgressBar.getProgress() ["
+ brightnessProgressBar.getProgress() + "]");
} }
@Override @Override