fix: retain displayed bitmaps until rendering ends

This commit is contained in:
Kurt Himebauch committed 2026-11-08 01:47:54 -05:00
1 parent 97c6229e85
commit a0cd5b0cad
3 files changed
+1 -3

No files matched your search

@@ -45,7 +45,6 @@ internal fun InputCommunityPage(library: InputLibrary, profile: String, initialR
val pageCount = ((filtered.size + 11) / 12).coerceAtLeast(1)
val pageEntries = filtered.drop(page * 12).take(12)
val previews = remember(selectedSource.id, pageEntries) { mutableStateMapOf<String, android.graphics.Bitmap>() }
DisposableEffect(previews, selectedSource.id, pageEntries) { onDispose { previews.values.forEach { it.recycle() } } }
LaunchedEffect(previews, pageEntries) {
for (entry in pageEntries) {
if (entry.preview == null || entry.key in previews) continue
@@ -39,7 +39,6 @@ internal fun InputLayoutRow(layout: SavedInputLayout, role: InputRole, detail: S
internal fun InputLayoutThumbnail(layout: SavedInputLayout, role: InputRole, images: Map<String, ByteArray> = emptyMap(),
modifier: Modifier = Modifier.width(112.dp).height(76.dp)) {
val bitmaps = remember(images) { images.mapValues { (_, bytes) -> android.graphics.BitmapFactory.decodeByteArray(bytes, 0, bytes.size) } }
DisposableEffect(bitmaps) { onDispose { bitmaps.values.forEach { it?.recycle() } } }
key(bitmaps) {
AndroidView(factory = { InputLayoutPreviewView(it, bitmaps.filterValues { it != null }.mapValues { it.value!! }) },
modifier = modifier.testTag("layout-preview-${layout.id}"), update = { it.update(layout, role) })
+1 -1
View File
@@ -4,7 +4,7 @@ Controller settings → Community controls browses source catalogs and imports o
## Sources and sharing
The Source selector includes DroidDeck and [bagasromadon/ARMSX2-CustomControllerSkins](https://github.com/bagasromadon/ARMSX2-CustomControllerSkins). **Connect another source** accepts a public GitHub repository URL, a GitHub manifest file link, or a direct HTTPS catalog URL. Repository URLs try `main/catalog.json`, then `main/manifest.json`; use a file URL for another branch or a catalog in a subdirectory. Connected sources persist locally and can be removed. Results are filtered before pagination, with at most 12 entries and their previews loaded per page. Previews are sampled to at most 256 pixels and released when changing page, filters, or source. Native manifests use `controls`; ARMSX2 manifests use `skins`. Relative paths stay within the manifest directory, with spaces encoded when downloading. No account credentials are stored in DroidDeck.
The Source selector includes DroidDeck and [bagasromadon/ARMSX2-CustomControllerSkins](https://github.com/bagasromadon/ARMSX2-CustomControllerSkins). **Connect another source** accepts a public GitHub repository URL, a GitHub manifest file link, or a direct HTTPS catalog URL. Repository URLs try `main/catalog.json`, then `main/manifest.json`; use a file URL for another branch or a catalog in a subdirectory. Connected sources persist locally and can be removed. Results are filtered before pagination, with at most 12 entries and their previews loaded per page. Previews are sampled to at most 256 pixels. Page/filter/source changes discard the old cache; Android reclaims displayed bitmaps after rendering references are released. Native manifests use `controls`; ARMSX2 manifests use `skins`. Relative paths stay within the manifest directory, with spaces encoded when downloading. No account credentials are stored in DroidDeck.
**Export this layout and actions** creates a portable DroidDeck pack. **Export skin artwork** creates an ARMSX2-compatible PNG-only ZIP when the selected layout has suitable artwork. Share either ZIP directly, or use **Open source submissions** to visit the selected source's issue page and attach it there. GitHub requires an account. Source owners manage submissions and publication; the app does not automatically publish uploads. For other HTTPS hosts, the button opens the catalog URL; use that host's own upload process. A native controls pack includes layouts and bindings, while an artwork ZIP includes only controller images.