mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 20:57:24 +01:00
Fix reader theme
This commit is contained in:
parent
aacd42b9f6
commit
de53681d2b
@ -17,8 +17,15 @@ import eu.kanade.tachiyomi.ui.reader.ReaderActivity
|
|||||||
|
|
||||||
class PageDecodeErrorLayout(context: Context) : LinearLayout(context) {
|
class PageDecodeErrorLayout(context: Context) : LinearLayout(context) {
|
||||||
|
|
||||||
private val lightGreyColor = ContextCompat.getColor(context, android.R.attr.textColorHint)
|
/**
|
||||||
private val blackColor = ContextCompat.getColor(context, android.R.attr.textColorPrimary)
|
* Text color for black theme.
|
||||||
|
*/
|
||||||
|
private val whiteColor = ContextCompat.getColor(context, R.color.textColorSecondaryDark)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Text color for white theme.
|
||||||
|
*/
|
||||||
|
private val blackColor = ContextCompat.getColor(context, R.color.textColorSecondaryLight)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
orientation = LinearLayout.VERTICAL
|
orientation = LinearLayout.VERTICAL
|
||||||
@ -31,7 +38,7 @@ class PageDecodeErrorLayout(context: Context) : LinearLayout(context) {
|
|||||||
TextView(context).apply {
|
TextView(context).apply {
|
||||||
gravity = Gravity.CENTER
|
gravity = Gravity.CENTER
|
||||||
setText(R.string.decode_image_error)
|
setText(R.string.decode_image_error)
|
||||||
setTextColor(if (theme == ReaderActivity.BLACK_THEME) lightGreyColor else blackColor)
|
setTextColor(if (theme == ReaderActivity.BLACK_THEME) whiteColor else blackColor)
|
||||||
addView(this)
|
addView(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -74,12 +74,12 @@ class PagerReaderFragment : BaseFragment() {
|
|||||||
/**
|
/**
|
||||||
* Text color for black theme.
|
* Text color for black theme.
|
||||||
*/
|
*/
|
||||||
private val lightGreyColor by lazy { ContextCompat.getColor(context, R.color.textColorHintDark) }
|
private val whiteColor = ContextCompat.getColor(context, R.color.textColorSecondaryDark)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Text color for white theme.
|
* Text color for white theme.
|
||||||
*/
|
*/
|
||||||
private val blackColor by lazy { ContextCompat.getColor(context, R.color.textColorHintLight) }
|
private val blackColor = ContextCompat.getColor(context, R.color.textColorSecondaryLight)
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedState: Bundle?): View? {
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedState: Bundle?): View? {
|
||||||
return inflater.inflate(R.layout.item_pager_reader, container, false)
|
return inflater.inflate(R.layout.item_pager_reader, container, false)
|
||||||
@ -87,7 +87,9 @@ class PagerReaderFragment : BaseFragment() {
|
|||||||
|
|
||||||
override fun onViewCreated(view: View, savedState: Bundle?) {
|
override fun onViewCreated(view: View, savedState: Bundle?) {
|
||||||
if (readerActivity.readerTheme == ReaderActivity.BLACK_THEME) {
|
if (readerActivity.readerTheme == ReaderActivity.BLACK_THEME) {
|
||||||
progress_text.setTextColor(lightGreyColor)
|
progress_text.setTextColor(whiteColor)
|
||||||
|
} else {
|
||||||
|
progress_text.setTextColor(blackColor)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pagerReader is RightToLeftReader) {
|
if (pagerReader is RightToLeftReader) {
|
||||||
|
Loading…
Reference in New Issue
Block a user