don't pass extra habit.color

pull/2195/head
zenador 2 months ago
parent 72a36c6d81
commit a69d528d54

@ -287,7 +287,6 @@ class ListHabitsScreen
override fun showCheckmarkPopup( override fun showCheckmarkPopup(
selectedValue: Int, selectedValue: Int,
notes: String, notes: String,
color: PaletteColor,
callback: ListHabitsBehavior.CheckMarkDialogCallback, callback: ListHabitsBehavior.CheckMarkDialogCallback,
habit: Habit? habit: Habit?
) { ) {
@ -295,7 +294,7 @@ class ListHabitsScreen
val fm = (context as AppCompatActivity).supportFragmentManager val fm = (context as AppCompatActivity).supportFragmentManager
val dialog = CheckmarkDialog() val dialog = CheckmarkDialog()
dialog.arguments = Bundle().apply { dialog.arguments = Bundle().apply {
putInt("color", theme.color(color).toInt()) habit?.color?.let { putInt("color", theme.color(it).toInt()) }
putInt("value", selectedValue) putInt("value", selectedValue)
putString("notes", notes) putString("notes", notes)
habit?.id?.let { putLong("habitId", it) } habit?.id?.let { putLong("habitId", it) }

@ -41,7 +41,6 @@ import org.isoron.uhabits.activities.common.dialogs.NumberDialog
import org.isoron.uhabits.core.commands.Command import org.isoron.uhabits.core.commands.Command
import org.isoron.uhabits.core.commands.CommandRunner import org.isoron.uhabits.core.commands.CommandRunner
import org.isoron.uhabits.core.models.Habit import org.isoron.uhabits.core.models.Habit
import org.isoron.uhabits.core.models.PaletteColor
import org.isoron.uhabits.core.preferences.Preferences import org.isoron.uhabits.core.preferences.Preferences
import org.isoron.uhabits.core.ui.callbacks.OnConfirmedCallback import org.isoron.uhabits.core.ui.callbacks.OnConfirmedCallback
import org.isoron.uhabits.core.ui.screens.habits.list.ListHabitsBehavior import org.isoron.uhabits.core.ui.screens.habits.list.ListHabitsBehavior
@ -190,14 +189,13 @@ class ShowHabitActivity : AppCompatActivity(), CommandRunner.Listener {
override fun showCheckmarkPopup( override fun showCheckmarkPopup(
selectedValue: Int, selectedValue: Int,
notes: String, notes: String,
color: PaletteColor,
callback: ListHabitsBehavior.CheckMarkDialogCallback, callback: ListHabitsBehavior.CheckMarkDialogCallback,
habit: Habit? habit: Habit?
) { ) {
val theme = view.currentTheme() val theme = view.currentTheme()
val dialog = CheckmarkDialog() val dialog = CheckmarkDialog()
dialog.arguments = Bundle().apply { dialog.arguments = Bundle().apply {
putInt("color", theme.color(color).toInt()) habit?.color?.let { putInt("color", theme.color(it).toInt()) }
putInt("value", selectedValue) putInt("value", selectedValue)
putString("notes", notes) putString("notes", notes)
putLong("habitId", habit?.id ?: -1) putLong("habitId", habit?.id ?: -1)

@ -71,7 +71,6 @@ open class ListHabitsBehavior @Inject constructor(
screen.showCheckmarkPopup( screen.showCheckmarkPopup(
entry.value, entry.value,
entry.notes, entry.notes,
habit.color,
{ newValue: Int, newNotes: String -> { newValue: Int, newNotes: String ->
if (newValue != entry.value && newValue == YES_MANUAL) screen.showConfetti(habit.color, x, y) if (newValue != entry.value && newValue == YES_MANUAL) screen.showConfetti(habit.color, x, y)
commandRunner.run(CreateRepetitionCommand(habitList, habit, timestamp, newValue, newNotes)) commandRunner.run(CreateRepetitionCommand(habitList, habit, timestamp, newValue, newNotes))
@ -187,7 +186,6 @@ open class ListHabitsBehavior @Inject constructor(
fun showCheckmarkPopup( fun showCheckmarkPopup(
selectedValue: Int, selectedValue: Int,
notes: String, notes: String,
color: PaletteColor,
callback: CheckMarkDialogCallback, callback: CheckMarkDialogCallback,
habit: Habit? = null habit: Habit? = null
) )

@ -97,7 +97,6 @@ class HistoryCardPresenter(
screen.showCheckmarkPopup( screen.showCheckmarkPopup(
entry.value, entry.value,
entry.notes, entry.notes,
habit.color,
{ newValue, newNotes -> { newValue, newNotes ->
commandRunner.run( commandRunner.run(
CreateRepetitionCommand( CreateRepetitionCommand(
@ -217,7 +216,6 @@ class HistoryCardPresenter(
fun showCheckmarkPopup( fun showCheckmarkPopup(
selectedValue: Int, selectedValue: Int,
notes: String, notes: String,
color: PaletteColor,
callback: ListHabitsBehavior.CheckMarkDialogCallback, callback: ListHabitsBehavior.CheckMarkDialogCallback,
habit: Habit? = null habit: Habit? = null
) )

Loading…
Cancel
Save