react-native-readium 1.0.0-alpha.9 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -53,6 +53,11 @@ yarn add react-native-readium
|
|
|
53
53
|
Due to the current state of the `Readium` swift libraries you need to manually
|
|
54
54
|
update your `Podfile` ([see more on that here](https://github.com/readium/swift-toolkit/issues/38)).
|
|
55
55
|
|
|
56
|
+
Additionally, note that the GitHub URL's below are pointing to the `develop`
|
|
57
|
+
branch. [This is currently necessary as a fix for CocoaPods was merged but has
|
|
58
|
+
not yet been released](https://github.com/readium/swift-toolkit/pull/76#issuecomment-1213170966).
|
|
59
|
+
It will land in the next release (after v2.3.0).
|
|
60
|
+
|
|
56
61
|
```rb
|
|
57
62
|
# ./ios/Podfile
|
|
58
63
|
...
|
|
@@ -64,9 +69,9 @@ target 'ExampleApp' do
|
|
|
64
69
|
config = use_native_modules!
|
|
65
70
|
...
|
|
66
71
|
pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/a8edee9790ef0995b2cf620ba1a9b5cf146b7221/GCDWebServer.podspec', modular_headers: true
|
|
67
|
-
pod 'R2Shared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/
|
|
68
|
-
pod 'R2Streamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/
|
|
69
|
-
pod 'R2Navigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/
|
|
72
|
+
pod 'R2Shared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/develop/Support/CocoaPods/ReadiumShared.podspec'
|
|
73
|
+
pod 'R2Streamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/develop/Support/CocoaPods/ReadiumStreamer.podspec'
|
|
74
|
+
pod 'R2Navigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/develop/Support/CocoaPods/ReadiumNavigator.podspec'
|
|
70
75
|
pod 'Minizip', modular_headers: true
|
|
71
76
|
...
|
|
72
77
|
end
|
|
@@ -78,6 +83,23 @@ Finally, install the pods:
|
|
|
78
83
|
|
|
79
84
|
#### Android
|
|
80
85
|
|
|
86
|
+
You might need to [add `jcenter` if you're getting a build failure on android](https://github.com/readium/kotlin-toolkit/issues/31):
|
|
87
|
+
|
|
88
|
+
```groovy
|
|
89
|
+
// android/build.gradle
|
|
90
|
+
...
|
|
91
|
+
|
|
92
|
+
allprojects {
|
|
93
|
+
repositories {
|
|
94
|
+
...
|
|
95
|
+
// required by react-native-readium https://github.com/readium/kotlin-toolkit/issues/31
|
|
96
|
+
jcenter()
|
|
97
|
+
}
|
|
98
|
+
...
|
|
99
|
+
}
|
|
100
|
+
...
|
|
101
|
+
```
|
|
102
|
+
|
|
81
103
|
If you're not using `compileSdkVersion` >= 31 you'll need to update that:
|
|
82
104
|
|
|
83
105
|
```groovy
|
|
@@ -2,6 +2,7 @@ package com.reactnativereadium.epub
|
|
|
2
2
|
|
|
3
3
|
import android.content.Context
|
|
4
4
|
import android.content.SharedPreferences
|
|
5
|
+
import android.graphics.Color
|
|
5
6
|
import androidx.appcompat.app.AppCompatActivity
|
|
6
7
|
import org.json.JSONArray
|
|
7
8
|
import org.readium.r2.navigator.R2BasicWebView
|
|
@@ -79,6 +80,21 @@ class UserSettings(
|
|
|
79
80
|
is Switchable -> updateSwitchableFromKeyValue(property, key, value)
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
// update the resourcePager background to match the newly selected theme
|
|
84
|
+
if (isPropertyModified && property is Enumerable && property.ref == APPEARANCE_REF) {
|
|
85
|
+
when (property.index) {
|
|
86
|
+
0 -> {
|
|
87
|
+
resourcePager.setBackgroundColor(Color.parseColor("#ffffff"))
|
|
88
|
+
}
|
|
89
|
+
1 -> {
|
|
90
|
+
resourcePager.setBackgroundColor(Color.parseColor("#faf4e8"))
|
|
91
|
+
}
|
|
92
|
+
2 -> {
|
|
93
|
+
resourcePager.setBackgroundColor(Color.parseColor("#000000"))
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
82
98
|
// apply the changes to the view
|
|
83
99
|
if (isPropertyModified) {
|
|
84
100
|
updateViewCSS(key)
|
package/ios/ReadiumView.swift
CHANGED
|
@@ -100,6 +100,13 @@ class ReadiumView : UIView, Loggable {
|
|
|
100
100
|
|
|
101
101
|
if let e = property as? Enumerable {
|
|
102
102
|
e.index = value as! Int
|
|
103
|
+
|
|
104
|
+
// synchronize background color
|
|
105
|
+
if property.reference == ReadiumCSSReference.appearance.rawValue {
|
|
106
|
+
if let vc = readerViewController as? EPUBViewController {
|
|
107
|
+
vc.setUIColor(for: property)
|
|
108
|
+
}
|
|
109
|
+
}
|
|
103
110
|
} else if let i = property as? Incrementable {
|
|
104
111
|
i.value = value as! Float
|
|
105
112
|
} else if let s = property as? Switchable {
|