Update manga list header
This commit is contained in:
@@ -3,9 +3,7 @@ package org.koitharu.kotatsu.search.ui
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.graphics.Insets
|
||||
import androidx.core.view.updateLayoutParams
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.fragment.app.commit
|
||||
@@ -28,13 +26,14 @@ class MangaListActivity : BaseActivity<ActivityContainerBinding>() {
|
||||
setContentView(ActivityContainerBinding.inflate(layoutInflater))
|
||||
val tags = intent.getParcelableExtra<ParcelableMangaTags>(EXTRA_TAGS)?.tags
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
val source = intent.getSerializableExtra(EXTRA_SOURCE) as? MangaSource ?: tags?.firstOrNull()?.source
|
||||
if (source == null) {
|
||||
finishAfterTransition()
|
||||
return
|
||||
}
|
||||
title = source.title
|
||||
val fm = supportFragmentManager
|
||||
if (fm.findFragmentById(R.id.container) == null) {
|
||||
val source = intent.getSerializableExtra(EXTRA_SOURCE) as? MangaSource ?: tags?.firstOrNull()?.source
|
||||
if (source == null) {
|
||||
finishAfterTransition()
|
||||
return
|
||||
}
|
||||
fm.commit {
|
||||
val fragment = if (source == MangaSource.LOCAL) {
|
||||
LocalListFragment.newInstance()
|
||||
|
||||
@@ -103,7 +103,7 @@ class MultiSearchActivity : BaseActivity<ActivitySearchMultiBinding>(), MangaLis
|
||||
viewModel.doSearch(viewModel.query.value.orEmpty())
|
||||
}
|
||||
|
||||
override fun onTagRemoveClick(tag: MangaTag) = Unit
|
||||
override fun onUpdateFilter(tags: Set<MangaTag>) = Unit
|
||||
|
||||
override fun onFilterClick() = Unit
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class SearchSuggestionViewModel(
|
||||
setupSuggestion()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun onSourceToggle(source: MangaSource, isEnabled: Boolean) {
|
||||
settings.hiddenSources = if (isEnabled) {
|
||||
settings.hiddenSources - source.name
|
||||
@@ -113,6 +113,8 @@ class SearchSuggestionViewModel(
|
||||
icon = 0,
|
||||
title = tag.title,
|
||||
data = tag,
|
||||
isCheckable = false,
|
||||
isChecked = false,
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user