-
-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Native Player Gesture for Volume & Brightness #133
Conversation
Can we add an option to disable this behavior? |
if(counter == -1f){ | ||
counter = windowLayoutParams.screenBrightness | ||
if(counter < 0f) | ||
counter = android.provider.Settings.System.getFloat( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Maxr1998 @nielsvanvelzen This line has a few problems. According to the docs, it should give value between 0 and 255 but on my phone (which has MIUI) it is goes over 255.
Worst case scenario, it jumps to full brightness first time the gesture is used.
I can disable it but imo the utility it offers is worth dealing with the bug.
Should I do this in this PR or send another one? |
Within this one should be fine. |
@nielsvanvelzen Added option to disable it in "Client Settings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks mostly good, I have a few comments about naming and formatting stuff however. I'd generally use a shorter name for the gesture feature.
Also, I'm not a fan of that counter
attribute.. I'm not sure how you could do it differently though, I think I'll have to play with the code myself once the other mentioned issues are fixed.
@Maxr1998 While brightness gesture can be implemented without the counter. The problem is with the volume gesture. I can also set volume by using the distance between |
I see, then there's probably no way around that. Could you still make the counter variable a bit more descriptive then, and add some documentation/comments on how you're using it? |
Yes I will do that and all the requested changes in a few hours. |
@yashx did some more tweaks and code style improvements, please let me know if it's ok for you, and if you @nielsvanvelzen also don't have any comments anymore, I'll squash and merge it. |
closes #13
How it looks