Skip to content

Custom Configuration

Hrishikesh Kadam edited this page Aug 20, 2018 · 4 revisions

You can pass custom configuration to FolioReader by following -

Config config = new Config()
        .setAllowedDirection(Config.AllowedDirection.ONLY_VERTICAL)
        .setDirection(Config.Direction.VERTICAL)
        .setFont(Constants.FONT_LORA)
        .setFontSize(2)
        .setNightMode(true)
        .setThemeColor(R.color.app_green)
        .setShowTts(true);

FolioReader folioReader = FolioReader.get()
        .setConfig(config, true)
        .openBook("file:///android_asset/TheSilverChair.epub");

setConfig(Config config, boolean overrideConfig)

Pass your configuration and choose to override it every time or just for first execution.

Parameter:

  • config - custom configuration.
  • overrideConfig - true will override the config, false will use either this config if it is null in application context or will fetch previously saved one while execution.