|
|
|
|
@ -36,6 +36,8 @@ import timber.log.Timber |
|
|
|
|
import java.util.* |
|
|
|
|
import java.util.Currency |
|
|
|
|
import kotlin.collections.ArrayList |
|
|
|
|
import kotlin.properties.Delegates |
|
|
|
|
import kotlin.reflect.KProperty |
|
|
|
|
|
|
|
|
|
open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepresentableDataSource, RowRepresentable, |
|
|
|
|
Timed { |
|
|
|
|
@ -110,6 +112,11 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
|
* The start date of the break |
|
|
|
|
*/ |
|
|
|
|
override var pauseDate: Date? = null |
|
|
|
|
set(value) { |
|
|
|
|
field = value |
|
|
|
|
this.updateRowRepresentation() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// The time frame of the Session, i.e. the start & end date |
|
|
|
|
// var timeFrame: TimeFrame? = null |
|
|
|
|
@ -186,6 +193,7 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
|
} else if (this.sessionSet != null) { |
|
|
|
|
SessionSetManager.removeFromTimeline(this) |
|
|
|
|
} |
|
|
|
|
this.updateRowRepresentation() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -469,7 +477,10 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
|
return "Session ${this.creationDate}" |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
|
@Ignore |
|
|
|
|
private var rowRepresentationForCurrentState : List<RowRepresentable> = this.updatedRowRepresentationForCurrentState() |
|
|
|
|
|
|
|
|
|
fun updatedRowRepresentationForCurrentState(): List<RowRepresentable> { |
|
|
|
|
val rows = ArrayList<RowRepresentable>() |
|
|
|
|
|
|
|
|
|
// Headers |
|
|
|
|
@ -534,6 +545,15 @@ open class Session : RealmObject(), SessionInterface, Manageable, StaticRowRepre |
|
|
|
|
return rows |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun updateRowRepresentation() { |
|
|
|
|
this.rowRepresentationForCurrentState = this.updatedRowRepresentationForCurrentState() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun adapterRows(): List<RowRepresentable>? { |
|
|
|
|
return this.rowRepresentationForCurrentState |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun boolForRow(row: RowRepresentable): Boolean { |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
|