Package-level declarations

Types

Link copied to clipboard
object SMC

Common name space for all Spend Manager Composable functions. Keeping all our own customized composable functions within a single parent object will help with naming and organizing, making it easier to differentiate between our own functions and android supplies composable functions.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun SMC.ButtonBar(modifier: Modifier = Modifier, buttonsSlot: @Composable RowScope.() -> Unit)
Link copied to clipboard
fun SMC.ClickableOutlinedInputField(value: String, onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, label: @Composable () -> Unit? = null, placeholder: @Composable () -> Unit? = null, leadingIcon: @Composable () -> Unit? = null, trailingIcon: @Composable () -> Unit? = null, supportingText: @Composable () -> Unit? = null, isError: Boolean = false, visualTransformation: VisualTransformation = VisualTransformation.None, keyboardOptions: KeyboardOptions = KeyboardOptions.Default, keyboardActions: KeyboardActions = KeyboardActions.Default)

Reusable composable that displays exactly like a Material3 OutlinedTextField, but interaction is done via an onClick rather than allowing the user to edit the field directly.

Link copied to clipboard
fun SMC.ContentCard(modifier: Modifier = Modifier, reduceVerticalPadding: Boolean = false, content: @Composable ColumnScope.() -> Unit)
fun SMC.ContentCard(onClick: () -> Unit, modifier: Modifier = Modifier, reduceVerticalPadding: Boolean = false, content: @Composable ColumnScope.() -> Unit)
Link copied to clipboard
fun SMC.ContentLoadError(modifier: Modifier = Modifier, icon: @Composable () -> Unit? = null, title: @Composable () -> Unit, description: @Composable () -> Unit = {}, retryButton: @Composable () -> Unit? = null)

Reusable composable used to display content load errors. Contains slots for an icon, title, description and retry (or other action) button. Styled after our default SM Content Loading Error.

fun SMC.ContentLoadError(modifier: Modifier = Modifier, onRetryClicked: () -> Unit, retryButtonText: String = stringResource(id = R.string.sb__base_contentloaderror_retry_button), icon: @Composable () -> Unit = { }, title: @Composable () -> Unit, description: @Composable () -> Unit = { })

Reusable composable used to display content load errors. Contains slots for an icon, title and description. Contains a simpler implementation for the retry button with parameters to handle the button being clicked and for the button's content. Styled after our default SM Content Loading Error.

Link copied to clipboard
fun SMC.DropdownChoice(onClick: () -> Unit, isSelected: Boolean, optionText: String, selectedTextStyle: TextStyle? = null)

Used for displaying an individual DropdownMenu item, using our own default styling

Link copied to clipboard
fun SMC.FlippableCard(isFlipped: Boolean, frontContent: @Composable () -> Unit, backContent: @Composable () -> Unit, modifier: Modifier = Modifier, invertColoursWhenFlipped: Boolean = true)

Flippable Card which remembers its state, and flips between the front and back content based on the passed in boolean.

Link copied to clipboard
fun SMC.FloatingActionButton(onClick: () -> Unit, icon: @Composable () -> Unit, text: @Composable () -> Unit, modifier: Modifier = Modifier)

Spend Manager Styled Floating Action Button. Generic implementation that takes icon and text composables.

fun SMC.FloatingActionButton(onClick: () -> Unit, @DrawableRes icon: Int, @StringRes text: Int, modifier: Modifier = Modifier)

Spend Manager Styled Floating Action Button. Specific implementation that takes icon and text resources.

Link copied to clipboard
fun SMC.IconCard(modifier: Modifier = Modifier, containerColour: Color = MaterialTheme.colorScheme.primaryContainer, contentColour: Color = MaterialTheme.colorScheme.onPrimaryContainer, content: @Composable () -> Unit)
Link copied to clipboard
Link copied to clipboard
fun SMC.PrimaryBarScreen(scrollable: Boolean = false, barColour: Color = MaterialTheme.colorScheme.primary, topBar: @Composable (topBarElevation: Dp) -> Unit = { }, floatingActionButton: @Composable () -> Unit = { }, scrollableContainer: @Composable (ScrollState, PaddingValues, @Composable () -> Unit) -> Unit = { scrollState, innerPadding, containerContent -> DefaultScrollableContainer(scrollState, innerPadding, containerContent) }, content: @Composable ColumnScope.() -> Unit = { })

A general template for the type of Spend Manager screen hooked up in a scaffold, with the following properties:

fun SMC.PrimaryBarScreenPullRefreshScrollableContainer(isRefreshing: Boolean, scrollState: ScrollState, innerPadding: PaddingValues, onRefresh: () -> Unit, content: @Composable () -> Unit, modifier: Modifier = Modifier, contentModifier: Modifier = Modifier)
Link copied to clipboard
fun SMC.RoundedOutlinedCard(modifier: Modifier = Modifier, contentRowModifier: Modifier = Modifier.padding(horizontal = 12.dp, vertical = 8.dp), borderStroke: BorderStroke = BorderStroke(0.75.dp, Color.Gray), content: @Composable () -> Unit)
fun SMC.RoundedOutlinedCard(onClick: () -> Unit, modifier: Modifier = Modifier, contentRowModifier: Modifier = Modifier.padding(horizontal = 12.dp, vertical = 8.dp), borderStroke: BorderStroke = BorderStroke(0.75.dp, Color.Gray), content: @Composable () -> Unit)

A customizable rounded outlined card that can be more easily reused.

Link copied to clipboard
fun SMC.SbScaffold(modifier: Modifier = Modifier, topBar: @Composable () -> Unit = {}, bottomBar: @Composable () -> Unit = {}, snackbarHost: @Composable () -> Unit = { SnackbarHost(LocalSnackbarHostState.current) }, floatingActionButton: @Composable () -> Unit = {}, floatingActionButtonPosition: FabPosition = FabPosition.End, containerColor: Color = MaterialTheme.colorScheme.background, contentColor: Color = contentColorFor(containerColor), contentWindowInsets: WindowInsets = ScaffoldDefaults.contentWindowInsets, content: @Composable (PaddingValues) -> Unit)

Sensibill implementation of the "base" Scaffold. Argument defaults have been copied from Scaffold.

Link copied to clipboard
fun SMC.SecondaryButton(onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, shape: Shape = ButtonDefaults.shape, colors: ButtonColors = secondaryButtonColours(), elevation: ButtonElevation? = ButtonDefaults.buttonElevation(), border: BorderStroke? = null, contentPadding: PaddingValues = ButtonDefaults.ContentPadding, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, content: @Composable RowScope.() -> Unit)

A Button styled with secondary colours.

Link copied to clipboard

Creator for ButtonColors that can be used to create colours for a secondary button