diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index d1abe686..69628481 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -13,7 +13,7 @@ diff --git a/app/src/main/java/space/celestia/mobilecelestia/browser/BrowserCommonRecyclerViewAdapter.kt b/app/src/main/java/space/celestia/mobilecelestia/browser/BrowserCommonRecyclerViewAdapter.kt index 1a1d4efc..724338a3 100644 --- a/app/src/main/java/space/celestia/mobilecelestia/browser/BrowserCommonRecyclerViewAdapter.kt +++ b/app/src/main/java/space/celestia/mobilecelestia/browser/BrowserCommonRecyclerViewAdapter.kt @@ -20,15 +20,21 @@ import space.celestia.mobilecelestia.common.CommonTextViewHolder import space.celestia.mobilecelestia.common.RecyclerViewItem import space.celestia.mobilecelestia.common.SeparatorHeaderRecyclerViewAdapter import space.celestia.celestia.BrowserItem +import space.celestia.mobilecelestia.utils.CelestiaString fun BrowserItem.createSection(): List { val list = ArrayList() + var hasMainObject = false if (`object` != null) { val section = CommonSectionV2(listOf( BrowserUIItem(this, true) )) list.add(section) + hasMainObject = true + } + val childItems = children.map { BrowserUIItem(it, it.children.size == 0) } + if (childItems.isNotEmpty()) { + list.add(CommonSectionV2(header = if (hasMainObject) CelestiaString("Subsystem", "") else null, items = childItems)) } - list.add(CommonSectionV2(children.map { BrowserUIItem(it, it.children.size == 0) })) return list }