Skip to content

Instantly share code, notes, and snippets.

@bhaak
Created September 21, 2012 17:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhaak/3762793 to your computer and use it in GitHub Desktop.
Save bhaak/3762793 to your computer and use it in GitHub Desktop.
package com.github.bhaak;
import java.net.URI;
import com.amazon.kindle.booklet.AbstractBooklet;
import com.amazon.kindle.booklet.BookletContext;
import com.amazon.kindle.booklet.ChromeException;
import com.amazon.kindle.booklet.ChromeHeaderBar;
import com.amazon.kindle.booklet.ChromeHeaderRequest;
import com.amazon.kindle.booklet.ChromeSearchBarRequest;
import com.amazon.ebook.util.log.Log;
public class KindleCustomBooklet extends AbstractBooklet {
private static final Log logger = Log.getInstance("KindleCustomBooklet");
public KindleCustomBooklet() {
logger.info("KindleCustomBooklet");
}
public void start(URI contentURI) {
logger.info("start("+contentURI+")");
ChromeHeaderBar chromeHeaderBar;
if ((chromeHeaderBar = (ChromeHeaderBar)this.getBookletContext().getService(ChromeHeaderBar.class)) != null)
{
chromeHeaderBar.setStyle(this.getBookletContext(), ChromeHeaderBar.Style.TITLE_ONLY); // NO_HEADER, TITLE_ONLY, TITLE_AND_SEARCH
}
super.start(contentURI);
}
public void create(BookletContext bookletContext) {
logger.info("create("+bookletContext+")");
super.create(bookletContext);
}
public void destroy() {
logger.info("destroy()");
super.destroy();
}
public String getName() {
logger.info("getName()");
return super.getName();
}
public void stop() {
logger.info("stop()");
super.stop();
}
public ChromeHeaderRequest getChromeHeaderRequest() {
logger.info("getChromeHeaderRequest()");
return super.getChromeHeaderRequest();
}
public ChromeSearchBarRequest getChromeSearchBarRequest() {
logger.info("stop()");
return super.getChromeSearchBarRequest();
}
public void setChromeHeaderRequest(ChromeHeaderRequest chromeHeaderRequest) {
logger.info("setChromeHeaderRequest("+chromeHeaderRequest+")");
super.setChromeHeaderRequest(chromeHeaderRequest);
}
public void setChromeSearchBarRequest(ChromeSearchBarRequest chromeSearchBarRequest) {
logger.info("setChromeSearchBarRequest("+chromeSearchBarRequest+")");
super.setChromeSearchBarRequest(chromeSearchBarRequest);
}
public void syncHeaderRequest() throws ChromeException {
logger.info("syncHeaderRequest()");
super.syncHeaderRequest();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment