Skip to content

Commit 8cfa37d

Browse files
author
Mahavir Jain
authored
Merge pull request #297 from codetoart/master
r2_streamer_kotlin integration
2 parents f47f87a + 8efa133 commit 8cfa37d

File tree

123 files changed

+2882
-17938
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+2882
-17938
lines changed

.gitignore

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild
10+
111
# Custom
212
_site
313

@@ -37,4 +47,7 @@ out
3747
# Maven
3848
target
3949
release.properties
40-
pom.xml.*
50+
pom.xml.*
51+
52+
# Readium DRM LCP
53+
liblcp.aar

README.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,30 @@ FolioReader-Android is an ePub reader written in Java.
3838

3939
### Gradle
4040

41-
Add following dependency to your app module `build.gradle` file:
41+
Add following dependency to your root project `build.gradle` file:
4242

4343
```groovy
44-
repositories {
45-
maven {
46-
url 'http://dl.bintray.com/mobisystech/maven'
44+
allprojects {
45+
repositories {
46+
...
47+
maven { url "https://dl.bintray.com/mobisystech/maven" }
48+
maven { url "https://jitpack.io" }
49+
...
4750
}
4851
}
52+
```
53+
54+
Add following dependency to your app module `build.gradle` file:
4955

56+
```groovy
5057
dependencies {
51-
implementation 'com.folioreader:folioreader:0.4.4'
58+
...
59+
implementation "com.folioreader:folioreader:0.5.1"
60+
...
5261
}
5362
```
5463

64+
5565
### AndroidManifest
5666

5767
Starting with Android 9.0 (API level 28), cleartext support is disabled by default.

build.gradle

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4-
ext.KOTLIN_VERSION = '1.2.61'
4+
ext.KOTLIN_VERSION = '1.2.71'
55

66
repositories {
77
google()
@@ -24,22 +24,28 @@ allprojects {
2424
repositories {
2525
google()
2626
jcenter()
27+
maven { url "https://dl.bintray.com/mobisystech/maven" }
28+
maven { url "https://jitpack.io" }
29+
mavenLocal()
2730
}
2831
}
2932

3033
ext {
31-
LIBRARY_VERSION = '0.4.4'
32-
R2_STREAMER_VERSION = '0.1.8'
34+
FOLIOREADER_SDK_VERSION = '0.5.1'
35+
R2_STREAMER_KOTLIN_VERSION = '1.0.3-5'
36+
R2_SHARED_KOTLIN_VERSION = '1.0.3-2'
3337

3438
VERSION_NAME = "1.0"
3539
VERSION_CODE = 1
3640

37-
ANDROID_MIN_SDK = 15
41+
ANDROID_MIN_SDK = 19
3842
ANDROID_COMPILE_SDK_VERSION = 28
3943
ANDROID_TARGET_SDK_VERSION = 28
40-
ANDROID_LIB_VERSION = '28.0.0-rc01'
44+
ANDROID_LIB_VERSION = '28.0.0'
4145

4246
CONSTRAINT_LAYOUT_VERSION = "1.1.3"
47+
48+
JACKSON_VERSION = '2.8.6'
4349
}
4450

4551
task clean(type: Delete) {

config/quality/checkstyle/checkstyle-config.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,6 @@
110110

111111
<!-- Naming -->
112112

113-
<module name="PackageName">
114-
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
115-
<message key="name.invalidPattern"
116-
value="Package name ''{0}'' must match pattern ''{1}''."/>
117-
</module>
118-
119113
<module name="MethodName">
120114
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
121115
<message key="name.invalidPattern"
@@ -127,15 +121,6 @@
127121
value="Type name ''{0}'' must match pattern ''{1}''."/>
128122
</module>
129123

130-
<module name="MemberName">
131-
<property name="applyToPublic" value="false" />
132-
<property name="applyToPackage" value="false" />
133-
<property name="applyToProtected" value="false" />
134-
<property name="format" value="^m[A-Z]+[a-z0-9][a-zA-Z0-9]*$"/>
135-
<message key="name.invalidPattern"
136-
value="Member name ''{0}'' must match pattern ''{1}''."/>
137-
</module>
138-
139124
<module name="ParameterName">
140125
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
141126
<message key="name.invalidPattern"

folioreader/AndroidManifest.xml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
34
package="com.folioreader">
45

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

8-
<application>
9+
<uses-sdk tools:overrideLibrary="org.readium.r2.streamer, org.readium.r2.shared" />
10+
11+
<application
12+
android:allowBackup="true"
13+
tools:replace="android:allowBackup">
914

1015
<provider
1116
android:name=".AppContext"
@@ -15,7 +20,7 @@
1520
<activity
1621
android:name=".ui.folio.activity.FolioActivity"
1722
android:label="@string/app_name"
18-
android:theme="@style/FolioAppDayTheme" />
23+
android:theme="@style/FolioActivityDayTheme" />
1924

2025
<activity
2126
android:name=".ui.folio.activity.ContentHighlightActivity"

folioreader/build.gradle

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ext {
1717
siteUrl = 'https://github.com/FolioReader/FolioReader-Android'
1818
gitUrl = 'https://github.com/FolioReader/FolioReader-Android.git'
1919

20-
libraryVersion = LIBRARY_VERSION
20+
libraryVersion = FOLIOREADER_SDK_VERSION
2121

2222
developerId = 'mobisystech'
2323
developerName = 'Folio Reader'
@@ -37,6 +37,7 @@ android {
3737
targetSdkVersion ANDROID_TARGET_SDK_VERSION
3838
versionCode VERSION_CODE
3939
versionName VERSION_NAME
40+
vectorDrawables.useSupportLibrary = true
4041
}
4142

4243
sourceSets {
@@ -72,40 +73,43 @@ android {
7273

7374
lintOptions {
7475
abortOnError false
76+
lintConfig file("lint.xml")
7577
}
7678

7779
checkstyle {
7880
ignoreFailures = true
7981
}
8082
}
8183

82-
repositories {
83-
maven {
84-
url "http://dl.bintray.com/mobisystech/maven"
85-
}
86-
}
87-
8884
apply from: '../folioreader/bintray/installv1.gradle'
8985
dependencies {
9086
implementation fileTree(include: ['*.jar'], dir: 'libs')
91-
implementation project(':webViewMarker')
9287

9388
implementation "com.android.support.constraint:constraint-layout:$CONSTRAINT_LAYOUT_VERSION"
9489
implementation "com.android.support:appcompat-v7:$ANDROID_LIB_VERSION"
9590
implementation "com.android.support:recyclerview-v7:$ANDROID_LIB_VERSION"
9691
implementation "com.android.support:support-v4:$ANDROID_LIB_VERSION"
9792
implementation "com.android.support:design:$ANDROID_LIB_VERSION"
9893

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

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

104-
// r2-streamer
105-
api "org.readium:r2-fetcher:$R2_STREAMER_VERSION"
106-
api "org.readium:r2-parser:$R2_STREAMER_VERSION"
107-
api "org.readium:r2-server:$R2_STREAMER_VERSION"
108-
109100
implementation 'org.greenrobot:eventbus:3.1.1'
101+
102+
implementation "com.fasterxml.jackson.core:jackson-core:$JACKSON_VERSION"
103+
implementation "com.fasterxml.jackson.core:jackson-annotations:$JACKSON_VERSION"
104+
implementation "com.fasterxml.jackson.core:jackson-databind:$JACKSON_VERSION"
105+
106+
// R2 modules
107+
implementation "com.github.codetoart:r2-shared-kotlin:$R2_SHARED_KOTLIN_VERSION"
108+
implementation("com.github.codetoart:r2-streamer-kotlin:$R2_STREAMER_KOTLIN_VERSION") {
109+
exclude group: "org.slf4j", module: "slf4j-api"
110+
}
111+
112+
// To use only ReflectionUtils in Spring framework
113+
implementation 'org.springframework:spring-core:4.3.19.RELEASE'
110114
}
111115
apply from: '../folioreader/bintray/bintrayv1.gradle'
-216 KB
Binary file not shown.
-28.1 KB
Binary file not shown.

folioreader/lint.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<lint>
3+
<!-- Disable the given check in this project -->
4+
<issue id="LogNotTimber" severity="ignore" />
5+
</lint>

folioreader/res/color/content_highlight_text_selector_night_mode.xml

Lines changed: 0 additions & 7 deletions
This file was deleted.
-1.9 KB
Binary file not shown.
-543 Bytes
Binary file not shown.
-666 Bytes
Binary file not shown.
-774 Bytes
Binary file not shown.
-756 Bytes
Binary file not shown.
-749 Bytes
Binary file not shown.
Binary file not shown.
-694 Bytes
Binary file not shown.
-242 Bytes
Binary file not shown.

folioreader/res/drawable/ic_close_green_24dp.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<vector xmlns:android="http://schemas.android.com/apk/res/android"
33
android:width="24dp"
44
android:height="24dp"
5-
android:viewportHeight="24"
6-
android:viewportWidth="24">
5+
android:viewportWidth="24"
6+
android:viewportHeight="24">
77
<path
88
android:fillColor="#71C851"
99
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" />

folioreader/res/drawable/ic_drawer.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
22
android:width="24dp"
33
android:height="24dp"
4-
android:viewportHeight="24.0"
5-
android:viewportWidth="24.0">
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
66
<path
77
android:fillColor="#71C951"
88
android:pathData="M3,18h18v-2L3,16v2zM3,13h18v-2L3,11v2zM3,6v2h18L21,6L3,6z" />
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
6+
7+
<!-- Add tools:fillColor="@color/night_underline_icon_fill_color_top"
8+
to see the preview -->
9+
<path
10+
android:fillColor="?underlineIconFillColorTop"
11+
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" />
12+
13+
<path
14+
android:fillColor="#FFCC0000"
15+
android:pathData="M5,19v2h14v-2L5,19z" />
16+
17+
</vector>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24.0"
5+
android:viewportHeight="24.0">
6+
7+
<!-- Add tools:fillColor="@color/night_highlight_delete_fill_color"
8+
to see the preview -->
9+
<path
10+
android:fillColor="?highlightDeleteFillColor"
11+
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" />
12+
</vector>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:drawable="@drawable/ic_offline_gray_48dp"/>
4+
</layer-list>

folioreader/res/drawable/note_edittext_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
android:shape="rectangle" >
55
<corners android:radius="3dp"/>
66
<solid android:color="#FFFFFF"/>
7-
<stroke android:color="@color/blue" android:width="2dp"/>
7+
<stroke android:color="@color/highlight_blue" android:width="2dp"/>
88
</shape>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="oval">
4+
5+
<size
6+
android:width="48dp"
7+
android:height="48dp" />
8+
9+
<solid android:color="@color/highlight_blue" />
10+
11+
</shape>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="oval">
4+
5+
<size
6+
android:width="48dp"
7+
android:height="48dp" />
8+
9+
<solid android:color="@color/highlight_green" />
10+
11+
</shape>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="oval">
4+
5+
<size
6+
android:width="48dp"
7+
android:height="48dp" />
8+
9+
<solid android:color="@color/highlight_pink" />
10+
11+
</shape>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="oval">
4+
5+
<size
6+
android:width="48dp"
7+
android:height="48dp" />
8+
9+
<solid android:color="@color/highlight_yellow" />
10+
11+
</shape>

folioreader/res/layout/activity_content_highlight.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
android:layout_centerInParent="true"
3333
android:layout_margin="16dp"
3434
android:scaleType="centerCrop"
35-
android:src="@drawable/ic_close_green_24dp" />
35+
app:srcCompat="@drawable/ic_close_green_24dp" />
3636

3737
<LinearLayout android:id="@+id/layout_content_highlights"
3838
android:layout_width="200dp"

folioreader/res/layout/item_dictionary.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
34
android:layout_width="match_parent"
45
android:layout_height="wrap_content"
56
android:id="@+id/rootView"
@@ -19,7 +20,7 @@
1920
android:layout_height="24dp"
2021
android:layout_gravity="center_vertical"
2122
android:background="@android:color/transparent"
22-
android:src="@drawable/ic_volume_gray_24dp"
23+
app:srcCompat="@drawable/ic_volume_gray_24dp"
2324
android:visibility="gone" />
2425

2526
<TextView

0 commit comments

Comments
 (0)