|
|
|
@ -33,6 +33,7 @@ class BookSourceFragment : BaseFragment(R.layout.fragment_book_source), BookSour |
|
|
|
|
setSupportToolbar(toolbar) |
|
|
|
|
initRecyclerView() |
|
|
|
|
initDataObservers() |
|
|
|
|
initSearchView() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
override fun onCompatCreateOptionsMenu(menu: Menu) { |
|
|
|
@ -59,6 +60,13 @@ class BookSourceFragment : BaseFragment(R.layout.fragment_book_source), BookSour |
|
|
|
|
ItemTouchHelper(itemTouchCallback).attachToRecyclerView(recycler_view) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun initSearchView() { |
|
|
|
|
search_view.visibility = View.VISIBLE |
|
|
|
|
search_view.onActionViewExpanded() |
|
|
|
|
search_view.queryHint = getString(R.string.search_book_source) |
|
|
|
|
search_view.clearFocus() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private fun initDataObservers() { |
|
|
|
|
bookSourceLiveDate?.removeObservers(viewLifecycleOwner) |
|
|
|
|
bookSourceLiveDate = LivePagedListBuilder(App.db.bookSourceDao().observeAll(), 30).build() |
|
|
|
|