Update: Screenshots on top of product's fragment (touches on #10)

This commit is contained in:
machiav3lli 2021-10-20 00:46:01 +02:00
parent 4c75a64927
commit a25fca1216

View File

@ -699,6 +699,18 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
return if (length >= 0) subSequence(0, length) else null return if (length >= 0) subSequence(0, length) else null
} }
val screenshotItems = productRepository.first.screenshots
.map { Item.ScreenshotItem(productRepository.second, packageName, it) }
if (screenshotItems.isNotEmpty()) {
items += Item.SectionItem(
SectionType.SCREENSHOTS,
ExpandType.SCREENSHOTS,
emptyList(),
screenshotItems.size
)
items += screenshotItems
}
val description = formatHtml(productRepository.first.description).apply { val description = formatHtml(productRepository.first.description).apply {
if (productRepository.first.let { it.summary.isNotEmpty() && it.name != it.summary }) { if (productRepository.first.let { it.summary.isNotEmpty() && it.name != it.summary }) {
if (isNotEmpty()) { if (isNotEmpty()) {
@ -878,19 +890,6 @@ class ProductAdapter(private val callbacks: Callbacks, private val columns: Int)
} }
} }
} }
val screenshotItems = productRepository.first.screenshots
.map { Item.ScreenshotItem(productRepository.second, packageName, it) }
if (screenshotItems.isNotEmpty()) {
items += Item.SectionItem(
SectionType.SCREENSHOTS,
ExpandType.SCREENSHOTS,
emptyList(),
screenshotItems.size
)
items += screenshotItems
}
} }
val incompatible = Preferences[Preferences.Key.IncompatibleVersions] val incompatible = Preferences[Preferences.Key.IncompatibleVersions]