Formatting

This commit is contained in:
arkon
2022-04-08 16:44:23 -04:00
parent 2dfafa387b
commit 5afff31f72
197 changed files with 481 additions and 483 deletions

View File

@@ -46,7 +46,7 @@ abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) : Contro
viewScope.cancel()
logcat { "Destroy view for ${controller.instance()}" }
}
}
},
)
}
@@ -107,7 +107,7 @@ abstract class BaseController<VB : ViewBinding>(bundle: Bundle? = null) : Contro
return onCollapse?.invoke(item) ?: true
}
}
},
)
if (expandActionViewFromInteraction) {

View File

@@ -90,7 +90,7 @@ abstract class DialogController : Controller {
RouterTransaction.with(this)
.pushChangeHandler(SimpleSwapChangeHandler(false))
.popChangeHandler(SimpleSwapChangeHandler(false))
.tag(tag)
.tag(tag),
)
}

View File

@@ -17,7 +17,7 @@ class OneWayFadeChangeHandler : FadeChangeHandler {
constructor(duration: Long) : super(duration)
constructor(duration: Long, removesFromViewOnPush: Boolean) : super(
duration,
removesFromViewOnPush
removesFromViewOnPush,
)
override fun getAnimator(

View File

@@ -57,7 +57,7 @@ abstract class SearchableNucleusController<VB : ViewBinding, P : BasePresenter<*
// Remove formatting from pasted text
val searchAutoComplete: SearchView.SearchAutoComplete = searchView.findViewById(
R.id.search_src_text
R.id.search_src_text,
)
searchAutoComplete.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {}
@@ -68,7 +68,7 @@ abstract class SearchableNucleusController<VB : ViewBinding, P : BasePresenter<*
editable.getSpans(0, editable.length, CharacterStyle::class.java)
.forEach { editable.removeSpan(it) }
}
})
},)
searchView.queryTextEvents()
.onEach {
@@ -149,7 +149,7 @@ abstract class SearchableNucleusController<VB : ViewBinding, P : BasePresenter<*
onSearchMenuItemActionCollapse(item)
return true
}
}
},
)
}

View File

@@ -31,7 +31,7 @@ class BrowseController :
TabbedController {
constructor(toExtensions: Boolean = false) : super(
bundleOf(TO_EXTENSIONS_EXTRA to toExtensions)
bundleOf(TO_EXTENSIONS_EXTRA to toExtensions),
)
@Suppress("unused")
@@ -114,7 +114,7 @@ class BrowseController :
private val tabTitles = listOf(
R.string.label_sources,
R.string.label_extensions,
R.string.label_migration
R.string.label_migration,
)
.map { resources!!.getString(it) }

View File

@@ -93,7 +93,7 @@ open class ExtensionController :
R.id.action_search -> expandActionViewFromInteraction = true
R.id.action_settings -> {
parentController!!.router.pushController(
ExtensionFilterController().withFadeTransaction()
ExtensionFilterController().withFadeTransaction(),
)
}
}
@@ -215,7 +215,7 @@ open class ExtensionController :
is Extension.Untrusted -> it.extension.name.contains(query, ignoreCase = true)
}
}
}
},
)
} else {
adapter?.updateDataSet(extensions)

View File

@@ -73,7 +73,7 @@ class ExtensionHolder(view: View, val adapter: ExtensionAdapter) :
is Extension.Available -> R.string.ext_install
}
}
}
},
)
val isIdle = installStep == InstallStep.Idle || installStep == InstallStep.Error

View File

@@ -69,7 +69,7 @@ open class ExtensionPresenter(
val installedSorted = installed.filter { !it.hasUpdate && (showNsfwSources || !it.isNsfw) }
.sortedWith(
compareBy<Extension.Installed> { !it.isObsolete }
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.name }
.thenBy(String.CASE_INSENSITIVE_ORDER) { it.name },
)
val untrustedSorted = untrusted.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { it.name })
@@ -163,7 +163,7 @@ open class ExtensionPresenter(
if (item != null) {
view.downloadUpdate(item)
}
})
},)
}
fun uninstallExtension(pkgName: String) {

View File

@@ -14,8 +14,8 @@ class ExtensionTrustDialog<T>(bundle: Bundle? = null) : DialogController(bundle)
constructor(target: T, signatureHash: String, pkgName: String) : this(
bundleOf(
SIGNATURE_KEY to signatureHash,
PKGNAME_KEY to pkgName
)
PKGNAME_KEY to pkgName,
),
) {
targetController = target
}

View File

@@ -55,7 +55,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
private var preferenceScreen: PreferenceScreen? = null
constructor(pkgName: String) : this(
bundleOf(PKGNAME_KEY to pkgName)
bundleOf(PKGNAME_KEY to pkgName),
)
init {
@@ -91,7 +91,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
binding.extensionPrefsRecycler.layoutManager = LinearLayoutManager(context)
binding.extensionPrefsRecycler.adapter = ConcatAdapter(
ExtensionDetailsHeaderAdapter(presenter),
initPreferencesAdapter(context, extension)
initPreferencesAdapter(context, extension),
)
}
@@ -166,7 +166,7 @@ class ExtensionDetailsController(bundle: Bundle? = null) :
block()
onSettingsClick = View.OnClickListener {
router.pushController(
SourcePreferencesController(source.id).withFadeTransaction()
SourcePreferencesController(source.id).withFadeTransaction(),
)
}
}

View File

@@ -33,7 +33,7 @@ class ExtensionDetailsPresenter(
.observeOn(AndroidSchedulers.mainThread())
.subscribeFirst({ view, _ ->
view.onExtensionUninstalled()
})
},)
}
fun uninstallExtension() {

View File

@@ -43,7 +43,7 @@ class SourcePreferencesController(bundle: Bundle? = null) :
private var preferenceScreen: PreferenceScreen? = null
constructor(sourceId: Long) : this(
bundleOf(SOURCE_ID to sourceId)
bundleOf(SOURCE_ID to sourceId),
)
override fun createBinding(inflater: LayoutInflater): SourcePreferencesControllerBinding {
@@ -69,7 +69,7 @@ class SourcePreferencesController(bundle: Bundle? = null) :
val themedContext by lazy { getPreferenceThemeContext() }
val manager = PreferenceManager(themedContext)
val dataStore = SharedPreferencesDataStore(
context.getSharedPreferences(source.getPreferenceKey(), Context.MODE_PRIVATE)
context.getSharedPreferences(source.getPreferenceKey(), Context.MODE_PRIVATE),
)
manager.preferenceDataStore = dataStore
manager.onDisplayPreferenceDialogListener = this
@@ -158,7 +158,7 @@ class SourcePreferencesController(bundle: Bundle? = null) :
.newInstance(preference.getKey())
else -> throw IllegalArgumentException(
"Tried to display dialog for unknown " +
"preference type. Did you forget to override onDisplayPreferenceDialog()?"
"preference type. Did you forget to override onDisplayPreferenceDialog()?",
)
}
f.targetController = this

View File

@@ -23,14 +23,14 @@ class MigrationMangaController :
constructor(sourceId: Long, sourceName: String?) : super(
bundleOf(
SOURCE_ID_EXTRA to sourceId,
SOURCE_NAME_EXTRA to sourceName
)
SOURCE_NAME_EXTRA to sourceName,
),
)
@Suppress("unused")
constructor(bundle: Bundle) : this(
bundle.getLong(SOURCE_ID_EXTRA),
bundle.getString(SOURCE_NAME_EXTRA)
bundle.getString(SOURCE_NAME_EXTRA),
)
private val sourceId: Long = args.getLong(SOURCE_ID_EXTRA)

View File

@@ -27,7 +27,7 @@ class SearchController(
override fun createPresenter(): GlobalSearchPresenter {
return SearchPresenter(
initialQuery,
manga!!
manga!!,
)
}

View File

@@ -40,7 +40,7 @@ class SearchPresenter(
replacingMangaRelay.subscribeLatestCache(
{ controller, (isReplacingManga, newManga) ->
(controller as? SearchController)?.renderIsReplacingManga(isReplacingManga, newManga)
}
},
)
}
@@ -93,15 +93,15 @@ class SearchPresenter(
val flags = preferences.migrateFlags().get()
val migrateChapters =
MigrationFlags.hasChapters(
flags
flags,
)
val migrateCategories =
MigrationFlags.hasCategories(
flags
flags,
)
val migrateTracks =
MigrationFlags.hasTracks(
flags
flags,
)
db.inTransaction {

View File

@@ -18,7 +18,7 @@ class SourceSearchController(
if (searchQuery != null) {
putString(SEARCH_QUERY_KEY, searchQuery)
}
}
},
)
private var oldManga: Manga? = args.getSerializable(MANGA_KEY) as Manga?
private var newManga: Manga? = null

View File

@@ -27,7 +27,7 @@ class SelectionHeader : AbstractHeaderItem<SelectionHeader.Holder>() {
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): Holder {
return Holder(
view,
adapter
adapter,
)
}

View File

@@ -30,7 +30,7 @@ data class SourceItem(val source: Source, val mangaCount: Int, val header: Selec
override fun createViewHolder(view: View, adapter: FlexibleAdapter<IFlexible<RecyclerView.ViewHolder>>): SourceHolder {
return SourceHolder(
view,
adapter as SourceAdapter
adapter as SourceAdapter,
)
}

View File

@@ -124,7 +124,7 @@ class SourceController :
val isPinned = item.header?.code?.equals(SourcePresenter.PINNED_KEY) ?: false
val items = mutableListOf(
activity.getString(if (isPinned) R.string.action_unpin else R.string.action_pin) to { toggleSourcePin(item.source) }
activity.getString(if (isPinned) R.string.action_unpin else R.string.action_pin) to { toggleSourcePin(item.source) },
)
if (item.source !is LocalSource) {
items.add(activity.getString(R.string.action_disable) to { disableSource(item.source) })
@@ -195,7 +195,7 @@ class SourceController :
R.id.action_settings -> {
parentController!!.router.pushController(
SourceFilterController()
.withFadeTransaction()
.withFadeTransaction(),
)
}
}
@@ -248,13 +248,13 @@ class SourceController :
R.menu.browse_sources,
R.id.action_search,
R.string.action_global_search_hint,
false // GlobalSearch handles the searching here
false, // GlobalSearch handles the searching here
)
}
override fun onSearchViewQueryTextSubmit(query: String?) {
parentController!!.router.pushController(
GlobalSearchController(query).withFadeTransaction()
GlobalSearchController(query).withFadeTransaction(),
)
}
}

View File

@@ -37,8 +37,8 @@ class SourceFilterController : SettingsController() {
val orderedLangs = sourcesByLang.keys.sortedWith(
compareBy(
{ it !in activeLangsCodes },
{ LocaleHelper.getSourceDisplayName(it, context) }
)
{ LocaleHelper.getSourceDisplayName(it, context) },
),
)
orderedLangs.forEach { lang ->

View File

@@ -76,7 +76,7 @@ open class BrowseSourceController(bundle: Bundle) :
if (searchQuery != null) {
putString(SEARCH_QUERY_KEY, searchQuery)
}
}
},
)
private val preferences: PreferencesHelper by injectLazy()
@@ -155,7 +155,7 @@ open class BrowseSourceController(bundle: Bundle) :
val newFilters = presenter.source.getFilterList()
presenter.sourceFilters = newFilters
filterSheet?.setFilters(presenter.filterItems)
}
},
)
filterSheet?.setFilters(presenter.filterItems)
@@ -269,7 +269,7 @@ open class BrowseSourceController(bundle: Bundle) :
}
true
}
},
)
val displayItem = when (preferences.sourceDisplayMode().get()) {
@@ -426,13 +426,13 @@ open class BrowseSourceController(bundle: Bundle) :
if (adapter.isEmpty) {
val actions = if (presenter.source is LocalSource) {
listOf(
EmptyView.Action(R.string.local_source_help_guide, R.drawable.ic_help_24dp) { openLocalSourceHelpGuide() }
EmptyView.Action(R.string.local_source_help_guide, R.drawable.ic_help_24dp) { openLocalSourceHelpGuide() },
)
} else {
listOf(
EmptyView.Action(R.string.action_retry, R.drawable.ic_refresh_24dp, retryAction),
EmptyView.Action(R.string.action_open_in_web_view, R.drawable.ic_public_24dp) { openInWebView() },
EmptyView.Action(R.string.label_help, R.drawable.ic_help_24dp) { activity?.openInBrowser(MoreController.URL_HELP) }
EmptyView.Action(R.string.label_help, R.drawable.ic_help_24dp) { activity?.openInBrowser(MoreController.URL_HELP) },
)
}

View File

@@ -157,7 +157,7 @@ open class BrowseSourcePresenter(
},
{ _, error ->
logcat(LogPriority.ERROR, error)
}
},
)
// Request first page.

View File

@@ -49,7 +49,7 @@ class SourceFilterSheet(
private val binding = SourceFilterSheetBinding.inflate(
LayoutInflater.from(context),
null,
false
false,
)
init {

View File

@@ -39,7 +39,7 @@ class GroupItem(val filter: Filter.Group<*>) : AbstractExpandableHeaderItem<Grou
R.drawable.ic_expand_less_24dp
} else {
R.drawable.ic_expand_more_24dp
}
},
)
holder.itemView.setOnClickListener(holder)

View File

@@ -31,7 +31,7 @@ open class SelectItem(val filter: Filter.Select<*>) : AbstractFlexibleItem<Selec
spinner.adapter = ArrayAdapter<Any>(
holder.itemView.context,
android.R.layout.simple_spinner_item,
filter.values
filter.values,
).apply {
setDropDownViewResource(R.layout.common_spinner_item)
}

View File

@@ -36,7 +36,7 @@ class SortGroup(val filter: Filter.Sort) : AbstractExpandableHeaderItem<SortGrou
R.drawable.ic_expand_less_24dp
} else {
R.drawable.ic_expand_more_24dp
}
},
)
holder.itemView.setOnClickListener(holder)

View File

@@ -40,7 +40,7 @@ open class TriStateItem(val filter: Filter.TriState) : AbstractFlexibleItem<TriS
Filter.TriState.STATE_INCLUDE -> TR.drawable.ic_check_box_24dp
Filter.TriState.STATE_EXCLUDE -> TR.drawable.ic_check_box_x_24dp
else -> throw Exception("Unknown state")
}
},
)?.apply {
val color = if (filter.state == Filter.TriState.STATE_INCLUDE) {
view.context.getResourceColor(R.attr.colorAccent)

View File

@@ -91,7 +91,7 @@ open class GlobalSearchController(
R.menu.global_search,
R.id.action_search,
null,
false // the onMenuItemActionExpand will handle this
false, // the onMenuItemActionExpand will handle this
)
optionsMenuSearchItem = menu.findItem(R.id.action_search)

View File

@@ -75,7 +75,7 @@ open class GlobalSearchPresenter(
// Perform a search with previous or initial state
search(
savedState?.getString(BrowseSourcePresenter::query.name)
?: initialQuery.orEmpty()
?: initialQuery.orEmpty(),
)
}
@@ -172,7 +172,7 @@ open class GlobalSearchPresenter(
.doOnNext { fetchImage(it, source) } // Load manga covers
.map { list -> createCatalogueSearchItem(source, list.map { GlobalSearchCardItem(it) }) }
},
5
5,
)
.observeOn(AndroidSchedulers.mainThread())
// Update matching source with the obtained results
@@ -185,8 +185,8 @@ open class GlobalSearchPresenter(
{ it.results.isNullOrEmpty() },
// Same as initial sort, i.e. pinned first then alphabetically
{ it.source.id.toString() !in pinnedSourceIds },
{ "${it.source.name.lowercase()} (${it.source.lang})" }
)
{ "${it.source.name.lowercase()} (${it.source.lang})" },
),
)
}
// Update current state
@@ -199,7 +199,7 @@ open class GlobalSearchPresenter(
},
{ _, error ->
logcat(LogPriority.ERROR, error)
}
},
)
}
@@ -234,7 +234,7 @@ open class GlobalSearchPresenter(
},
{ error ->
logcat(LogPriority.ERROR, error)
}
},
)
}

View File

@@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter
class LatestUpdatesController(bundle: Bundle) : BrowseSourceController(bundle) {
constructor(source: CatalogueSource) : this(
bundleOf(SOURCE_ID_KEY to source.id)
bundleOf(SOURCE_ID_KEY to source.id),
)
override fun createPresenter(): BrowseSourcePresenter {

View File

@@ -195,7 +195,7 @@ class CategoryController :
(activity as? MainActivity)?.binding?.rootCoordinator!!,
R.string.snack_categories_deleted,
R.string.action_undo,
4000
4000,
)
mode.finish()

View File

@@ -12,7 +12,7 @@ import eu.davidea.flexibleadapter.items.AbstractFlexibleItem
class DownloadAdapter(controller: DownloadController) : FlexibleAdapter<AbstractFlexibleItem<*>>(
null,
controller,
true
true,
) {
/**

View File

@@ -312,7 +312,7 @@ class DownloadController :
R.string.action_pause
} else {
R.string.action_resume
}
},
)
setIconResource(
@@ -320,7 +320,7 @@ class DownloadController :
R.drawable.ic_pause_24dp
} else {
R.drawable.ic_play_arrow_24dp
}
},
)
}
}

View File

@@ -95,7 +95,7 @@ class DownloadHolder(private val view: View, val adapter: DownloadAdapter) :
},
onMenuItemClick = {
adapter.downloadItemListener.onMenuItemClick(bindingAdapterPosition, this)
}
},
)
}
}

View File

@@ -43,7 +43,7 @@ class ChangeMangaCategoriesDialog<T>(bundle: Bundle? = null) :
setQuadStateMultiChoiceItems(
items = categories.map { it.name },
isActionList = false,
initialSelected = preselected.toIntArray()
initialSelected = preselected.toIntArray(),
) { selections ->
selected = selections
}

View File

@@ -24,7 +24,7 @@ class DeleteLibraryMangasDialog<T>(bundle: Bundle? = null) :
val items = when (canDeleteChapters) {
true -> listOf(
R.string.manga_from_library,
R.string.downloaded_chapters
R.string.downloaded_chapters,
)
false -> listOf(R.string.manga_from_library)
}

View File

@@ -211,7 +211,7 @@ class LibraryController(
binding.btnGlobalSearch.clicks()
.onEach {
router.pushController(
GlobalSearchController(presenter.query).withFadeTransaction()
GlobalSearchController(presenter.query).withFadeTransaction(),
)
}
.launchIn(viewScope)
@@ -281,8 +281,8 @@ class LibraryController(
listOf(
EmptyView.Action(R.string.getting_started_guide, R.drawable.ic_help_24dp) {
activity?.openInBrowser("https://tachiyomi.org/help/guides/getting-started")
}
)
},
),
)
(activity as? MainActivity)?.ready = true
}

View File

@@ -107,7 +107,7 @@ class LibraryPresenter(
.observeOn(AndroidSchedulers.mainThread())
.subscribeLatestCache({ view, (categories, mangaMap) ->
view.onNextLibraryUpdate(categories, mangaMap)
})
},)
}
}
@@ -381,7 +381,7 @@ class LibraryPresenter(
LibraryItem(
libraryManga,
shouldSetFromCategory,
defaultLibraryDisplayMode
defaultLibraryDisplayMode,
)
}.groupBy { it.manga.category }
}

View File

@@ -57,13 +57,13 @@ class LibrarySettingsSheet(
override fun getTabViews(): List<View> = listOf(
filters,
sort,
display
display,
)
override fun getTabTitles(): List<Int> = listOf(
R.string.action_filter,
R.string.action_sort,
R.string.action_display
R.string.action_display,
)
/**

View File

@@ -217,7 +217,7 @@ class MainActivity : BaseActivity() {
handler: ControllerChangeHandler,
) {
}
}
},
)
if (!router.hasRootController()) {
// Set start screen
@@ -494,7 +494,7 @@ class MainActivity : BaseActivity() {
// Color taken from m3_appbar_background
window.statusBarColor = ColorUtils.compositeColors(
getColor(R.color.m3_appbar_overlay_color),
getThemeColor(R.attr.colorSurface)
getThemeColor(R.attr.colorSurface),
)
super.onSupportActionModeStarted(mode)
}

View File

@@ -121,8 +121,8 @@ class MangaController :
constructor(manga: Manga?, fromSource: Boolean = false) : super(
bundleOf(
MANGA_EXTRA to (manga?.id ?: 0),
FROM_SOURCE_EXTRA to fromSource
)
FROM_SOURCE_EXTRA to fromSource,
),
) {
this.manga = manga
if (manga != null) {
@@ -131,7 +131,7 @@ class MangaController :
}
constructor(mangaId: Long) : this(
Injekt.get<DatabaseHelper>().getManga(mangaId).executeAsBlocking()
Injekt.get<DatabaseHelper>().getManga(mangaId).executeAsBlocking(),
)
@Suppress("unused")
@@ -222,7 +222,7 @@ class MangaController :
override fun createPresenter(): MangaPresenter {
return MangaPresenter(
manga!!,
source!!
source!!,
)
}
@@ -268,7 +268,7 @@ class MangaController :
val mainActivityAppBar = (activity as? MainActivity)?.binding?.appbar
(it.layoutManager as LinearLayoutManager).scrollToPositionWithOffset(
1,
mainActivityAppBar?.height ?: 0
mainActivityAppBar?.height ?: 0,
)
mainActivityAppBar?.isLifted = true
}
@@ -532,7 +532,7 @@ class MangaController :
if (duplicateManga != null) {
showAddDuplicateDialog(
manga,
duplicateManga
duplicateManga,
)
} else {
addToLibrary(manga)
@@ -661,7 +661,7 @@ class MangaController :
super.postDestroy(controller)
dialog = null
}
}
},
)
dialog?.showDialog(router)
}
@@ -770,7 +770,7 @@ class MangaController :
super.postDestroy(controller)
dialog = null
}
}
},
)
dialog?.showDialog(router)
}
@@ -785,8 +785,8 @@ class MangaController :
image = Image.Cover(
bitmap = coverBitmap,
name = manga.title,
location = Location.Cache
)
location = Location.Cache,
),
)
launchUI {
startActivity(uri.toShareIntent(activity))
@@ -809,8 +809,8 @@ class MangaController :
image = Image.Cover(
bitmap = coverBitmap,
name = manga.title,
location = Location.Pictures.create()
)
location = Location.Pictures.create(),
),
)
launchUI {
activity.toast(R.string.cover_saved)
@@ -840,9 +840,9 @@ class MangaController :
startActivityForResult(
Intent.createChooser(
intent,
resources?.getString(R.string.file_select_cover)
resources?.getString(R.string.file_select_cover),
),
REQUEST_IMAGE_OPEN
REQUEST_IMAGE_OPEN,
)
} else {
activity?.toast(R.string.notification_first_add_to_library)
@@ -954,13 +954,13 @@ class MangaController :
val activityOptions = ActivityOptions.makeSceneTransitionAnimation(
activity,
sharedElement,
ReaderActivity.SHARED_ELEMENT_NAME
ReaderActivity.SHARED_ELEMENT_NAME,
)
startActivity(
intent.apply {
putExtra(ReaderActivity.EXTRA_IS_TRANSITION, true)
},
activityOptions.toBundle()
activityOptions.toBundle(),
)
} else {
startActivity(intent)
@@ -1259,7 +1259,7 @@ class MangaController :
private fun showCustomDownloadDialog() {
DownloadCustomChaptersDialog(
this,
presenter.allChapters.size
presenter.allChapters.size,
).showDialog(router)
}

View File

@@ -137,7 +137,7 @@ class MangaPresenter(
filteredAndSortedChapters = chapters
view?.onNextChapters(chapters)
},
{ _, error -> logcat(LogPriority.ERROR, error) }
{ _, error -> logcat(LogPriority.ERROR, error) },
)
// Manga info - end
@@ -162,7 +162,7 @@ class MangaPresenter(
// Listen for download status changes
observeDownloads()
}
.subscribe { chaptersRelay.call(it) }
.subscribe { chaptersRelay.call(it) },
)
// Chapters list - end
@@ -328,7 +328,7 @@ class MangaPresenter(
.observeOn(AndroidSchedulers.mainThread())
.subscribeFirst(
{ view, _ -> view.onSetCoverSuccess() },
{ view, e -> view.onSetCoverError(e) }
{ view, e -> view.onSetCoverError(e) },
)
}
@@ -343,7 +343,7 @@ class MangaPresenter(
.observeOn(AndroidSchedulers.mainThread())
.subscribeFirst(
{ view, _ -> view.onSetCoverSuccess() },
{ view, e -> view.onSetCoverError(e) }
{ view, e -> view.onSetCoverError(e) },
)
}
@@ -365,7 +365,7 @@ class MangaPresenter(
},
{ _, error ->
logcat(LogPriority.ERROR, error)
}
},
)
observeDownloadsPageSubscription?.let { remove(it) }

View File

@@ -29,7 +29,7 @@ class ChaptersAdapter(
val decimalFormat = DecimalFormat(
"#.###",
DecimalFormatSymbols()
.apply { decimalSeparator = '.' }
.apply { decimalSeparator = '.' },
)
val relativeTime: Int = preferences.relativeTime().get()

View File

@@ -38,13 +38,13 @@ class ChaptersSettingsSheet(
override fun getTabViews(): List<View> = listOf(
filters,
sort,
display
display,
)
override fun getTabTitles(): List<Int> = listOf(
R.string.action_filter,
R.string.action_sort,
R.string.action_display
R.string.action_display,
)
private fun showPopupMenu(view: View) {
@@ -56,7 +56,7 @@ class ChaptersSettingsSheet(
SetChapterSettingsDialog(presenter.manga).showDialog(router)
}
}
}
},
)
}

View File

@@ -26,7 +26,7 @@ class DownloadCustomChaptersDialog<T> : DialogController
*/
constructor(target: T, maxChapters: Int) : super(
// Add maximum number of chapters to download value to bundle.
bundleOf(KEY_ITEM_MAX to maxChapters)
bundleOf(KEY_ITEM_MAX to maxChapters),
) {
targetController = target
this.maxChapters = maxChapters

View File

@@ -14,7 +14,7 @@ import eu.kanade.tachiyomi.widget.DialogCheckboxView
class SetChapterSettingsDialog(bundle: Bundle? = null) : DialogController(bundle) {
constructor(manga: Manga) : this(
bundleOf(MANGA_KEY to manga)
bundleOf(MANGA_KEY to manga),
)
override fun onCreateDialog(savedViewState: Bundle?): Dialog {

View File

@@ -36,7 +36,7 @@ open class BaseChapterHolder(
} else {
adapter.clickListener.deleteChapter(position)
}
}
},
)
}
}

View File

@@ -107,8 +107,8 @@ class MangaFullCoverDialog : DialogController {
binding?.container?.setImage(
it,
ReaderPageImageView.Config(
zoomDuration = 500
)
zoomDuration = 500,
),
)
}
.build()

View File

@@ -115,7 +115,7 @@ class MangaInfoHeaderAdapter(
text = view.context.resources.getQuantityString(
R.plurals.num_trackers,
trackCount,
trackCount
trackCount,
)
isActivated = true
} else {
@@ -143,7 +143,7 @@ class MangaInfoHeaderAdapter(
.onEach {
controller.activity?.copyToClipboard(
view.context.getString(R.string.title),
binding.mangaFullTitle.text.toString()
binding.mangaFullTitle.text.toString(),
)
}
.launchIn(controller.viewScope)
@@ -158,7 +158,7 @@ class MangaInfoHeaderAdapter(
.onEach {
controller.activity?.copyToClipboard(
binding.mangaAuthor.text.toString(),
binding.mangaAuthor.text.toString()
binding.mangaAuthor.text.toString(),
)
}
.launchIn(controller.viewScope)
@@ -173,7 +173,7 @@ class MangaInfoHeaderAdapter(
.onEach {
controller.activity?.copyToClipboard(
binding.mangaArtist.text.toString(),
binding.mangaArtist.text.toString()
binding.mangaArtist.text.toString(),
)
}
.launchIn(controller.viewScope)
@@ -204,7 +204,7 @@ class MangaInfoHeaderAdapter(
R.string.action_share,
R.string.action_save,
// Can only edit cover for library manga
if (manga.favorite) R.string.action_edit else null
if (manga.favorite) R.string.action_edit else null,
).map(controller.activity!!::getString).toTypedArray()
MaterialAlertDialogBuilder(controller.activity!!)

View File

@@ -22,7 +22,7 @@ class SetTrackChaptersDialog<T> : DialogController
private lateinit var listener: Listener
constructor(target: T, listener: Listener, item: TrackItem) : super(
bundleOf(KEY_ITEM_TRACK to item.track)
bundleOf(KEY_ITEM_TRACK to item.track),
) {
targetController = target
this.listener = listener

View File

@@ -22,7 +22,7 @@ class SetTrackScoreDialog<T> : DialogController
private lateinit var listener: Listener
constructor(target: T, listener: Listener, item: TrackItem) : super(
bundleOf(KEY_ITEM_TRACK to item.track)
bundleOf(KEY_ITEM_TRACK to item.track),
) {
targetController = target
this.listener = listener

View File

@@ -20,7 +20,7 @@ class SetTrackStatusDialog<T> : DialogController
private lateinit var listener: Listener
constructor(target: T, listener: Listener, item: TrackItem) : super(
bundleOf(KEY_ITEM_TRACK to item.track)
bundleOf(KEY_ITEM_TRACK to item.track),
) {
targetController = target
this.listener = listener

View File

@@ -138,7 +138,7 @@ class AboutController : SettingsController(), NoAppBarElevationController {
val outputDf = DateFormat.getDateTimeInstance(
DateFormat.MEDIUM,
DateFormat.SHORT,
Locale.getDefault()
Locale.getDefault(),
)
outputDf.timeZone = TimeZone.getDefault()

View File

@@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.ui.base.controller.DialogController
class NewUpdateDialogController(bundle: Bundle? = null) : DialogController(bundle) {
constructor(update: AppUpdateResult.NewUpdate) : this(
bundleOf(BODY_KEY to update.release.info, URL_KEY to update.release.getDownloadLink())
bundleOf(BODY_KEY to update.release.info, URL_KEY to update.release.getDownloadLink()),
)
override fun onCreateDialog(savedViewState: Bundle?): Dialog {

View File

@@ -48,5 +48,5 @@ private val strokeColor = Color.rgb(45, 45, 45)
// A span object with text outlining properties
private val spanOutline = OutlineSpan(
strokeColor = strokeColor,
strokeWidth = 4f
strokeWidth = 4f,
)

View File

@@ -349,7 +349,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
action = MainActivity.SHORTCUT_MANGA
putExtra(MangaController.MANGA_EXTRA, id)
addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
}
},
)
}
}
@@ -363,7 +363,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
override fun onStopTrackingTouch(slider: Slider) {
isScrollingThroughPages = false
}
})
},)
binding.pageSlider.addOnChangeListener { slider, value, fromUser ->
if (viewer != null && fromUser) {
isScrollingThroughPages = true
@@ -406,13 +406,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
it.foreground = RippleDrawable(
ColorStateList.valueOf(getThemeColor(android.R.attr.colorControlHighlight)),
null,
it.background
it.background,
)
}
val toolbarColor = ColorUtils.setAlphaComponent(
toolbarBackground.resolvedTintColor,
toolbarBackground.alpha
toolbarBackground.alpha,
)
window.statusBarColor = toolbarColor
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
@@ -431,7 +431,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
setOnClickListener {
popupMenu(
items = ReadingModeType.values().map { it.flagValue to it.stringRes },
selectedItemId = presenter.getMangaReadingMode(resolveDefault = false)
selectedItemId = presenter.getMangaReadingMode(resolveDefault = false),
) {
val newReadingMode = ReadingModeType.fromPreference(itemId)
@@ -465,7 +465,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
R.string.on
} else {
R.string.off
}
},
)
}
}
@@ -485,7 +485,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
popupMenu(
items = OrientationType.values().map { it.flagValue to it.stringRes },
selectedItemId = presenter.manga?.orientationType
?: preferences.defaultOrientationType()
?: preferences.defaultOrientationType(),
) {
val newOrientation = OrientationType.fromPreference(itemId)
@@ -530,7 +530,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
R.drawable.ic_crop_24dp
} else {
R.drawable.ic_crop_off_24dp
}
},
)
}
@@ -553,7 +553,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
// Fix status bar being translucent the first time it's opened.
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS)
}
}
},
)
binding.toolbar.startAnimation(toolbarAnimation)
@@ -579,7 +579,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
override fun onAnimationEnd(animation: Animation) {
binding.readerMenu.isVisible = false
}
}
},
)
binding.toolbar.startAnimation(toolbarAnimation)
@@ -610,7 +610,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
if (window.sharedElementEnterTransition is MaterialContainerTransform) {
// Wait until transition is complete to avoid crash on API 26
window.sharedElementEnterTransition.addListener(
onEnd = { setOrientation(presenter.getMangaOrientationType()) }
onEnd = { setOrientation(presenter.getMangaOrientationType()) },
)
} else {
setOrientation(presenter.getMangaOrientationType())
@@ -832,7 +832,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
val intent = uri.toShareIntent(
context = applicationContext,
message = getString(R.string.share_page_info, manga.title, chapter.name, page.number)
message = getString(R.string.share_page_info, manga.title, chapter.name, page.number),
)
startActivity(Intent.createChooser(intent, getString(R.string.action_share)))
}
@@ -878,7 +878,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
Success -> R.string.cover_updated
AddToLibraryFirst -> R.string.notification_first_add_to_library
Error -> R.string.notification_cover_update_failed
}
},
)
}
@@ -925,12 +925,12 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
-1f, 0f, 0f, 0f, 255f,
0f, -1f, 0f, 0f, 255f,
0f, 0f, -1f, 0f, 255f,
0f, 0f, 0f, 1f, 0f
)
)
0f, 0f, 0f, 1f, 0f,
),
),
)
}
}
},
)
}
}
@@ -947,7 +947,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>() {
2 -> R.color.reader_background_dark
3 -> automaticBackgroundColor()
else -> android.R.color.black
}
},
)
}
.launchIn(lifecycleScope)

View File

@@ -225,7 +225,7 @@ class ReaderPresenter(
{ _, _ ->
// Ignore onNext event
},
ReaderActivity::setInitialChapterError
ReaderActivity::setInitialChapterError,
)
}
@@ -260,7 +260,7 @@ class ReaderPresenter(
{ _, _ ->
// Ignore onNext event
},
ReaderActivity::setInitialChapterError
ReaderActivity::setInitialChapterError,
)
}
@@ -283,9 +283,9 @@ class ReaderPresenter(
ViewerChapters(
chapter,
chapterList.getOrNull(chapterPos - 1),
chapterList.getOrNull(chapterPos + 1)
chapterList.getOrNull(chapterPos + 1),
)
}
},
)
.observeOn(AndroidSchedulers.mainThread())
.doOnNext { newChapters ->
@@ -336,7 +336,7 @@ class ReaderPresenter(
},
{ _, _ ->
// Ignore onError event, viewers handle that state
}
},
)
}
@@ -531,7 +531,7 @@ class ReaderPresenter(
view.setManga(manga)
view.setChapters(currChapters)
}
})
},)
}
/**
@@ -562,7 +562,7 @@ class ReaderPresenter(
if (currChapters != null) {
view.setOrientation(getMangaOrientationType())
}
})
},)
}
/**
@@ -575,7 +575,7 @@ class ReaderPresenter(
val chapter = page.chapter.chapter
val filenameSuffix = " - ${page.number}"
return DiskUtil.buildValidFilename(
"${manga.title} - ${chapter.name}".takeBytes(MAX_FILE_NAME_BYTES - filenameSuffix.byteSize())
"${manga.title} - ${chapter.name}".takeBytes(MAX_FILE_NAME_BYTES - filenameSuffix.byteSize()),
) + filenameSuffix
}
@@ -603,8 +603,8 @@ class ReaderPresenter(
image = Image.Page(
inputStream = page.stream!!,
name = filename,
location = Location.Pictures.create(relativePath)
)
location = Location.Pictures.create(relativePath),
),
)
launchUI {
notifier.onComplete(uri)
@@ -640,8 +640,8 @@ class ReaderPresenter(
image = Image.Page(
inputStream = page.stream!!,
name = filename,
location = Location.Cache
)
location = Location.Cache,
),
)
launchUI {
view!!.onShareImageResult(uri, page)
@@ -683,7 +683,7 @@ class ReaderPresenter(
.observeOn(AndroidSchedulers.mainThread())
.subscribeFirst(
{ view, result -> view.onSetAsCoverResult(result) },
{ view, _ -> view.onSetAsCoverResult(SetAsCoverResult.Error) }
{ view, _ -> view.onSetAsCoverResult(SetAsCoverResult.Error) },
)
}

View File

@@ -47,7 +47,7 @@ class SaveImageNotifier(private val context: Context) {
},
onError = {
onError(null)
}
},
)
.build()
context.imageLoader.enqueue(request)
@@ -69,13 +69,13 @@ class SaveImageNotifier(private val context: Context) {
addAction(
R.drawable.ic_share_24dp,
context.getString(R.string.action_share),
NotificationReceiver.shareImagePendingBroadcast(context, uri.path!!, notificationId)
NotificationReceiver.shareImagePendingBroadcast(context, uri.path!!, notificationId),
)
// Delete action
addAction(
R.drawable.ic_delete_24dp,
context.getString(R.string.action_delete),
NotificationReceiver.deleteImagePendingBroadcast(context, uri.path!!, notificationId)
NotificationReceiver.deleteImagePendingBroadcast(context, uri.path!!, notificationId),
)
updateNotification()

View File

@@ -49,7 +49,7 @@ class EpubPageLoader(file: File) : PageLoader() {
Page.ERROR
} else {
Page.READY
}
},
)
}
}

View File

@@ -54,7 +54,7 @@ class HttpPageLoader(
if (error !is InterruptedException) {
logcat(LogPriority.ERROR, error)
}
}
},
)
}

View File

@@ -63,7 +63,7 @@ class RarPageLoader(file: File) : PageLoader() {
Page.ERROR
} else {
Page.READY
}
},
)
}

View File

@@ -58,7 +58,7 @@ class ZipPageLoader(file: File) : PageLoader() {
Page.ERROR
} else {
Page.READY
}
},
)
}
}

View File

@@ -54,7 +54,7 @@ class ReaderSettingsSheet(
activity.setMenuVisibility(!isFilterTab)
}
}
})
},)
if (showColorFilterSettings) {
binding.tabs.getTabAt(filterTabIndex)?.select()
@@ -64,12 +64,12 @@ class ReaderSettingsSheet(
override fun getTabViews() = listOf(
readingModeSettings,
generalSettings,
colorFilterSettings
colorFilterSettings,
)
override fun getTabTitles() = listOf(
R.string.pref_category_reading_mode,
R.string.pref_category_general,
R.string.custom_filter
R.string.custom_filter,
)
}

View File

@@ -102,7 +102,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
override fun onImageLoadError(e: Exception) {
onImageLoadError()
}
}
},
)
}
}
@@ -123,7 +123,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
.withEasing(EASE_IN_OUT_QUAD)
.withInterruptible(true)
.start()
}, 500)
}, 500,)
}
}
@@ -233,7 +233,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
override fun onCenterChanged(newCenter: PointF?, origin: Int) {
// Not used
}
}
},
)
setOnClickListener { this@ReaderPageImageView.onViewClicked() }
}
@@ -271,7 +271,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
override fun onImageLoadError(e: Exception) {
this@ReaderPageImageView.onImageLoadError()
}
}
},
)
when (image) {
@@ -314,7 +314,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
this@ReaderPageImageView.onViewClicked()
return super.onSingleTapConfirmed(e)
}
}
},
)
setOnScaleChangeListener { _, _, _ ->
this@ReaderPageImageView.onScaleChanged(scale)
@@ -350,7 +350,7 @@ open class ReaderPageImageView @JvmOverloads constructor(
},
onError = {
this@ReaderPageImageView.onImageLoadError()
}
},
)
.crossfade(false)
.build()

View File

@@ -31,7 +31,7 @@ class ReaderProgressIndicator @JvmOverloads constructor(
Animation.RELATIVE_TO_SELF,
0.5F,
Animation.RELATIVE_TO_SELF,
0.5F
0.5F,
).apply {
interpolator = LinearInterpolator()
repeatCount = Animation.INFINITE

View File

@@ -24,7 +24,7 @@ abstract class ViewerNavigation {
fun invert(invertMode: PreferenceValues.TappingInvertMode): Region {
if (invertMode == PreferenceValues.TappingInvertMode.NONE) return this
return this.copy(
rectF = this.rectF.invert(invertMode)
rectF = this.rectF.invert(invertMode),
)
}
}

View File

@@ -18,15 +18,15 @@ class EdgeNavigation : ViewerNavigation() {
override var regions: List<Region> = listOf(
Region(
rectF = RectF(0f, 0f, 0.33f, 1f),
type = NavigationRegion.NEXT
type = NavigationRegion.NEXT,
),
Region(
rectF = RectF(0.33f, 0.66f, 0.66f, 1f),
type = NavigationRegion.PREV
type = NavigationRegion.PREV,
),
Region(
rectF = RectF(0.66f, 0f, 1f, 1f),
type = NavigationRegion.NEXT
)
type = NavigationRegion.NEXT,
),
)
}

View File

@@ -18,11 +18,11 @@ class KindlishNavigation : ViewerNavigation() {
override var regions: List<Region> = listOf(
Region(
rectF = RectF(0.33f, 0.33f, 1f, 1f),
type = NavigationRegion.NEXT
type = NavigationRegion.NEXT,
),
Region(
rectF = RectF(0f, 0.33f, 0.33f, 1f),
type = NavigationRegion.PREV
)
type = NavigationRegion.PREV,
),
)
}

View File

@@ -18,19 +18,19 @@ open class LNavigation : ViewerNavigation() {
override var regions: List<Region> = listOf(
Region(
rectF = RectF(0f, 0.33f, 0.33f, 0.66f),
type = NavigationRegion.PREV
type = NavigationRegion.PREV,
),
Region(
rectF = RectF(0f, 0f, 1f, 0.33f),
type = NavigationRegion.PREV
type = NavigationRegion.PREV,
),
Region(
rectF = RectF(0.66f, 0.33f, 1f, 0.66f),
type = NavigationRegion.NEXT
type = NavigationRegion.NEXT,
),
Region(
rectF = RectF(0f, 0.66f, 1f, 1f),
type = NavigationRegion.NEXT
)
type = NavigationRegion.NEXT,
),
)
}

View File

@@ -18,11 +18,11 @@ class RightAndLeftNavigation : ViewerNavigation() {
override var regions: List<Region> = listOf(
Region(
rectF = RectF(0f, 0f, 0.33f, 1f),
type = NavigationRegion.LEFT
type = NavigationRegion.LEFT,
),
Region(
rectF = RectF(0.66f, 0f, 1f, 1f),
type = NavigationRegion.RIGHT
)
type = NavigationRegion.RIGHT,
),
)
}

View File

@@ -55,7 +55,7 @@ class PagerConfig(
theme = it
automaticBackground = it == 3
},
{ imagePropertyChangedListener?.invoke() }
{ imagePropertyChangedListener?.invoke() },
)
preferences.imageScaleType()
@@ -89,7 +89,7 @@ class PagerConfig(
{
imagePropertyChangedListener?.invoke()
dualPageSplitChangedListener?.invoke(it)
}
},
)
preferences.dualPageInvertPaged()

View File

@@ -227,8 +227,8 @@ class PagerPageHolder(
minimumScaleType = viewer.config.imageScaleType,
cropBorders = viewer.config.imageCropBorders,
zoomStartPosition = viewer.config.imageZoomType,
landscapeZoom = viewer.config.landscapeZoom
)
landscapeZoom = viewer.config.landscapeZoom,
),
)
if (!isAnimated) {
pageBackground = background

View File

@@ -92,7 +92,7 @@ abstract class PagerViewer(val activity: ReaderActivity) : BaseViewer {
override fun onPageScrollStateChanged(state: Int) {
isIdle = state == ViewPager.SCROLL_STATE_IDLE
}
}
},
)
pager.tapListener = f@{ event ->
val pos = PointF(event.rawX / pager.width, event.rawY / pager.height)

View File

@@ -260,8 +260,8 @@ class WebtoonPageHolder(
ReaderPageImageView.Config(
zoomDuration = viewer.config.doubleTapAnimDuration,
minimumScaleType = SubsamplingScaleImageView.SCALE_TYPE_FIT_WIDTH,
cropBorders = viewer.config.imageCropBorders
)
cropBorders = viewer.config.imageCropBorders,
),
)
}
// Keep the Rx stream alive to close the input stream only when unsubscribed

View File

@@ -164,7 +164,7 @@ open class WebtoonRecyclerView @JvmOverloads constructor(
currentScale *= scaleFactor
currentScale = currentScale.coerceIn(
MIN_RATE,
MAX_SCALE_RATE
MAX_SCALE_RATE,
)
setScaleRate(currentScale)

View File

@@ -104,7 +104,7 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
}
}
}
}
},
)
recycler.tapListener = f@{ event ->
val pos = PointF(event.rawX / recycler.width, event.rawY / recycler.height)
@@ -344,7 +344,7 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
adapter.refresh()
adapter.notifyItemRangeChanged(
max(0, position - 3),
min(position + 3, adapter.itemCount - 1)
min(position + 3, adapter.itemCount - 1),
)
}
}

View File

@@ -30,7 +30,7 @@ class HistoryAdapter(controller: HistoryController) :
val decimalFormat = DecimalFormat(
"#.###",
DecimalFormatSymbols()
.apply { decimalSeparator = '.' }
.apply { decimalSeparator = '.' },
)
init {

View File

@@ -211,7 +211,7 @@ class HistoryController :
// Fixes problem with the overflow icon showing up in lieu of search
searchItem.fixExpand(
onExpand = { invalidateMenuOnExpand() }
onExpand = { invalidateMenuOnExpand() },
)
}

View File

@@ -58,7 +58,7 @@ class HistoryHolder(
binding.mangaSubtitle.text = itemView.context.getString(
R.string.recent_manga_time,
formattedNumber,
Date(history.last_read).toTimestampString()
Date(history.last_read).toTimestampString(),
)
} else {
binding.mangaSubtitle.text = Date(history.last_read).toTimestampString()

View File

@@ -47,7 +47,7 @@ class HistoryPresenter : BasePresenter<HistoryController>() {
{ view, mangas ->
view.onNextManga(mangas)
},
HistoryController::onAddPageError
HistoryController::onAddPageError,
)
}
@@ -96,7 +96,7 @@ class HistoryPresenter : BasePresenter<HistoryController>() {
{ view, mangas ->
view.onNextManga(mangas, true)
},
HistoryController::onAddPageError
HistoryController::onAddPageError,
)
}

View File

@@ -46,7 +46,7 @@ class UpdatesHolder(private val view: View, private val adapter: UpdatesAdapter)
} else {
binding.mangaTitle.setTextColor(adapter.unreadColor)
binding.chapterTitle.setTextColor(
if (item.bookmark) adapter.bookmarkedColor else adapter.unreadColorSecondary
if (item.bookmark) adapter.bookmarkedColor else adapter.unreadColorSecondary,
)
}

View File

@@ -55,7 +55,7 @@ class UpdatesPresenter : BasePresenter<UpdatesController>() {
},
{ _, error ->
logcat(LogPriority.ERROR, error)
}
},
)
downloadManager.queue.getProgressObservable()
@@ -180,7 +180,7 @@ class UpdatesPresenter : BasePresenter<UpdatesController>() {
{ view, _ ->
view.onChaptersDeleted()
},
UpdatesController::onChaptersDeletedError
UpdatesController::onChaptersDeletedError,
)
}

View File

@@ -42,7 +42,7 @@ class UnlockActivity : BaseActivity() {
preferences.lastAppUnlock().set(Date().time)
finish()
}
}
},
)
}
}

View File

@@ -169,14 +169,14 @@ class SettingsAdvancedController : SettingsController() {
"Cloudflare",
"Google",
"AdGuard",
"Quad9"
"Quad9",
)
entryValues = arrayOf(
"-1",
PREF_DOH_CLOUDFLARE.toString(),
PREF_DOH_GOOGLE.toString(),
PREF_DOH_ADGUARD.toString(),
PREF_DOH_QUAD9.toString()
PREF_DOH_QUAD9.toString(),
)
defaultValue = "-1"
summary = "%s"

View File

@@ -41,21 +41,21 @@ class SettingsAppearanceController : SettingsController() {
entriesRes = arrayOf(
R.string.theme_system,
R.string.theme_light,
R.string.theme_dark
R.string.theme_dark,
)
entryValues = arrayOf(
Values.ThemeMode.system.name,
Values.ThemeMode.light.name,
Values.ThemeMode.dark.name
Values.ThemeMode.dark.name,
)
} else {
entriesRes = arrayOf(
R.string.theme_light,
R.string.theme_dark
R.string.theme_dark,
)
entryValues = arrayOf(
Values.ThemeMode.light.name,
Values.ThemeMode.dark.name
Values.ThemeMode.dark.name,
)
}
@@ -103,7 +103,7 @@ class SettingsAppearanceController : SettingsController() {
entriesRes = arrayOf(
R.string.alignment_top,
R.string.alignment_center,
R.string.alignment_bottom
R.string.alignment_bottom,
)
entryValues = arrayOf("0", "1", "2")
summary = "%s"

View File

@@ -114,7 +114,7 @@ class SettingsBackupController : SettingsController() {
R.string.update_12hour,
R.string.update_24hour,
R.string.update_48hour,
R.string.update_weekly
R.string.update_weekly,
)
entryValues = arrayOf("0", "6", "12", "24", "48", "168")
summary = "%s"
@@ -228,7 +228,7 @@ class SettingsBackupController : SettingsController() {
R.string.categories,
R.string.chapters,
R.string.track,
R.string.history
R.string.history,
)
.map { activity.getString(it) }
val selected = options.map { true }.toBooleanArray()
@@ -264,7 +264,7 @@ class SettingsBackupController : SettingsController() {
class RestoreBackupDialog(bundle: Bundle? = null) : DialogController(bundle) {
constructor(uri: Uri) : this(
bundleOf(KEY_URI to uri)
bundleOf(KEY_URI to uri),
)
override fun onCreateDialog(savedViewState: Bundle?): Dialog {

View File

@@ -58,7 +58,7 @@ class SettingsBrowseController : SettingsController() {
requireAuthentication(
activity as? FragmentActivity,
context.getString(R.string.pref_category_nsfw_content),
context.getString(R.string.confirm_lock_change)
context.getString(R.string.confirm_lock_change),
)
}
}

View File

@@ -89,7 +89,7 @@ class SettingsDownloadController : SettingsController() {
R.string.second_to_last,
R.string.third_to_last,
R.string.fourth_to_last,
R.string.fifth_to_last
R.string.fifth_to_last,
)
entryValues = arrayOf("-1", "0", "1", "2", "3", "4")
defaultValue = "-1"
@@ -266,7 +266,7 @@ class SettingsDownloadController : SettingsController() {
.setQuadStateMultiChoiceItems(
message = R.string.pref_download_new_categories_details,
items = items,
initialSelected = selected
initialSelected = selected,
) { selections ->
selected = selections
}

View File

@@ -27,7 +27,7 @@ class SettingsGeneralController : SettingsController() {
R.string.label_library,
R.string.label_recent_updates,
R.string.label_recent_manga,
R.string.browse
R.string.browse,
)
entryValues = arrayOf("1", "3", "2", "4")
defaultValue = "1"

View File

@@ -145,7 +145,7 @@ class SettingsLibraryController : SettingsController() {
R.string.update_24hour,
R.string.update_48hour,
R.string.update_72hour,
R.string.update_weekly
R.string.update_weekly,
)
entryValues = arrayOf("0", "12", "24", "48", "72", "168")
summary = "%s"
@@ -357,7 +357,7 @@ class SettingsLibraryController : SettingsController() {
.setQuadStateMultiChoiceItems(
message = R.string.pref_library_update_categories_details,
items = items,
initialSelected = selected
initialSelected = selected,
) { selections ->
selected = selections
}

View File

@@ -111,7 +111,7 @@ class SettingsMainController : SettingsController() {
override fun onMenuItemActionCollapse(item: MenuItem?): Boolean {
return true
}
}
},
)
}
}

View File

@@ -32,7 +32,7 @@ class SettingsReaderController : SettingsController() {
R.string.right_to_left_viewer,
R.string.vertical_viewer,
R.string.webtoon_viewer,
R.string.vertical_plus_viewer
R.string.vertical_plus_viewer,
)
entryValues = ReadingModeType.values().drop(1)
.map { value -> "${value.flagValue}" }.toTypedArray()
@@ -81,7 +81,7 @@ class SettingsReaderController : SettingsController() {
R.string.rotation_reverse_portrait,
R.string.rotation_landscape,
R.string.rotation_force_portrait,
R.string.rotation_force_landscape
R.string.rotation_force_landscape,
)
entryValues = OrientationType.values().drop(1)
.map { value -> "${value.flagValue}" }.toTypedArray()
@@ -156,13 +156,13 @@ class SettingsReaderController : SettingsController() {
R.string.tapping_inverted_none,
R.string.tapping_inverted_horizontal,
R.string.tapping_inverted_vertical,
R.string.tapping_inverted_both
R.string.tapping_inverted_both,
)
entryValues = arrayOf(
TappingInvertMode.NONE.name,
TappingInvertMode.HORIZONTAL.name,
TappingInvertMode.VERTICAL.name,
TappingInvertMode.BOTH.name
TappingInvertMode.BOTH.name,
)
summary = "%s"
}
@@ -175,7 +175,7 @@ class SettingsReaderController : SettingsController() {
R.string.scale_type_fit_width,
R.string.scale_type_fit_height,
R.string.scale_type_original_size,
R.string.scale_type_smart_fit
R.string.scale_type_smart_fit,
)
entryValues = arrayOf("1", "2", "3", "4", "5", "6")
summary = "%s"
@@ -192,7 +192,7 @@ class SettingsReaderController : SettingsController() {
R.string.zoom_start_automatic,
R.string.zoom_start_left,
R.string.zoom_start_right,
R.string.zoom_start_center
R.string.zoom_start_center,
)
entryValues = arrayOf("1", "2", "3", "4")
summary = "%s"
@@ -235,13 +235,13 @@ class SettingsReaderController : SettingsController() {
R.string.tapping_inverted_none,
R.string.tapping_inverted_horizontal,
R.string.tapping_inverted_vertical,
R.string.tapping_inverted_both
R.string.tapping_inverted_both,
)
entryValues = arrayOf(
TappingInvertMode.NONE.name,
TappingInvertMode.HORIZONTAL.name,
TappingInvertMode.VERTICAL.name,
TappingInvertMode.BOTH.name
TappingInvertMode.BOTH.name,
)
summary = "%s"
}
@@ -254,7 +254,7 @@ class SettingsReaderController : SettingsController() {
R.string.webtoon_side_padding_10,
R.string.webtoon_side_padding_15,
R.string.webtoon_side_padding_20,
R.string.webtoon_side_padding_25
R.string.webtoon_side_padding_25,
)
entryValues = arrayOf("0", "5", "10", "15", "20", "25")
summary = "%s"
@@ -266,7 +266,7 @@ class SettingsReaderController : SettingsController() {
R.string.pref_highest,
R.string.pref_high,
R.string.pref_low,
R.string.pref_lowest
R.string.pref_lowest,
)
entryValues = PreferenceValues.ReaderHideThreshold.values()
.map { it.name }

View File

@@ -34,7 +34,7 @@ class SettingsSecurityController : SettingsController() {
requireAuthentication(
activity as? FragmentActivity,
context.getString(R.string.lock_with_biometrics),
context.getString(R.string.confirm_lock_change)
context.getString(R.string.confirm_lock_change),
)
}
@@ -74,7 +74,7 @@ class SettingsSecurityController : SettingsController() {
super.onAuthenticationError(activity, errorCode, errString)
activity?.toast(errString.toString())
}
}
},
)
false
}

View File

@@ -117,7 +117,7 @@ class SettingsTrackingController :
login()
}
}
}
},
)
}

View File

@@ -82,7 +82,7 @@ class SettingsSearchController :
router.popCurrentController()
return false
}
}
},
)
searchView.setOnQueryTextListener(
@@ -96,7 +96,7 @@ class SettingsSearchController :
setItems(getResultSet(newText))
return false
}
}
},
)
searchView.setQuery(presenter.preferences.lastSearchQuerySearchSettings().get(), true)

View File

@@ -39,7 +39,7 @@ object SettingsSearchHelper {
SettingsLibraryController::class,
SettingsReaderController::class,
SettingsSecurityController::class,
SettingsTrackingController::class
SettingsTrackingController::class,
)
/**
@@ -113,8 +113,8 @@ object SettingsSearchHelper {
title = title,
summary = summary,
breadcrumb = breadcrumbsStr,
searchController = ctrl
)
searchController = ctrl,
),
)
}
}

View File

@@ -27,8 +27,8 @@ abstract class BaseOAuthLoginActivity : BaseActivity() {
FrameLayout.LayoutParams(
ViewGroup.LayoutParams.WRAP_CONTENT,
ViewGroup.LayoutParams.WRAP_CONTENT,
Gravity.CENTER
)
Gravity.CENTER,
),
)
handleResult(intent.data)