1 Commits

Author SHA1 Message Date
2c48e3614c notes: add icons to use previous/next event as template 2025-11-07 21:19:38 +01:00

View File

@@ -302,7 +302,7 @@ class MainActivity : AppCompatActivity() {
val clearTextView = dialogView.findViewById<TextView>(R.id.notes_clear)
val prevTextView = dialogView.findViewById<TextView>(R.id.notes_template_prev)
fun update(current: LunaEvent) {
fun updateContent(current: LunaEvent) {
val prevEvent = getPreviousSameEvent(current, allEvents)
val nextEvent = getNextSameEvent(current, allEvents)
@@ -318,7 +318,7 @@ class MainActivity : AppCompatActivity() {
if (useQuantity) {
qtyET.setText(nextEvent.quantity.toString())
}
update(nextEvent)
updateContent(nextEvent)
}
} else {
nextTextView.visibility = View.GONE
@@ -331,26 +331,27 @@ class MainActivity : AppCompatActivity() {
if (useQuantity) {
qtyET.setText(prevEvent.quantity.toString())
}
update(prevEvent)
updateContent(prevEvent)
}
} else {
nextTextView.visibility = View.GONE
}
}
update(lunaEvent)
clearTextView.setOnClickListener {
notesET.setText("")
if (useQuantity) {
qtyET.setText("")
}
updateContent(lunaEvent)
}
if (!useQuantity) {
qtyET.visibility = View.GONE
}
updateContent(lunaEvent)
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
val qtyStr = qtyET.text.toString()
if (qtyStr.isNotEmpty() && useQuantity) {