#22 get tasks from firestore
This commit is contained in:
parent
e1c05bb0d4
commit
056947e1db
8 changed files with 44 additions and 23 deletions
|
@ -0,0 +1,18 @@
|
|||
package be.ugent.sel.studeez.data
|
||||
|
||||
import be.ugent.sel.studeez.data.local.models.task.Subject
|
||||
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.
|
||||
* Because this is a singleton-class the view-models of both screens observe the same data.
|
||||
*/
|
||||
@Singleton
|
||||
class SelectedSubject @Inject constructor() {
|
||||
private lateinit var subject: Subject
|
||||
operator fun invoke() = subject
|
||||
fun set(subject: Subject) {
|
||||
this.subject = subject
|
||||
}
|
||||
}
|
|
@ -5,7 +5,6 @@ import com.google.firebase.firestore.DocumentId
|
|||
data class Subject(
|
||||
@DocumentId val id: String = "",
|
||||
val name: String = "",
|
||||
val tasks: List<Task> = mutableListOf(),
|
||||
val time: Int = 0,
|
||||
val argb_color: Long = 0,
|
||||
)
|
Reference in a new issue