Cleanup
This commit is contained in:
parent
9ddadae078
commit
325ac2b43e
@ -462,14 +462,20 @@ class MigrationListController(bundle: Bundle? = null) :
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
menuCopy.icon.mutate()
|
|
||||||
menuMigrate.icon.mutate()
|
|
||||||
val tintColor = activity?.getResourceColor(R.attr.colorOnToolbar) ?: Color.WHITE
|
val tintColor = activity?.getResourceColor(R.attr.colorOnToolbar) ?: Color.WHITE
|
||||||
val translucentWhite = ColorUtils.setAlphaComponent(tintColor, 127)
|
val color = if (allMangasDone) {
|
||||||
menuCopy.icon?.setTint(if (allMangasDone) tintColor else translucentWhite)
|
tintColor
|
||||||
menuMigrate?.icon?.setTint(if (allMangasDone) tintColor else translucentWhite)
|
} else {
|
||||||
menuCopy.isEnabled = allMangasDone
|
ColorUtils.setAlphaComponent(tintColor, 127)
|
||||||
menuMigrate.isEnabled = allMangasDone
|
}
|
||||||
|
menuCopy.setIconTint(allMangasDone, color)
|
||||||
|
menuMigrate.setIconTint(allMangasDone, color)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun MenuItem.setIconTint(enabled: Boolean, color: Int) {
|
||||||
|
icon.mutate()
|
||||||
|
icon.setTint(color)
|
||||||
|
isEnabled = enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user