Now totally fix migration list issues

This commit is contained in:
Jobobby04 2020-05-28 23:22:59 -04:00
parent 473bb69f70
commit bfdd39d4aa

View File

@ -80,7 +80,7 @@ class MigrationListController(bundle: Bundle? = null) :
private set private set
private var migratingManga: MutableList<MigratingManga>? = null private var migratingManga: MutableList<MigratingManga>? = null
private var selectedPosition: Int? = null private var selectedPosition: Int? = null
private var manaulMigrations = 0 private var manualMigrations = 0
override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View { override fun inflateView(inflater: LayoutInflater, container: ViewGroup): View {
binding = MigrationListControllerBinding.inflate(inflater) binding = MigrationListControllerBinding.inflate(inflater)
@ -326,7 +326,7 @@ class MigrationListController(bundle: Bundle? = null) :
if (res != null) { if (res != null) {
activity?.toast( activity?.toast(
res.getQuantityString( res.getQuantityString(
R.plurals.manga_migrated, manaulMigrations, manaulMigrations R.plurals.manga_migrated, manualMigrations, manualMigrations
) )
) )
} }
@ -357,11 +357,11 @@ class MigrationListController(bundle: Bundle? = null) :
R.id.action_skip -> adapter?.removeManga(position) R.id.action_skip -> adapter?.removeManga(position)
R.id.action_migrate_now -> { R.id.action_migrate_now -> {
adapter?.migrateManga(position, false) adapter?.migrateManga(position, false)
manaulMigrations++ manualMigrations++
} }
R.id.action_copy_now -> { R.id.action_copy_now -> {
adapter?.migrateManga(position, true) adapter?.migrateManga(position, true)
manaulMigrations++ manualMigrations++
} }
} }
} }
@ -486,7 +486,7 @@ class MigrationListController(bundle: Bundle? = null) :
menuCopy.icon.mutate() menuCopy.icon.mutate()
menuMigrate.icon.mutate() menuMigrate.icon.mutate()
val tintColor = activity?.getResourceColor(R.attr.colorPrimary) ?: Color.WHITE val tintColor = activity?.getResourceColor(R.attr.colorOnPrimary) ?: Color.WHITE
val translucentWhite = ColorUtils.setAlphaComponent(tintColor, 127) val translucentWhite = ColorUtils.setAlphaComponent(tintColor, 127)
menuCopy.icon?.setTint(if (allMangasDone) tintColor else translucentWhite) menuCopy.icon?.setTint(if (allMangasDone) tintColor else translucentWhite)
menuMigrate?.icon?.setTint(if (allMangasDone) tintColor else translucentWhite) menuMigrate?.icon?.setTint(if (allMangasDone) tintColor else translucentWhite)