mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-04-23 19:32:16 +00:00
Update: Replace extended item's ActionButton
This commit is contained in:
parent
a2666ea362
commit
20a544f88b
@ -10,8 +10,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
|
|||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.wrapContentHeight
|
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.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
@ -148,23 +146,16 @@ fun ExpandedItemContent(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
AnimatedVisibility(visible = installed == null || installed.launcherActivities.isNotEmpty()) {
|
AnimatedVisibility(visible = installed == null || installed.launcherActivities.isNotEmpty()) {
|
||||||
FilledTonalButton(
|
val action = when {
|
||||||
colors = buttonColors(
|
installed != null -> ActionState.Launch
|
||||||
containerColor = MaterialTheme.colorScheme.primaryContainer,
|
else -> ActionState.Install
|
||||||
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))
|
|
||||||
}
|
}
|
||||||
|
ActionButton(
|
||||||
|
text = stringResource(id = action.textId),
|
||||||
|
icon = action.icon,
|
||||||
|
positive = true,
|
||||||
|
onClick = { onActionClicked(item) }
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user