From b13ee880ec251a4280c67182aa04697afef2053f Mon Sep 17 00:00:00 2001 From: Levin Li Date: Sat, 20 Aug 2022 14:04:19 +0800 Subject: [PATCH] Bump build --- app/src/main/AndroidManifest.xml | 2 +- .../browser/BrowserCommonRecyclerViewAdapter.kt | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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 }