Implement Mihon's spotless PR (#1257)
* Remove detekt (mihonapp/mihon#1130) Annoying. More annoying in this project. (cherry picked from commit 777ae2461e1eb277a3aa0c998ff69e4f100387a1) * Add spotless (with ktlint) (mihonapp/mihon#1136) (cherry picked from commit 5ae8095ef1ed2ae9f98486f9148e933c77a28692) * Address spotless lint errors (mihonapp/mihon#1138) * Add spotless (with ktlint) * Run spotlessApply * screaming case screaming case screaming case * Update PagerViewerAdapter.kt * Update ReaderTransitionView.kt (cherry picked from commit d6252ab7703d52ecf9f43de3ee36fd63e665a31f) * Generate locales_config.xml in build dir (cherry picked from commit ac41bffdc97b4cfed923de6b9e8e01cccf3eb6eb) * Address more spotless lint errors in SY * some more missed * more missed * still missing, not sure while it won't report error when running locally * one more * more * more * correct comment --------- Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest />
|
||||
<manifest />
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
@file:Suppress("FunctionName", "ktlint:standard:function-naming")
|
||||
|
||||
package eu.kanade.tachiyomi.network
|
||||
|
||||
import okhttp3.CacheControl
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package exh.util
|
||||
|
||||
operator fun StringBuilder.plusAssign(other: String) { append(other) }
|
||||
operator fun StringBuilder.plusAssign(other: String) {
|
||||
append(other)
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ class ArchiveInputStream(
|
||||
name,
|
||||
isFile,
|
||||
// SY -->
|
||||
isEncrypted
|
||||
isEncrypted,
|
||||
// SY <--
|
||||
)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class ZipWriter(
|
||||
private val entry = ArchiveEntry.new2(archive)
|
||||
private val buffer = ByteBuffer.allocateDirect(
|
||||
// SY -->
|
||||
BUFFER_SIZE
|
||||
BUFFER_SIZE,
|
||||
// SY <--
|
||||
)
|
||||
|
||||
|
||||
@@ -210,8 +210,11 @@ object ImageUtil {
|
||||
* new image with added center padding scaled relative to the height of the display view
|
||||
* to compensate for scaling.
|
||||
*/
|
||||
|
||||
fun addHorizontalCenterMargin(imageSource: BufferedSource, viewHeight: Int, backgroundContext: Context): BufferedSource {
|
||||
fun addHorizontalCenterMargin(
|
||||
imageSource: BufferedSource,
|
||||
viewHeight: Int,
|
||||
backgroundContext: Context,
|
||||
): BufferedSource {
|
||||
val imageBitmap = ImageDecoder.newInstance(imageSource.inputStream())?.decode()!!
|
||||
val height = imageBitmap.height
|
||||
val width = imageBitmap.width
|
||||
@@ -547,16 +550,20 @@ object ImageUtil {
|
||||
darkBG -> {
|
||||
return ColorDrawable(blackColor)
|
||||
}
|
||||
topIsBlackStreak || (
|
||||
topCornersIsDark && topOffsetCornersIsDark &&
|
||||
(topMidIsDark || overallBlackPixels > 9)
|
||||
) -> {
|
||||
topIsBlackStreak ||
|
||||
(
|
||||
topCornersIsDark &&
|
||||
topOffsetCornersIsDark &&
|
||||
(topMidIsDark || overallBlackPixels > 9)
|
||||
) -> {
|
||||
intArrayOf(blackColor, blackColor, whiteColor, whiteColor)
|
||||
}
|
||||
bottomIsBlackStreak || (
|
||||
botCornersIsDark && botOffsetCornersIsDark &&
|
||||
(bottomCenterPixel.isDark() || overallBlackPixels > 9)
|
||||
) -> {
|
||||
bottomIsBlackStreak ||
|
||||
(
|
||||
botCornersIsDark &&
|
||||
botOffsetCornersIsDark &&
|
||||
(bottomCenterPixel.isDark() || overallBlackPixels > 9)
|
||||
) -> {
|
||||
intArrayOf(whiteColor, whiteColor, blackColor, blackColor)
|
||||
}
|
||||
else -> {
|
||||
@@ -616,6 +623,7 @@ object ImageUtil {
|
||||
|
||||
private val optimalImageHeight = getDisplayMaxHeightInPx * 2
|
||||
|
||||
// SY -->
|
||||
fun mergeBitmaps(
|
||||
imageBitmap: Bitmap,
|
||||
imageBitmap2: Bitmap,
|
||||
@@ -661,6 +669,7 @@ object ImageUtil {
|
||||
|
||||
private val Bitmap.rect: Rect
|
||||
get() = Rect(0, 0, width, height)
|
||||
// SY <--
|
||||
}
|
||||
|
||||
val getDisplayMaxHeightInPx: Int
|
||||
|
||||
Reference in New Issue
Block a user