File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/conversation
ui/components/src/main/kotlin/com/getcode/ui/utils Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,9 @@ internal fun ConversationMessages(
8787 modifier = Modifier
8888 .fillMaxSize()
8989 .verticalScrollStateGradient(
90- lazyListState,
91- color = CodeTheme .colors.background
90+ scrollState = lazyListState,
91+ color = CodeTheme .colors.background,
92+ showAtStartAlways = true
9293 ),
9394 messages = messages,
9495 listState = lazyListState,
Original file line number Diff line number Diff line change @@ -262,21 +262,23 @@ fun Modifier.verticalScrollStateGradient(
262262 scrollState : LazyListState ,
263263 color : Color = Color .Unspecified ,
264264 showAtStart : Boolean = true,
265+ showAtStartAlways : Boolean = false,
265266 showAtEnd : Boolean = true,
267+ showAtEndAlways : Boolean = false,
266268 isLongGradient : Boolean = false,
267269): Modifier = composed {
268270 val backgroundColor = color.takeOrElse { CodeTheme .colors.background }
269271 val gradientSizePx =
270272 with (LocalDensity .current) { gradientSize.toPx() } * if (isLongGradient) 1.5f else 1f
271273 this
272- .addIf(showAtStart && ! scrollState.isScrolledToStart()) {
274+ .addIf(( showAtStart && ! scrollState.isScrolledToStart()) || showAtStartAlways ) {
273275 Modifier .drawWithGradient(
274276 color = backgroundColor,
275277 startY = { gradientSizePx },
276278 endY = { 0f },
277279 )
278280 }
279- .addIf(showAtEnd && ! scrollState.isScrolledToEnd()) {
281+ .addIf(( showAtEnd && ! scrollState.isScrolledToEnd()) || showAtEndAlways ) {
280282 Modifier .drawWithGradient(
281283 color = backgroundColor,
282284 startY = { size.height - gradientSizePx },
You can’t perform that action at this time.
0 commit comments