react-native-readium 1.0.3 → 1.0.4
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.
|
@@ -21,6 +21,7 @@ class ReadiumView(
|
|
|
21
21
|
var file: File? = null
|
|
22
22
|
var fragment: BaseReaderFragment? = null
|
|
23
23
|
var isViewInitialized: Boolean = false
|
|
24
|
+
var lateInitSettings: Map<String, Any>? = null
|
|
24
25
|
|
|
25
26
|
fun updateLocation(location: LinkOrLocator) : Boolean {
|
|
26
27
|
if (fragment == null) {
|
|
@@ -30,15 +31,25 @@ class ReadiumView(
|
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
fun updateSettingsFromMap(map: Map<String, Any
|
|
34
|
-
if (
|
|
34
|
+
fun updateSettingsFromMap(map: Map<String, Any>?) {
|
|
35
|
+
if (map == null) {
|
|
36
|
+
return
|
|
37
|
+
} else if (fragment == null) {
|
|
38
|
+
lateInitSettings = map
|
|
39
|
+
return
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (fragment is EpubReaderFragment) {
|
|
35
43
|
(fragment as EpubReaderFragment).updateSettingsFromMap(map)
|
|
36
44
|
}
|
|
45
|
+
|
|
46
|
+
lateInitSettings = null
|
|
37
47
|
}
|
|
38
48
|
|
|
39
49
|
fun addFragment(frag: BaseReaderFragment) {
|
|
40
50
|
fragment = frag
|
|
41
51
|
setupLayout()
|
|
52
|
+
updateSettingsFromMap(lateInitSettings)
|
|
42
53
|
val activity: FragmentActivity? = reactContext.currentActivity as FragmentActivity?
|
|
43
54
|
activity!!.supportFragmentManager
|
|
44
55
|
.beginTransaction()
|