Last active
August 4, 2018 22:15
-
-
Save paulocns/76e7c2a3069f59de06205d302107c8e1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class QueryFragment : BaseFragment() { | |
| private var binding: FragmentQueryMvvmBinding? = null | |
| override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { | |
| val view = inflater.inflate(R.layout.fragment_query_mvvm, container, false) | |
| binding = DataBindingUtil.bind(view) | |
| return view | |
| } | |
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | |
| super.onViewCreated(view, savedInstanceState) | |
| val queryViewModelArc = ViewModelProviders.of(this, viewModelFactory).get(QueryViewModelArc::class.java) | |
| binding?.let{ | |
| it.viewModel = queryViewModelArc | |
| it.setLifecycleOwner(this) | |
| it.executePendingBindings() | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment