Skip to content

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

Merged
Zen-CODE merged 1 commit into
masterfrom
unknown repository
Nov 30, 2019
Merged

Fix vibrator, which was not working on Android devices.#523
Zen-CODE merged 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Nov 18, 2019

Copy link
Copy Markdown

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

ghost commented Nov 26, 2019

Copy link
Copy Markdown
Author

@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
Copy Markdown
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

ghost commented Nov 30, 2019

Copy link
Copy Markdown
Author

You're welcome!

@tomgold182

Copy link
Copy Markdown

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

@tomgold182

Copy link
Copy Markdown

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

@Zen-CODE

Zen-CODE commented Dec 2, 2019

Copy link
Copy Markdown
Member

@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
Copy Markdown

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

@Zen-CODE

Zen-CODE commented Dec 2, 2019

Copy link
Copy Markdown
Member

@tomgold182 Can you confirm that it works for you?

@tomgold182

Copy link
Copy Markdown

@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