mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 10:17:56 +00:00
Fix long name jitter as voice note position updates.
This commit is contained in:
@@ -35,6 +35,7 @@ class VoiceNotePlayerView @JvmOverloads constructor(
|
||||
|
||||
private val playPauseToggleView: LottieAnimationView
|
||||
private val infoView: TextView
|
||||
private val durationView: TextView
|
||||
private val speedView: PlaybackSpeedToggleTextView
|
||||
private val closeButton: View
|
||||
|
||||
@@ -49,6 +50,7 @@ class VoiceNotePlayerView @JvmOverloads constructor(
|
||||
|
||||
playPauseToggleView = findViewById(R.id.voice_note_player_play_pause_toggle)
|
||||
infoView = findViewById(R.id.voice_note_player_info)
|
||||
durationView = findViewById(R.id.voice_note_player_duration)
|
||||
speedView = findViewById(R.id.voice_note_player_speed)
|
||||
closeButton = findViewById(R.id.voice_note_player_close)
|
||||
|
||||
@@ -116,7 +118,11 @@ class VoiceNotePlayerView @JvmOverloads constructor(
|
||||
animateToggleToPause()
|
||||
}
|
||||
|
||||
infoView.text = context.getString(R.string.VoiceNotePlayerView__s_dot_s, state.name, formatDuration(state.playbackDuration - state.playbackPosition))
|
||||
if (infoView.text != state.name) {
|
||||
infoView.text = state.name
|
||||
}
|
||||
|
||||
durationView.text = context.getString(R.string.VoiceNotePlayerView__dot_s, formatDuration(state.playbackDuration - state.playbackPosition))
|
||||
speedView.setCurrentSpeed(state.playbackSpeed)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user