pellucide/Android-Switch-Demo-pre-4.0 — pull request #4 by dshafer (2013-02-19 15:54:31+00:00)
Title: Speed up slider switch layout by using native extractAlpha() method

Was making use of this great widget, but having performance problems on layout. I found that most of the time was being spent in onLayout() iterating over the background mask to extract the alpha layer to a separate mask drawable. Replacing that loop with a call to Bitmap.extractAlpha() eliminated the performance issues I was having.

Sample layout times measured on my Nexus One:
Before: 1.6 Seconds
After : 7 milliseconds