Skip to content

Conversation

@EiyuuZack
Copy link

@EiyuuZack EiyuuZack commented Dec 5, 2025

evaluateJavascript is the way. Read the commit message.

References https://outsystemsrd.atlassian.net/browse/RDMR-1125

BEFORE:

predictive-back-before.mp4

AFTER:

predictive-back-after.mp4

Resolves a critical issue where the predictive back-to-home gesture
animation was being aborted. The loadUrl("javascript:...") method is
treated as a navigation event by the WebView. This had two negative
side-effects:

 - Incorrectly added an entry to the WebView's history stack. This
   caused canGoBack() to become true at the as soon as the application
   opened, which prevented the Android system to take over and displaying
   the animation when navigating back (out of the application)
 - Executing this call synchronously within the
   OnApplyWindowInsetsListener could interfere with the sensitive setup
   phase of system animations, causing them to fail

Using evaluateJavascript is the modern practice for script execution and
it does not affect the navigation history. Also, by wrapping the call in
post(), the execution on the UI thread is deferred until the system is
stable. The system also handles application teardown gracefully by
discarding the post() Runnable if the associated view no longer exists.

References https://outsystemsrd.atlassian.net/browse/RDMR-1125
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants