Bug Project Address: Https://github.com/lzyzsd/AndroidUIPorblems
This job is view optimized, before running the program, tick show GPU in developer Options Overdraw
1. The program homepage is as follows
The over-drawn area of 3X and above has the text above the button and the entire linearlayout below.
Two button over-drawing is due to the entire interface background and button default background overlay, this is a reasonable demand, so do not change.
The following linearlayout background and interface background, can be deleted, the effect is as follows.
2. Open the Overdrawview interface
Draw four rectangles, the first to fill the entire interface, the second from the height of the interface 1/4 to the bottom, the third and fourth from the 1/3 and 1/2 are drawn down. As a result, the more the interface is drawn down, the greater the degree.
Instead, draw only the visible portion of each rectangle, with the following effect:
3. Open Busyondraw
There is no serious problem of over-drawing.
Originally wanted to use the profile GPU rendering to view, but the computer performance is too poor, the operation of the simulator is very card, see the effect, can only operate on the real machine, the results show jump a bit of lag.
View Code Discovery There is a circular 1k System.out.println operation in the OnDraw method of the custom control, plus 30 of the loaded custom controls, which is equivalent to doing 3W in a UI thread.
Then delete the background output operation, rerun, the page jumps smoothly.
Geekband Job 13--View optimization