Apply Spotless formatting to Java and Kotlin files

This commit is contained in:
世界
2026-01-17 16:58:26 +08:00
parent 3c9ab19466
commit 9c820a3400
170 changed files with 4496 additions and 5318 deletions

View File

@@ -102,13 +102,7 @@ class MLKitQRCodeAnalyzer(
}
}
private fun tryInvertedScan(
yData: ByteArray,
width: Int,
height: Int,
rotationDegrees: Int,
onComplete: () -> Unit,
) {
private fun tryInvertedScan(yData: ByteArray, width: Int, height: Int, rotationDegrees: Int, onComplete: () -> Unit) {
val inverted = toLumaBitmap(yData, width, 0, 0, width, height, invert = true)
barcodeScanner.process(InputImage.fromBitmap(inverted, rotationDegrees))
.addOnSuccessListener { codes ->
@@ -140,15 +134,7 @@ class MLKitQRCodeAnalyzer(
return yData
}
private fun toLumaBitmap(
yData: ByteArray,
srcWidth: Int,
left: Int,
top: Int,
width: Int,
height: Int,
invert: Boolean,
): Bitmap {
private fun toLumaBitmap(yData: ByteArray, srcWidth: Int, left: Int, top: Int, width: Int, height: Int, invert: Boolean): Bitmap {
val size = width * height
val pixels = pixelBuffer?.takeIf { it.size >= size } ?: IntArray(size).also { pixelBuffer = it }

View File

@@ -19,10 +19,7 @@ import io.nekohasekai.sfa.update.UpdateState
object Vendor : VendorInterface {
private const val TAG = "Vendor"
override fun checkUpdate(
activity: Activity,
byUser: Boolean,
) {
override fun checkUpdate(activity: Activity, byUser: Boolean) {
val appUpdateManager = AppUpdateManagerFactory.create(activity)
val appUpdateInfoTask = appUpdateManager.appUpdateInfo
appUpdateInfoTask.addOnSuccessListener { appUpdateInfo ->
@@ -95,11 +92,7 @@ object Vendor : VendorInterface {
}
}
override fun supportsTrackSelection(): Boolean {
return false
}
override fun supportsTrackSelection(): Boolean = false
override fun checkUpdateAsync(): UpdateInfo? {
return null
}
override fun checkUpdateAsync(): UpdateInfo? = null
}