mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
d45ffd8181
A voice message that arrives without amplitude data — bridged messages and those sent by clients that omit it — is unusable. The waveform is empty, so its measured width is zero: the progress overlay never draws, the cursor is pinned to the left edge, and the touch handler rejects every event because no x coordinate can fall inside a zero-width range. The message plays, but there is no way to see where it is or to move it. Fall back to a flat run of zero amplitudes sized to the canvas when there is no waveform. Width, progress, cursor and seeking then all work exactly as they do for a real waveform, and the existing minimum amplitude renders those zeros as the same flat track a genuinely silent recording already draws, so no new drawing code is needed. Nothing changes for a message that has a waveform, and the model still carries the empty list, which is the honest value. Computing a real waveform from the audio is a separate piece of work.