Minor fix

This commit is contained in:
tom5079
2020-11-29 15:23:16 +09:00
parent 3feae80359
commit 26c5e07f04
4 changed files with 13 additions and 11 deletions

View File

@@ -144,6 +144,7 @@ class SearchResultsAdapter(private val results: List<SearchResult>) : RecyclerSw
binding.thumbnail.controller = Fresco.newDraweeControllerBuilder()
.setUri(result.thumbnail)
.setOldController(binding.thumbnail.controller)
.setControllerListener(controllerListener)
.build()

View File

@@ -22,6 +22,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.launch
import xyz.quaver.hitomi.galleryblockdir
import xyz.quaver.hiyobi.*
import xyz.quaver.pupil.R
import xyz.quaver.pupil.sources.DefaultSortMode
@@ -41,7 +42,7 @@ class Hiyobi : Source<DefaultSortMode> {
val (results, total) = if (query.isEmpty())
list(range)
else
search(query, range)
search(query.trim(), range)
CoroutineScope(Dispatchers.Unconfined).launch {
results.forEach {
@@ -65,7 +66,8 @@ class Hiyobi : Source<DefaultSortMode> {
SearchResult.ExtraType.CHARACTER to { galleryBlock.characters.joinToString { it.value.wordCapitalize() } },
SearchResult.ExtraType.SERIES to { galleryBlock.parodys.joinToString { it.value.wordCapitalize() } },
SearchResult.ExtraType.TYPE to { galleryBlock.type.name.replace('_', ' ').wordCapitalize() },
SearchResult.ExtraType.PAGECOUNT to { getGalleryInfo(galleryBlock.id).files.size.toString() }
SearchResult.ExtraType.PAGECOUNT to { getGalleryInfo(galleryBlock.id).files.size.toString() },
SearchResult.ExtraType.GROUP to { galleryBlock.groups.joinToString { it.value.wordCapitalize() } }
),
galleryBlock.tags.map { it.value }
)

View File

@@ -98,8 +98,6 @@ class MainActivity :
binding = MainActivityBinding.inflate(layoutInflater)
setContentView(binding.root)
setSource(sources.values.first())
if (intent.action == Intent.ACTION_VIEW) {
intent.dataString?.let { url ->
restore(url,
@@ -340,6 +338,7 @@ class MainActivity :
setupSearchBar()
setupRecyclerView()
setSource(sources.values.first())
query()
}