Fix playback speed icon lagging one step behind in release builds
dallo28 committed
- Author
- dallo28 · dallo28@users.noreply.github.comOct 27, 2026 at 16:37
- Committer
- dallo28 · dallo28@users.noreply.github.comOct 27, 2026 at 16:37
- Parents
- 3de37c8cfb03
Fix playback speed icon lagging one step behind in release builds SpeedIconDrawable passed an anonymous Drawable.Callback to its text drawable and kept it only in a private field. Drawable.setCallback() holds the callback through a WeakReference, and R8 removes the field because it is never read outside the constructor, so after the first GC the text drawable can no longer request redraws. The speed text then only refreshed when something else redrew the button, which happens at the start of the next change, so the icon showed the previous speed while the toast showed the new one. Make SpeedIconDrawable itself the callback: the view holding the icon references it strongly.
1 file changed+18−16