1

I want to allow the user of my app to trim a specific part from a video. And i'm looking for a solution that can help me make a time selection slider with two thumbs(Max and Min time).

This is a sample of what i want to achieve .

enter image description here

I know that there is already some librarys that can help:

android-range-seek-bar

Material Range Bar

But they work only with floats and integers. My question is how can i make it work with time values ?

SaidTagnit
  • 115
  • 3
  • 14

1 Answers1

0

Basically you can represent time with a numeric type! With integer you can have a range time from 0 to Integer.MAX_VALUE seconds (for example)

What do you need is display this int value in a mm:ss format.

I don't know if the libs up here already do this, however I suggest to fork one on that and work on the values displayed on screen.

Example from another (using millis) SO link

String hms = String.format("%02d:%02d:%02d", TimeUnit.MILLISECONDS.toHours(millis),
    TimeUnit.MILLISECONDS.toMinutes(millis) % TimeUnit.HOURS.toMinutes(1),
    TimeUnit.MILLISECONDS.toSeconds(millis) % TimeUnit.MINUTES.toSeconds(1));
Community
  • 1
  • 1
appersiano
  • 2,670
  • 22
  • 42