Overdrawn Pixel

Context

UI

Affects

Efficiency

Problem

The layout of an Android UI is generally build using XML. So you can stack several layers to form complex user interfaces. Containers and basic elements may have attributes to describe their background, text, border, etc. In this case it might be possible to overdraw a pixel. This means for example the root container has a black background and contains several other elements that havve another (non-transparent) background color. And on top of these are buttons, text-fields that are also colored. This means that a pixel must be drawn several times which is a costly process.

This example shows overdrawn pixels. From best to worst (blue, green, light red, red)

Example for overdrawn pixels

Refactorings

Related