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(
selectedValue: Int,
notes: String,
color: PaletteColor,
callback: ListHabitsBehavior.CheckMarkDialogCallback,
habit: Habit?
) {
@ -295,7 +294,7 @@ class ListHabitsScreen
val fm = (context as AppCompatActivity).supportFragmentManager
val dialog = CheckmarkDialog()
dialog.arguments = Bundle().apply {
putInt("color", theme.color(color).toInt())
habit?.color?.let { putInt("color", theme.color(it).toInt()) }
putInt("value", selectedValue)
putString("notes", notes)
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.CommandRunner
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.ui.callbacks.OnConfirmedCallback
import org.isoron.uhabits.core.ui.screens.habits.list.ListHabitsBehavior
@ -190,14 +189,13 @@ class ShowHabitActivity : AppCompatActivity(), CommandRunner.Listener {
override fun showCheckmarkPopup(
selectedValue: Int,
notes: String,
color: PaletteColor,
callback: ListHabitsBehavior.CheckMarkDialogCallback,
habit: Habit?
) {
val theme = view.currentTheme()
val dialog = CheckmarkDialog()
dialog.arguments = Bundle().apply {
putInt("color", theme.color(color).toInt())
habit?.color?.let { putInt("color", theme.color(it).toInt()) }
putInt("value", selectedValue)
putString("notes", notes)
putLong("habitId", habit?.id ?: -1)

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

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

Loading…
Cancel
Save