Skip to content

Commit

Permalink
Prepare version 0.5.2
Browse files Browse the repository at this point in the history
Last Read Locator
Search Locator
  • Loading branch information
hrishikesh-kadam committed Nov 13, 2018
1 parent 975fe40 commit ccd082d
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 85 deletions.
9 changes: 8 additions & 1 deletion KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
This is a list of major known issues. For the latest list of all issues see the
[Github Issues page](https://github.com/FolioReader/FolioReader-Android/issues)

## Media Overlay

From version 0.5.1, Media Overlay would not work as the streamer implementation is not done yet in r2-streamer-kotlin.

## TTS

From version 5.0.2, TTS is disabled temporarily till the fix is complete.
From version 0.5.2, TTS is disabled.
In previous versions, sentences were formed by changing the DOM structure.
To implement TTS without changing DOM would require NLP to extract sentences.
As of now, no major reading systems other than Google Play Books implements TTS bug free.
68 changes: 19 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Build Status](https://api.travis-ci.org/FolioReader/FolioReader-Android.svg?branch=master)](https://travis-ci.org/FolioReader/FolioReader-Android)

FolioReader-Android is an ePub reader written in Java.
FolioReader-Android is an ePub reader written in Java and Kotlin.

### Features

Expand All @@ -13,27 +13,27 @@ FolioReader-Android is an ePub reader written in Java.
- [x] List / Edit / Delete Highlights
- [x] Handle Internal and External Links
- [x] Portrait / Landscape
- [x] Reading Time Left / Pages left
- [ ] Reading Time Left / Pages left
- [x] In-App Dictionary
- [x] Media Overlays (Sync text rendering with audio playback)
- [x] TTS - Text to Speech Support
- [ ] Media Overlays (Sync text rendering with audio playback)
- [ ] TTS - Text to Speech Support
- [ ] Parse epub cover image
- [ ] PDF support
- [x] Book Search
- [x] Add Notes to a Highlight
- [ ] Better Documentation
- [x] Last Read Position Listener
- [x] Horizontal reading
- [x] Last Read Locator
- [x] Horizontal Reading
- [x] Distraction Free Reading

## Demo
##### Custom Fonts
![Custom fonts](https://cloud.githubusercontent.com/assets/1277242/19012915/0661c7b2-87e0-11e6-81d6-8c71051e1074.gif)
##### Day and Night Mode
![Day night mode](https://cloud.githubusercontent.com/assets/1277242/19012914/f42059c4-87df-11e6-97f8-29e61a79e8aa.gif)
##### Text Highlighting
##### Text Highlighting
![Highlight](https://cloud.githubusercontent.com/assets/1277242/19012904/c2700c3a-87df-11e6-97ed-507765b3ddf0.gif)
##### Media Overlays
##### Media Overlays
![Media Overlay](https://cloud.githubusercontent.com/assets/1277242/19012908/d61f3ce2-87df-11e6-8652-d72b6a1ad9a3.gif)

### Gradle
Expand All @@ -44,7 +44,7 @@ Add following dependency to your root project `build.gradle` file:
allprojects {
repositories {
...
maven { url "https://dl.bintray.com/mobisystech/maven" }
jcenter()
maven { url "https://jitpack.io" }
...
}
Expand All @@ -56,39 +56,14 @@ Add following dependency to your app module `build.gradle` file:
```groovy
dependencies {
...
implementation "com.folioreader:folioreader:0.5.1"
implementation "com.folioreader:folioreader:0.5.2"
...
}
```

### Enable Multidex support

### AndroidManifest

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

{your-app-module}/res/xml/network_security_config.xml

```xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">127.0.0.1</domain>
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>
```

Then add network_security_config.xml in your app module's AndroidManifest.xml

```xml
<?xml version="1.0" encoding="utf-8"?>
<manifest ...>
...
<application android:networkSecurityConfig="@xml/network_security_config">
...
</application>
</manifest>
```
Enable Multidex support as explained in this [Android Doc](https://developer.android.com/studio/build/multidex)

### Usage

Expand All @@ -100,22 +75,17 @@ FolioReader folioReader = FolioReader.get();

Call the function `openBook()`:

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

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

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

<br />

**Note: From v0.4.1 you don't need to specify permissions and `FolioActivity` tag in AndroidManifest.xml**

<br />

## WIKI

Expand All @@ -126,21 +96,21 @@ folioReader.openBook(R.raw.adventures);
* [Highlight Action](https://github.com/FolioReader/FolioReader-Android/wiki/Highlight-Action)
* [Highlight Event](https://github.com/FolioReader/FolioReader-Android/wiki/Highlight-Event)
* [Providing External Highlight](https://github.com/FolioReader/FolioReader-Android/wiki/Providing-External-Highlight)
* [ReadPosition](https://github.com/FolioReader/FolioReader-Android/wiki/ReadPosition)
* [Get ReadPosition](https://github.com/FolioReader/FolioReader-Android/wiki/Get-ReadPosition)
* [Set ReadPosition](https://github.com/FolioReader/FolioReader-Android/wiki/Set-ReadPosition)
* [ReadLocator](https://github.com/FolioReader/FolioReader-Android/wiki/ReadLocator)
* [Get ReadLocator](https://github.com/FolioReader/FolioReader-Android/wiki/Get-ReadLocator)
* [Set ReadLocator](https://github.com/FolioReader/FolioReader-Android/wiki/Set-ReadLocator)
* [Clean up code](https://github.com/FolioReader/FolioReader-Android/wiki/Clean-up-code)

## Reporting Issue

Please follow [Issue Template](https://github.com/FolioReader/FolioReader-Android/blob/master/.github/ISSUE_TEMPLATE.md) to report any issue.
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>
2. <a href="https://github.com/readium/r2-streamer-kotlin">r2-streamer-kotlin</a>
3. <a href="http://developer.pearson.com/apis/dictionaries">Pearson Dictionaries</a>
4. <a href="https://github.com/timdown/rangy">rangy</a>

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ allprojects {
}

ext {
folioreaderSdkVersion = "0.5.1"
r2StreamerKotlinVersion = "1.0.3-6.dev"
r2SharedKotlinVersion = "1.0.3-3.dev"
folioreaderSdkVersion = "0.5.2"
r2StreamerKotlinVersion = "1.0.3-7"
r2SharedKotlinVersion = "1.0.3-4"

projectVersionCode = 1
projectVersionName = "1.0"

androidMinSdkVersion = 19
androidMinSdkVersion = 21
androidCompileSdkVersion = 28
androidTargetSdkVersion = 28
androidSupportLibVersion = "28.0.0"
Expand Down
3 changes: 2 additions & 1 deletion folioreader/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

<application
android:allowBackup="true"
android:networkSecurityConfig="@xml/network_security_config"
tools:replace="android:allowBackup">

<provider
android:name=".AppContext"
android:authorities="${applicationId}.com.folioreader"
android:authorities="${applicationId}.provider.appcontext"
android:exported="false" />

<activity
Expand Down
2 changes: 1 addition & 1 deletion folioreader/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ dependencies {
changing = true
}

// To use only ReflectionUtils in Spring framework
// Only ReflectionUtils in Spring framework is used
implementation 'org.springframework:spring-core:4.3.19.RELEASE'
}
apply from: '../folioreader/bintray/bintrayv1.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ class SearchLoader : AsyncTaskLoader<Any?> {

//Thread.sleep(6000)

/*val objectMapper = ObjectMapper()
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
locatorList = objectMapper.readValue(stringBuilder.toString())*/
val locatorType = object : TypeToken<MutableList<Locator>>() {}.type
locatorList = Gson().fromJson(stringBuilder.toString(), locatorType)
Log.d(LOG_TAG, "-> loadInBackground -> " + stringBuilder.toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ class FolioActivity : AppCompatActivity(), FolioActivityCallback, MediaControlle
val cbzParser = CbzParser()
cbzParser.parse(path!!, "")
}
else -> {
null
}
}

val portNumber = intent.getIntExtra(Config.INTENT_PORT, Constants.PORT_NUMBER)
Expand All @@ -470,11 +473,11 @@ class FolioActivity : AppCompatActivity(), FolioActivityCallback, MediaControlle
r2StreamerServer!!.start()
}

fun onBookInitFailure() {
private fun onBookInitFailure() {
//TODO -> Fail gracefully
}

fun onBookInitSuccess() {
private fun onBookInitSuccess() {

val publication = pubBox!!.publication
spine = publication.spine
Expand Down Expand Up @@ -525,7 +528,7 @@ class FolioActivity : AppCompatActivity(), FolioActivityCallback, MediaControlle
}
}

fun initDistractionFreeMode(savedInstanceState: Bundle?) {
private fun initDistractionFreeMode(savedInstanceState: Bundle?) {
Log.v(LOG_TAG, "-> initDistractionFreeMode")

window.decorView.setOnSystemUiVisibilityChangeListener(this)
Expand Down Expand Up @@ -673,7 +676,7 @@ class FolioActivity : AppCompatActivity(), FolioActivityCallback, MediaControlle
}
}

fun showSystemUI() {
private fun showSystemUI() {
Log.v(LOG_TAG, "-> showSystemUI")

if (Build.VERSION.SDK_INT >= 16) {
Expand All @@ -689,7 +692,7 @@ class FolioActivity : AppCompatActivity(), FolioActivityCallback, MediaControlle
}
}

fun hideSystemUI() {
private fun hideSystemUI() {
Log.v(LOG_TAG, "-> hideSystemUI")

if (Build.VERSION.SDK_INT >= 16) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package com.folioreader.android

import org.junit.Assert.assertEquals
import org.junit.Test
import org.readium.r2.shared.Locations
import org.readium.r2.shared.Locator

/**
* Example local unit test, which will execute on the development machine (host).
Expand All @@ -16,20 +14,4 @@ class ExampleUnitTest {
fun addition_isCorrect() {
assertEquals(4, (2 + 2).toLong())
}

@Test
fun testNullability() {

var locator = Locator("", 0, "", Locations(), null)

//var string: String = locator.text?.before + locator.text?.hightlight + locator.text?.after

var string: String = StringBuilder()
.append(locator.text?.before)
.append(locator.text?.hightlight ?: "")
.append(locator.text?.after ?: "")
.toString()

println(string)
}
}
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

implementation 'com.android.support:multidex:1.0.3'

implementation project(':folioreader')
//implementation "com.folioreader:folioreader:$folioreaderSdkVersion"

implementation "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
implementation "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
implementation "com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion"

implementation 'com.android.support:multidex:1.0.3'
}
1 change: 0 additions & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
Expand Down

0 comments on commit ccd082d

Please sign in to comment.