Formatting
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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) }
|
||||
|
||||
@@ -29,7 +29,7 @@ class ChaptersAdapter(
|
||||
val decimalFormat = DecimalFormat(
|
||||
"#.###",
|
||||
DecimalFormatSymbols()
|
||||
.apply { decimalSeparator = '.' }
|
||||
.apply { decimalSeparator = '.' },
|
||||
)
|
||||
|
||||
val relativeTime: Int = preferences.relativeTime().get()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -36,7 +36,7 @@ open class BaseChapterHolder(
|
||||
} else {
|
||||
adapter.clickListener.deleteChapter(position)
|
||||
}
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,8 +107,8 @@ class MangaFullCoverDialog : DialogController {
|
||||
binding?.container?.setImage(
|
||||
it,
|
||||
ReaderPageImageView.Config(
|
||||
zoomDuration = 500
|
||||
)
|
||||
zoomDuration = 500,
|
||||
),
|
||||
)
|
||||
}
|
||||
.build()
|
||||
|
||||
@@ -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!!)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user