Cleanup and fixes

This commit is contained in:
Jobobby04
2021-10-18 23:09:26 -04:00
parent 14d6e8dd94
commit 2f203f7a1d
11 changed files with 31 additions and 136 deletions
@@ -321,7 +321,7 @@ class MangaPresenter(
withUIContext { view?.onFetchMangaInfoDone() }
} catch (e: Throwable) {
xLogE("Error getting manga details", e)
this@MangaPresenter.xLogE("Error getting manga details", e)
withUIContext { view?.onFetchMangaInfoError(e) }
}
}
@@ -392,16 +392,6 @@ class MangaInfoHeaderAdapter(
// Update description TextView.
binding.mangaSummaryText.text = updateDescription(manga.description, (fromSource || isTablet).not())
// SY -->
if (manga.description == "meta") {
binding.mangaSummaryText.text = ""
/*binding.mangaInfoToggleLess.updateLayoutParams<ConstraintLayout.LayoutParams> {
topToBottom = -1
bottomToBottom = binding.mangaSummaryText.id
}*/
}
// SY <--
// Update genres list
if (!manga.genre.isNullOrBlank()) {
binding.mangaGenresTagsCompactChips.setChips(
@@ -484,6 +474,9 @@ class MangaInfoHeaderAdapter(
private fun updateDescription(description: String?, isCurrentlyExpanded: Boolean): CharSequence {
return when {
description.isNullOrBlank() -> view.context.getString(R.string.unknown)
// SY -->
description == "meta" -> ""
// SY <--
isCurrentlyExpanded ->
description
.replace(Regex(" +\$", setOf(RegexOption.MULTILINE)), "")
@@ -106,11 +106,11 @@ class HttpPageLoader(
ReaderPage(index, page.url, page.imageUrl)
}
if (preferences.aggressivePageLoading().get()) {
rp.mapNotNull {
rp.forEach {
if (it.status == Page.QUEUE) {
PriorityPage(it, 0)
} else null
}.forEach { queue.offer(it) }
queue.offer(PriorityPage(it, 0))
}
}
}
rp
// SY <--
@@ -51,10 +51,12 @@ class SettingsLibraryController : SettingsController() {
private val db: DatabaseHelper = Injekt.get()
private val trackManager: TrackManager by injectLazy()
// SY -->
/**
* Sheet containing filter/sort/display items.
*/
private var settingsSheet: LibrarySettingsSheet? = null
// SY <--
override fun setupPreferenceScreen(screen: PreferenceScreen) = screen.apply {
titleRes = R.string.pref_category_library
@@ -71,6 +71,7 @@ class SettingsReaderController : SettingsController() {
summaryRes = R.string.pref_show_navigation_mode_summary
defaultValue = false
}
// SY -->
switchPreference {
key = Keys.forceHorizontalSeekbar
titleRes = R.string.pref_force_horz_seekbar
@@ -91,6 +92,7 @@ class SettingsReaderController : SettingsController() {
defaultValue = false
preferences.forceHorizontalSeekbar().asImmediateFlow { isVisible = !it }.launchIn(viewScope)
}
// SY <--
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
switchPreference {
key = Keys.trueColor
@@ -410,6 +412,7 @@ class SettingsReaderController : SettingsController() {
}
}
// SY -->
preferenceCategory {
titleRes = R.string.page_downloading
@@ -499,7 +502,6 @@ class SettingsReaderController : SettingsController() {
}
}
// EXH -->
preferenceCategory {
titleRes = R.string.pref_category_fork
@@ -550,9 +552,10 @@ class SettingsReaderController : SettingsController() {
preferences.pageLayout().asImmediateFlow { isVisible = it != PagerConfig.PageLayout.SINGLE_PAGE }
}
}
// EXH <--
// SY <--
}
// SY -->
class ReaderBottomButtonsDialog : DialogController() {
private val preferences: PreferencesHelper = Injekt.get()
@@ -586,4 +589,5 @@ class SettingsReaderController : SettingsController() {
.create()
}
}
// SY <--
}
@@ -123,6 +123,7 @@ class SettingsSecurityController : SettingsController() {
titleRes = R.string.hide_notification_content
defaultValue = false
}
// SY -->
preference {
key = "pref_edit_lock_times"
titleRes = R.string.action_edit_biometric_lock_times
@@ -149,8 +150,10 @@ class SettingsSecurityController : SettingsController() {
SetLockedDaysDialog().showDialog(router)
}
}
// SY <--
}
// SY -->
class SetLockedDaysDialog(bundle: Bundle? = null) : DialogController(bundle) {
val preferences: PreferencesHelper by injectLazy()
@@ -212,4 +215,5 @@ class SettingsSecurityController : SettingsController() {
.create()
}
}
// SY <--
}