Skip to content

Commit 96135dd

Browse files
author
Jill Heske
committed
Step.06-Exercise-Use-the-Repository
1 parent df63328 commit 96135dd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/main/java/com/example/android/devbyteviewer/viewmodels/DevByteViewModel.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@ class DevByteViewModel(application: Application) : AndroidViewModel(application)
5555
*/
5656
private val viewModelScope = CoroutineScope(viewModelJob + Dispatchers.Main)
5757

58+
// TODO (01) Remove _playlist, playlist variables, the init block, and refreshDataFromNetwork() function.
59+
60+
// TODO (02) Create a database variable and assign it to getDatabase(), passing the application.
61+
62+
// TODO (03) Define a videosRepository by calling the constructor and passing in the database.
63+
64+
// TODO (04) Create an init block and launch a coroutine to call videosRepository.refreshVideos().
65+
66+
// TODO (05) Get videos from the repository and assign it to a playlist variable.
67+
5868
/**
5969
* A playlist of videos that can be shown on the screen. This is private to avoid exposing a
6070
* way to set this value to observers.

0 commit comments

Comments
 (0)