http://www.piwai.info/chatheads-basics/
By following this good guide, I can make a chathead and also detect the touch event.
However, if I touch the chathead with first finger, and try to touch other area (outside) the chathead with second finger, the second touch is not possible.
(The area outside can be the home screen, or another app, activity)
Similarly, IF I first touch the outside, and try to use second finger to touch the chathead, it is not possible.
I tried the similar interaction with facebook messenger chathead and it is the same.
My question is: is it possible to support the second touch?
maybe using dispatch touch event? but afaik dispatch is only for activity.
the chathead uses service and window.
Any help would be deeply appreciated!
From Chats, tap your profile picture in the top left. Scroll down and tap Bubbles. Tap All conversations can bubble or Selected conversations can bubble. To turn off this feature, select Nothing can bubble.
In Android, Floating bubbles or ChatHeads allow quick access to core features without fully opening the app.
Yes its possible using the following workaround.
OnTouchEvent()
.To let the other apps handle touch event,the transparent view can only be activated when the user is already touching your chathead.This way you cna make sure that the user is planning to do some gesture with your chathead.
This isn't possible using layouts manually added to the WindowManager
as a system overlay when the underlying view is from a completely different hierarchy.
Once you start a touch event on the first view, all subsequent touch events will be sent to the same view heirarchy until ALL MotionEvent
s are finished (I.e ACTION_UP
or ACTION_CANCEL
has occurred).
Basically, once you are interacting with one view heirarchy, any outside touches are interpreted as touches outside the current heirarchy, and ignore any underlying view heirarchies which may or may not occupy the same screen position.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With