Skip to content

Commit

Permalink
update sample to viewlifecycleowner
Browse files Browse the repository at this point in the history
  • Loading branch information
psato-ciandt committed Mar 15, 2019
1 parent 7572c81 commit 0ea5c91
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -34,10 +34,12 @@ class QueryFragment : BaseFragment() {

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
bind(queryViewModelArc.searchEnabled, searchButton::setEnabled)
bind(queryViewModelArc.showLoading){ loadinLayout.present = it}
viewLifecycleOwner.apply {
bind(queryViewModelArc.searchEnabled, searchButton::setEnabled)
bind(queryViewModelArc.showLoading){ loadinLayout.present = it}
twoWayBind(queryViewModelArc.queryValue, queryEditText.bindableText)
}
searchButton.onClick(queryViewModelArc::onQueryClick)
twoWayBind(queryViewModelArc.queryValue, queryEditText.bindableText)
adapter = QuerryAdapter(queryViewModelArc)
showResponse.layoutManager = LinearLayoutManager(activity)
showResponse.adapter = adapter
Expand Down

0 comments on commit 0ea5c91

Please sign in to comment.