Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Implement ViewModelProvider.Factory (#602)
Browse files Browse the repository at this point in the history
Co-authored-by: Lady Nicole <[email protected]>
  • Loading branch information
tatsuyafujisaki and nic0lette authored May 11, 2020
1 parent ffb65e1 commit 9a345fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.google.samples.apps.sunflower.data.GardenPlantingRepository
*/
class GardenPlantingListViewModelFactory(
private val repository: GardenPlantingRepository
) : ViewModelProvider.NewInstanceFactory() {
) : ViewModelProvider.Factory {

@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel> create(modelClass: Class<T>): T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class PlantDetailViewModelFactory(
private val plantRepository: PlantRepository,
private val gardenPlantingRepository: GardenPlantingRepository,
private val plantId: String
) : ViewModelProvider.NewInstanceFactory() {
) : ViewModelProvider.Factory {

@Suppress("UNCHECKED_CAST")
override fun <T : ViewModel> create(modelClass: Class<T>): T {
Expand Down

0 comments on commit 9a345fe

Please sign in to comment.