Compare commits
1 Commits
7ba58cadd3
...
ba4e3a9e94
| Author | SHA1 | Date | |
|---|---|---|---|
| ba4e3a9e94 |
@@ -303,13 +303,17 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
fun updateContent(current: LunaEvent) {
|
fun updateContent(current: LunaEvent) {
|
||||||
val prevEvent = getPreviousSameEvent(current, allEvents)
|
val prevEvent = getPreviousSameEvent(current, allEvents)
|
||||||
val nextEvent = getNextSameEvent(current, allEvents)
|
var nextEvent = getNextSameEvent(current, allEvents)
|
||||||
|
|
||||||
notesET.setText(current.notes)
|
notesET.setText(current.notes)
|
||||||
if (useQuantity) {
|
if (useQuantity) {
|
||||||
qtyET.setText(current.quantity.toString())
|
qtyET.setText(current.quantity.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nextEvent == null && current != lunaEvent) {
|
||||||
|
nextEvent = lunaEvent
|
||||||
|
}
|
||||||
|
|
||||||
if (nextEvent != null) {
|
if (nextEvent != null) {
|
||||||
nextTextView.setOnClickListener {
|
nextTextView.setOnClickListener {
|
||||||
notesET.setText(nextEvent.notes)
|
notesET.setText(nextEvent.notes)
|
||||||
@@ -322,12 +326,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
} else {
|
} else {
|
||||||
nextTextView.setOnClickListener {}
|
nextTextView.setOnClickListener {}
|
||||||
nextTextView.alpha = 0.5f
|
nextTextView.alpha = 0.5f
|
||||||
|
|
||||||
// clear fields
|
|
||||||
notesET.setText("")
|
|
||||||
if (useQuantity) {
|
|
||||||
qtyET.setText("")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prevEvent != null) {
|
if (prevEvent != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user