compose: details: Remove prefix from components
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -64,17 +64,17 @@ import com.aurora.store.compose.preview.coilPreviewProvider
|
|||||||
import com.aurora.store.compose.menu.AppDetailsMenu
|
import com.aurora.store.compose.menu.AppDetailsMenu
|
||||||
import com.aurora.store.compose.menu.items.AppDetailsMenuItem
|
import com.aurora.store.compose.menu.items.AppDetailsMenuItem
|
||||||
import com.aurora.store.compose.navigation.Screen
|
import com.aurora.store.compose.navigation.Screen
|
||||||
import com.aurora.store.compose.ui.details.components.AppActions
|
import com.aurora.store.compose.ui.details.components.Actions
|
||||||
import com.aurora.store.compose.ui.details.components.AppChangelog
|
import com.aurora.store.compose.ui.details.components.Changelog
|
||||||
import com.aurora.store.compose.ui.details.components.AppCompatibility
|
import com.aurora.store.compose.ui.details.components.Compatibility
|
||||||
import com.aurora.store.compose.ui.details.components.AppDataSafety
|
import com.aurora.store.compose.ui.details.components.DataSafety
|
||||||
import com.aurora.store.compose.ui.details.components.AppDetails
|
import com.aurora.store.compose.ui.details.components.Details
|
||||||
import com.aurora.store.compose.ui.details.components.AppDeveloperDetails
|
import com.aurora.store.compose.ui.details.components.DeveloperDetails
|
||||||
import com.aurora.store.compose.ui.details.components.AppPrivacy
|
import com.aurora.store.compose.ui.details.components.Privacy
|
||||||
import com.aurora.store.compose.ui.details.components.AppRatingAndReviews
|
import com.aurora.store.compose.ui.details.components.RatingAndReviews
|
||||||
import com.aurora.store.compose.ui.details.components.AppScreenshots
|
import com.aurora.store.compose.ui.details.components.Screenshots
|
||||||
import com.aurora.store.compose.ui.details.components.AppTags
|
import com.aurora.store.compose.ui.details.components.Tags
|
||||||
import com.aurora.store.compose.ui.details.components.AppTesting
|
import com.aurora.store.compose.ui.details.components.Testing
|
||||||
import com.aurora.store.compose.ui.details.navigation.ExtraScreen
|
import com.aurora.store.compose.ui.details.navigation.ExtraScreen
|
||||||
import com.aurora.store.compose.ui.dev.DevProfileScreen
|
import com.aurora.store.compose.ui.dev.DevProfileScreen
|
||||||
import com.aurora.store.data.installer.AppInstaller
|
import com.aurora.store.data.installer.AppInstaller
|
||||||
@@ -257,10 +257,10 @@ private fun ScreenContentApp(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun SetupAppActions() {
|
fun SetupActions() {
|
||||||
when (state) {
|
when (state) {
|
||||||
is AppState.Downloading -> {
|
is AppState.Downloading -> {
|
||||||
AppActions(
|
Actions(
|
||||||
primaryActionDisplayName = stringResource(R.string.action_open),
|
primaryActionDisplayName = stringResource(R.string.action_open),
|
||||||
secondaryActionDisplayName = stringResource(R.string.action_cancel),
|
secondaryActionDisplayName = stringResource(R.string.action_cancel),
|
||||||
isPrimaryActionEnabled = false,
|
isPrimaryActionEnabled = false,
|
||||||
@@ -269,7 +269,7 @@ private fun ScreenContentApp(
|
|||||||
}
|
}
|
||||||
|
|
||||||
is AppState.Updatable -> {
|
is AppState.Updatable -> {
|
||||||
AppActions(
|
Actions(
|
||||||
primaryActionDisplayName = stringResource(R.string.action_update),
|
primaryActionDisplayName = stringResource(R.string.action_update),
|
||||||
secondaryActionDisplayName = stringResource(R.string.action_uninstall),
|
secondaryActionDisplayName = stringResource(R.string.action_uninstall),
|
||||||
onPrimaryAction = onDownload,
|
onPrimaryAction = onDownload,
|
||||||
@@ -278,7 +278,7 @@ private fun ScreenContentApp(
|
|||||||
}
|
}
|
||||||
|
|
||||||
is AppState.Installed -> {
|
is AppState.Installed -> {
|
||||||
AppActions(
|
Actions(
|
||||||
primaryActionDisplayName = stringResource(R.string.action_open),
|
primaryActionDisplayName = stringResource(R.string.action_open),
|
||||||
secondaryActionDisplayName = stringResource(R.string.action_uninstall),
|
secondaryActionDisplayName = stringResource(R.string.action_uninstall),
|
||||||
onPrimaryAction = onOpen,
|
onPrimaryAction = onOpen,
|
||||||
@@ -293,7 +293,7 @@ private fun ScreenContentApp(
|
|||||||
if (app.isFree) stringResource(R.string.action_install) else app.price
|
if (app.isFree) stringResource(R.string.action_install) else app.price
|
||||||
}
|
}
|
||||||
|
|
||||||
AppActions(
|
Actions(
|
||||||
primaryActionDisplayName = primaryActionName,
|
primaryActionDisplayName = primaryActionName,
|
||||||
secondaryActionDisplayName = stringResource(R.string.title_manual_download),
|
secondaryActionDisplayName = stringResource(R.string.title_manual_download),
|
||||||
onPrimaryAction = onDownload,
|
onPrimaryAction = onDownload,
|
||||||
@@ -321,7 +321,7 @@ private fun ScreenContentApp(
|
|||||||
.padding(dimensionResource(R.dimen.padding_medium)),
|
.padding(dimensionResource(R.dimen.padding_medium)),
|
||||||
verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))
|
verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))
|
||||||
) {
|
) {
|
||||||
AppDetails(
|
Details(
|
||||||
app = app,
|
app = app,
|
||||||
inProgress = state.inProgress(),
|
inProgress = state.inProgress(),
|
||||||
progress = state.progress(),
|
progress = state.progress(),
|
||||||
@@ -331,38 +331,35 @@ private fun ScreenContentApp(
|
|||||||
timeRemaining = if (state is AppState.Downloading) state.timeRemaining else 0
|
timeRemaining = if (state is AppState.Downloading) state.timeRemaining else 0
|
||||||
)
|
)
|
||||||
|
|
||||||
SetupAppActions()
|
SetupActions()
|
||||||
|
|
||||||
AppTags(app = app)
|
Tags(app = app)
|
||||||
AppChangelog(changelog = app.changes)
|
Changelog(changelog = app.changes)
|
||||||
HeaderComposable(
|
HeaderComposable(
|
||||||
title = stringResource(R.string.details_more_about_app),
|
title = stringResource(R.string.details_more_about_app),
|
||||||
subtitle = app.shortDescription,
|
subtitle = app.shortDescription,
|
||||||
onClick = { showExtraPane(ExtraScreen.More) }
|
onClick = { showExtraPane(ExtraScreen.More) }
|
||||||
)
|
)
|
||||||
|
|
||||||
AppScreenshots(
|
Screenshots(
|
||||||
screenshots = app.screenshots,
|
screenshots = app.screenshots,
|
||||||
onNavigateToScreenshot = { showExtraPane(ExtraScreen.Screenshot(it)) }
|
onNavigateToScreenshot = { showExtraPane(ExtraScreen.Screenshot(it)) }
|
||||||
)
|
)
|
||||||
|
|
||||||
AppRatingAndReviews(
|
RatingAndReviews(
|
||||||
rating = app.rating,
|
rating = app.rating,
|
||||||
featuredReviews = featuredReviews,
|
featuredReviews = featuredReviews,
|
||||||
onNavigateToDetailsReview = { showExtraPane(ExtraScreen.Review) }
|
onNavigateToDetailsReview = { showExtraPane(ExtraScreen.Review) }
|
||||||
)
|
)
|
||||||
|
|
||||||
if (!isAnonymous && app.testingProgram?.isAvailable == true) {
|
if (!isAnonymous && app.testingProgram?.isAvailable == true) {
|
||||||
AppTesting(
|
Testing(
|
||||||
isSubscribed = app.testingProgram!!.isSubscribed,
|
isSubscribed = app.testingProgram!!.isSubscribed,
|
||||||
onTestingSubscriptionChange = onTestingSubscriptionChange
|
onTestingSubscriptionChange = onTestingSubscriptionChange
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
AppCompatibility(
|
Compatibility(needsGms = app.requiresGMS(), plexusScores = plexusScores)
|
||||||
needsGms = app.requiresGMS(),
|
|
||||||
plexusScores = plexusScores
|
|
||||||
)
|
|
||||||
|
|
||||||
HeaderComposable(
|
HeaderComposable(
|
||||||
title = stringResource(R.string.details_permission),
|
title = stringResource(R.string.details_permission),
|
||||||
@@ -379,13 +376,10 @@ private fun ScreenContentApp(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if (dataSafetyReport != null) {
|
if (dataSafetyReport != null) {
|
||||||
AppDataSafety(
|
DataSafety(report = dataSafetyReport, privacyPolicyUrl = app.privacyPolicyUrl)
|
||||||
report = dataSafetyReport,
|
|
||||||
privacyPolicyUrl = app.privacyPolicyUrl
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AppPrivacy(
|
Privacy(
|
||||||
report = exodusReport,
|
report = exodusReport,
|
||||||
onNavigateToDetailsExodus = if (!exodusReport?.trackers.isNullOrEmpty()) {
|
onNavigateToDetailsExodus = if (!exodusReport?.trackers.isNullOrEmpty()) {
|
||||||
{ showExtraPane(ExtraScreen.Exodus) }
|
{ showExtraPane(ExtraScreen.Exodus) }
|
||||||
@@ -394,7 +388,7 @@ private fun ScreenContentApp(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
AppDeveloperDetails(
|
DeveloperDetails(
|
||||||
address = app.developerAddress,
|
address = app.developerAddress,
|
||||||
website = app.developerWebsite,
|
website = app.developerWebsite,
|
||||||
email = app.developerEmail
|
email = app.developerEmail
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import com.aurora.store.R
|
|||||||
* @param windowAdaptiveInfo Adaptive window information
|
* @param windowAdaptiveInfo Adaptive window information
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppActions(
|
fun Actions(
|
||||||
primaryActionDisplayName: String,
|
primaryActionDisplayName: String,
|
||||||
secondaryActionDisplayName: String,
|
secondaryActionDisplayName: String,
|
||||||
isPrimaryActionEnabled: Boolean = true,
|
isPrimaryActionEnabled: Boolean = true,
|
||||||
@@ -85,9 +85,9 @@ fun AppActions(
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppActionsPreview() {
|
private fun ActionsPreview() {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppActions(
|
Actions(
|
||||||
primaryActionDisplayName = stringResource(R.string.action_install),
|
primaryActionDisplayName = stringResource(R.string.action_install),
|
||||||
secondaryActionDisplayName = stringResource(R.string.title_manual_download)
|
secondaryActionDisplayName = stringResource(R.string.title_manual_download)
|
||||||
)
|
)
|
||||||
@@ -34,7 +34,7 @@ import com.aurora.store.compose.preview.AppPreviewProvider
|
|||||||
* @param changelog Changelog to show
|
* @param changelog Changelog to show
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppChangelog(changelog: String) {
|
fun Changelog(changelog: String) {
|
||||||
HeaderComposable(title = stringResource(R.string.details_changelog))
|
HeaderComposable(title = stringResource(R.string.details_changelog))
|
||||||
Box(
|
Box(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
@@ -56,8 +56,8 @@ fun AppChangelog(changelog: String) {
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppChangelogPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun ChangelogPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppChangelog(changelog = app.changes)
|
Changelog(changelog = app.changes)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ import com.aurora.store.data.model.Scores
|
|||||||
* @param plexusScores Scores from the Plexus
|
* @param plexusScores Scores from the Plexus
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppCompatibility(needsGms: Boolean, plexusScores: Scores? = null) {
|
fun Compatibility(needsGms: Boolean, plexusScores: Scores? = null) {
|
||||||
HeaderComposable(
|
HeaderComposable(
|
||||||
title = stringResource(R.string.details_compatibility_title),
|
title = stringResource(R.string.details_compatibility_title),
|
||||||
subtitle = stringResource(R.string.plexus_powered),
|
subtitle = stringResource(R.string.plexus_powered),
|
||||||
@@ -72,8 +72,8 @@ fun AppCompatibility(needsGms: Boolean, plexusScores: Scores? = null) {
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppCompatibilityPreview() {
|
private fun CompatibilityPreview() {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppCompatibility(needsGms = true)
|
Compatibility(needsGms = true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -31,7 +31,7 @@ import com.aurora.store.compose.preview.AppPreviewProvider
|
|||||||
* @param privacyPolicyUrl App's privacy policy URL
|
* @param privacyPolicyUrl App's privacy policy URL
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppDataSafety(report: Report, privacyPolicyUrl: String) {
|
fun DataSafety(report: Report, privacyPolicyUrl: String) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
HeaderComposable(
|
HeaderComposable(
|
||||||
@@ -80,9 +80,9 @@ fun AppDataSafety(report: Report, privacyPolicyUrl: String) {
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppDataSafetyPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun DataSafetyPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppDataSafety(
|
DataSafety(
|
||||||
privacyPolicyUrl = app.privacyPolicyUrl,
|
privacyPolicyUrl = app.privacyPolicyUrl,
|
||||||
report = Report(
|
report = Report(
|
||||||
packageName = app.packageName,
|
packageName = app.packageName,
|
||||||
@@ -43,7 +43,7 @@ import com.aurora.store.util.PackageUtil
|
|||||||
* @param isUpdatable Whether the app has a valid update available
|
* @param isUpdatable Whether the app has a valid update available
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppDetails(
|
fun Details(
|
||||||
app: App,
|
app: App,
|
||||||
progress: Float = 0F,
|
progress: Float = 0F,
|
||||||
inProgress: Boolean = false,
|
inProgress: Boolean = false,
|
||||||
@@ -106,10 +106,10 @@ fun AppDetails(
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppDetailsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun DetailsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
CompositionLocalProvider(LocalAsyncImagePreviewHandler provides coilPreviewProvider) {
|
CompositionLocalProvider(LocalAsyncImagePreviewHandler provides coilPreviewProvider) {
|
||||||
AppDetails(app = app)
|
Details(app = app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ import com.aurora.store.compose.preview.AppPreviewProvider
|
|||||||
* @param email Email address of the app developer
|
* @param email Email address of the app developer
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppDeveloperDetails(address: String, website: String, email: String) {
|
fun DeveloperDetails(address: String, website: String, email: String) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
HeaderComposable(title = stringResource(R.string.details_dev_details))
|
HeaderComposable(title = stringResource(R.string.details_dev_details))
|
||||||
@@ -68,9 +68,9 @@ fun AppDeveloperDetails(address: String, website: String, email: String) {
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppDeveloperDetailsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun DeveloperDetailsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppDeveloperDetails(
|
DeveloperDetails(
|
||||||
address = app.developerAddress,
|
address = app.developerAddress,
|
||||||
website = app.developerWebsite,
|
website = app.developerWebsite,
|
||||||
email = app.developerEmail
|
email = app.developerEmail
|
||||||
@@ -24,7 +24,7 @@ import com.aurora.store.data.model.Report
|
|||||||
* @param onNavigateToDetailsExodus Callback when the user navigates
|
* @param onNavigateToDetailsExodus Callback when the user navigates
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppPrivacy(report: Report?, onNavigateToDetailsExodus: (() -> Unit)? = null) {
|
fun Privacy(report: Report?, onNavigateToDetailsExodus: (() -> Unit)? = null) {
|
||||||
HeaderComposable(
|
HeaderComposable(
|
||||||
title = stringResource(R.string.details_privacy),
|
title = stringResource(R.string.details_privacy),
|
||||||
subtitle = stringResource(R.string.exodus_powered),
|
subtitle = stringResource(R.string.exodus_powered),
|
||||||
@@ -50,8 +50,8 @@ fun AppPrivacy(report: Report?, onNavigateToDetailsExodus: (() -> Unit)? = null)
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppPrivacyPreview() {
|
private fun PrivacyPreview() {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppPrivacy(report = Report(), onNavigateToDetailsExodus = {})
|
Privacy(report = Report(), onNavigateToDetailsExodus = {})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@ import java.util.Locale
|
|||||||
* @param windowAdaptiveInfo Adaptive window information
|
* @param windowAdaptiveInfo Adaptive window information
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppRatingAndReviews(
|
fun RatingAndReviews(
|
||||||
rating: Rating,
|
rating: Rating,
|
||||||
featuredReviews: List<Review> = emptyList(),
|
featuredReviews: List<Review> = emptyList(),
|
||||||
onNavigateToDetailsReview: () -> Unit = {},
|
onNavigateToDetailsReview: () -> Unit = {},
|
||||||
@@ -141,8 +141,8 @@ fun AppRatingAndReviews(
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppReviewsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun RatingAndReviewsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppRatingAndReviews(rating = app.rating)
|
RatingAndReviews(rating = app.rating)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ import com.aurora.store.compose.preview.coilPreviewProvider
|
|||||||
* @param onNavigateToScreenshot Callback when a screenshot is clicked
|
* @param onNavigateToScreenshot Callback when a screenshot is clicked
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppScreenshots(screenshots: List<Artwork>, onNavigateToScreenshot: (index: Int) -> Unit = {}) {
|
fun Screenshots(screenshots: List<Artwork>, onNavigateToScreenshot: (index: Int) -> Unit = {}) {
|
||||||
LazyRow(horizontalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_small))) {
|
LazyRow(horizontalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_small))) {
|
||||||
items(items = screenshots, key = { artwork -> artwork.url }) { artwork ->
|
items(items = screenshots, key = { artwork -> artwork.url }) { artwork ->
|
||||||
ScreenshotComposable(
|
ScreenshotComposable(
|
||||||
@@ -50,10 +50,10 @@ fun AppScreenshots(screenshots: List<Artwork>, onNavigateToScreenshot: (index: I
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppScreenshotsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun ScreenshotsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
CompositionLocalProvider(LocalAsyncImagePreviewHandler provides coilPreviewProvider) {
|
CompositionLocalProvider(LocalAsyncImagePreviewHandler provides coilPreviewProvider) {
|
||||||
AppScreenshots(screenshots = app.screenshots)
|
Screenshots(screenshots = app.screenshots)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,7 +28,7 @@ import com.aurora.store.util.CommonUtil
|
|||||||
* @param app App to show tags
|
* @param app App to show tags
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppTags(app: App) {
|
fun Tags(app: App) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
|
|
||||||
val installsLabel = CommonUtil.addDiPrefix(app.installs)
|
val installsLabel = CommonUtil.addDiPrefix(app.installs)
|
||||||
@@ -68,8 +68,8 @@ fun AppTags(app: App) {
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppTagsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun TagsPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppTags(app = app)
|
Tags(app = app)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -34,10 +34,7 @@ import com.aurora.store.compose.preview.AppPreviewProvider
|
|||||||
* @param onTestingSubscriptionChange Callback when the the subscription button is clicked
|
* @param onTestingSubscriptionChange Callback when the the subscription button is clicked
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun AppTesting(
|
fun Testing(isSubscribed: Boolean, onTestingSubscriptionChange: (subscribe: Boolean) -> Unit = {}) {
|
||||||
isSubscribed: Boolean,
|
|
||||||
onTestingSubscriptionChange: (subscribe: Boolean) -> Unit = {}
|
|
||||||
) {
|
|
||||||
HeaderComposable(title = stringResource(R.string.details_beta))
|
HeaderComposable(title = stringResource(R.string.details_beta))
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
@@ -72,8 +69,8 @@ fun AppTesting(
|
|||||||
|
|
||||||
@Preview(showBackground = true)
|
@Preview(showBackground = true)
|
||||||
@Composable
|
@Composable
|
||||||
private fun AppTestingPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
private fun TestingPreview(@PreviewParameter(AppPreviewProvider::class) app: App) {
|
||||||
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
Column(verticalArrangement = Arrangement.spacedBy(dimensionResource(R.dimen.margin_medium))) {
|
||||||
AppTesting(isSubscribed = app.testingProgram!!.isSubscribed)
|
Testing(isSubscribed = app.testingProgram!!.isSubscribed)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user