feat(#15): allow disabling WebView hardware acceleration to stop smiley flicker#244
Draft
jim-daf wants to merge 1 commit into
Draft
Conversation
…top smiley flicker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #15.
Issue recap
On certain devices the WebView used to display topic posts flickers entire text blocks whenever an animated smiley is on screen, as shown in the linked YouTube clip. The reporter suspected hardware-accelerated rendering and asked for a user preference to disable it.
Fix
Teach
NestedScrollingWebViewabout a single boolean preference,pref_disable_webview_hardware_accel. When the flag is on, the WebView is created withLAYER_TYPE_SOFTWARE, which is the standard Android workaround for hardware-rendering glitches inside a WebView. Two small public helpers (setSoftwareLayerTypeandsetHardwareLayerType) are exposed so callers can flip the rendering mode at runtime if the preference is changed without rebuilding the fragment.Why this is safe by default
false, so unaffected users keep the existing hardware-accelerated rendering path.NestedScrollingWebView, so no other Activity, Fragment or layout file needs to be touched in this PR.SettingsActivityso the option is discoverable in the UI. Until then, advanced users can flip the SharedPreferences key manually and immediately benefit from the workaround.Validation
trueand reopening a topic with animated smileys eliminates the flicker on a Samsung Galaxy S6 reproducer.