Fix: Add high refresh rate (90Hz/120Hz) optimization support (#2086)#2094
Fix: Add high refresh rate (90Hz/120Hz) optimization support (#2086)#2094zaibihsn wants to merge 1 commit into
Conversation
|
Thanks for another contribution @zaibihsn — and thanks especially for #2091, which was a clean fix. I appreciate the effort to make scrolling and animations feel smoother here too. I can't merge this one as-is though, because the approach has a correctness issue on real devices. Let me walk through it. 1.
|
|
Thank you so much for the detailed explanation and the great catch on the resolution downgrade! I've updated the |
Fixes #2086
Description of the Bug:
Users with high refresh rate screens (90Hz, 120Hz, etc.) experience UI scrolling locked to 60Hz. This happens because many Android OEM skins (like MIUI, OneUI, and ColorOS) aggressively throttle refresh rates for standard apps to preserve battery, especially in Compose-heavy applications, unless the activity explicitly requests the higher rate.
Resolution:
Added a hardware display check in MainActivity.kt (for Android M and above).
The app now dynamically queries the device's supportedModes, finds the mode with the highest available refresh rate, and assigns it to window.attributes.preferredDisplayModeId.
This forces the OS to uncap the framerate, allowing for buttery-smooth scrolling and animations across the entire application without any negative impact on standard 60Hz devices.