Skip to content

Commit

Permalink
Merge pull request #112 from codetoart/dev
Browse files Browse the repository at this point in the history
r2_streamer_kotlin integration PR
  • Loading branch information
Mahavir Jain committed Oct 11, 2018
2 parents 33489b1 + 59af4bf commit 8efa133
Show file tree
Hide file tree
Showing 123 changed files with 2,886 additions and 17,938 deletions.
15 changes: 14 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild

# Custom
_site

Expand Down Expand Up @@ -37,4 +47,7 @@ out
# Maven
target
release.properties
pom.xml.*
pom.xml.*

# Readium DRM LCP
liblcp.aar
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,30 @@ FolioReader-Android is an ePub reader written in Java.

### Gradle

Add following dependency to your app module `build.gradle` file:
Add following dependency to your root project `build.gradle` file:

```groovy
repositories {
maven {
url 'http://dl.bintray.com/mobisystech/maven'
allprojects {
repositories {
...
maven { url "https://dl.bintray.com/mobisystech/maven" }
maven { url "https://jitpack.io" }
...
}
}
```

Add following dependency to your app module `build.gradle` file:

```groovy
dependencies {
implementation 'com.folioreader:folioreader:0.4.4'
...
implementation "com.folioreader:folioreader:0.5.1"
...
}
```


### AndroidManifest

Starting with Android 9.0 (API level 28), cleartext support is disabled by default.
Expand Down Expand Up @@ -125,6 +135,9 @@ folioReader.openBook(R.raw.adventures);

Please follow [Issue Template](https://github.com/FolioReader/FolioReader-Android/blob/master/.github/ISSUE_TEMPLATE.md) to report any issue.

## Share your application
If you are using FolioReader in your application, share your application link in [this issue](https://github.com/FolioReader/FolioReader-Android/issues/291)

### Credits
1. <a href="https://github.com/daimajia/AndroidSwipeLayout">SwipeLayout</a>
2. <a href="https://github.com/readium/r2-streamer-java">r2-streamer-java</a>
Expand Down Expand Up @@ -158,3 +171,4 @@ Please follow [Issue Template](https://github.com/FolioReader/FolioReader-Androi

## License
FolioReaderKit is available under the BSD license. See the [LICENSE](https://github.com/FolioReader/FolioReader-Android/blob/master/License.md) file.

16 changes: 11 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.KOTLIN_VERSION = '1.2.61'
ext.KOTLIN_VERSION = '1.2.71'

repositories {
google()
Expand All @@ -24,22 +24,28 @@ allprojects {
repositories {
google()
jcenter()
maven { url "https://dl.bintray.com/mobisystech/maven" }
maven { url "https://jitpack.io" }
mavenLocal()
}
}

ext {
LIBRARY_VERSION = '0.4.4'
R2_STREAMER_VERSION = '0.1.8'
FOLIOREADER_SDK_VERSION = '0.5.1'
R2_STREAMER_KOTLIN_VERSION = '1.0.3-5'
R2_SHARED_KOTLIN_VERSION = '1.0.3-2'

VERSION_NAME = "1.0"
VERSION_CODE = 1

ANDROID_MIN_SDK = 15
ANDROID_MIN_SDK = 19
ANDROID_COMPILE_SDK_VERSION = 28
ANDROID_TARGET_SDK_VERSION = 28
ANDROID_LIB_VERSION = '28.0.0-rc01'
ANDROID_LIB_VERSION = '28.0.0'

CONSTRAINT_LAYOUT_VERSION = "1.1.3"

JACKSON_VERSION = '2.8.6'
}

task clean(type: Delete) {
Expand Down
15 changes: 0 additions & 15 deletions config/quality/checkstyle/checkstyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,6 @@

<!-- Naming -->

<module name="PackageName">
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
<message key="name.invalidPattern"
value="Package name ''{0}'' must match pattern ''{1}''."/>
</module>

<module name="MethodName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
<message key="name.invalidPattern"
Expand All @@ -127,15 +121,6 @@
value="Type name ''{0}'' must match pattern ''{1}''."/>
</module>

<module name="MemberName">
<property name="applyToPublic" value="false" />
<property name="applyToPackage" value="false" />
<property name="applyToProtected" value="false" />
<property name="format" value="^m[A-Z]+[a-z0-9][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>

<module name="ParameterName">
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
Expand Down
9 changes: 7 additions & 2 deletions folioreader/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.folioreader">

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

<application>
<uses-sdk tools:overrideLibrary="org.readium.r2.streamer, org.readium.r2.shared" />

<application
android:allowBackup="true"
tools:replace="android:allowBackup">

<provider
android:name=".AppContext"
Expand All @@ -15,7 +20,7 @@
<activity
android:name=".ui.folio.activity.FolioActivity"
android:label="@string/app_name"
android:theme="@style/FolioAppDayTheme" />
android:theme="@style/FolioActivityDayTheme" />

<activity
android:name=".ui.folio.activity.ContentHighlightActivity"
Expand Down
30 changes: 17 additions & 13 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 = LIBRARY_VERSION
libraryVersion = FOLIOREADER_SDK_VERSION

developerId = 'mobisystech'
developerName = 'Folio Reader'
Expand All @@ -37,6 +37,7 @@ android {
targetSdkVersion ANDROID_TARGET_SDK_VERSION
versionCode VERSION_CODE
versionName VERSION_NAME
vectorDrawables.useSupportLibrary = true
}

sourceSets {
Expand Down Expand Up @@ -72,40 +73,43 @@ android {

lintOptions {
abortOnError false
lintConfig file("lint.xml")
}

checkstyle {
ignoreFailures = true
}
}

repositories {
maven {
url "http://dl.bintray.com/mobisystech/maven"
}
}

apply from: '../folioreader/bintray/installv1.gradle'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':webViewMarker')

implementation "com.android.support.constraint:constraint-layout:$CONSTRAINT_LAYOUT_VERSION"
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"
implementation "com.android.support:design:$ANDROID_LIB_VERSION"

implementation 'org.slf4j:slf4j-android:1.7.25'
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'

//Kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION"

// r2-streamer
api "org.readium:r2-fetcher:$R2_STREAMER_VERSION"
api "org.readium:r2-parser:$R2_STREAMER_VERSION"
api "org.readium:r2-server:$R2_STREAMER_VERSION"

implementation 'org.greenrobot:eventbus:3.1.1'

implementation "com.fasterxml.jackson.core:jackson-core:$JACKSON_VERSION"
implementation "com.fasterxml.jackson.core:jackson-annotations:$JACKSON_VERSION"
implementation "com.fasterxml.jackson.core:jackson-databind:$JACKSON_VERSION"

// R2 modules
implementation "com.github.codetoart:r2-shared-kotlin:$R2_SHARED_KOTLIN_VERSION"
implementation("com.github.codetoart:r2-streamer-kotlin:$R2_STREAMER_KOTLIN_VERSION") {
exclude group: "org.slf4j", module: "slf4j-api"
}

// To use only ReflectionUtils in Spring framework
implementation 'org.springframework:spring-core:4.3.19.RELEASE'
}
apply from: '../folioreader/bintray/bintrayv1.gradle'
Binary file removed folioreader/libs/epublib-core-latest.jar
Binary file not shown.
Binary file removed folioreader/libs/slf4j-android-1.5.8.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions folioreader/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<!-- Disable the given check in this project -->
<issue id="LogNotTimber" severity="ignore" />
</lint>

This file was deleted.

Binary file removed folioreader/res/drawable-xhdpi/colors_marker.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/ic_action_discard.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/ic_action_share.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/ic_blue_marker.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/ic_green_marker.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/ic_pink_marker.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/ic_underline_marker.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/ic_yellow_marker.png
Binary file not shown.
Binary file removed folioreader/res/drawable-xhdpi/icon_close.png
Binary file not shown.
4 changes: 2 additions & 2 deletions folioreader/res/drawable/ic_close_green_24dp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#71C851"
android:pathData="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z" />
Expand Down
4 changes: 2 additions & 2 deletions folioreader/res/drawable/ic_drawer.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
android:viewportWidth="24.0"
android:viewportHeight="24.0">
<path
android:fillColor="#71C951"
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z" />
Expand Down
17 changes: 17 additions & 0 deletions folioreader/res/drawable/ic_format_underlined.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">

<!-- Add tools:fillColor="@color/night_underline_icon_fill_color_top"
to see the preview -->
<path
android:fillColor="?underlineIconFillColorTop"
android:pathData="M12,17c3.31,0 6,-2.69 6,-6L18,3h-2.5v8c0,1.93 -1.57,3.5 -3.5,3.5S8.5,12.93 8.5,11L8.5,3L6,3v8c0,3.31 2.69,6 6,6z" />

<path
android:fillColor="#FFCC0000"
android:pathData="M5,19v2h14v-2L5,19z" />

</vector>
12 changes: 12 additions & 0 deletions folioreader/res/drawable/ic_highlight_delete.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24.0"
android:viewportHeight="24.0">

<!-- Add tools:fillColor="@color/night_highlight_delete_fill_color"
to see the preview -->
<path
android:fillColor="?highlightDeleteFillColor"
android:pathData="M14.59,8L12,10.59 9.41,8 8,9.41 10.59,12 8,14.59 9.41,16 12,13.41 14.59,16 16,14.59 13.41,12 16,9.41 14.59,8zM12,2C6.47,2 2,6.47 2,12s4.47,10 10,10 10,-4.47 10,-10S17.53,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z" />
</vector>
4 changes: 4 additions & 0 deletions folioreader/res/drawable/ic_offline_gray_layer_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/ic_offline_gray_48dp"/>
</layer-list>
2 changes: 1 addition & 1 deletion folioreader/res/drawable/note_edittext_background.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
android:shape="rectangle" >
<corners android:radius="3dp"/>
<solid android:color="#FFFFFF"/>
<stroke android:color="@color/blue" android:width="2dp"/>
<stroke android:color="@color/highlight_blue" android:width="2dp"/>
</shape>
11 changes: 11 additions & 0 deletions folioreader/res/drawable/shape_highlight_blue.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<size
android:width="48dp"
android:height="48dp" />

<solid android:color="@color/highlight_blue" />

</shape>
11 changes: 11 additions & 0 deletions folioreader/res/drawable/shape_highlight_green.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<size
android:width="48dp"
android:height="48dp" />

<solid android:color="@color/highlight_green" />

</shape>
11 changes: 11 additions & 0 deletions folioreader/res/drawable/shape_highlight_pink.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<size
android:width="48dp"
android:height="48dp" />

<solid android:color="@color/highlight_pink" />

</shape>
11 changes: 11 additions & 0 deletions folioreader/res/drawable/shape_highlight_yellow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">

<size
android:width="48dp"
android:height="48dp" />

<solid android:color="@color/highlight_yellow" />

</shape>
2 changes: 1 addition & 1 deletion folioreader/res/layout/activity_content_highlight.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
android:layout_centerInParent="true"
android:layout_margin="16dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_close_green_24dp" />
app:srcCompat="@drawable/ic_close_green_24dp" />

<LinearLayout android:id="@+id/layout_content_highlights"
android:layout_width="200dp"
Expand Down

0 comments on commit 8efa133

Please sign in to comment.