@ -78,7 +78,7 @@ class VoiceMessageView : RelativeLayout, AudioSlidePlayer.Listener {
binding . voiceMessageViewDurationTextView . visibility = View . VISIBLE
binding . voiceMessageViewDurationTextView . visibility = View . VISIBLE
binding . voiceMessageViewDurationTextView . text = String . format ( " %01d:%02d " ,
binding . voiceMessageViewDurationTextView . text = String . format ( " %01d:%02d " ,
TimeUnit . MILLISECONDS . toMinutes ( audioExtras . durationMs ) ,
TimeUnit . MILLISECONDS . toMinutes ( audioExtras . durationMs ) ,
TimeUnit . MILLISECONDS . toSeconds ( audioExtras . durationMs ) )
TimeUnit . MILLISECONDS . toSeconds ( audioExtras . durationMs ) % 60 )
}
}
}
}
}
}
@ -102,7 +102,7 @@ class VoiceMessageView : RelativeLayout, AudioSlidePlayer.Listener {
this . progress = progress
this . progress = progress
binding . voiceMessageViewDurationTextView . text = String . format ( " %01d:%02d " ,
binding . voiceMessageViewDurationTextView . text = String . format ( " %01d:%02d " ,
TimeUnit . MILLISECONDS . toMinutes ( duration - ( progress * duration . toDouble ( ) ) . roundToLong ( ) ) ,
TimeUnit . MILLISECONDS . toMinutes ( duration - ( progress * duration . toDouble ( ) ) . roundToLong ( ) ) ,
TimeUnit . MILLISECONDS . toSeconds ( duration - ( progress * duration . toDouble ( ) ) . roundToLong ( ) ) )
TimeUnit . MILLISECONDS . toSeconds ( duration - ( progress * duration . toDouble ( ) ) . roundToLong ( ) ) % 60 )
val layoutParams = binding . progressView . layoutParams as RelativeLayout . LayoutParams
val layoutParams = binding . progressView . layoutParams as RelativeLayout . LayoutParams
layoutParams . width = ( width . toFloat ( ) * progress . toFloat ( ) ) . roundToInt ( )
layoutParams . width = ( width . toFloat ( ) * progress . toFloat ( ) ) . roundToInt ( )
binding . progressView . layoutParams = layoutParams
binding . progressView . layoutParams = layoutParams