Merge pull request #3102 from vhsw/dev

Fix initial brightness value
This commit is contained in:
Stypox 2020-02-19 15:26:40 +01:00 committed by GitHub
commit 12c72842ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

View File

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