Package-level declarations

Types

Link copied to clipboard

This error indicates that this poll creation contains a duplicated option item.

Link copied to clipboard
sealed interface PollOptionError

Indicates the error of the poll while configuring the options.

Link copied to clipboard
data class PollOptionItem(val title: String, val key: String = UUID.randomUUID().toString(), val pollOptionError: PollOptionError? = null)

The option item for creating a poll.

Link copied to clipboard

This error indicates that this poll creation input (number type) is exceed the maximum value.

Link copied to clipboard
data class PollSwitchInput(var value: Any, val maxValue: Any? = null, val keyboardType: KeyboardType = KeyboardType.Text)

The input information that will be used to create a poll switch item.

Link copied to clipboard
data class PollSwitchItem(val title: String, val enabled: Boolean, val key: String = UUID.randomUUID().toString(), val pollSwitchInput: PollSwitchInput? = null, val pollOptionError: PollOptionError? = null)

The option switch item for creating a poll.

Functions

Link copied to clipboard
fun PollCreationDiscardDialog(usePlatformDefaultWidth: Boolean = false, onCancelClicked: () -> Unit, onDiscardClicked: () -> Unit)

A dialog to ask if a user wants to discard the current poll creation information.

Link copied to clipboard
fun PollCreationHeader(modifier: Modifier = Modifier, color: Color = ChatTheme.colors.appBackground, shape: Shape = ChatTheme.shapes.header, elevation: Dp = 0.dp, onBackPressed: () -> Unit = {}, enabledCreation: Boolean, onPollCreateClicked: () -> Unit, leadingContent: @Composable RowScope.() -> Unit? = null, centerContent: @Composable RowScope.() -> Unit? = null, trailingContent: @Composable RowScope.() -> Unit? = null)

Poll's creation header (toolbar) Composable that consist of several components.

Link copied to clipboard
fun PollOptionList(modifier: Modifier = Modifier, lazyListState: LazyListState = rememberLazyListState(), title: String = stringResource(id = R.string.stream_compose_poll_option_title), optionItems: List<PollOptionItem> = emptyList(), onQuestionsChanged: (List<PollOptionItem>) -> Unit, itemHeightSize: Dp = ChatTheme.dimens.pollOptionInputHeight, itemInnerPadding: PaddingValues = PaddingValues(horizontal = 16.dp, vertical = 4.dp))

The Poll Creation option list that is a Composable that enables users to create and reorder question items easily.

Link copied to clipboard
fun PollQuestionInput(modifier: Modifier = Modifier, title: String = stringResource(id = R.string.stream_compose_poll_questions_title), question: String, onQuestionChanged: (String) -> Unit)

Poll option's question Composable that consist of the title and PollOptionInput.

Link copied to clipboard
fun PollSwitchList(modifier: Modifier = Modifier, pollSwitchItems: List<PollSwitchItem>, onSwitchesChanged: (List<PollSwitchItem>) -> Unit, itemHeightSize: Dp = ChatTheme.dimens.pollOptionInputHeight, itemInnerPadding: PaddingValues = PaddingValues(horizontal = 16.dp, vertical = 16.dp))

The Poll switch list is that a Composable that enables users to create a poll with configurations.