bb6f0504c1607c89d9a3dd3e6023f36d61837016 |
|
31-Oct-2013 |
Andrew Sapperstein <asapperstein@google.com> |
Prevent flickering. Fixes b/10994303. The problem was that we were calling positionOverlays from onScrollChanged in WebView which is called during draw. Since positionOverlays adds views, this is broken. Two manifestations of it were flickering message headers during flings and flickering of the drop shadow for the snap header. To fix the flickering (which was really not drawing for a frame), we have slightly changed the recycling behavior of ConversationContainer. Instead of adding and removing views, we just move them offscreen (where they're no longer drawn) until they're needed again. If we don't have a recycled view, we will still add the views (via a post) but we don't ever remove when a view is scrolled off anymore. Additionally, we stop overriding dispatchDraw to forcibly draw the topmost overlay. This resulted in flickering of the snap header gradient because it would be drawn sometimes twice and sometimes once. We no longer need to since we don't add or remove views during draw anymore. Change-Id: I937a4cc67f04ed005439c1fab2103287a986148d
/packages/apps/UnifiedEmail/src/com/android/mail/browse/ScrollNotifier.java
|