Compare commits
1 Commits
2c48e3614c
...
f37089d96a
| Author | SHA1 | Date | |
|---|---|---|---|
| f37089d96a |
@@ -302,7 +302,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
val clearTextView = dialogView.findViewById<TextView>(R.id.notes_clear)
|
val clearTextView = dialogView.findViewById<TextView>(R.id.notes_clear)
|
||||||
val prevTextView = dialogView.findViewById<TextView>(R.id.notes_template_prev)
|
val prevTextView = dialogView.findViewById<TextView>(R.id.notes_template_prev)
|
||||||
|
|
||||||
fun updateContent(current: LunaEvent) {
|
fun update(current: LunaEvent) {
|
||||||
val prevEvent = getPreviousSameEvent(current, allEvents)
|
val prevEvent = getPreviousSameEvent(current, allEvents)
|
||||||
val nextEvent = getNextSameEvent(current, allEvents)
|
val nextEvent = getNextSameEvent(current, allEvents)
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
if (useQuantity) {
|
if (useQuantity) {
|
||||||
qtyET.setText(nextEvent.quantity.toString())
|
qtyET.setText(nextEvent.quantity.toString())
|
||||||
}
|
}
|
||||||
updateContent(nextEvent)
|
update(nextEvent)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nextTextView.visibility = View.GONE
|
nextTextView.visibility = View.GONE
|
||||||
@@ -331,27 +331,26 @@ class MainActivity : AppCompatActivity() {
|
|||||||
if (useQuantity) {
|
if (useQuantity) {
|
||||||
qtyET.setText(prevEvent.quantity.toString())
|
qtyET.setText(prevEvent.quantity.toString())
|
||||||
}
|
}
|
||||||
updateContent(prevEvent)
|
update(prevEvent)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
nextTextView.visibility = View.GONE
|
nextTextView.visibility = View.GONE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
update(lunaEvent)
|
||||||
|
|
||||||
clearTextView.setOnClickListener {
|
clearTextView.setOnClickListener {
|
||||||
notesET.setText("")
|
notesET.setText("")
|
||||||
if (useQuantity) {
|
if (useQuantity) {
|
||||||
qtyET.setText("")
|
qtyET.setText("")
|
||||||
}
|
}
|
||||||
updateContent(lunaEvent)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!useQuantity) {
|
if (!useQuantity) {
|
||||||
qtyET.visibility = View.GONE
|
qtyET.visibility = View.GONE
|
||||||
}
|
}
|
||||||
|
|
||||||
updateContent(lunaEvent)
|
|
||||||
|
|
||||||
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
||||||
val qtyStr = qtyET.text.toString()
|
val qtyStr = qtyET.text.toString()
|
||||||
if (qtyStr.isNotEmpty() && useQuantity) {
|
if (qtyStr.isNotEmpty() && useQuantity) {
|
||||||
|
|||||||
Reference in New Issue
Block a user