e59cdf30748da38326b1bc0071065bd3bf4d1db5 |
|
12-Aug-2016 |
Maurice Lam <yukl@google.com> |
Share GlifPatternDrawable bitmap cache Reduce memory usage of GlifPatternDrawable by - Setting max bitmap cache scale to 1.5x (similar to VectorDrawableCompat, which caps at 2048px) - Use ALPHA_8 mask instead of ARGB8888 - Share the cache across all pattern drawables, using a SoftReference The memory allocation of a single bitmap cache, measured on Pixel C, dropped from 17MB to 2.3MB. Memory consumption was measured in Android studio. 1. Open SetupLibrarySample app in Android Studio 2. Run app 3. Open "Android Monitor" tab, and go to Monitors tab 4. Press "Trigger GC" in Studio 5. Press "Start Allocation Tracking" 6. Start a new activity in the test app 7. press "Stop Allocation Tracking" Test: ./gradlew connectedAndroidTest Bug: 30813561 Change-Id: Ic78d6f2bdfa6a18a7dd2afc73f9647e2a7ed4cf1 (cherry picked from commit 515c0b156d03f7ea348303c75e37ee4c16d90557)
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java
|
081551e44a801f439f0e0f30008303dd765c118f |
|
03-May-2016 |
Maurice Lam <yukl@google.com> |
[SuwLib] GLIF pattern update Implement GLIF pattern according to latest UX spec, which is to overlay a grayscale pattern at 20% opacity on top of the solid accent color. Bug: 28601978 Change-Id: I89f54a434d54e1cac64363588fd06736d67c51e1
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java
|
a2f04916533b900d3661c9e8c9d98b71276fde13 |
|
24-Mar-2016 |
Maurice Lam <yukl@google.com> |
[SuwLib] Cache GlifPatternDrawable in Bitmap Avoid rendering the path every time by caching the GlifPatternDrawable on a Bitmap. Bug: 27821812 Change-Id: I8eefcf662763ec05d11b53a0a02e3f39764075ae
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java
|
c3eebe9f664af4b77e5948a14bf266b25dc25cc8 |
|
14-Nov-2015 |
Maurice Lam <yukl@google.com> |
[SuwLib] Implement pattern drawable background - Implement the pattern background for GLIF using a custom drawable. The drawable draws the paths manually as specified in the SVG, for backwards compatibility. - Use a FrameLayout subclass to draw the custom status bar background in the case of phone layouts, and set draw the background directly for tablet / clamshell layouts. Bug: 25650709 Change-Id: I527bb47efa143ec43c1030b57087fd2414d7045b
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/GlifPatternDrawable.java
|