barat
07/17/2023, 9:49 AMyPx
value is obtained with -it.Offset
,
Using this yPx value, progress is measured by (scrollParams.yPx / maxScrollOut.toPx()).coerceIn(0f, 1f)
.
Since coerceIn is used here, if the offset of the initial value is a positive number, yPx becomes a negative number, and progress returns 0f by coerceIn, so timetext is displayed normally while the screen has just been drawn.
However, the problem is when the index 1 item's offset is a negative number.
If the initial offset is negative, yPx will be positive, and positive yPx / maxScrollOut.toPx()
is performed, it will return something greater than 0.
In other words, timeText is already moved to the top while the screen has just been drawn, so I cannot see the timetext.
From experience, it seems that the above issue occurs when index 1 item
is very short height and located at the top.
In this case, To make scrollAway
work normally, and to make timeText move when the item with index1 moves, what is the best way?
I thinks select index 2 or 3 item, which is returns the positive offset, and apply the offset between the index 2 or 3 item and item 1 to scrollAway?
Or is there something I'm missing?yschimke
07/17/2023, 6:03 PMyschimke
07/17/2023, 6:04 PMyschimke
07/17/2023, 6:06 PMyschimke
07/17/2023, 6:07 PMbarat
07/18/2023, 6:58 AMscrollaway
.
val tempBelowTimeTextState = ScalingLazyColumn.belowTimeText().create
Scaffold(
timeText = {
Text(
modifier = Modifier.fillMaxWidth(),
.scrollAway(scrollState = tempBelowTimeTextState.state)),
text = "testTime"
)
}
){
ScalingLazyColumn(
columnStae = tempBelowTimeTextState
){
SOME ITME
}
}
yschimke
07/18/2023, 8:48 AMbarat
07/18/2023, 9:55 AMyschimke
07/18/2023, 10:34 AMbarat
07/18/2023, 11:14 AMbarat
07/20/2023, 3:33 AMbarat
07/20/2023, 3:41 AMrememberActiveFocusRequester
does not request focus when pager scrolled.
So I thinks I need to way of focus request manually on horologist scalingLazyColumn or I can trigger onFocusChange manually.
Am I right? Or is there a better way?yschimke
07/20/2023, 6:03 AMbarat
07/20/2023, 7:37 AM