Skip to content

Conversation

@Ullas-Aithal
Copy link

Fixes #3084

Brightness gesture now works the same ways as volume gesture. The brightness progress bar value is set to previously saved gesture value and increases/decreases value based on relative moment from this value. Previously saved brightness gesture value is calculated by current screen brightness.

Tested different brightness values and verified if the value persists in the next play.
app-debug.zip

@TobiGr TobiGr added bug Issue is related to a bug player Issues related to any player (main, popup and background) labels Feb 16, 2020
@Stypox
Copy link
Member

Stypox commented Feb 16, 2020

Are you sure that layoutParams.screenBrightness is in range [0.0, 1.0]? The reference says:

A value of less than 0, the default, means to use the preferred screen brightness. 0 to 1 adjusts the brightness from dark to full bright.

Couldn't this go below 0?

@Stypox
Copy link
Member

Stypox commented Feb 16, 2020

Oh, #3102 is another PR that does the same thing, but it also prints some debug info. I'd use that one, what do you think @TobiGr ?

@Ullas-Aithal
Copy link
Author

Are you sure that layoutParams.screenBrightness is in range [0.0, 1.0]? The reference says:

A value of less than 0, the default, means to use the preferred screen brightness. 0 to 1 adjusts the brightness from dark to full bright.

Couldn't this go below 0?

We do get negative value of -1 if the user has never used brightness gesture. But since we're not using any negative value for ProgressBar using setMin(), the default minimum is 0. So assigning a negative value will default to 0 in our case.

I guess we can set the gesture value to be whatever the system brightness is if the user has never used the gesture?

@Stypox
Copy link
Member

Stypox commented Feb 16, 2020

@Ullas-Aithal see #3102 (review)

@Ullas-Aithal
Copy link
Author

Ullas-Aithal commented Feb 16, 2020

@Stypox , oh, its the same change 😄. How does this work? Should I work on my pull request or wait for the author to work on #3102 ?

@Stypox
Copy link
Member

Stypox commented Feb 16, 2020

@Ullas-Aithal #3102 also adds debug information, so I think it is preferable. So you probably shouldn't work on this PR, sorry ;-)
Thank you very much for your contribution, anyway! I will leave the PR open just in case the creator of the other PR does not resolve the submitted reviews.

@Ullas-Aithal
Copy link
Author

@Stypox that's totally fine. I'll probably take a look at another bug maybe. Thank you for maintaining this app!

@Stypox
Copy link
Member

Stypox commented Feb 19, 2020

@Ullas-Aithal I merged #3102 in the end. Thank you for your contribution, anyway! :-)

@Stypox Stypox closed this Feb 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Issue is related to a bug player Issues related to any player (main, popup and background)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Brightness resets on first gesture brightness change after playback activity open

3 participants