• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Android] Support for Androids new camera gesture control
#7
I'd have to test to know for certain, but listening for a focus event wouldn't really make sense, because you have to know which component/view on the screen you are attaching the onFocusChanged listener to. Focus can change if you tap in the search text field in the filters, for example, or if you trigger a dropdown, or tap other components on the screen. It definitely would not make sense to attach an onFocusChanged listener to every component in the entire application and it would not make sense to attach it to the parent view of the entire hierarchy because the children will most likely consume the event and not pass it back to their parent. There are next/previous IME events (https://www.geeksforgeeks.org/how-to-han...n-android/ for example), but that only makes sense if an edittext control has focus and the user is interacting with the virtual keyboard. If the camera switches app is generating IME events when a text field doesn't have focus, that wouldn't make a whole lot of sense. Looking at the list of actions that can be triggered, they seem to be all over the place:
  • Pause Camera Switch
  • Toggle auto-scan (disabled)
  • Reverse auto-scan
  • Select
  • Next
  • Previous
  • Touch & hold
  • Scroll forward
  • Scroll backward
  • Home
  • Back
  • Notifications
  • Quick Settings
  • Overview
What does it mean to trigger "Overview" or "Quick Settings"? What does it mean to trigger "Reverse auto-scan"? What does it mean to trigger Touch & Hold when you aren't actually touching the screen? Is the idea that you trigger focus changes using accessability features, and once you've put focus on certain things, then you trigger the face gesture? That would suddenly make a lot more sense, as you could shift focus to a button, then trigger the "Touch & hold", or if you are actively entering text, you could be using speech-to-text, then use the face gesture to trigger "Next" to go to the next text field. If that's how these are intended to be used, it means they aren't really for general use. Applications can't listen specifically for these events, as they are triggering functionality the same way as a finger would. Does "Scroll forward" trigger a page down? What mechanism is it using to scroll forward otherwise? If it's triggering page down, then it could be used with the pedal actions. If it's doing something else, that would mean it's probably using something in the Android framework to try to grab the current control with focus and force it to scroll some amount downward, which would be impossible for my app to detect. Honestly, what I need is not to try to react to the camera switches app triggering actions, I just need the code they used to detect facial gestures. Then I can add functionality to trigger anything in MobileSheets without having to rely on an external application. 

The other thing that is important to consider is that the camera switches app is going to be draining your power in the background, and it could be a significant power drain. It will also sit there detecting facial gestures when you aren't looking at any songs, or when the app is idle, which are both suboptimal. I still think it's going to be much better for me to add the necessary changes to detect facial gestures on my own, using ML Kit:

https://developers.google.com/android/re.../face/Face
https://www.journaldev.com/15629/android-face-detection

For some simple gestures, it should work pretty well I think. Based on what I'm seeing, I can probably implement all of the same gestures detected by the camera switches app. Of course there will be a fair amount of effort involved with this. If someone is a programmer and wants a side project, I'd be happy to work with someone if they want to implement all of the necessary code to detect all the various gestures, trigger callbacks that I can listen to, and handle easily starting/stopping the detection as needed. Otherwise I will add this to the list of things to work on after the iOS version is released.

Mike
Reply


Messages In This Thread
RE: [Android] Support for Androids new camera gesture control - by Zubersoft - 08-21-2021, 04:17 AM



Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.