Remove some uses of color resources

(cherry picked from commit ee26d6dffd8c77115683ea242c3ab729c70f7ea6)

# Conflicts:
#	app/src/main/res/drawable/ic_tachi.xml
#	presentation-core/src/main/res/values/colors.xml
This commit is contained in:
arkon
2023-07-22 18:56:45 -04:00
committed by Jobobby04
parent f0777ac2f7
commit ccf4b90bff
49 changed files with 81 additions and 111 deletions
@@ -1460,18 +1460,20 @@ class ReaderActivity : BaseActivity() {
}
}
private val grayBackgroundColor = Color.rgb(0x20, 0x21, 0x25)
/**
* Initializes the reader subscriptions.
*/
init {
readerPreferences.readerTheme().changes()
.onEach { theme ->
binding.readerContainer.setBackgroundResource(
binding.readerContainer.setBackgroundColor(
when (theme) {
0 -> R.color.md_white_1000
2 -> R.color.reader_background_dark
0 -> Color.WHITE
2 -> grayBackgroundColor
3 -> automaticBackgroundColor()
else -> R.color.md_black_1000
else -> Color.BLACK
},
)
}
@@ -1547,9 +1549,9 @@ class ReaderActivity : BaseActivity() {
*/
private fun automaticBackgroundColor(): Int {
return if (baseContext.isNightMode()) {
R.color.reader_background_dark
grayBackgroundColor
} else {
R.color.md_white_1000
Color.WHITE
}
}
@@ -66,7 +66,7 @@ class ReaderNavigationOverlayView(context: Context, attributeSet: AttributeSet)
// Scale rect from 1f,1f to screen width and height
canvas.withScale(width.toFloat(), height.toFloat()) {
regionPaint.color = context.getColor(region.type.colorRes)
regionPaint.color = region.type.color
drawRect(rect, regionPaint)
}
@@ -1,5 +1,6 @@
package eu.kanade.tachiyomi.ui.reader.viewer
import android.graphics.Color
import android.graphics.PointF
import android.graphics.RectF
import androidx.annotation.StringRes
@@ -9,12 +10,12 @@ import eu.kanade.tachiyomi.util.lang.invert
abstract class ViewerNavigation {
sealed class NavigationRegion(@StringRes val nameRes: Int, val colorRes: Int) {
data object MENU : NavigationRegion(R.string.action_menu, R.color.navigation_menu)
data object PREV : NavigationRegion(R.string.nav_zone_prev, R.color.navigation_prev)
data object NEXT : NavigationRegion(R.string.nav_zone_next, R.color.navigation_next)
data object LEFT : NavigationRegion(R.string.nav_zone_left, R.color.navigation_left)
data object RIGHT : NavigationRegion(R.string.nav_zone_right, R.color.navigation_right)
sealed class NavigationRegion(@StringRes val nameRes: Int, val color: Int) {
data object MENU : NavigationRegion(R.string.action_menu, Color.argb(0xCC, 0x95, 0x81, 0x8D))
data object PREV : NavigationRegion(R.string.nav_zone_prev, Color.argb(0xCC, 0xFF, 0x77, 0x33))
data object NEXT : NavigationRegion(R.string.nav_zone_next, Color.argb(0xCC, 0x84, 0xE2, 0x96))
data object LEFT : NavigationRegion(R.string.nav_zone_left, Color.argb(0xCC, 0x7D, 0x11, 0x28))
data object RIGHT : NavigationRegion(R.string.nav_zone_right, Color.argb(0xCC, 0xA6, 0xCF, 0xD5))
}
data class Region(