In modern Android user interface development, hardware layers (View.LAYER_TYPE_HARDWARE) allow complex view hierarchies, alpha fades, and translation animations to be cached into GPU textures. When an animated element moves, Android simply repositions the cached texture on the GPU instead of executing an expensive, CPU-intensive redraw pass across every child view. However, if an application continuously modifies properties inside that cached layer during an animation, the hardware layer invalidates and recreates itself every single frame—negating all performance benefits.
To visually verify that your hardware layers are behaving efficiently and not invalidating unnecessarily, Android includes a specialized developer tool: Show view updates (often labeled Show hardware layers updates).
What is Show View Updates?
When you enable Show view updates, Android’s hardware rendering engine flashes a bright green tint over any hardware layer or view component the exact instant it updates or redraws. In a properly optimised application:
- During Layer Initialization: The view should flash green once when the hardware layer is first created.
- During Translation / Alpha Animation: While the view fades, slides, or scales across the screen, it should NOT flash green. It should move cleanly without flashing because the GPU is simply moving the existing texture.
- If Redundant Redraws Occur: If the view flashes green continuously throughout the entire duration of an animation, the layer is invalidating on every frame, causing unnecessary GPU texture uploads and dropped frames.
Show View Updates vs Show Surface Updates
Distinguishing between these two flashing diagnostic tools is essential for accurate profiling:
| Diagnostic Tool | Rendered Flash Colour | Architectural Level | Primary Use Case |
|---|---|---|---|
| Show View Updates | Green Flashes | Individual Views & Hardware Layers (in-app) | Verifies hardware layer caching during animations and custom View invalidations. |
| Show Surface Updates | Translucent Tint Flashes | Whole Window Surfaces (SurfaceFlinger) | Detects full-window redraws, runaway background timers, and overlay compositor load. |
Step-by-Step: Enabling Developer Options
If Developer Options is not already active on your Android smartphone or tablet:
- Open the Settings app on your Android device.
- Scroll down and tap About phone (or About device).
- Locate the Build number entry.
- Tap Build number seven consecutive times until you see the confirmation message: “You are now a developer!”
- Confirm your lock screen PIN or biometrics when prompted.
Activating Show View Updates
- Return to the main Settings menu.
- Navigate to System > Developer options (on Samsung Galaxy devices running One UI, select Developer options at the bottom of the Settings list).
- Scroll down to the Hardware accelerated rendering section.
- Locate the Show view updates (or Show hardware layers updates) toggle.
- Switch the toggle to the ON position.
- Any hardware-cached view that updates its internal buffer will immediately flash green momentarily.
Troubleshooting Animations and Layout Inefficiencies
With the overlay active, open your app and trigger complex UI transitions:
- Test Navigation Drawer or Sheet Transitions: Open a modal navigation drawer. If the entire drawer flashes green continuously as it slides open, a child view (such as an indeterminate loading bar or clock text) is invalidating the parent layer during the translation.
- Verify Complex Card Animations: Ensure card expansion animations do not trigger green flashes on sibling cards that are merely shifting position.
- Refactor View Code: To prevent layer invalidations, avoid altering
TextViewcontent, background colours, or padding inside active animation listeners; animate strictly via transform properties liketranslationX,translationY,scaleX,scaleY, oralpha.
Disabling the Overlay
Once your animation inspection is complete, return to Settings > System > Developer options > Show view updates and toggle the switch to OFF to restore standard screen visuals.
Frequently Asked Questions
Why do web views in Chrome flash green when scrolling?
Modern mobile browsers use GPU compositing layers for web content tiles. As you scroll, newly rasterized HTML/CSS tiles flash green as they are committed to hardware memory, which is expected behaviour for web view engines.
Does enabling Show View Updates increase battery consumption?
The green tint overlay requires negligible processing overhead while rendering. However, because it is an active debugging mode, disable it during everyday device usage.