mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +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.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||||
import androidx.compose.material3.MaterialTheme
|
|
||||||
import androidx.compose.material3.Scaffold
|
import androidx.compose.material3.Scaffold
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
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.Connection
|
||||||
import com.looker.droidify.service.DownloadService
|
import com.looker.droidify.service.DownloadService
|
||||||
import com.looker.droidify.ui.activities.MainActivityX
|
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.ScreenshotItem
|
||||||
import com.looker.droidify.ui.compose.components.ScreenshotList
|
import com.looker.droidify.ui.compose.components.ScreenshotList
|
||||||
import com.looker.droidify.ui.compose.components.SwitchPreference
|
import com.looker.droidify.ui.compose.components.SwitchPreference
|
||||||
@ -562,42 +562,46 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
|||||||
item {
|
item {
|
||||||
val links = product.generateLinks(requireContext())
|
val links = product.generateLinks(requireContext())
|
||||||
if (links.isNotEmpty()) {
|
if (links.isNotEmpty()) {
|
||||||
Text(
|
ExpandableBlock(
|
||||||
text = stringResource(id = R.string.links),
|
heading = stringResource(id = R.string.links),
|
||||||
color = MaterialTheme.colorScheme.primary
|
positive = true,
|
||||||
)
|
preExpanded = true
|
||||||
links.forEach { link ->
|
) {
|
||||||
LinkItem(
|
links.forEach { link ->
|
||||||
linkType = link,
|
LinkItem(
|
||||||
onClick = { it?.let { onUriClick(it, true) } },
|
linkType = link,
|
||||||
onLongClick = { link ->
|
onClick = { it?.let { onUriClick(it, true) } },
|
||||||
copyLinkToClipboard(
|
onLongClick = { link ->
|
||||||
requireActivity().window.decorView.rootView,
|
copyLinkToClipboard(
|
||||||
link.toString()
|
requireActivity().window.decorView.rootView,
|
||||||
)
|
link.toString()
|
||||||
}
|
)
|
||||||
)
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item {
|
item {
|
||||||
if (product.donates.isNotEmpty()) {
|
if (product.donates.isNotEmpty()) {
|
||||||
Text(
|
ExpandableBlock(
|
||||||
text = stringResource(id = R.string.donate),
|
heading = stringResource(id = R.string.donate),
|
||||||
color = MaterialTheme.colorScheme.primary
|
positive = true,
|
||||||
)
|
preExpanded = false
|
||||||
product.donates.forEach {
|
) {
|
||||||
LinkItem(linkType = DonateType(it, requireContext()),
|
product.donates.forEach {
|
||||||
onClick = { link ->
|
LinkItem(linkType = DonateType(it, requireContext()),
|
||||||
link?.let { onUriClick(it, true) }
|
onClick = { link ->
|
||||||
},
|
link?.let { onUriClick(it, true) }
|
||||||
onLongClick = { link ->
|
},
|
||||||
copyLinkToClipboard(
|
onLongClick = { link ->
|
||||||
requireActivity().window.decorView.rootView,
|
copyLinkToClipboard(
|
||||||
link.toString()
|
requireActivity().window.decorView.rootView,
|
||||||
)
|
link.toString()
|
||||||
}
|
)
|
||||||
)
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -630,28 +634,32 @@ class AppSheetX() : FullscreenBottomSheetDialogFragment(), Callbacks {
|
|||||||
}
|
}
|
||||||
item {
|
item {
|
||||||
if (product.antiFeatures.isNotEmpty()) {
|
if (product.antiFeatures.isNotEmpty()) {
|
||||||
Text(
|
ExpandableBlock(
|
||||||
text = stringResource(id = R.string.anti_features),
|
heading = stringResource(id = R.string.anti_features),
|
||||||
color = MaterialTheme.colorScheme.secondary
|
positive = false,
|
||||||
)
|
preExpanded = false
|
||||||
Text(
|
) {
|
||||||
text = product.antiFeatures.map { af ->
|
Text(
|
||||||
val titleId =
|
text = product.antiFeatures.map { af ->
|
||||||
AntiFeature.values().find { it.key == af }?.titleResId
|
val titleId =
|
||||||
if (titleId != null) stringResource(id = titleId)
|
AntiFeature.values().find { it.key == af }?.titleResId
|
||||||
else stringResource(id = R.string.unknown_FORMAT, af)
|
if (titleId != null) stringResource(id = titleId)
|
||||||
}
|
else stringResource(id = R.string.unknown_FORMAT, af)
|
||||||
.joinToString(separator = "\n") { "\u2022 $it" }
|
}
|
||||||
)
|
.joinToString(separator = "\n") { "\u2022 $it" }
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
item {
|
item {
|
||||||
if (product.whatsNew.isNotEmpty()) {
|
if (product.whatsNew.isNotEmpty()) {
|
||||||
Text(
|
ExpandableBlock(
|
||||||
text = stringResource(id = R.string.changes),
|
heading = stringResource(id = R.string.changes),
|
||||||
color = MaterialTheme.colorScheme.primary
|
positive = true,
|
||||||
)
|
preExpanded = true
|
||||||
HtmlTextBlock(description = product.whatsNew)
|
) {
|
||||||
|
HtmlTextBlock(description = product.whatsNew)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user