WebView next/previous page transitions

前端 未结 1 1421
花落未央
花落未央 2021-02-06 14:03

I\'m generating a book app, of sorts, that displays pages in a WebView. I have Next/Previous ImageButtons and a GestureOverlay to detect l

1条回答
  •  青春惊慌失措
    2021-02-06 14:35

    If anyone's interested, I found a way to do this. I defined Animation variables:

    Animation slideLeftAnimation = AnimationUtils.loadAnimation(getBaseContext(), R.anim.slide_left);
    Animation slideRightAnimation = AnimationUtils.loadAnimation(getBaseContext(), R.anim.slide_right);
    

    And the slide_left and slide_right xml files are from the Android API tutorials.

    Then, for left or right swipes, I used mWebView.startAnimation(leftOrRightAnimation); before my mWebView.loadUrl(url); call.

    Hope this helps anyone else!
    Chris

    0 讨论(0)
提交回复
热议问题