|
@@ -97,6 +97,12 @@ class PagerPageHolder(
|
|
|
*/
|
|
|
private var readImageHeaderSubscription: Subscription? = null
|
|
|
|
|
|
+ /**
|
|
|
+ * Context that has been wrapped to use the correct theme values based on the
|
|
|
+ * current app theme and reader background color
|
|
|
+ */
|
|
|
+ private val readerThemedContext = context.createReaderThemeContext(viewer.config.theme)
|
|
|
+
|
|
|
val stateChangedListener = object : SubsamplingScaleImageView.OnStateChangedListener {
|
|
|
override fun onScaleChanged(newScale: Float, origin: Int) {
|
|
|
viewer.activity.hideMenu()
|
|
@@ -115,8 +121,7 @@ class PagerPageHolder(
|
|
|
}
|
|
|
|
|
|
init {
|
|
|
- val indicatorContext = context.createReaderThemeContext(viewer.config.theme)
|
|
|
- progressIndicator = ReaderProgressIndicator(indicatorContext).apply {
|
|
|
+ progressIndicator = ReaderProgressIndicator(readerThemedContext).apply {
|
|
|
updateLayoutParams<LayoutParams> {
|
|
|
gravity = Gravity.CENTER
|
|
|
}
|
|
@@ -418,7 +423,7 @@ class PagerPageHolder(
|
|
|
private fun initRetryButton(): PagerButton {
|
|
|
if (retryButton != null) return retryButton!!
|
|
|
|
|
|
- retryButton = PagerButton(context, viewer).apply {
|
|
|
+ retryButton = PagerButton(readerThemedContext, viewer).apply {
|
|
|
layoutParams = LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply {
|
|
|
gravity = Gravity.CENTER
|
|
|
}
|
|
@@ -445,7 +450,7 @@ class PagerPageHolder(
|
|
|
}
|
|
|
decodeErrorLayout = decodeLayout
|
|
|
|
|
|
- TextView(context).apply {
|
|
|
+ TextView(readerThemedContext).apply {
|
|
|
layoutParams = LinearLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply {
|
|
|
setMargins(margins, margins, margins, margins)
|
|
|
}
|
|
@@ -455,7 +460,7 @@ class PagerPageHolder(
|
|
|
decodeLayout.addView(this)
|
|
|
}
|
|
|
|
|
|
- PagerButton(context, viewer).apply {
|
|
|
+ PagerButton(readerThemedContext, viewer).apply {
|
|
|
layoutParams = LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply {
|
|
|
setMargins(margins, margins, margins, margins)
|
|
|
}
|
|
@@ -469,7 +474,7 @@ class PagerPageHolder(
|
|
|
|
|
|
val imageUrl = page.imageUrl
|
|
|
if (imageUrl.orEmpty().startsWith("http", true)) {
|
|
|
- PagerButton(context, viewer).apply {
|
|
|
+ PagerButton(readerThemedContext, viewer).apply {
|
|
|
layoutParams = LayoutParams(WRAP_CONTENT, WRAP_CONTENT).apply {
|
|
|
setMargins(margins, margins, margins, margins)
|
|
|
}
|