Using MVC to write advertising strip rotation effect
I understand that the MVC idea in Android is to use holder to program, display layout, provide views, and bind views and data. We can see advertising strips in many apps. Here, we can fill the advertising strips with FrameLayout, and then use the MVC idea to add the provided layout to FrameLayout; The implementation of advertising strips can also use open-source frameworks such as banner, which are not listed here. Interested friends can search it
Of course, because the pictures of my project are provided by the designer and not obtained from the Internet, I wrote viewpager directly here to fill in
Logic:
Here, the indicator (DOT) or picture description at the bottom of the rotation chart can be added. Specifically, according to the requirements of the company's art workers, we can make an optimization to stop the rotation; Click to listen to the viewpager design, rewrite three methods, lift it up, then start (), go to the run method, the viewpager jumps to the next page, and go to the start () method in autoscrolltask. When the handler of the main thread sends a delay message, continue to cycle the run method to realize the wireless cycle of the rotation chart. By the way, say the writing method of the pageradapter of the rotation chart
A large number is returned here. In fact, it is not necessary to return integer.max_ VALUE; Because if you write this, you have to judge the remainder to make the switch between the indicator below and the picture above consistent. Of course, because the picture is directly given by the artist here, I put it directly under the project. In fact, if it is obtained from the Internet, you can use Picasso or glass picture loading framework
So far, a simple picture rotation function has been realized.