Minor cleanup
(cherry picked from commit 1b3d76398baa785196817faf3f99355b0e0ca854)
This commit is contained in:
parent
a3ef057e15
commit
76496daa75
3 changed files with 6 additions and 5 deletions
|
|
@ -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),
|
||||||
) {
|
) {
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
|
|
@ -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())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue