Fix *chan search
This commit is contained in:
@@ -23,7 +23,12 @@ abstract class ChanRepository(loaderContext: MangaLoaderContext) : RemoteMangaRe
|
||||
): List<Manga> {
|
||||
val domain = conf.getDomain(defaultDomain)
|
||||
val url = when {
|
||||
query != null -> "https://$domain/?do=search&subaction=search&story=${query.urlEncoded()}"
|
||||
query != null -> {
|
||||
if (offset != 0) {
|
||||
return emptyList()
|
||||
}
|
||||
"https://$domain/?do=search&subaction=search&story=${query.urlEncoded()}"
|
||||
}
|
||||
tag != null -> "https://$domain/tags/${tag.key}&n=${getSortKey2(sortOrder)}?offset=$offset"
|
||||
else -> "https://$domain/${getSortKey(sortOrder)}?offset=$offset"
|
||||
}
|
||||
|
||||
@@ -126,6 +126,7 @@ abstract class MangaListFragment<E> : BaseFragment(R.layout.fragment_list),
|
||||
}
|
||||
|
||||
final override fun onRefresh() {
|
||||
swipeRefreshLayout.isRefreshing = true
|
||||
onRequestMoreItems(0)
|
||||
}
|
||||
|
||||
@@ -188,10 +189,11 @@ abstract class MangaListFragment<E> : BaseFragment(R.layout.fragment_list),
|
||||
override fun onLoadingStateChanged(isLoading: Boolean) {
|
||||
val hasItems = recyclerView.hasItems
|
||||
progressBar.isVisible = isLoading && !hasItems
|
||||
swipeRefreshLayout.isRefreshing = isLoading && hasItems
|
||||
swipeRefreshLayout.isEnabled = isSwipeRefreshEnabled && !progressBar.isVisible
|
||||
if (isLoading) {
|
||||
layout_holder.isVisible = false
|
||||
} else {
|
||||
swipeRefreshLayout.isRefreshing = false
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user