Commit fc0ebff2 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Set to hide the searchView progress wheel on the proper place

parent ad7837e6
...@@ -34,19 +34,17 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView { ...@@ -34,19 +34,17 @@ class ChatRoomsFragment : Fragment(), ChatRoomsView {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
presenter.chatRooms() presenter.chatRooms()
floating_search_view.setOnQueryChangeListener { oldQuery, newQuery -> floating_search_view.setOnQueryChangeListener { oldQuery, newQuery ->
floating_search_view.showProgress()
presenter.chatRoomsByName(newQuery) presenter.chatRoomsByName(newQuery)
if (oldQuery.isNotEmpty() && newQuery.isEmpty()) { if (oldQuery.isNotEmpty() && newQuery.isEmpty()) {
floating_search_view.clearSuggestions() floating_search_view.clearSuggestions()
floating_search_view.hideProgress() floating_search_view.hideProgress()
} else {
floating_search_view.showProgress()
presenter.chatRoomsByName(newQuery)
floating_search_view.hideProgress()
} }
} }
} }
override fun showChatRooms(dataSet: MutableList<ChatRoom>) { override fun showChatRooms(dataSet: MutableList<ChatRoom>) {
floating_search_view.hideProgress()
activity?.apply { activity?.apply {
recycler_view.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false) recycler_view.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)
recycler_view.addItemDecoration(DividerItemDecoration(this, 144, 32)) recycler_view.addItemDecoration(DividerItemDecoration(this, 144, 32))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment