mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(library/compose): Don't left the title empty
This commit is contained in:
parent
48c2ad9b33
commit
ad22250265
1 changed files with 33 additions and 1 deletions
|
@ -11,17 +11,40 @@ import androidx.core.view.isVisible
|
||||||
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
|
||||||
import eu.kanade.tachiyomi.databinding.LibraryControllerBinding
|
import eu.kanade.tachiyomi.databinding.LibraryControllerBinding
|
||||||
import eu.kanade.tachiyomi.ui.base.controller.BaseCoroutineController
|
import eu.kanade.tachiyomi.ui.base.controller.BaseCoroutineController
|
||||||
|
import eu.kanade.tachiyomi.ui.main.BottomSheetController
|
||||||
|
import eu.kanade.tachiyomi.ui.main.FloatingSearchInterface
|
||||||
|
import eu.kanade.tachiyomi.ui.main.RootSearchInterface
|
||||||
|
import java.util.Locale
|
||||||
import uy.kohesive.injekt.Injekt
|
import uy.kohesive.injekt.Injekt
|
||||||
import uy.kohesive.injekt.api.get
|
import uy.kohesive.injekt.api.get
|
||||||
import yokai.domain.ui.UiPreferences
|
import yokai.domain.ui.UiPreferences
|
||||||
|
import yokai.i18n.MR
|
||||||
import yokai.presentation.library.LibraryContent
|
import yokai.presentation.library.LibraryContent
|
||||||
import yokai.presentation.theme.YokaiTheme
|
import yokai.presentation.theme.YokaiTheme
|
||||||
|
import yokai.util.lang.getString
|
||||||
|
|
||||||
class LibraryComposeController(
|
class LibraryComposeController(
|
||||||
bundle: Bundle? = null,
|
bundle: Bundle? = null,
|
||||||
val uiPreferences: UiPreferences = Injekt.get(),
|
val uiPreferences: UiPreferences = Injekt.get(),
|
||||||
val preferences: PreferencesHelper = Injekt.get(),
|
val preferences: PreferencesHelper = Injekt.get(),
|
||||||
) : BaseCoroutineController<LibraryControllerBinding, LibraryComposePresenter>(bundle) {
|
) : BaseCoroutineController<LibraryControllerBinding, LibraryComposePresenter>(bundle) ,
|
||||||
|
BottomSheetController,
|
||||||
|
RootSearchInterface,
|
||||||
|
FloatingSearchInterface {
|
||||||
|
|
||||||
|
override fun getTitle(): String? {
|
||||||
|
return view?.context?.getString(MR.strings.library)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getSearchTitle(): String? {
|
||||||
|
return searchTitle(
|
||||||
|
if (preferences.showLibrarySearchSuggestions().get() && preferences.librarySearchSuggestion().get().isNotBlank()) {
|
||||||
|
"\"${preferences.librarySearchSuggestion().get()}\""
|
||||||
|
} else {
|
||||||
|
view?.context?.getString(MR.strings.your_library)?.lowercase(Locale.ROOT)
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
override val presenter = LibraryComposePresenter()
|
override val presenter = LibraryComposePresenter()
|
||||||
|
|
||||||
|
@ -46,4 +69,13 @@ class LibraryComposeController(
|
||||||
columns = 3,
|
columns = 3,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun showSheet() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun hideSheet() {
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun toggleSheet() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue