Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #144 from readium/RC/1.2.0
Browse files Browse the repository at this point in the history
Release Prep
  • Loading branch information
mickael-menu authored Jun 25, 2020
2 parents 07fccd8 + 59f79a0 commit 6eb6108
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 49 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ All notable changes to this project will be documented in this file.

**Warning:** Features marked as *experimental* may change or be removed in a future release without notice. Use with caution.

[unreleased]: https://github.com/readium/r2-navigator-kotlin/compare/master...HEAD
[1.2.0]: https://github.com/readium/r2-navigator-kotlin/compare/1.1.6...1.2.0

## [Unreleased]

## [1.2.0]

### Added

* The [position](https://github.com/readium/architecture/tree/master/models/locators/positions) is now reported in the locators for EPUB, CBZ and PDF.
Expand All @@ -30,6 +35,3 @@ All notable changes to this project will be documented in this file.
* [Crash when opening a publication with a space in its filename](https://github.com/readium/r2-navigator-kotlin/pull/136).
* [Jumping to an EPUB location from the search](https://github.com/readium/r2-navigator-kotlin/pull/111).
* The `AndroidManifest.xml` is not forcing anymore `allowBackup` and `supportsRtl`, to let reading apps manage these features themselves (contributed by [@twaddington](https://github.com/readium/r2-navigator-kotlin/pull/118)).

[unreleased]: https://github.com/readium/r2-navigator-kotlin/compare/master...HEAD
[x.x.x]: https://github.com/readium/r2-navigator-kotlin/compare/1.1.6...x.x.x
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.61'
ext.kotlin_version = '1.3.72'

repositories {
google()
jcenter()
}
dependencies {
// AM NOTE: needs to stay this version for now (June 24,2020)
//noinspection GradleDependency
classpath 'com.android.tools.build:gradle:3.5.3'

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'

classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
35 changes: 20 additions & 15 deletions r2-navigator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ group='com.github.readium'

android {

compileSdkVersion 29
compileSdkVersion 30
defaultConfig {
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 30
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
Expand All @@ -40,41 +40,46 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'com.shopgun.android:utils:1.0.9'

if (findProject(':r2-shared')) {
implementation project(':r2-shared')
} else {
implementation "com.github.readium:r2-shared-kotlin:1.1.6"
}
implementation "androidx.appcompat:appcompat:1.2.0-beta01"

implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.core:core-ktx:1.3.0"
implementation 'androidx.webkit:webkit:1.1.0'
implementation 'androidx.webkit:webkit:1.2.0'
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "com.google.android.material:material:1.2.0-alpha03"
implementation 'joda-time:joda-time:2.9.9'
implementation 'com.google.android.material:material:1.3.0-alpha01'
implementation 'joda-time:joda-time:2.10.5'

implementation 'com.duolingo.open:rtl-viewpager:1.0.3'

implementation 'com.jakewharton.timber:timber:4.7.1'

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.1'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.5'

implementation 'org.zeroturnaround:zt-zip:1.13'
implementation 'org.zeroturnaround:zt-zip:1.14'

// AM NOTE: needs to stay this version for now (June 24,2020)
//noinspection GradleDependency
implementation 'org.jsoup:jsoup:1.10.3'

api 'com.github.barteksc:android-pdf-viewer:2.8.2'

testImplementation 'junit:junit:4.12'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"

implementation "androidx.activity:activity-ktx:1.1.0"
implementation "androidx.appcompat:appcompat:1.2.0-beta01"
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.core:core-ktx:1.2.0"
implementation "androidx.fragment:fragment-ktx:1.2.4"
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
implementation "androidx.legacy:legacy-support-core-ui:1.0.0"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:2.2.0"
Expand All @@ -83,7 +88,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0"
implementation "androidx.recyclerview:recyclerview:1.1.0"
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'androidx.webkit:webkit:1.1.0'
implementation 'androidx.webkit:webkit:1.2.0'

// ChrisBane/PhotoView ( for the Zoom handling )
implementation 'com.github.chrisbanes:PhotoView:2.1.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class R2WebView(context: Context, attrs: AttributeSet) : R2BasicWebView(context,
uiScope.launch {
if (mCurItem < numPages - 1) {
mCurItem++
listener.onPageChanged(mCurItem + 1, numPages, url)
url?.let { listener.onPageChanged(mCurItem + 1, numPages, it) }
}
}
}
Expand All @@ -58,7 +58,7 @@ class R2WebView(context: Context, attrs: AttributeSet) : R2BasicWebView(context,
uiScope.launch {
if (mCurItem > 0) {
mCurItem--
listener.onPageChanged(mCurItem + 1, numPages, url)
url?.let { listener.onPageChanged(mCurItem + 1, numPages, it) }
}
}
}
Expand Down Expand Up @@ -323,7 +323,7 @@ class R2WebView(context: Context, attrs: AttributeSet) : R2BasicWebView(context,
}

if (post) {
listener.onPageChanged(item + 1, numPages, url)
url?.let { listener.onPageChanged(item + 1, numPages, it) }
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,24 +380,26 @@ open class R2AudiobookActivity : AppCompatActivity(), CoroutineScope, IR2Activit
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == 2 && resultCode == Activity.RESULT_OK) {
if (data != null) {
val locator = data.getParcelableExtra("locator") as Locator
val locator = data.getParcelableExtra("locator") as? Locator

// href is the link to the page in the toc
var href = locator.href
locator?.let {
// href is the link to the page in the toc
var href = locator.href

if (href.indexOf("#") > 0) {
href = href.substring(0, href.indexOf("#"))
}
if (href.indexOf("#") > 0) {
href = href.substring(0, href.indexOf("#"))
}

var index = 0
for (resource in publication.readingOrder) {
if (resource.href.endsWith(href)) {
currentResource = index
break
var index = 0
for (resource in publication.readingOrder) {
if (resource.href.endsWith(href)) {
currentResource = index
break
}
index++
}
index++
seekLocation = locator.locations
}
seekLocation = locator.locations

isSeekNeeded = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,21 +221,23 @@ open class R2CbzActivity : AppCompatActivity(), CoroutineScope, IR2Activity, Vis
if (requestCode == 2 && resultCode == Activity.RESULT_OK) {
if (data != null) {

val locator = data.getParcelableExtra("locator") as Locator

fun setCurrent(resources: List<String>) {
for (index in 0 until resources.count()) {
val resource = resources[index]
if (resource.endsWith(locator.href)) {
resourcePager.currentItem = index
break
val locator = data.getParcelableExtra("locator") as? Locator

locator?.let {
fun setCurrent(resources: List<String>) {
for (index in 0 until resources.count()) {
val resource = resources[index]
if (resource.endsWith(locator.href)) {
resourcePager.currentItem = index
break
}
}
}
}

resourcePager.adapter = adapter
resourcePager.adapter = adapter

setCurrent(resources)
setCurrent(resources)
}

if (supportActionBar!!.isShowing && allowToggleActionBar) {
resourcePager.systemUiVisibility = (View.SYSTEM_UI_FLAG_LAYOUT_STABLE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class R2EpubPageFragment : Fragment() {
if (id != null) {
webView.loadUrl("$resourceUrl#$id")
} else {
webView.loadUrl(resourceUrl)
resourceUrl?.let { webView.loadUrl(it) }
}

return v
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class R2FXLPageFragment : Fragment() {
true
}

webView.loadUrl(resourceUrl)
resourceUrl?.let { webView.loadUrl(it) }
}

companion object {
Expand Down

0 comments on commit 6eb6108

Please sign in to comment.