Last active
June 26, 2018 08:17
-
-
Save annchar/25ebcdf19f74ee7893f08a5587d3634e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
super.onViewCreated(view, savedInstanceState) | |
// factory คือ การสร้าง model โดยมีการโยนค่าอื่นๆเข้าไป | |
val factory = InjectorUtils.provideTeamViewModelFactory(context!!, teamId, teamName) | |
teamDetailViewModel = ViewModelProviders.of(this, factory).get(TeamDetailViewModel::class.java) | |
viewDataBinding.viewModel = teamDetailViewModel | |
teamDetailViewModel.adapter.value = PlayerListAdapter() | |
val linearLayoutManager = LinearLayoutManager(this.context, LinearLayoutManager.VERTICAL, false) | |
teamDetailViewModel.layoutManager.value = linearLayoutManager | |
teamDetailViewModel.loadPlayerList() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment