mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-16 14:07:28 +01:00
Replace some old color attribute usages
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package eu.kanade.tachiyomi.ui.manga.chapter
|
||||
|
||||
import android.content.Context
|
||||
import androidx.core.content.ContextCompat
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||
@@ -20,9 +21,8 @@ class ChaptersAdapter(
|
||||
|
||||
var items: List<ChapterItem> = emptyList()
|
||||
|
||||
val readColor = context.getResourceColor(android.R.attr.textColorHint)
|
||||
|
||||
val unreadColor = context.getResourceColor(android.R.attr.textColorPrimary)
|
||||
val readColor = ContextCompat.getColor(context, R.color.material_on_surface_disabled)
|
||||
val unreadColor = context.getResourceColor(R.attr.colorOnSurface)
|
||||
|
||||
val bookmarkedColor = context.getResourceColor(R.attr.colorAccent)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package eu.kanade.tachiyomi.ui.recent.updates
|
||||
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.download.model.Download
|
||||
@@ -25,15 +26,8 @@ import kotlinx.android.synthetic.main.updates_item.manga_title
|
||||
class UpdatesHolder(private val view: View, private val adapter: UpdatesAdapter) :
|
||||
BaseFlexibleViewHolder(view, adapter) {
|
||||
|
||||
/**
|
||||
* Color of read chapter
|
||||
*/
|
||||
private var readColor = view.context.getResourceColor(android.R.attr.textColorHint)
|
||||
|
||||
/**
|
||||
* Color of unread chapter
|
||||
*/
|
||||
private var unreadColor = view.context.getResourceColor(android.R.attr.textColorPrimary)
|
||||
private var readColor = ContextCompat.getColor(view.context, R.color.material_on_surface_disabled)
|
||||
private var unreadColor = view.context.getResourceColor(R.attr.colorOnSurface)
|
||||
|
||||
/**
|
||||
* Currently bound item.
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package eu.kanade.tachiyomi.ui.source.browse
|
||||
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.bumptech.glide.load.engine.DiskCacheStrategy
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.database.models.Manga
|
||||
import eu.kanade.tachiyomi.data.glide.GlideApp
|
||||
import eu.kanade.tachiyomi.util.system.getResourceColor
|
||||
@@ -20,8 +22,8 @@ import kotlinx.android.synthetic.main.source_list_item.title
|
||||
class SourceListHolder(private val view: View, adapter: FlexibleAdapter<*>) :
|
||||
SourceHolder(view, adapter) {
|
||||
|
||||
private val favoriteColor = view.context.getResourceColor(android.R.attr.textColorHint)
|
||||
private val unfavoriteColor = view.context.getResourceColor(android.R.attr.textColorPrimary)
|
||||
private val favoriteColor = ContextCompat.getColor(view.context, R.color.material_on_surface_disabled)
|
||||
private val unfavoriteColor = view.context.getResourceColor(R.attr.colorOnSurface)
|
||||
|
||||
/**
|
||||
* Method called from [CatalogueAdapter.onBindViewHolder]. It updates the data for this
|
||||
|
||||
@@ -2,6 +2,7 @@ package eu.kanade.tachiyomi.ui.source.filter
|
||||
|
||||
import android.view.View
|
||||
import android.widget.CheckedTextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat
|
||||
import com.google.android.material.R
|
||||
@@ -39,11 +40,11 @@ open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem<TriS
|
||||
else -> throw Exception("Unknown state")
|
||||
}, null)?.apply {
|
||||
val color = if (filter.state == Filter.TriState.STATE_INCLUDE)
|
||||
R.attr.colorAccent
|
||||
view.context.getResourceColor(R.attr.colorAccent)
|
||||
else
|
||||
android.R.attr.textColorSecondary
|
||||
ContextCompat.getColor(view.context, R.color.material_on_background_disabled)
|
||||
|
||||
setTint(view.context.getResourceColor(color))
|
||||
setTint(color)
|
||||
}
|
||||
|
||||
view.setCompoundDrawablesWithIntrinsicBounds(getIcon(), null, null, null)
|
||||
|
||||
Reference in New Issue
Block a user