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
31 changes: 15 additions & 16 deletions stream-chat-android-compose/api/stream-chat-android-compose.api
Original file line number Diff line number Diff line change
Expand Up @@ -576,13 +576,13 @@ public final class io/getstream/chat/android/compose/ui/attachments/preview/Comp
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/attachments/preview/ComposableSingletons$MediaGalleryPreviewScreenKt;
public fun <init> ()V
public final fun getLambda$-1186868066$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function7;
public final fun getLambda$-1317756983$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1613254346$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-177774698$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1899518912$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-2102393707$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-210669840$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-244397814$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-49086904$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-357715190$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-52298206$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-563857596$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-822354111$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
Expand All @@ -591,10 +591,10 @@ public final class io/getstream/chat/android/compose/ui/attachments/preview/Comp
public final fun getLambda$1327866271$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1331114327$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1375691933$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1465472073$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1549246429$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1672511429$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1672603643$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1711218079$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1880503530$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1902056283$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$19148184$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
Expand Down Expand Up @@ -763,14 +763,14 @@ public final class io/getstream/chat/android/compose/ui/channel/info/ComposableS
public fun <init> ()V
public final fun getLambda$-1114359326$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1207226509$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1284495299$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1330176946$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1754400971$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-2125016004$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-572168236$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1139087319$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1302953779$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda$2046556554$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$217368988$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$756179806$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/channel/info/ComposableSingletons$ChannelInfoMemberInfoModalSheetKt {
Expand Down Expand Up @@ -820,10 +820,10 @@ public final class io/getstream/chat/android/compose/ui/channel/info/ComposableS
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/channel/info/ComposableSingletons$GroupChannelEditScreenKt;
public fun <init> ()V
public final fun getLambda$-1290011797$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1600862874$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1839460112$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1996460951$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-949819074$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-952635417$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1273794324$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1411993017$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1947836857$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
Expand Down Expand Up @@ -870,9 +870,9 @@ public final class io/getstream/chat/android/compose/ui/channels/header/Composab
public final fun getLambda$-1782552518$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-39363265$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-903354658$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1125356903$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1371852185$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$318691263$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$423422310$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$621281156$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

Expand Down Expand Up @@ -1400,7 +1400,7 @@ public final class io/getstream/chat/android/compose/ui/components/messageaction
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/messageactions/ComposableSingletons$MessageActionsHeaderKt;
public fun <init> ()V
public final fun getLambda$-1164493217$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1304549080$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$746565017$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/components/messageactions/ComposableSingletons$MessageActionsKt {
Expand Down Expand Up @@ -1614,8 +1614,8 @@ public final class io/getstream/chat/android/compose/ui/components/moderatedmess
public final class io/getstream/chat/android/compose/ui/components/poll/ComposableSingletons$PollAnswersKt {
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/components/poll/ComposableSingletons$PollAnswersKt;
public fun <init> ()V
public final fun getLambda$-1411166830$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1780669891$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1805570669$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1980307438$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
public final fun getLambda$-232122758$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-49181804$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function3;
Expand Down Expand Up @@ -1877,7 +1877,6 @@ public final class io/getstream/chat/android/compose/ui/messages/attachments/pol
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/messages/attachments/poll/ComposableSingletons$PollCreationHeaderKt;
public fun <init> ()V
public final fun getLambda$1291237378$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1775632701$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$226546083$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

Expand All @@ -1902,15 +1901,15 @@ public final class io/getstream/chat/android/compose/ui/messages/attachments/pol
}

public final class io/getstream/chat/android/compose/ui/messages/attachments/poll/CreatePollScreenKt {
public static final fun CreatePollScreen (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;I)V
public static final fun CreatePollScreen (Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;Ljava/lang/String;Landroidx/compose/runtime/Composer;II)V
}

public final class io/getstream/chat/android/compose/ui/messages/attachments/poll/PollCreationDiscardDialogKt {
public static final fun PollCreationDiscardDialog (ZLkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;II)V
}

public final class io/getstream/chat/android/compose/ui/messages/attachments/poll/PollCreationHeaderKt {
public static final fun PollCreationHeader (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;ZLkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
public static final fun PollCreationHeader (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function0;ZLkotlin/jvm/functions/Function0;Ljava/lang/String;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V
}

public final class io/getstream/chat/android/compose/ui/messages/attachments/poll/PollOptionDuplicated : io/getstream/chat/android/compose/ui/messages/attachments/poll/PollOptionError {
Expand Down Expand Up @@ -2028,11 +2027,11 @@ public final class io/getstream/chat/android/compose/ui/messages/composer/intern
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/messages/composer/internal/ComposableSingletons$AudioRecordingContentKt;
public fun <init> ()V
public final fun getLambda$-129303699$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-1855012696$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-2139230466$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-630641788$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$491551885$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$-744252283$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$2045550761$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$545156019$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$549534158$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

public final class io/getstream/chat/android/compose/ui/messages/composer/internal/ComposableSingletons$MessageComposerEditIndicatorKt {
Expand Down Expand Up @@ -3781,7 +3780,7 @@ public final class io/getstream/chat/android/compose/ui/theme/ComposableSingleto
public static final field INSTANCE Lio/getstream/chat/android/compose/ui/theme/ComposableSingletons$ChatComponentFactoryKt;
public fun <init> ()V
public final fun getLambda$-845861723$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1812629511$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$1301617352$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
public final fun getLambda$69070923$stream_chat_android_compose_release ()Lkotlin/jvm/functions/Function2;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ internal fun StreamButton(
onClick: () -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
onClickLabel: String? = null,
style: StreamButtonStyle = StreamButtonStyleDefaults.primarySolid,
size: StreamButtonSize = StreamButtonSize.Medium,
content: @Composable () -> Unit,
Expand All @@ -95,6 +96,7 @@ internal fun StreamButton(
.ifNotNull(style.borderColor(enabled)) { border(1.dp, it, CircleShape) }
.clickable(
onClick = onClick,
onClickLabel = onClickLabel,
enabled = enabled,
role = Role.Button,
interactionSource = remember(::MutableInteractionSource),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.hideFromAccessibility
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.text.TextRange
import androidx.compose.ui.text.TextStyle
Expand Down Expand Up @@ -127,6 +128,7 @@ public fun PollOptionInput(
if (value.isBlank()) {
Text(
text = description,
modifier = Modifier.semantics { hideFromAccessibility() },
style = typography.bodyDefault,
color = colors.inputTextPlaceholder,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ import io.getstream.chat.android.models.CreatePollParams
* @param onBack Called when the user navigates back from the poll creation screen
* (via back press or discard). Resets the ViewModel state.
* @param onCreatePoll Called when the user submits a new poll configuration.
* @param onCreatePollLabel Semantic / accessibility label for the poll creation button that triggers [onCreatePoll].
*/
@Suppress("LongMethod")
@Composable
public fun CreatePollScreen(
onBack: () -> Unit,
onCreatePoll: (CreatePollParams) -> Unit,
onCreatePollLabel: String? = null,
) {
val viewModel: CreatePollViewModel = viewModel(
factory = CreatePollViewModelFactory(ChatTheme.config.polls),
Expand Down Expand Up @@ -88,6 +90,7 @@ public fun CreatePollScreen(
PollCreationHeader(
modifier = Modifier.fillMaxWidth(),
enabledCreation = state.isCreationEnabled,
onPollCreateClickedLabel = onCreatePollLabel,
onPollCreateClicked = {
onCreatePoll(
createPollParamsFrom(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* @param onBackPressed A lambda that will be executed if users click the back button on the default [leadingContent].
* @param enabledCreation Represents if user can click the creation button or not.
* @param onPollCreateClicked A lambda that will be executed if users click the poll creation button.
* @param onPollCreateClickedLabel Semantic / accessibility label for [onPollCreateClicked].
* @param leadingContent Customizable composable function that represents the leading content of a poll creation item, usually
* holding a back action button.
* @param centerContent Customizable composable function that represents the center content of a poll creation item, usually
Expand All @@ -58,11 +59,12 @@
* usually holding the creation action button.
*/
@Composable
public fun PollCreationHeader(

Check warning on line 62 in stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/attachments/poll/PollCreationHeader.kt

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This function has 8 parameters, which is greater than the 7 authorized.

See more on https://sonarcloud.io/project/issues?id=GetStream_stream-chat-android&issues=AZ5FZE1EHQnSU-rswLkq&open=AZ5FZE1EHQnSU-rswLkq&pullRequest=6445
modifier: Modifier = Modifier,
onBackPressed: () -> Unit = {},
enabledCreation: Boolean,
onPollCreateClicked: () -> Unit,
onPollCreateClickedLabel: String? = null,
leadingContent: @Composable (RowScope.() -> Unit)? = null,
centerContent: @Composable (RowScope.() -> Unit)? = null,
trailingContent: @Composable (RowScope.() -> Unit)? = null,
Expand All @@ -86,7 +88,8 @@

trailingContent?.invoke(this) ?: DefaultPollOptionsHeaderTrailingContent(
enabled = enabledCreation,
onPollCreateClicked = onPollCreateClicked,
onPollCreateClick = onPollCreateClicked,
onPollCreateClickLabel = onPollCreateClickedLabel,
)
}
}
Expand Down Expand Up @@ -118,18 +121,21 @@
}

@Composable
internal fun DefaultPollOptionsHeaderTrailingContent(
private fun DefaultPollOptionsHeaderTrailingContent(
enabled: Boolean,
onPollCreateClicked: () -> Unit,
onPollCreateClick: () -> Unit,
onPollCreateClickLabel: String? = null,
) {
val onClickLabel = onPollCreateClickLabel ?: stringResource(R.string.stream_compose_poll_create_action)
StreamButton(
onClick = onPollCreateClicked,
onClick = onPollCreateClick,
enabled = enabled,
onClickLabel = onClickLabel,
style = StreamButtonStyleDefaults.primarySolid,
) {
Icon(
painter = painterResource(R.drawable.stream_design_ic_checkmark),
contentDescription = stringResource(R.string.stream_compose_poll_title),
contentDescription = onClickLabel,
)
}
}
Expand Down
Loading
Loading