Status Update
Comments
ae...@gmail.com <ae...@gmail.com> #2
ChromiumPerf/android-pixel6-perf/system_health.memory_mobile/memory:chrome:all_processes:reported_by_chrome:malloc:max_committed_size_avg/browse_news
Verification workflow id: projects/62121018386/locations/us-central1/workflows/sandwich-verification-workflow-prod/executions/f430dab5-4642-48dd-a3d6-a50904c1d68e
ae...@gmail.com <ae...@gmail.com> #3
did NOT reproduce the regression with statistic: {'control_median': 135405568, 'lower': -2.0340368398504394, 'p_value': 0.42795460671186447, 'treatment_median': 135325696, 'upper': 1.0165479548803757}.
Issue closed.
jo...@google.com <jo...@google.com> #4
Hi, can you please share the entire Pager usage that reproduces this issue? Thanks!
ae...@gmail.com <ae...@gmail.com> #5
Hi. Here is an example.
val pagerState = rememberPagerState { 2 }
HorizontalPager(
state = pagerState,
flingBehavior = PagerDefaults.flingBehavior(
state = pagerState,
snapPositionalThreshold = 0.075f
)
) { page ->
when (page) {
0 -> {
LazyColumn(
modifier = Modifier.fillMaxSize(),
) {
items(...) {
...
}
}
}
1 -> {
Column(
Modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(16.dp)
) {
...
}
}
}
}
be...@google.com <be...@google.com>
ae...@gmail.com <ae...@gmail.com> #6
Hi. Is there any updates? Can't upgrade to 1.8.0-alpha08 because of this and 1.7.6 have blinking lazy lists which is not happens in 1.8.0-alpha08 so I really want to upgrade.
cl...@google.com <cl...@google.com> #7
Levi is this bug on your radar? Sounds like a regression so it would be good to investigate before 1.8 goes out
le...@google.com <le...@google.com> #8
Hi, thanks for bringing this up Clara.
For cases where competing scrollable containers exist we usually recommend overriding the TouchSlop for the outer component. The View's ViewPager uses a touch slop which is twice as the regular one, but we decided to not do the same and leave it up to the developer to do it if they want to.
If you're seeing a different behaviour than the one in my video, please feel free to upload a video so we can double check. Thanks!
ae...@gmail.com <ae...@gmail.com> #9
Hello.
For some reason, the text of your messages is not shown to me, I am replying to the text that came to me in the notification to the mail.
I watched your video, there is definitely a problem. At the 30th second, you try to scroll horizontally and you can’t. This is a problem, even a big problem, I would say. And there is no such problem in 1.7 compose. If you give me the source code, I can record a video for you for compose 1.7.
About overriding TouchSlop. This is the first time I hear about this. I asked ChatGPT what it is and how it is overriding and realized that it is not for nothing that I hear about this for the first time - this is definitely a workaround, and not a regular system solution.
Here is an example of code from ChatGPT about overriding TouchSlop. This code does not look normal to me.
@Composable
fun CustomPager(
state: PagerState,
modifier: Modifier = Modifier,
touchSlop: Float = 16f
) {
Box(modifier.pointerInput(Unit) {
detectHorizontalDragGestures(
onDragStart = { ... },
onDragEnd = { ... },
onDragCancel = { ... },
onHorizontalDrag = { change, dragAmount ->
change.consume()
state.scrollToOffset(state.currentPageOffsetFraction + dragAmount / size.width)
}
) {
val touchSlopOverride = touchSlop
awaitTouchSlopOrCancellation(it, PointerDirection.Horizontal, touchSlopOverride)
}
}) {
HorizontalPager(
state = state,
modifier = Modifier.fillMaxSize()
) { page ->
// Content
}
}
}
I also want to add that I have never seen a problem like this anywhere! Neither XML, nor iOS, nor Flutter have this logic! The usual logic is this - you start scrolling the list vertically - until you release your finger - the pager will not respond. You start scrolling horizontally, even if it is crooked - the pager responds and responds easily, but the list will not respond.
Only in compose (this is shown in your video) I see a different logic where if I scrolled the list I cannot scroll the pager and I am outraged that you call this the expected behavior. This is not true at all!
Imagine you as a user scrolled the store section and want to go to the next page. Why do you need to go back to the beginning of the list of the current page to be able to scroll horizontally? I believe that this is either a bug or an erroneous implementation.
Please fix it.
Description
Jetpack Compose version: 1.8.0-alpha07
Jetpack Compose component(s) used: HorizontalPager, LazyColumn
Android Studio Build: Android Studio Meerkat | 2024.3.1 Canary 8
Kotlin version: 2.1.0
Steps to Reproduce or Code Sample to Reproduce:
Please fix.