Address spotless lint errors (#1138)
* Add spotless (with ktlint) * Run spotlessApply * screaming case screaming case screaming case * Update PagerViewerAdapter.kt * Update ReaderTransitionView.kt
This commit is contained in:
@@ -165,13 +165,19 @@ class ReaderViewModel @JvmOverloads constructor(
|
||||
(
|
||||
manga.downloadedFilterRaw == Manga.CHAPTER_SHOW_DOWNLOADED &&
|
||||
!downloadManager.isChapterDownloaded(
|
||||
it.name, it.scanlator, manga.title, manga.source,
|
||||
it.name,
|
||||
it.scanlator,
|
||||
manga.title,
|
||||
manga.source,
|
||||
)
|
||||
) ||
|
||||
(
|
||||
manga.downloadedFilterRaw == Manga.CHAPTER_SHOW_NOT_DOWNLOADED &&
|
||||
downloadManager.isChapterDownloaded(
|
||||
it.name, it.scanlator, manga.title, manga.source,
|
||||
it.name,
|
||||
it.scanlator,
|
||||
manga.title,
|
||||
manga.source,
|
||||
)
|
||||
) ||
|
||||
(manga.bookmarkedFilterRaw == Manga.CHAPTER_SHOW_BOOKMARKED && !it.bookmark) ||
|
||||
|
||||
@@ -142,7 +142,7 @@ class ReaderPreferences(
|
||||
enum class FlashColor {
|
||||
BLACK,
|
||||
WHITE,
|
||||
WHITE_BLACK
|
||||
WHITE_BLACK,
|
||||
}
|
||||
|
||||
enum class TappingInvertMode(
|
||||
|
||||
@@ -404,7 +404,9 @@ open class ReaderPageImageView @JvmOverloads constructor(
|
||||
)
|
||||
|
||||
enum class ZoomStartPosition {
|
||||
LEFT, CENTER, RIGHT
|
||||
LEFT,
|
||||
CENTER,
|
||||
RIGHT,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,15 +32,16 @@ class ReaderTransitionView @JvmOverloads constructor(context: Context, attrs: At
|
||||
Data(
|
||||
transition = transition,
|
||||
currChapterDownloaded = transition.from.pageLoader?.isLocal == true,
|
||||
goingToChapterDownloaded = manga.isLocal() || transition.to?.chapter?.let { goingToChapter ->
|
||||
downloadManager.isChapterDownloaded(
|
||||
chapterName = goingToChapter.name,
|
||||
chapterScanlator = goingToChapter.scanlator,
|
||||
mangaTitle = manga.title,
|
||||
sourceId = manga.source,
|
||||
skipCache = true,
|
||||
)
|
||||
} ?: false,
|
||||
goingToChapterDownloaded = manga.isLocal() ||
|
||||
transition.to?.chapter?.let { goingToChapter ->
|
||||
downloadManager.isChapterDownloaded(
|
||||
chapterName = goingToChapter.name,
|
||||
chapterScanlator = goingToChapter.scanlator,
|
||||
mangaTitle = manga.title,
|
||||
sourceId = manga.source,
|
||||
skipCache = true,
|
||||
)
|
||||
} ?: false,
|
||||
)
|
||||
} else {
|
||||
null
|
||||
|
||||
@@ -92,7 +92,9 @@ class PagerViewerAdapter(private val viewer: PagerViewer) : ViewPagerAdapter() {
|
||||
// Add next chapter transition and pages.
|
||||
nextTransition = ChapterTransition.Next(chapters.currChapter, chapters.nextChapter)
|
||||
.also {
|
||||
if (nextHasMissingChapters || forceTransition ||
|
||||
if (
|
||||
nextHasMissingChapters ||
|
||||
forceTransition ||
|
||||
chapters.nextChapter?.state !is ReaderChapter.State.Loaded
|
||||
) {
|
||||
newItems.add(it)
|
||||
|
||||
@@ -82,7 +82,7 @@ class WebtoonConfig(
|
||||
readerPreferences.webtoonDisableZoomOut()
|
||||
.register(
|
||||
{ zoomOutDisabled = it },
|
||||
{ zoomPropertyChangedListener?.invoke(it) }
|
||||
{ zoomPropertyChangedListener?.invoke(it) },
|
||||
)
|
||||
|
||||
readerPreferences.webtoonDoubleTapZoomEnabled()
|
||||
|
||||
+5
-1
@@ -182,7 +182,11 @@ class WebtoonRecyclerView @JvmOverloads constructor(
|
||||
|
||||
setScaleRate(currentScale)
|
||||
|
||||
layoutParams.height = if (currentScale < 1) { (originalHeight / currentScale).toInt() } else { originalHeight }
|
||||
layoutParams.height = if (currentScale < 1) {
|
||||
(originalHeight / currentScale).toInt()
|
||||
} else {
|
||||
originalHeight
|
||||
}
|
||||
halfHeight = layoutParams.height / 2
|
||||
|
||||
if (currentScale != DEFAULT_RATE) {
|
||||
|
||||
@@ -79,7 +79,7 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
|
||||
.threshold
|
||||
|
||||
init {
|
||||
recycler.setItemViewCacheSize(RecyclerViewCacheSize)
|
||||
recycler.setItemViewCacheSize(RECYCLER_VIEW_CACHE_SIZE)
|
||||
recycler.isVisible = false // Don't let the recycler layout yet
|
||||
recycler.layoutParams = ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT)
|
||||
recycler.isFocusable = false
|
||||
@@ -362,4 +362,4 @@ class WebtoonViewer(val activity: ReaderActivity, val isContinuous: Boolean = tr
|
||||
}
|
||||
|
||||
// Double the cache size to reduce rebinds/recycles incurred by the extra layout space on scroll direction changes
|
||||
private const val RecyclerViewCacheSize = 4
|
||||
private const val RECYCLER_VIEW_CACHE_SIZE = 4
|
||||
|
||||
Reference in New Issue
Block a user