Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil-z committed Jul 17, 2018
2 parents 1f690ae + f9aa164 commit 52e8050
Show file tree
Hide file tree
Showing 81 changed files with 2,677 additions and 1,854 deletions.
27 changes: 16 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
language: android

before_install:
- echo yes | android update sdk --filter extra-android-support --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null
script:
- ./gradlew build

android:
components:
- build-tools-27.0.3
- android-27
- android-19
- extra-android-m2repository

licenses:
- android-sdk-license-.+
- android-sdk-preview-license-.+
- android-sdk-license-.+

components:
# https://docs.travis-ci.com/user/languages/android/#Installing-a-newer-SDK-Platform-Tools-revision
- tools
- platform-tools
- tools

# The BuildTools version used by your project
- build-tools-27.0.3

script:
./gradlew checkstyle build
# The SDK version used to compile your project
- android-28
- extra-android-m2repository
19 changes: 0 additions & 19 deletions FolioReader.iml

This file was deleted.

49 changes: 35 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ FolioReader-Android is an ePub reader written in Java.
- [x] Add Notes to a Highlight
- [ ] Better Documentation
- [x] Last Read Position Listener
- [x] Horizontal reading

## Demo
##### Custom Fonts
Expand All @@ -35,12 +36,14 @@ FolioReader-Android is an ePub reader written in Java.
![Media Overlay](https://cloud.githubusercontent.com/assets/1277242/19012908/d61f3ce2-87df-11e6-8652-d72b6a1ad9a3.gif)

### Gradle
Add following dependency to your app build.gradle

Add following dependency to your app build.gradle:

``` java
compile 'com.folioreader:folioreader:0.3.9'
compile 'com.folioreader:folioreader:0.4.0'
```

Add maven repository to your top level build.gradle
Add maven repository to your top level build.gradle:

```groovy
allprojects {
Expand All @@ -54,32 +57,50 @@ allprojects {

### Usage

First add activity tag for FolioActivity in your AndroidManifest.xml
First add permissions and activity tag for `FolioActivity` in your `AndroidManifest.xml`:

```xml
<activity
android:name="com.folioreader.ui.folio.activity.FolioActivity"
android:configChanges="orientation|screenSize"
android:theme="@style/AppTheme.NoActionBar"/>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.folioreader.android.sample">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />

<application>

...

<activity
android:name="com.folioreader.ui.folio.activity.FolioActivity"
android:theme="@style/AppTheme.NoActionBar" />

...

</application>

</manifest>
```

To use FolioReader, get singleton object of **FolioReader**.
**Note: In case if you are upgrading to 0.4.0 and above don't forget to remove `android:configChanges="orientation|screenSize"` from `<activity>` tag of `FolioActivity`.**

Get singleton object of `FolioReader`:

```java
FolioReader folioReader = FolioReader.getInstance(getApplicationContext());
```

Call the function openBook().
Call the function `openBook()`:

##### opening book from assets
##### opening book from assets -

```java
folioReader.openBook("file:///android_asset/adventures.epub");
folioReader.openBook("file:///android_asset/TheSilverChair.epub");
```
##### opening book from raw
##### opening book from raw -

```java
folioReader.openBook(R.raw.barrett);
folioReader.openBook(R.raw.adventures);
```

## WIKI
Expand Down
47 changes: 29 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
buildscript {
ext.KOTLIN_VERSION= '1.2.41'
// Top-level build file where you can add configuration options common to all sub-projects/modules.

ext.ANDROID_LIB_VERSION = '27.1.1'
ext.R2_STREAMER_VERSION = '0.1.5'
def KOTLIN_VERSION = ext.KOTLIN_VERSION
buildscript {
ext.KOTLIN_VERSION = '1.2.50'

repositories {
google()
jcenter()
maven {
url "http://dl.bintray.com/mobisystech/maven"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.android.tools.build:gradle:3.1.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
Expand All @@ -26,13 +22,28 @@ buildscript {

allprojects {
repositories {
google()
jcenter()
maven {
url "http://dl.bintray.com/mobisystech/maven"
}
maven {
url 'https://maven.google.com/'
name 'Google'
url "http://dl.bintray.com/mobisystech/maven"
}
}
}

ext {
LIBRARY_VERSION = "0.4.0"

VERSION_NAME = "1.0"
VERSION_CODE = 1

ANDROID_MIN_SDK = 14
ANDROID_COMPILE_SDK_VERSION = 28
ANDROID_TARGET_SDK_VERSION = 28
ANDROID_LIB_VERSION = '28.0.0-alpha3'

R2_STREAMER_VERSION = '0.1.7'
}

task clean(type: Delete) {
delete rootProject.buildDir
}
4 changes: 3 additions & 1 deletion folioreader/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
package="com.folioreader">

<application>
<activity android:name=".ui.folio.activity.ContentHighlightActivity" />
<activity
android:name=".ui.folio.activity.ContentHighlightActivity"
android:theme="@style/AppTheme.NoActionBar" />
</application>

</manifest>
16 changes: 7 additions & 9 deletions folioreader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ext {
siteUrl = 'https://github.com/FolioReader/FolioReader-Android'
gitUrl = 'https://github.com/FolioReader/FolioReader-Android.git'

libraryVersion = '0.3.9'
libraryVersion = LIBRARY_VERSION

developerId = 'mobisystech'
developerName = 'Folio Reader'
Expand All @@ -30,14 +30,13 @@ ext {

android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion ANDROID_COMPILE_SDK_VERSION

defaultConfig {
versionCode 1
versionName "1.0"
minSdkVersion 14
targetSdkVersion 27
minSdkVersion ANDROID_MIN_SDK
targetSdkVersion ANDROID_TARGET_SDK_VERSION
versionCode VERSION_CODE
versionName VERSION_NAME
}

sourceSets {
Expand Down Expand Up @@ -86,8 +85,7 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':webViewMarker')

//noinspection GradleDependency
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation "com.android.support:appcompat-v7:$ANDROID_LIB_VERSION"
implementation "com.android.support:recyclerview-v7:$ANDROID_LIB_VERSION"
implementation "com.android.support:support-v4:$ANDROID_LIB_VERSION"
Expand Down
8 changes: 8 additions & 0 deletions folioreader/res/drawable/blue_border_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#00F" />
<solid android:color="#880000FF"/>
</shape>
8 changes: 8 additions & 0 deletions folioreader/res/drawable/green_border_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#0F0" />
<solid android:color="#8800FF00"/>
</shape>
7 changes: 7 additions & 0 deletions folioreader/res/drawable/red_border_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#F00" />
</shape>
37 changes: 31 additions & 6 deletions folioreader/res/layout/folio_page_fragment.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rlContainer"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/folioPageFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.folioreader.view.ObservableWebView
android:id="@+id/contentWebView"

<FrameLayout
android:id="@+id/webViewLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/indicatorLayout"
android:paddingBottom="2dp" />
android:layout_above="@+id/indicatorLayout">

<com.folioreader.view.WebViewPager
android:id="@+id/webViewPager"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<com.folioreader.view.FolioWebView
android:id="@+id/folioWebView"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</FrameLayout>

<com.folioreader.view.LoadingView
android:id="@+id/loadingView"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:visibility="invisible" />

<com.folioreader.view.VerticalSeekbar
android:id="@+id/scrollSeekbar"
android:layout_width="wrap_content"
Expand All @@ -20,20 +40,25 @@
android:animateLayoutChanges="true"
android:thumb="@drawable/thumb"
android:visibility="invisible" />

<LinearLayout
android:id="@+id/indicatorLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center"
android:orientation="horizontal"
android:paddingBottom="2dp">
android:paddingBottom="2dp"
android:paddingTop="2dp"
android:visibility="gone">

<TextView
android:id="@+id/minutesLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#888888"
android:textSize="7sp" />

<TextView
android:id="@+id/pagesLeft"
android:layout_width="wrap_content"
Expand Down

0 comments on commit 52e8050

Please sign in to comment.