mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Fix reader theme
This commit is contained in:
		@@ -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)
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user