Android uses viewpager to load pictures and rotate videos

As one of the basic components of Android, we are already familiar with viewpager, and there are many cases of using viewpager to load pictures on the Internet. However, the example of clicking on pictures like wechat to display pictures and videos in rotation was not found. It happens that there is a demand in the project, so you can take the time to write it down. Now give me the core code, hoping to play a role in attracting jade for the students with this demand. I don't have much to say. Code:

Here is the code for initdata

I think the difficulty of rotating video is that the viewpager can only play one video, and each viewitem has a surfacevideoview control inherited from surfaceview. I stop the surfacevideoview of the original page and pay the surfacevideoview of the new page to mvideoview, and then I can control the video of the selected page.

Here is a rendering:

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.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>