feat: refine gallery image loading and system tab support
This commit is contained in:
1 parent
88db5dd1a5
commit
7cb11f88eb
2 files changed
+6
-4
No files matched your search
@@ -512,7 +512,7 @@ fun GalleryDetailScreen(
|
||||
ZoomableImage(
|
||||
photo = photo,
|
||||
colorSpace = currentColorSpace,
|
||||
showOrigin = showOrigin,
|
||||
showOrigin = showOrigin || viewModel.selectedTab == GalleryTab.SYSTEM,
|
||||
isActive = page == pagerState.currentPage,
|
||||
viewModel = viewModel,
|
||||
onZoomChange = { zoomed ->
|
||||
|
||||
@@ -2024,10 +2024,12 @@ class GalleryViewModel(application: Application) : AndroidViewModel(application)
|
||||
return@withContext cached
|
||||
}
|
||||
|
||||
val isSystem = selectedTab == GalleryTab.SYSTEM
|
||||
|
||||
// 2. 原始底图缓存(按 maxEdge 加载,快速预览走小尺寸,正式预览走高分辨率)
|
||||
val currentBitmap = bitmap ?: if (showOrigin) {
|
||||
GalleryManager.loadOriginalBitmap(context, photo.id, maxEdge)
|
||||
?: if (selectedTab == GalleryTab.SYSTEM) GalleryManager.loadBitmap(context, photo.uri, maxEdge) else null
|
||||
GalleryManager.loadOriginalBitmap(context, photo.id, maxEdge, isSystem)
|
||||
?: if (isSystem) GalleryManager.loadBitmap(context, photo.uri, maxEdge, isSystem) else null
|
||||
} else {
|
||||
val bokehFile = GalleryManager.getBokehFile(context, photo.id)
|
||||
when {
|
||||
@@ -2038,7 +2040,7 @@ class GalleryViewModel(application: Application) : AndroidViewModel(application)
|
||||
maxEdge
|
||||
)
|
||||
else -> GalleryManager.loadOriginalBitmap(context, photo.id, maxEdge)
|
||||
} ?: if (selectedTab == GalleryTab.SYSTEM) GalleryManager.loadBitmap(context, photo.uri, maxEdge) else null
|
||||
} ?: if (isSystem) GalleryManager.loadBitmap(context, photo.uri, maxEdge) else null
|
||||
} ?: return@withContext null
|
||||
|
||||
// 只在全分辨率路径下缓存原始底图(避免低分辨率污染 origin 缓存)
|
||||
|
||||
Reference in new issue
Block a user