Fix reader theme

This commit is contained in:
len 2016-03-17 20:35:45 +01:00
parent aacd42b9f6
commit de53681d2b
2 changed files with 15 additions and 6 deletions

View File

@ -17,8 +17,15 @@ import eu.kanade.tachiyomi.ui.reader.ReaderActivity
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 {
orientation = LinearLayout.VERTICAL
@ -31,7 +38,7 @@ class PageDecodeErrorLayout(context: Context) : LinearLayout(context) {
TextView(context).apply {
gravity = Gravity.CENTER
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)
}

View File

@ -74,12 +74,12 @@ class PagerReaderFragment : BaseFragment() {
/**
* 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.
*/
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? {
return inflater.inflate(R.layout.item_pager_reader, container, false)
@ -87,7 +87,9 @@ class PagerReaderFragment : BaseFragment() {
override fun onViewCreated(view: View, savedState: Bundle?) {
if (readerActivity.readerTheme == ReaderActivity.BLACK_THEME) {
progress_text.setTextColor(lightGreyColor)
progress_text.setTextColor(whiteColor)
} else {
progress_text.setTextColor(blackColor)
}
if (pagerReader is RightToLeftReader) {