mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-08 00:39:54 +00:00
Update: Make info blocks in AppSheet expandable
This commit is contained in:
parent
db5b22f5cf
commit
a09692884e
@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@ -65,6 +64,7 @@ import com.looker.droidify.screen.ScreenshotsFragment
|
||||
import com.looker.droidify.service.Connection
|
||||
import com.looker.droidify.service.DownloadService
|
||||
import com.looker.droidify.ui.activities.MainActivityX
|
||||
import com.looker.droidify.ui.compose.components.ExpandableBlock
|
||||
import com.looker.droidify.ui.compose.components.ScreenshotItem
|
||||
import com.looker.droidify.ui.compose.components.ScreenshotList
|
||||
import com.looker.droidify.ui.compose.components.SwitchPreference
|
||||
@ -562,10 +562,11 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
||||
item {
|
||||
val links = product.generateLinks(requireContext())
|
||||
if (links.isNotEmpty()) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.links),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
ExpandableBlock(
|
||||
heading = stringResource(id = R.string.links),
|
||||
positive = true,
|
||||
preExpanded = true
|
||||
) {
|
||||
links.forEach { link ->
|
||||
LinkItem(
|
||||
linkType = link,
|
||||
@ -580,12 +581,14 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
item {
|
||||
if (product.donates.isNotEmpty()) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.donate),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
ExpandableBlock(
|
||||
heading = stringResource(id = R.string.donate),
|
||||
positive = true,
|
||||
preExpanded = false
|
||||
) {
|
||||
product.donates.forEach {
|
||||
LinkItem(linkType = DonateType(it, requireContext()),
|
||||
onClick = { link ->
|
||||
@ -601,6 +604,7 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
item {
|
||||
product.displayRelease?.generatePermissionGroups(requireContext())
|
||||
?.let { list ->
|
||||
@ -630,10 +634,11 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
||||
}
|
||||
item {
|
||||
if (product.antiFeatures.isNotEmpty()) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.anti_features),
|
||||
color = MaterialTheme.colorScheme.secondary
|
||||
)
|
||||
ExpandableBlock(
|
||||
heading = stringResource(id = R.string.anti_features),
|
||||
positive = false,
|
||||
preExpanded = false
|
||||
) {
|
||||
Text(
|
||||
text = product.antiFeatures.map { af ->
|
||||
val titleId =
|
||||
@ -645,15 +650,18 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
item {
|
||||
if (product.whatsNew.isNotEmpty()) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.changes),
|
||||
color = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
ExpandableBlock(
|
||||
heading = stringResource(id = R.string.changes),
|
||||
positive = true,
|
||||
preExpanded = true
|
||||
) {
|
||||
HtmlTextBlock(description = product.whatsNew)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
items(items = releaseItems) {
|
||||
ReleaseItem(
|
||||
|
Loading…
x
Reference in New Issue
Block a user