First
I have been learning about OpenGL ES recently, and I have studied launcher for a while and want to make a 3D switching effect.
When openg is used, the switching between glsurfaceview and 2D view will flash the screen, and the switching efficiency is low. After two days of tossing and tossing, we abandoned OpenGL and used graphics. camera achieves the desired results
In fact, camera is a simplified OpenGL, which also supports operations such as rotation and translation. It is more efficient than OpenGL to implement simple 3D effects.
The method is very simple. Let's talk about the ideas:
1. The native launcher has three celllayout, Which is reloaded with dispatchdraw ();
2. In dispatchdraw (), rotate camera to a certain angle and apply it to canvas;
3. In response to the scrolling of the sliding screen onscrollchanged () and loose, add the code for adjusting the camera angle of celllayout.
Haha, isn't it easy! As long as you modify the camera angle when sliding the screen, several celllayout will bring together a beautiful 3D desktop.
PS: You have the following problems.
After the mobile phone is released during the screen Sliding Process, the screen is quickly clicked before the screen is stopped. If the left and right slides, the frame is obviously dropped! After reading the launcher pro and GDE, the native 2.1 launcher may also drop frames, but it is not obvious.