Android customized seekbar to realize video playback progress bar

First, let's take a look at the renderings, as shown below:

The progress bar is as follows:

Next, let's talk about my idea. The progress drag bar above has a custom thumb. There is a popupwindow window directly above the thumb, which displays the current playback time. There is a text box on the right of seekbar to display the current playback time / total time.

Step1. First take a look at the layout file of popupwindow, seek_ Pop.xml, as shown in the following figure:

Step 2. Customize a seekbar

Step3. Add the customized drag bar to the layout file. The following is part of the code

Step4. Monitor the drag bar in the main file

The method of converting progress value to time maketimestring (int secs) is as follows:

Of course, here is just a brief introduction to the custom progress bar, and the style of the progress bar is not displayed. The style readers can define it themselves.

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
分享
二维码
< <上一篇
下一篇>>