Skip to content

Commit 267109d

Browse files
author
Mahavir Jain
authored
Merge pull request #228 from codetoart/master
Horizontal scroll code for v0.4.0
2 parents edc562f + 28d5173 commit 267109d

File tree

81 files changed

+2644
-1837
lines changed

Some content is hidden

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

81 files changed

+2644
-1837
lines changed

.travis.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ before_install:
66

77
android:
88
components:
9-
- build-tools-27.0.3
10-
- android-27
11-
- android-19
9+
- android-28
1210
- extra-android-m2repository
1311

1412
licenses:
1513
- android-sdk-license-.+
1614

1715
script:
18-
./gradlew checkstyle build
16+
./gradlew build

FolioReader.iml

-19
This file was deleted.

README.md

+35-14
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ FolioReader-Android is an ePub reader written in Java.
2323
- [x] Add Notes to a Highlight
2424
- [ ] Better Documentation
2525
- [x] Last Read Position Listener
26+
- [x] Horizontal reading
2627

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

3738
### Gradle
38-
Add following dependency to your app build.gradle
39+
40+
Add following dependency to your app build.gradle:
41+
3942
``` java
40-
compile 'com.folioreader:folioreader:0.3.11'
43+
compile 'com.folioreader:folioreader:0.4.0'
4144
```
4245

43-
Add maven repository to your top level build.gradle
46+
Add maven repository to your top level build.gradle:
4447

4548
```groovy
4649
allprojects {
@@ -54,32 +57,50 @@ allprojects {
5457

5558
### Usage
5659

57-
First add activity tag for FolioActivity in your AndroidManifest.xml
60+
First add permissions and activity tag for `FolioActivity` in your `AndroidManifest.xml`:
5861

5962
```xml
60-
<activity
61-
android:name="com.folioreader.ui.folio.activity.FolioActivity"
62-
android:configChanges="orientation|screenSize"
63-
android:theme="@style/AppTheme.NoActionBar"/>
63+
<?xml version="1.0" encoding="utf-8"?>
64+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
65+
package="com.folioreader.android.sample">
66+
67+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
68+
<uses-permission android:name="android.permission.INTERNET" />
69+
70+
<application>
71+
72+
...
73+
74+
<activity
75+
android:name="com.folioreader.ui.folio.activity.FolioActivity"
76+
android:theme="@style/AppTheme.NoActionBar" />
77+
78+
...
79+
80+
</application>
81+
82+
</manifest>
6483
```
6584

66-
To use FolioReader, get singleton object of **FolioReader**.
85+
**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`.**
86+
87+
Get singleton object of `FolioReader`:
6788

6889
```java
6990
FolioReader folioReader = FolioReader.getInstance(getApplicationContext());
7091
```
7192

72-
Call the function openBook().
93+
Call the function `openBook()`:
7394

74-
##### opening book from assets
95+
##### opening book from assets -
7596

7697
```java
77-
folioReader.openBook("file:///android_asset/adventures.epub");
98+
folioReader.openBook("file:///android_asset/TheSilverChair.epub");
7899
```
79-
##### opening book from raw
100+
##### opening book from raw -
80101

81102
```java
82-
folioReader.openBook(R.raw.barrett);
103+
folioReader.openBook(R.raw.adventures);
83104
```
84105

85106
## WIKI

build.gradle

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
13
buildscript {
2-
ext.KOTLIN_VERSION= '1.2.41'
34

5+
ext.KOTLIN_VERSION = '1.2.41'
46
ext.ANDROID_LIB_VERSION = '27.1.1'
57
ext.R2_STREAMER_VERSION = '0.1.7'
68
def KOTLIN_VERSION = ext.KOTLIN_VERSION
79

810
repositories {
11+
google()
912
jcenter()
10-
maven {
11-
url "http://dl.bintray.com/mobisystech/maven"
12-
}
13-
maven {
14-
url 'https://maven.google.com/'
15-
name 'Google'
16-
}
1713
}
1814
dependencies {
19-
classpath 'com.android.tools.build:gradle:3.1.2'
15+
classpath 'com.android.tools.build:gradle:3.1.3'
16+
17+
// NOTE: Do not place your application dependencies here; they belong
18+
// in the individual module build.gradle files
19+
2020
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
2121
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
2222
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION"
@@ -26,13 +26,14 @@ buildscript {
2626

2727
allprojects {
2828
repositories {
29+
google()
2930
jcenter()
3031
maven {
31-
url "http://dl.bintray.com/mobisystech/maven"
32-
}
33-
maven {
34-
url 'https://maven.google.com/'
35-
name 'Google'
32+
url "http://dl.bintray.com/mobisystech/maven"
3633
}
3734
}
3835
}
36+
37+
task clean(type: Delete) {
38+
delete rootProject.buildDir
39+
}

folioreader/AndroidManifest.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
package="com.folioreader">
44

55
<application>
6-
<activity android:name=".ui.folio.activity.ContentHighlightActivity" />
6+
<activity
7+
android:name=".ui.folio.activity.ContentHighlightActivity"
8+
android:theme="@style/AppTheme.NoActionBar" />
79
</application>
810

911
</manifest>

folioreader/build.gradle

+7-9
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 = '0.3.11'
20+
libraryVersion = '0.4.0'
2121

2222
developerId = 'mobisystech'
2323
developerName = 'Folio Reader'
@@ -30,14 +30,13 @@ ext {
3030

3131
android {
3232
useLibrary 'org.apache.http.legacy'
33-
compileSdkVersion 27
34-
buildToolsVersion "27.0.3"
33+
compileSdkVersion Integer.parseInt(project.ANDROID_COMPILE_SDK_VERSION)
3534

3635
defaultConfig {
37-
versionCode 1
38-
versionName "1.0"
39-
minSdkVersion 14
40-
targetSdkVersion 27
36+
minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK)
37+
targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)
38+
versionCode Integer.parseInt(project.VERSION_CODE)
39+
versionName project.VERSION_NAME
4140
}
4241

4342
sourceSets {
@@ -86,8 +85,7 @@ dependencies {
8685
implementation fileTree(include: ['*.jar'], dir: 'libs')
8786
implementation project(':webViewMarker')
8887

89-
//noinspection GradleDependency
90-
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
88+
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
9189
implementation "com.android.support:appcompat-v7:$ANDROID_LIB_VERSION"
9290
implementation "com.android.support:recyclerview-v7:$ANDROID_LIB_VERSION"
9391
implementation "com.android.support:support-v4:$ANDROID_LIB_VERSION"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle">
4+
<stroke
5+
android:width="1dp"
6+
android:color="#00F" />
7+
<solid android:color="#880000FF"/>
8+
</shape>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle">
4+
<stroke
5+
android:width="1dp"
6+
android:color="#0F0" />
7+
<solid android:color="#8800FF00"/>
8+
</shape>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="rectangle">
4+
<stroke
5+
android:width="1dp"
6+
android:color="#F00" />
7+
</shape>

folioreader/res/layout/folio_page_fragment.xml

+31-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,35 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3-
android:id="@+id/rlContainer"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
android:id="@+id/folioPageFragment"
45
android:layout_width="match_parent"
56
android:layout_height="match_parent"
67
android:orientation="vertical">
7-
<com.folioreader.view.ObservableWebView
8-
android:id="@+id/contentWebView"
8+
9+
<FrameLayout
10+
android:id="@+id/webViewLayout"
911
android:layout_width="match_parent"
1012
android:layout_height="match_parent"
11-
android:layout_above="@+id/indicatorLayout"
12-
android:paddingBottom="2dp" />
13+
android:layout_above="@+id/indicatorLayout">
14+
15+
<com.folioreader.view.WebViewPager
16+
android:id="@+id/webViewPager"
17+
android:layout_width="match_parent"
18+
android:layout_height="match_parent" />
19+
20+
<com.folioreader.view.FolioWebView
21+
android:id="@+id/folioWebView"
22+
android:layout_width="match_parent"
23+
android:layout_height="match_parent" />
24+
25+
</FrameLayout>
26+
27+
<com.folioreader.view.LoadingView
28+
android:id="@+id/loadingView"
29+
android:layout_width="match_parent"
30+
android:layout_height="match_parent"
31+
tools:visibility="invisible" />
32+
1333
<com.folioreader.view.VerticalSeekbar
1434
android:id="@+id/scrollSeekbar"
1535
android:layout_width="wrap_content"
@@ -20,20 +40,25 @@
2040
android:animateLayoutChanges="true"
2141
android:thumb="@drawable/thumb"
2242
android:visibility="invisible" />
43+
2344
<LinearLayout
2445
android:id="@+id/indicatorLayout"
2546
android:layout_width="match_parent"
2647
android:layout_height="wrap_content"
2748
android:layout_alignParentBottom="true"
2849
android:gravity="center"
2950
android:orientation="horizontal"
30-
android:paddingBottom="2dp">
51+
android:paddingBottom="2dp"
52+
android:paddingTop="2dp"
53+
android:visibility="gone">
54+
3155
<TextView
3256
android:id="@+id/minutesLeft"
3357
android:layout_width="wrap_content"
3458
android:layout_height="wrap_content"
3559
android:textColor="#888888"
3660
android:textSize="7sp" />
61+
3762
<TextView
3863
android:id="@+id/pagesLeft"
3964
android:layout_width="wrap_content"

0 commit comments

Comments
 (0)