FrozenKoi / PlaybackInList

Quick and dirty sample on how to update playback info of a list item
1 stars 0 forks source link

Very Good Work !! #2

Open obaidjatoi opened 9 years ago

obaidjatoi commented 9 years ago

Hello there ! You have did a very good work ! :+1: and can you please tell me that how i can implement setOnSeekBarChangeListener for that specific seek bar which is playing / updating.

FrozenKoi commented 9 years ago

You could add the listener when getView assigns the updater, but in general you wouldn't want to do that. In this particular example, there is a seekbar for each item in the list, since they all share the same layout. In an actual release app you'd only have it in the current item.

What is your use case? If you want to keep track of the position of the item being played, then a better approach would be to add a listener to the PlaybackUpdater, so that you only have to listen to one event source (instead of trying to figure out which seekbar to start listening to and when and when to stop paying attention to it).

obaidjatoi commented 9 years ago

Thanks for reply , and i am using a listView in which there are multiple seek bars , i have controlled the recycling issues with your provided solution , and now i want to let user change the progress by dragging the seek bar for the specific position in which the audio is playing and also for the other items , You can say that i want to implement approach like WHATSAPP , how they are allowing user to use seek bar for downloaded audios , but i am not getting directions to control these seek bars. Once again thanks for your time :)

FrozenKoi commented 8 years ago

That's kinda a different use case. I thought you wanted to monitor the movement of the progressbar, but what you're looking for is to monitor the user initiated events on a seekbar (i.e. the user dragging the thumb).

In that case I'm not sure what to recommend you, look into setting a SeekBar.OnSeekBarChangeListener (install it for the item when playback starts for that item) that controls the audio controller.