Skip to content

Commit

Permalink
Merge pull request #228 from codetoart/master
Browse files Browse the repository at this point in the history
Horizontal scroll code for v0.4.0
  • Loading branch information
Mahavir Jain committed Jun 29, 2018
2 parents edc562f + 28d5173 commit 267109d
Show file tree
Hide file tree
Showing 81 changed files with 2,644 additions and 1,837 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Expand Up @@ -6,13 +6,11 @@ before_install:

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

licenses:
- android-sdk-license-.+

script:
./gradlew checkstyle build
./gradlew build
19 changes: 0 additions & 19 deletions FolioReader.iml

This file was deleted.

49 changes: 35 additions & 14 deletions README.md
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.11'
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
29 changes: 15 additions & 14 deletions build.gradle
@@ -1,22 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.KOTLIN_VERSION= '1.2.41'

ext.KOTLIN_VERSION = '1.2.41'
ext.ANDROID_LIB_VERSION = '27.1.1'
ext.R2_STREAMER_VERSION = '0.1.7'
def KOTLIN_VERSION = ext.KOTLIN_VERSION

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 +26,14 @@ 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"
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
4 changes: 3 additions & 1 deletion folioreader/AndroidManifest.xml
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
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.11'
libraryVersion = '0.4.0'

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 Integer.parseInt(project.ANDROID_COMPILE_SDK_VERSION)

defaultConfig {
versionCode 1
versionName "1.0"
minSdkVersion 14
targetSdkVersion 27
minSdkVersion Integer.parseInt(project.ANDROID_MIN_SDK)
targetSdkVersion Integer.parseInt(project.ANDROID_TARGET_SDK_VERSION)
versionCode Integer.parseInt(project.VERSION_CODE)
versionName project.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
@@ -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
@@ -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
@@ -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
@@ -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 267109d

Please sign in to comment.