Ok, so I am stuck with this problem for a week and unable to come up with a solution. I have epub book loaded into the webview android. I used jquery pagination to make it horizontal so now my book scrolls horizontally. But I want to add animation to flip pages. Now each page is a column after pagination. What is the best way to add animation? Using Page curl libraries in android or using javascript/jquery.
Here's what I have done so far..This is the code where after loading the book into the webview as
webview.loadDataWithBaseURL("file://"+Environment.getExternalStorageDirectory()+"/books/", linez, "text/html", "utf-8", null);
Now I used on pagefinished to add js for horizontal pagination. How, where and what needs to be added for flipping?
webview.setWebViewClient(new WebViewClient() {
@SuppressLint("NewApi")
public void onPageFinished(WebView view, String url) {
String js = "";
//js.append("<html>"+"<head>");
String data = "";
try{
InputStream is = assetManager.open("initialize.js");
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
String jLine="";
while((jLine=br.readLine())!=null){
data =
js+=jLine;
}
is.close();
}
catch(Exception e){
e.printStackTrace();
}
webview.loadUrl("javascript:(" + js + ")()");
}
});