mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
fixing some comments from @hiqua
This commit is contained in:
@@ -117,11 +117,11 @@ class NumberDialog : AppCompatDialogFragment() {
|
|||||||
val notes = view.notes.text.toString()
|
val notes = view.notes.text.toString()
|
||||||
onToggle(value, notes)
|
onToggle(value, notes)
|
||||||
requireDialog().dismiss()
|
requireDialog().dismiss()
|
||||||
val v = requireActivity().findViewById<LinearLayout>(R.id.konfettiLayout)
|
val konfettiView = requireActivity().findViewById<LinearLayout>(R.id.konfettiLayout)
|
||||||
|
|
||||||
if (value > 0.0) {
|
if (value > 0.0) {
|
||||||
showConfetti(v)
|
//To motivate, show confetti even if some value is present
|
||||||
|
showConfetti(konfettiView)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ class CheckmarkButtonView(
|
|||||||
setOnLongClickListener(this)
|
setOnLongClickListener(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun performToggle(v: View) {
|
fun performToggle(view: View) {
|
||||||
value = Entry.nextToggleValue(
|
value = Entry.nextToggleValue(
|
||||||
value = value,
|
value = value,
|
||||||
isSkipEnabled = preferences.isSkipEnabled,
|
isSkipEnabled = preferences.isSkipEnabled,
|
||||||
@@ -98,7 +98,7 @@ class CheckmarkButtonView(
|
|||||||
onToggle(value, notes)
|
onToggle(value, notes)
|
||||||
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
|
performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
|
||||||
when (value) {
|
when (value) {
|
||||||
YES_MANUAL -> showConfetti(v.rootView)
|
YES_MANUAL -> showConfetti(view.rootView)
|
||||||
}
|
}
|
||||||
invalidate()
|
invalidate()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user