最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

kotlin - Detect Shake on Android in Jetpack Compose - Stack Overflow

programmeradmin8浏览0评论

This seems to have been asked many times, but most of the answers are old and refer to abandoned/retired packages.

In the iPhone version of my app I'm able to use deviceDidShakeNotification (guidance from here) to detect when the phone is shaken. It works really well and I'm hoping to find something on Android (via package if appropriate) to do the same thing.

Most of the answers I find seem to require some maths; and some of the code I've tried doesn't work well, either too sensitive (activates when the phone is picked up), or takes really specific movements to trigger.

I'm sure there are complications here that I'm not fully appreciating, but surely someone has a simple, reliable solution that just works??

发布评论

评论列表(0)

  1. 暂无评论