Compare commits
1 Commits
ba4e3a9e94
...
7ba58cadd3
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ba58cadd3 |
@@ -303,17 +303,13 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
fun updateContent(current: LunaEvent) {
|
fun updateContent(current: LunaEvent) {
|
||||||
val prevEvent = getPreviousSameEvent(current, allEvents)
|
val prevEvent = getPreviousSameEvent(current, allEvents)
|
||||||
var nextEvent = getNextSameEvent(current, allEvents)
|
val 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)
|
||||||
@@ -326,6 +322,12 @@ 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