#13 and #17 form for creating, editing and deleting tasks

This commit is contained in:
brreynie 2023-05-03 23:18:53 +02:00
parent 6a676c2fad
commit 6765229d37
14 changed files with 249 additions and 30 deletions

View file

@ -5,7 +5,7 @@ import javax.inject.Inject
import javax.inject.Singleton
/**
* Used to communicate the selected subject from the subject overview to the task overview of that subject.
* Used to communicate the selected subject from the subject overview other screens.
* Because this is a singleton-class the view-models of both screens observe the same data.
*/
@Singleton
@ -15,4 +15,6 @@ class SelectedSubject @Inject constructor() {
fun set(subject: Subject) {
this.subject = subject
}
fun isSet() = this::subject.isInitialized
}

View file

@ -0,0 +1,21 @@
package be.ugent.sel.studeez.data
import be.ugent.sel.studeez.data.local.models.task.Task
import javax.inject.Inject
import javax.inject.Singleton
/**
* Used to communicate the selected task from the task overview other screens.
* Because this is a singleton-class the view-models of both screens observe the same data.
*/
@Singleton
class SelectedTask @Inject constructor() {
private lateinit var task: Task
operator fun invoke() = task
fun set(task: Task) {
this.task = task
}
fun isSet() = this::task.isInitialized
}