Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/getcode/models/BillState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ data class BillState(

sealed interface Action {

val label: String
val label: String?
@Composable get
val asset: Painter
@Composable get
Expand All @@ -63,7 +63,7 @@ data class BillState(

data class Share(override val action: () -> Unit): Action {
override val label: String
@Composable get() = stringResource(R.string.action_share)
@Composable get() = stringResource(R.string.action_shareAsURL)

override val asset: Painter
@Composable get() = painterResource(id = R.drawable.ic_remote_send)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/getcode/ui/components/Pill.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fun Pill(
fun Pill(
modifier: Modifier = Modifier,
backgroundColor: Color = Black50,
contentColor: Color = Color.White,
contentColor: Color = CodeTheme.colors.onAction,
shape: CornerBasedShape = CircleShape,
contentPadding: PaddingValues = PaddingValues(
horizontal = CodeTheme.dimens.grid.x2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ class HomeViewModel @Inject constructor(
val billState = it.billState.copy(
bill = Bill.Tip(code),
primaryAction = BillState.Action.Share { onRemoteSend() },
secondaryAction = BillState.Action.Done(::cancelSend)
secondaryAction = BillState.Action.Cancel(::cancelSend)
)

it.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.getcode.theme.Gray50
import com.getcode.theme.White
import com.getcode.ui.components.CodeCircularProgressIndicator
import com.getcode.ui.components.Pill
import com.getcode.ui.utils.addIf
import com.getcode.ui.utils.rememberedClickable

@Composable
Expand All @@ -45,10 +46,9 @@ internal fun BillManagementOptions(
if (primaryAction != null) {
Pill(
modifier = Modifier
.rememberedClickable(enabled = !isSending) { primaryAction.action() }
.padding(vertical = 15.dp, horizontal = 20.dp),
contentPadding = PaddingValues(),
backgroundColor = Gray50,
.rememberedClickable(enabled = !isSending) { primaryAction.action() },
contentPadding = PaddingValues(15.dp),
backgroundColor = CodeTheme.colors.action,
) {
Box {
Row(
Expand All @@ -59,10 +59,12 @@ internal fun BillManagementOptions(
contentDescription = "",
modifier = Modifier.width(22.dp)
)
Text(
modifier = Modifier.padding(start = 10.dp),
text = primaryAction.label
)
primaryAction.label?.let { label ->
Text(
modifier = Modifier.padding(start = 10.dp),
text = label
)
}
}

if (isSending) {
Expand All @@ -80,20 +82,21 @@ internal fun BillManagementOptions(
if (secondaryAction != null) {
Pill(
modifier = Modifier
.rememberedClickable(enabled = isInteractable) { secondaryAction.action() }
.padding(vertical = 15.dp, horizontal = 20.dp),
contentPadding = PaddingValues(),
backgroundColor = Gray50,
.rememberedClickable(enabled = isInteractable) { secondaryAction.action() },
contentPadding = PaddingValues(15.dp),
backgroundColor = CodeTheme.colors.action,
) {
Image(
painter = secondaryAction.asset,
contentDescription = "",
modifier = Modifier.size(18.dp)
)
Text(
modifier = Modifier.padding(start = 10.dp),
text = secondaryAction.label
)
secondaryAction.label?.let { label ->
Text(
modifier = Modifier.padding(start = 10.dp),
text = label
)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion common/theme/src/main/kotlin/com/getcode/theme/Color.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ val BrandLight = Color(0xFF7379A0)
val BrandSubtle = Color(0xFF565C86)
val BrandMuted = Color(0xFF45464E)
val BrandDark = Color(0xFF1F1A34)
val BrandOverlay = Color(0xBF1E1E1E)
val BrandAction = Color(0xFF212121)

val Brand01 = Color(0xFF130F27)
val White = Color(0xffffffff)
Expand Down
11 changes: 11 additions & 0 deletions common/theme/src/main/kotlin/com/getcode/theme/Theme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ private val DarkColorPalette = CodeColors(
brandLight = BrandLight,
brandSubtle = BrandSubtle,
brandMuted = BrandMuted,
action = Gray50,
onAction = White,
background = Brand,
onBackground = White,
surface = Brand,
Expand Down Expand Up @@ -82,6 +84,8 @@ class CodeColors(
brandLight: Color,
brandSubtle: Color,
brandMuted: Color,
action: Color,
onAction: Color,
background: Color,
onBackground: Color,
surface: Color,
Expand All @@ -99,6 +103,10 @@ class CodeColors(
private set
var brandMuted by mutableStateOf(brandMuted)
private set
var action by mutableStateOf(action)
private set
var onAction by mutableStateOf(onAction)
private set
var background by mutableStateOf(background)
private set
var onBackground by mutableStateOf(onBackground)
Expand All @@ -121,6 +129,7 @@ class CodeColors(
brandLight = other.brandLight
brandSubtle = other.brandSubtle
brandMuted = other.brandMuted
action = other.action
background = other.background
onBackground = other.onBackground
surface = other.surface
Expand All @@ -136,6 +145,8 @@ class CodeColors(
brandLight = brandLight,
brandSubtle = brandSubtle,
brandMuted = brandMuted,
action = action,
onAction = onAction,
background = background,
onBackground = onBackground,
surface = surface,
Expand Down