Skip to content
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

Fix vibrator, which was not working on Android devices. #523

Merged
merged 1 commit into from Nov 30, 2019
Merged

Fix vibrator, which was not working on Android devices. #523

merged 1 commit into from Nov 30, 2019

Conversation

ghost
Copy link

@ghost ghost commented Nov 18, 2019

Fixes #501 #509

In this PR I implemented a solution considering the deprecations applied since API 26 (check https://developer.android.com/reference/android/os/Vibrator). In order to make the vibration work again, I had to first use jnius.cast with "android.os.Vibrator" and VIBRATOR_SERVICE.

Since API 26, the VIbrationEffect class admits different types of vibrations, but I just implemented https://developer.android.com/reference/android/os/VibrationEffect.html#createOneShot(long,%20int) and https://developer.android.com/reference/android/os/VibrationEffect.html#createWaveform(long[],%20int), otherwise I could break plyer's VIbrator API.

This PR has been already tested. Anyway, I invite you to try it and post the results.

@ghost
Copy link
Author

ghost commented Nov 26, 2019

@Zen-CODE This is ready to be checked.

@Zen-CODE Zen-CODE merged commit 1158444 into kivy:master Nov 30, 2019
@Zen-CODE
Copy link
Member

Thanks for this. It's a nice PR, and I appreciate the consideration for backwards compatibility +1

@ghost ghost deleted the vibrator-fix branch November 30, 2019 14:51
@ghost
Copy link
Author

ghost commented Nov 30, 2019

You're welcome!

@tomgold182
Copy link

@Zen-CODE what about the fix to the camera module ? it is not working on android anymore

@tomgold182
Copy link

@franccisco Is there any way to use this important commit with buildozer without waiting for a new plyer version ?

@Zen-CODE
Copy link
Member

Zen-CODE commented Dec 2, 2019

@tomgold182 Yes. In your requirements, instead of just "plyer", point it to the github repo using the master branch. Google should tell you how to do that: it's just like a pip requirement.

With regards to the camera fix, that would be great. You are welcome to submit a PR fixing that.

@tomgold182
Copy link

@Zen-CODE Thank you for your response!
As for the camera fix, the is already a PR waiting :
#525

@Zen-CODE
Copy link
Member

Zen-CODE commented Dec 2, 2019

@tomgold182 Can you confirm that it works for you?

@tomgold182
Copy link

@Zen-CODE Will check soon and let you know.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vibrate revision in api 26
2 participants