Minor cleanup

(cherry picked from commit 1b3d76398baa785196817faf3f99355b0e0ca854)
This commit is contained in:
Jobobby04 2024-12-08 15:18:51 -05:00 committed by Cuong-Tran
parent a3ef057e15
commit 76496daa75
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
3 changed files with 6 additions and 5 deletions

View file

@ -21,9 +21,7 @@ internal fun LibraryTabs(
getNumberOfMangaForCategory: (Category) -> Int?, getNumberOfMangaForCategory: (Category) -> Int?,
onTabItemClick: (Int) -> Unit, onTabItemClick: (Int) -> Unit,
) { ) {
// SY -->
val currentPageIndex = pagerState.currentPage.coerceAtMost(categories.lastIndex) val currentPageIndex = pagerState.currentPage.coerceAtMost(categories.lastIndex)
// SY <--
Column( Column(
modifier = Modifier.zIndex(1f), modifier = Modifier.zIndex(1f),
) { ) {

View file

@ -66,7 +66,10 @@ class TachiyomiImageDecoder(private val resources: ImageSource, private val opti
check(bitmap != null) { "Failed to decode image" } check(bitmap != null) { "Failed to decode image" }
if (options.bitmapConfig == Bitmap.Config.HARDWARE && ImageUtil.canUseHardwareBitmap(bitmap)) { if (
options.bitmapConfig == Bitmap.Config.HARDWARE &&
ImageUtil.canUseHardwareBitmap(bitmap)
) {
val hwBitmap = bitmap.copy(Bitmap.Config.HARDWARE, false) val hwBitmap = bitmap.copy(Bitmap.Config.HARDWARE, false)
if (hwBitmap != null) { if (hwBitmap != null) {
bitmap.recycle() bitmap.recycle()

View file

@ -92,7 +92,7 @@ class MemAutoFlushingLookupTable<T>(
val size = bb.getInt(4) val size = bb.getInt(4)
val strBArr = ByteArray(size) val strBArr = ByteArray(size)
if (!input.requireBytes(strBArr, size)) break if (!input.requireBytes(strBArr, size)) break
table.put(k, serializer.read(strBArr.toString(Charsets.UTF_8))) table.put(k, serializer.read(strBArr.decodeToString()))
} }
} }
} catch (e: FileNotFoundException) { } catch (e: FileNotFoundException) {
@ -131,7 +131,7 @@ class MemAutoFlushingLookupTable<T>(
try { try {
val out = fos.sink().buffer() val out = fos.sink().buffer()
table.forEach { key, value -> table.forEach { key, value ->
val v = serializer.write(value).toByteArray(Charsets.UTF_8) val v = serializer.write(value).encodeToByteArray()
bb.putInt(0, key) bb.putInt(0, key)
bb.putInt(4, v.size) bb.putInt(4, v.size)
out.write(bb.array()) out.write(bb.array())