Android desktop switch 3D Effects

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.