Gottbrok / EpubReaderAndroid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EpubReaderAndroid

ePub-Reader for Android to make it easy integrate and customize epub-Reader functionality in any Android App

Simple Integrate

<com.smartmobilefactory.epubreader.EpubView
    android:id="@+id/epubView"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
EpubView epubView = findViewById(R.id.epubView);
epubView.setEpub(epub);

Display Modes

The Epub can be displayed in different modes:

  • horizontal chapters + vertical content
epubView.setScrollDirection(EpubScrollDirection.HORIZONTAL_WITH_VERTICAL_CONTENT);
  • vertical chapters + vertical content
epubView.setScrollDirection(EpubScrollDirection.VERTICAL_WITH_VERTICAL_CONTENT);
  • single chapters + vertical content
epubView.setScrollDirection(EpubScrollDirection.SINGLE_CHAPTER_VERTICAL);

More modes may be implemented later.

Customization Settings

EpubViewSettings settings = epubView.getSettings();
settings.setFont(EpubFont.fromFontFamiliy("Monospace"));
settings.setFontSizeSp(30);

// inject code into chapters
settings.setJavascriptBridge(bridge);
settings.setCustomChapterScript(...);
settings.setCustomChapterCss(...);

Observe current status

observation is implemented using RxJava2

  • Current Chapter
  • Current Location

Installation

repositories {    
    // ...    
    maven { url "https://jitpack.io" }   
}   

dependencies {    
    compile 'com.github.smartmobilefactory:EpubReaderAndroid:XXX'
}

About

License:MIT License


Languages

Language:Kotlin 53.1%Language:Java 32.2%Language:JavaScript 8.7%Language:Python 5.3%Language:Shell 0.6%Language:CSS 0.2%