Compare commits
1 Commits
f37089d96a
...
2c48e3614c
| Author | SHA1 | Date | |
|---|---|---|---|
| 2c48e3614c |
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user