Android uses matrix to rotate pictures to simulate disc loading process
Today, a small demo simulating the disc loading process is implemented, which is shown here. It's not easy to capture dynamic pictures in the company, so take two static pictures here to see the effect first.
Here's a simple list of the code.
Setp1. Prepare two pictures for rotation, as follows: loading_ Disc.png is the first picture, loading_ Light.png is the second picture.
Step 2. Customize a view to control the rotation of the two pictures. com.oyp.loadingdisk.LoadingDiscView.java
Step3. Write a handler to control the rotation of the picture. Com.oyp.loadingdisk.refreshhandle.java
Step4. Application layout file RES / layout / loading.xml
Step5. Write an activity to load the layout file and display com.oyp.loadingdisk.loadingactivity.java
Of course, this is only to simulate the disc loading process. In fact, the code can be processed to start the corresponding interface to display the video, image and music resources in the disc after the disc loading process. However, it is inconvenient to write here.
For source code, you can https://github.com/ouyangpeng/LoadingDisk To view and download the code for free.
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.