1

I want to implement native page transition curl effect on a WebView after the content changed (that means, the page is not being reloaded!).

One common solution is using Animations before loading a new page, e.g. with a custom WebViewClient: https://stackoverflow.com/a/8319579/1684030

However, this only works if there's actually a new page being loaded. In my case I have a WebView displaying a javascript app which just switches the contents of a div ("single page application"). Animating those content changes with javascript leads to a laggy solution, so I wanted to try to implement it natively.

For iOS, this seems to be possible (UIPageViewController with only one content view controller - I know, Android OS and iOS are not quite comparable, I just wanted to mention it) and I was asking myself if there is some similar solution for Android as well.

Community
  • 1
  • 1
flxapps
  • 1,066
  • 1
  • 11
  • 24

1 Answers1

0

You can use javaScript bridge to call your Java method which performs the curl transition effect on webView.

mWebView.addJavaScriptInterface(new JsObject, "injectedObject");

Refer: Android developers - JS Interface

There are some implemented JS bridge in Github.

venkatvb
  • 681
  • 1
  • 9
  • 24