how save the ReadLocator?
@Override public void saveReadLocator(ReadLocator readLocator) { Log.i(LOG_TAG, "-> saveReadLocator -> " + readLocator.toJson());
/*ReadLocator has toJson() method which gives JSON in following format -
{
bookId : string,
href : string,
created : integer,
locations : {
cfi : string
}
}
You can save this last read position in your local or remote db*/
}
this fun don't run
"Uncaught ReferenceError: DOMRect is not defined", source: file:///android_asset/js/Bridge.js (865)
return new DOMRect(rectJson.x, rectJson.y, rectJson.width, rectJson.height);
function constructDOMRect(rectJsonString) { var rectJson = JSON.parse(rectJsonString); var drect = {top:rectJson.y, right:rectJson.x+rectJson.width, bottom:rectJson.y+rectJson.height,left:rectJson.x}; return drect; }
I rewrite this fun can save ReadLocator;
How were you able to fix it?
How were you able to fix it?
rewrite JS function constructDOMRect(rectJsonString) {}
do you have a sample code you can send me?
assets/Bridge.js --->rewrited
function constructDOMRect(rectJsonString) { var rectJson = JSON.parse(rectJsonString); var drect = {top:rectJson.y, right:rectJson.x+rectJson.width, bottom:rectJson.y+rectJson.height,left:rectJson.x}; return drect; }
Thanks. Much appreciated.
Thanks. Much appreciated.
you're welcome , Is the problem solved?
noo, still not working
Still not getting any output from: @Override public void saveReadLocator(ReadLocator readLocator) { Log.i(LOG_TAG, "-> saveReadLocator -> " + readLocator.toJson());
}
What I have done so far:
- Created a file known as Bridge.js in the assets folder.(this is because I have included the Folio Reader Library in my gradle file)
- Copied the original Bridge.js from the FolioReader Library
- Made the change you had suggested.
Still getting zero output form the method: @override public void saveReadLocator(ReadLocator readLocator) { Log.i(LOG_TAG, "-> saveReadLocator -> " + readLocator.toJson());
}
can you give me your email? I'll send you the FolioReader lib. but I change something. The lib is used locally. src/folioreaderlib
can you give me your email? I'll send you the FolioReader lib. but I change something. The lib is used locally. src/folioreaderlib.
can you help me too, I'm stuck, cant get it to work :(
can you give me your email? I'll send you the FolioReader lib. but I change something. The lib is used locally. src/folioreaderlib.
can you help me too, I'm stuck, cant get it to work :(
find the .js file rewirte this funtion
function constructDOMRect(rectJsonString) { var rectJson = JSON.parse(rectJsonString); var drect = {top:rectJson.y, right:rectJson.x+rectJson.width, bottom:rectJson.y+rectJson.height,left:rectJson.x}; return drect; }
can you give me your email? I'll send you the FolioReader lib. but I change something. The lib is used locally. src/folioreaderlib.
can you help me too, I'm stuck, cant get it to work :(
source: file:///android_asset/js/Bridge.js (865)