How does Facebook Messenger draw a chathead? (Android)
android, android-imageview, android-layout, android-windowmanager, facebook
Solution
my chathead like facebook messenger : https://github.com/henrychuangtw/FB-ChatHead
- Dragging and Bounce animation
- Messenger : show text and sendtext
- LongPressing to Stop
Problem
I know this has already been asked a lot of times here on StackOverflow, but I'm fascinated how Facebook Messenger draws the Chatheads. I followed this tutorial to place an ImageView as an overlay. However, dragging it around is very sluggish, unlike Chatheads which show extremely smooth animation. Turning on the "Show GPU view updates" option in Developer options flashes the screen while a Chathead is being dragged. However, dragging my ImageView doesn't trigger any flashing. Here's a small screencast: https://dl.dropboxusercontent.com/u/13595927/temp/TRIM_20140225_134543.mp4 I tried setting the layer type to `LAYER_TYPE_SOFTWARE`, but it didn't change anything. What else am I missing?