mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
reset seekbar to zero on init, fix equals() for AudioSlide
This commit is contained in:
@@ -80,6 +80,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener
|
||||
{
|
||||
controlToggle.displayQuick(playButton);
|
||||
seekBar.setEnabled(true);
|
||||
seekBar.setProgress(0);
|
||||
audioSlidePlayer = AudioSlidePlayer.createFor(getContext(), audio, this);
|
||||
timestamp.setText(DateUtils.getFormatedDuration(duration));
|
||||
|
||||
@@ -155,7 +156,7 @@ public class AudioView extends FrameLayout implements AudioSlidePlayer.Listener
|
||||
|
||||
@Override
|
||||
public void onProgress(AudioSlide slide, double progress, long millis) {
|
||||
if (audioSlidePlayer.getAudioSlide().getDcMsgId() != slide.getDcMsgId()) {
|
||||
if (!audioSlidePlayer.getAudioSlide().equals(slide)) {
|
||||
return;
|
||||
}
|
||||
int seekProgress = (int) Math.floor(progress * this.seekBar.getMax());
|
||||
|
||||
@@ -45,6 +45,13 @@ public class AudioSlide extends Slide {
|
||||
super(context, new UriAttachment(uri, null, contentType, AttachmentDatabase.TRANSFER_PROGRESS_STARTED, dataSize, 0, 0, null, null, voiceNote));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == null) return false;
|
||||
if (!(other instanceof AudioSlide)) return false;
|
||||
return this.getDcMsgId() == ((AudioSlide)other).getDcMsgId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public Uri getThumbnailUri() {
|
||||
|
||||
Reference in New Issue
Block a user