|
|
@ -141,6 +141,14 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se |
|
|
|
recycler_view.layoutManager = LinearLayoutManager(this) |
|
|
|
recycler_view.layoutManager = LinearLayoutManager(this) |
|
|
|
recycler_view.adapter = adapter |
|
|
|
recycler_view.adapter = adapter |
|
|
|
loadMoreView = LoadMoreView(this) |
|
|
|
loadMoreView = LoadMoreView(this) |
|
|
|
|
|
|
|
recycler_view.addOnScrollListener(object : RecyclerView.OnScrollListener() { |
|
|
|
|
|
|
|
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) { |
|
|
|
|
|
|
|
super.onScrolled(recyclerView, dx, dy) |
|
|
|
|
|
|
|
if (!recyclerView.canScrollVertically(1)) { |
|
|
|
|
|
|
|
scrollToBottom() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun initOtherView() { |
|
|
|
private fun initOtherView() { |
|
|
@ -169,6 +177,12 @@ class SearchActivity : VMBaseActivity<SearchViewModel>(R.layout.activity_book_se |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun scrollToBottom() { |
|
|
|
|
|
|
|
if (!viewModel.isLoading) { |
|
|
|
|
|
|
|
viewModel.search("") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun upGroupMenu() { |
|
|
|
private fun upGroupMenu() { |
|
|
|
val selectedGroup = getPrefString("searchGroup") ?: "" |
|
|
|
val selectedGroup = getPrefString("searchGroup") ?: "" |
|
|
|
menu?.removeGroup(R.id.source_group) |
|
|
|
menu?.removeGroup(R.id.source_group) |
|
|
|