Reflowable Layout
New Function
String getStyleForChapter(int chapterIndex);
Added to ScriptListener
public interface ScriptListener {
// should return the custom script for chapterIndex
String getScriptForChapter(int chapterIndex); // datasource
// should return the custom style for chapterIndex
String getStyleForChapter(int chapterIndex); // Newly Added
}
String getStyleForChapter(int chapterIndex); can be used when you need to set custom css file for a given chapter.
example)
class ScriptDelegate implements ScriptListener {
@Override
public String getScriptForChapter(int chapterIndex) {
// TODO Auto-generated method stub
String customScript = null;
// customScript = “” +
// “function changePColor() {” +
// ” var elements = document.getElementsByTagName(‘p’);” +
// ” for (var i=0; i<elements.length; i++) {" +
// " elements[i].style.color = '#FF0000';" +
// " }"+
// "}"+
// "changePColor();";
//
return customScript;
}
@Override
public String getStyleForChapter(int chapterIndex) {
// TODO Auto-generated method stub
String customCSS = null;
// customCSS = “p{ color: #ff0000; }”;
return customCSS;
}
}