From 20a544f88b19a207ad935e9cc81578caf12942c8 Mon Sep 17 00:00:00 2001 From: machiav3lli Date: Mon, 10 Oct 2022 00:39:17 +0200 Subject: [PATCH] Update: Replace extended item's ActionButton --- .../ui/compose/components/ProductsListItem.kt | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductsListItem.kt b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductsListItem.kt index 5eae3470..c3c222b4 100644 --- a/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductsListItem.kt +++ b/src/main/kotlin/com/machiav3lli/fdroid/ui/compose/components/ProductsListItem.kt @@ -10,8 +10,6 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.material3.ButtonDefaults.buttonColors -import androidx.compose.material3.FilledTonalButton import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme @@ -148,23 +146,16 @@ fun ExpandedItemContent( ) } AnimatedVisibility(visible = installed == null || installed.launcherActivities.isNotEmpty()) { - FilledTonalButton( - colors = buttonColors( - containerColor = MaterialTheme.colorScheme.primaryContainer, - contentColor = MaterialTheme.colorScheme.onPrimaryContainer - ), - onClick = { onActionClicked(item) } - ) { - val action = when { - installed != null -> ActionState.Launch - else -> ActionState.Install - } - Icon( - imageVector = action.icon, - contentDescription = stringResource(id = action.textId) - ) - Text(text = stringResource(id = action.textId)) + val action = when { + installed != null -> ActionState.Launch + else -> ActionState.Install } + ActionButton( + text = stringResource(id = action.textId), + icon = action.icon, + positive = true, + onClick = { onActionClicked(item) } + ) } } }