|
|
@@ -253,7 +253,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
@SuppressLint("ClickableViewAccessibility")
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
|
|
- if (AppConfig.sharedElementEnterTransitionEnable && savedInstanceState == null) {
|
|
|
+ if (AppConfig.sharedElementEnterTransitionEnable) {
|
|
|
|
|
|
val transform = MaterialContainerTransform().apply {
|
|
|
addTarget(binding.rootView)
|
|
|
@@ -280,8 +280,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
override fun onTransitionResume(transition: Transition) {}
|
|
|
})
|
|
|
}
|
|
|
- } else {
|
|
|
- loadBook()
|
|
|
+
|
|
|
}
|
|
|
window.sharedElementReturnTransition =
|
|
|
MaterialSharedAxis(MaterialSharedAxis.X, true).apply {
|
|
|
@@ -289,6 +288,10 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
}
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
|
|
+ if (savedInstanceState != null && AppConfig.delayBookLoadEnable) {
|
|
|
+ loadBook()
|
|
|
+ }
|
|
|
+
|
|
|
if (AppConfig.sharedElementEnterTransitionEnable)
|
|
|
binding.rootView.transitionName = intent.getStringExtra("transitionName")
|
|
|
|
|
|
@@ -325,6 +328,13 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ override fun onPostCreate(savedInstanceState: Bundle?) {
|
|
|
+ super.onPostCreate(savedInstanceState)
|
|
|
+ if (!AppConfig.delayBookLoadEnable || !AppConfig.sharedElementEnterTransitionEnable) {
|
|
|
+ loadBook()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
override fun onNewIntent(intent: Intent) {
|
|
|
super.onNewIntent(intent)
|
|
|
viewModel.initData(intent)
|
|
|
@@ -440,7 +450,7 @@ class ReadBookActivity : BaseReadBookActivity(),
|
|
|
lifecycleScope.launch(Dispatchers.Default) {
|
|
|
viewModel.initReadBookConfig(intent)
|
|
|
viewModel.initData(intent)
|
|
|
- withContext(Dispatchers.Main) {
|
|
|
+ withContext(Main) {
|
|
|
binding.readView.initAfterTransition()
|
|
|
justInitData = true
|
|
|
}
|