Explorar o código

Fix reader theme

len %!s(int64=9) %!d(string=hai) anos
pai
achega
de53681d2b

+ 10 - 3
app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/base/PageDecodeErrorLayout.kt

@@ -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)
         }
 

+ 5 - 3
app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/pager/PagerReaderFragment.kt

@@ -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) {