Status Update
Comments
le...@google.com <le...@google.com> #2
This is a particularly hard device to come by - do you happen to have access to the device? If so could you provide us with the output of: adb shell dumpsys media.camera > info.txt
Thanks!
to...@gmail.com <to...@gmail.com> #3
Stacktrace:
Caused by: java.lang.IllegalArgumentException: Can not get supported output size under supported maximum for the format: 34
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes(SupportedSurfaceCombination.java:355)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions(SupportedSurfaceCombination.java:197)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions(Camera2DeviceSurfaceManager.java:198)
at androidx.camera.core.CameraX.calculateSuggestedResolutions(CameraX.java:943)
at androidx.camera.core.CameraX.bindToLifecycle(CameraX.java:293)
at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:227)
Below are some findings based on our debugging
When Dex is connected
previewConfig.getMaxResolution() is returning "731x411" as maxSize.
Inside Preview.Builder.build() -> Default_MAX_resolution is set to "CameraX.getSurfaceManager().getPreviewSize()" which is 731x411
this is being picked as maxSize.
While rendering maxSize is 731x411 and minSize is 640x480 and below are available outputSizes
0 = {Size@11860} "4032x3024"
1 = {Size@11861} "3984x2988"
2 = {Size@11862} "4032x2268"
3 = {Size@11863} "3024x3024"
4 = {Size@11864} "2976x2976"
5 = {Size@11865} "3840x2160"
6 = {Size@11866} "3264x2448"
7 = {Size@11867} "4032x1960"
8 = {Size@11868} "2880x2160"
9 = {Size@11869} "3264x1836"
10 = {Size@11870} "2160x2160"
11 = {Size@11871} "2560x1440"
12 = {Size@11872} "2224x1080"
13 = {Size@11873} "2048x1152"
14 = {Size@11874} "1920x1080"
15 = {Size@11875} "1440x1080"
16 = {Size@11876} "1088x1088"
17 = {Size@11877} "1280x720"
18 = {Size@11878} "1024x768"
19 = {Size@11879} "1056x704"
20 = {Size@11880} "960x720"
21 = {Size@11881} "960x540"
22 = {Size@11882} "720x720"
23 = {Size@11883} "800x450"
24 = {Size@11884} "720x480"
25 = {Size@11885} "640x480"
26 = {Size@11886} "352x288"
27 = {Size@11887} "320x240"
28 = {Size@11888} "256x144"
29 = {Size@11889} "176x144"
and couldn't find any size in this range.
When Dex not connected
minsize = 640x480
maxsize = 1920x1080
0 = {Size@11836} "4032x3024"
1 = {Size@11837} "3984x2988"
2 = {Size@11838} "4032x2268"
3 = {Size@11839} "3024x3024"
4 = {Size@11840} "2976x2976"
5 = {Size@11841} "3840x2160"
6 = {Size@11842} "3264x2448"
7 = {Size@11843} "4032x1960"
8 = {Size@11844} "2880x2160"
9 = {Size@11845} "3264x1836"
10 = {Size@11846} "2160x2160"
11 = {Size@11847} "2560x1440"
12 = {Size@11848} "2224x1080"
13 = {Size@11849} "2048x1152"
14 = {Size@11850} "1920x1080"
15 = {Size@11851} "1440x1080"
16 = {Size@11852} "1088x1088"
17 = {Size@11853} "1280x720"
18 = {Size@11854} "1024x768"
19 = {Size@11855} "1056x704"
20 = {Size@11856} "960x720"
21 = {Size@11857} "960x540"
22 = {Size@11858} "720x720"
23 = {Size@11859} "800x450"
24 = {Size@11860} "720x480"
25 = {Size@11861} "640x480"
26 = {Size@11862} "352x288"
27 = {Size@11863} "320x240"
28 = {Size@11864} "256x144"
29 = {Size@11865} "176x144"
and we have 12 available sizes in this range
Camera2DeviceSurfaceManager.java:: getPreviewSize()
mCameraSupportedSurfaceCombinationMap.get(cameraId).getSurfaceDefinition().getPreviewSize() = "1920x1080"
cameraId=0
le...@google.com <le...@google.com> #4
The issue root cause is that CameraX will default filter out sizes smaller than 640x480. For Preview, the max size will be limited to under display size. I checked the HW spec info for the issue related devices. Display size of FUJITSU F-04J/F-05J is 360x640. That will result int that no size exists in the conditions that is larger or equal to 640x480 and smaller or equal to 360x640.
A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
For device FUJITSU arrowsM04, I checked its HW spec info and its display size I found is 1280x720. It seems that the problem should not exist in the device.
Could you confirm that the problem exist on arrowsM04 device? What will be the returned value when using Display#getRealSize to obtain the display size?
to...@gmail.com <to...@gmail.com> #5
> A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
OK. I will try it.
> Could you confirm that the problem exist on arrowsM04 device?
We receive the crash report (Crashlytics) that this crash has occurred on arrowsM04.
We don't have this device so we can't confirm that the problem really exist on arrowsM04.
> What will be the returned value when using Display#getRealSize to obtain the display size?
We can't investigate it for the same reason.
Thank you.
le...@google.com <le...@google.com> #6
This issue happened on devices that the display size is smaller than 640x480. In original auto-resolution mechanism, supported sizes smaller than 640x480 will be default filter out.
The auto-resolution mechanism encodes the guaranteed configurations tables in CameraDevice#createCaptureSession(SessionConfiguration). It defines that the PREVIEW size is the small one of the device display size and 1080p. The PREVIEW size will be the maximal size limitation for Preview use case. The reason it limits the size to display size and 1080p is the stream output in display size or 1080p has been able to provide good enough preview quality. Therefore, auto-resolution mechanism will limit the selected size to be smaller than the small one of the device display size and 1080p.
With above two conditions, in this issue, all sizes smaller than 640x480 have been filter out, therefore, there is no size smaller than the display size 320x240 can be selected to use. And cause the exception.
Solution:
When the display size is smaller than 640x480, auto-resolution mechanism won't filter out those small sizes smaller than 640x480. This makes those small size be left and can be selected for the Preview use case on small display devices.
The solution has been merged and will be included in next CameraX release.
to...@gmail.com <to...@gmail.com> #7
Hello.
This crash still occurs.
- CAMERAX VERSION: 1.0.0-beta4
- ANDROID OS BUILD NUMBER: Android 7.1.1
- DEVICE NAME: FUJITSU F-02H
We receive following crash report from FUJITSU F-02H. So far We have received this crash report only from F-02H.
java.lang.IllegalArgumentException
Can not get supported output size under supported maximum for the format: 34
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes (SupportedSurfaceCombination.java:349)
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions (SupportedSurfaceCombination.java:197)
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions (Camera2DeviceSurfaceManager.java:198)
androidx.camera.core.CameraX.calculateSuggestedResolutions (CameraX.java:949)
androidx.camera.core.CameraX.bindToLifecycle (CameraX.java:351)
androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle (ProcessCameraProvider.java:230)
(our application's package name).CameraFragment.bindCameraUseCases (CameraFragment.java:174)
jo...@google.com <jo...@google.com> #8
Could you help to provide the following information to clarify the issue?
1. Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
2. Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
to...@gmail.com <to...@gmail.com> #9
- Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
Yes
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
Since we don't have this device, we'll try to collect this information in the next version of our app. The next version will be released later this month.
le...@google.com <le...@google.com> #10
Hello.
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
We have collected the output of the device where the crash occurs.
Device1
- Model : arrows Be F-05J
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Device2
- Model : Fujitsu arrows M04
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Additional Information
CameraX version : 1.0.0-beta04
We collect the supported output sizes by following code.
val errorString = buildString {
append("The supported output sizes of ImageFormat.PRIVATE: ")
(requireContext().getSystemService(Context.CAMERA_SERVICE) as CameraManager).apply {
cameraIdList.forEachIndexed { index, cameraId ->
val msg = if (VERSION.SDK_INT >= VERSION_CODES.M) {
val configurationMap =
getCameraCharacteristics(cameraId).get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)
val sizes = configurationMap?.getOutputSizes(ImageFormat.PRIVATE)
"CameraId $index: ${sizes?.joinToString(" ,")}"
} else {
"CameraId $index: This device version is under M."
}
append(msg)
}
}
}
to...@gmail.com <to...@gmail.com> #11
le...@google.com <le...@google.com> #12
I tried to find the device specs and both 720x1280
size display. For the camera id 0 device, it is a different case that the display size is larger than 640x480
but the device only supports a 480x480
size. The case also caused the same IllegalArgumentException and was also fixed by 1.0.0-beta04
release. Before 480x480
size would be filtered out and then caused the IllegalArgumentException. After it was merged, the 640x480
size threshold was removed and then the 480x480
size would be kept and selected to use.
It looks like 1.0.0-beta04
release had been used to collect the supported sizes information. But the issue should have been fixed by 1.0.0-beta04
release. Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
CameraX's 1.0.0-beta04
version. Maybe you can also consider to upgrade to the latest 1.0.0-rc01
version for your application. Thanks.
to...@gmail.com <to...@gmail.com> #13
Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
We collect informations only from the device on which IllegalArgumentException happened.
Our latest app uses CameraX version 1.0.0-beta10
and this issue still occurres.
However we don't receive crash report from Fujitsu arrows Be F-05J
or Fujitsu arrows M04
so far. (This doesn't mean this issue is fixed on these devices because our app is heavily rely on camera so these device's user wouldn't use our app anymore.)
Instead, we receive crash report from
- Model : Fujitsu F-03K
- Android Version : 7.1.2
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0 : 480x480
CameraId 1 : 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
to...@gmail.com <to...@gmail.com> #14
I missed some settings when I simulated the issue by robolectric test so that I was not able to reproduce it. Now, I can reproduce the issue if the device only supports one 480x480 resolution. I'm working on the solution and target to make it included in next release.
to...@gmail.com <to...@gmail.com> #15
Branch: androidx-main
commit 69d15dff7bb857ee33a0f643ff42a0f8bc475ab2
Author: charcoalchen <charcoalchen@google.com>
Date: Fri Jan 08 18:30:03 2021
Fixed IllegalArgumentException issue happened when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480.
Do not filter out sizes smaller than 640x480 when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480.
Relnote:"Fixed IllegalArgumentException issue happened when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480."
Bug: 150506192
Test: SupportedSurfaceCombinationTest
Change-Id: I2a63ce8e2ad42a9cc060c8635ac3603bf440b1ec
M camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java
M camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/SupportedSurfaceCombinationTest.java
le...@google.com <le...@google.com> #16
to...@gmail.com <to...@gmail.com> #17
Thanks (Still closed).
So no way for me to be more autonomous for the second wave of builds that will needed? I've sent him the test APKs.
le...@google.com <le...@google.com>
to...@gmail.com <to...@gmail.com> #18
So I guess we can thank the nice Canadian user who took a lot of time on this. (And me at the same time maybe)
I mostly reversed the pageToken for the snapshot list and did the dichotomy search.
The PR causing issue on his device (and his wife that have the exact same device) is
As a reminder he have no issue on any other non Compose app on his device, so the platform way works there.
le...@google.com <le...@google.com> #19
Hey, the change you linked was published on 1.4.0-alpha04 and you previously mentioned that the issue was between alpha02 and alpha03?
That change didn't raise any signals internally and externally (apart from your user's device) since it is a parity change with platform, but since you're saying they didn't have issues with other apps I'm going to try and get a hold of a similar device so I can try to reproduce the issue. In the meantime could you give me a barebones structure for one of the screens where the issue is happening so I can create a sample app that is close enough to yours to test when I get the device?
Thanks.
to...@gmail.com <to...@gmail.com> #20
Yes the user mixed the APKs during the first tests as I sent him all of them at once.
Improved the process later with version display so he could not repeat the mistake.
I'm joining Layout inspector export (From Girafe A6) for one of the screen should give you everything and details.
The user report the exact same behavior on his wife phone (same device) with no other issues in any other apps.
Since he already passed a couple of hours on this, he agreed to run other test builds if you need to logs things if you know what. I'd really like this to be fixed in final 1.4 and stop chasing bugs and alphas. 1 year of doing this was exhausting I'd like some rest now that most of the other issues are fixed :)
to...@gmail.com <to...@gmail.com> #21
Bump, RC is tagged :(
As I said I can do whatever debugging is necessary with the help of the user and would appreciate a way to move forward if you can't get the device.
to...@gmail.com <to...@gmail.com> #22
Really love the communication and the feeling that external devs are important and partners as all the communications says ;)
Can you check
If not can you check if that could be the cause, since from the bugs it's rare and touched the same kind of devices.
le...@google.com <le...@google.com> #23
Hi, we still don't have updates on this, still trying to get a hold of a similar device. Since this only happens with a single device model it's a bit tricky to reproduce. I talked with the team internally and it seems that any sort of additional debugging to actually find the issue would need to be done on the device.
The code change in
If not can you check if that could be the cause, since from the bugs it's rare and touched the same kind of devices.
Maybe the device is generating bad MotionEvents and that in turn can cause the scroll to not get the proper events to generate an accurate fling, but without a device to test it it would hard for us to know.
In the meantime, we can take a look at both the events that the pointer input system receives and the MotionEvents generated by the specific device vs a device where it works properly? Maybe that could give an insight on what type of events Compose is receiving.
For looking into the pointer input system events generated to a given composable you can do something like:
LazyColumn(modifier = Modifier.pointerInput(Unit) {
coroutineScope {
awaitEachGesture {
while (isActive){
awaitPointerEvent(pass = PointerEventPass.Initial).changes.forEach{
println("$it")
}
}
}
}
})
For looking into MotionEvents you can log inside dispatchTouchEvent of your root activity.
Let us know what you find out.
Thanks.
to...@gmail.com <to...@gmail.com> #24
Thanks, since I don't really know what I'm looking for I attached the logs from the user.
And a simple fling from my device (P6 Pro):
One big difference I can see is the classification.
All mine are: classification=AMBIGUOUS_GESTURE
all his are classification=NONE
18:18:10.442 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861375, position=Offset(70.0, 2008.0), pressed=true, pressure=0.31746033, previousUptimeMillis=555861375, previousPosition=Offset(70.0, 2008.0), previousPressed=false, isConsumed=false, type=Touch, historical=[],scrollDelta=Offset(0.0, 0.0))
18:18:10.448 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_DOWN, actionButton=0, id[0]=0, x[0]=70.0, y[0]=2008.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=555861375, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=980593719 }
18:18:10.464 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(false): MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=70.0, y[0]=2008.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=AMBIGUOUS_GESTURE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=2, eventTime=555861396, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=725713755 }
18:18:10.478 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861413, position=Offset(104.0, 1938.0), pressed=true, pressure=0.36507937, previousUptimeMillis=555861375, previousPosition=Offset(70.0, 2008.0), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=555861400, position=Offset(70.0, 2008.0)), HistoricalChange(uptimeMillis=555861408, position=Offset(87.0, 1974.0)), HistoricalChange(uptimeMillis=555861413, position=Offset(104.0, 1938.0))],scrollDelta=Offset(0.0, 0.0))
18:18:10.480 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=104.015724, y[0]=1937.9667, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=AMBIGUOUS_GESTURE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=3, eventTime=555861413, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=461611088 }
18:18:10.492 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861421, position=Offset(134.1, 1859.6), pressed=true, pressure=0.41269845, previousUptimeMillis=555861413, previousPosition=Offset(104.0, 1938.0), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=555861417, position=Offset(122.0, 1901.0)), HistoricalChange(uptimeMillis=555861421, position=Offset(134.0, 1860.0))],scrollDelta=Offset(0.0, 0.0))
18:18:10.495 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=134.09256, y[0]=1859.6483, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=AMBIGUOUS_GESTURE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=2, eventTime=555861421, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=598428426 }
18:18:10.509 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861444, position=Offset(169.1, 1637.2), pressed=true, pressure=0.5714286, previousUptimeMillis=555861421, previousPosition=Offset(134.1, 1859.6), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=555861425, position=Offset(144.0, 1822.0)), HistoricalChange(uptimeMillis=555861429, position=Offset(152.0, 1783.0)), HistoricalChange(uptimeMillis=555861433, position=Offset(158.0, 1745.0)), HistoricalChange(uptimeMillis=555861437, position=Offset(163.0, 1704.0)), HistoricalChange(uptimeMillis=555861442, position=Offset(168.0, 1660.0))],scrollDelta=Offset(0.0, 0.0))
18:18:10.513 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=169.06133, y[0]=1637.1816, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=AMBIGUOUS_GESTURE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=5, eventTime=555861444, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=561305389 }
18:18:10.531 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861460, position=Offset(171.9, 1437.4), pressed=true, pressure=0.6984127, previousUptimeMillis=555861444, previousPosition=Offset(169.1, 1637.2), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=555861445, position=Offset(170.0, 1617.0)), HistoricalChange(uptimeMillis=555861450, position=Offset(173.0, 1568.0)), HistoricalChange(uptimeMillis=555861454, position=Offset(175.0, 1518.0)), HistoricalChange(uptimeMillis=555861458, position=Offset(174.0, 1466.0))],scrollDelta=Offset(0.0, 0.0))
18:18:10.535 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=171.88011, y[0]=1437.3815, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=AMBIGUOUS_GESTURE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=4, eventTime=555861460, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=488565489 }
18:18:10.550 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861479, position=Offset(120.4, 1172.2), pressed=true, pressure=0.8253969, previousUptimeMillis=555861460, previousPosition=Offset(171.9, 1437.4), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=555861462, position=Offset(170.0, 1412.0)), HistoricalChange(uptimeMillis=555861466, position=Offset(165.0, 1355.0)), HistoricalChange(uptimeMillis=555861471, position=Offset(152.0, 1295.0)), HistoricalChange(uptimeMillis=555861475, position=Offset(142.0, 1236.0)), HistoricalChange(uptimeMillis=555861479, position=Offset(122.0, 1177.0))],scrollDelta=Offset(0.0, 0.0))
18:18:10.550 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=120.384636, y[0]=1172.1539, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=AMBIGUOUS_GESTURE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=5, eventTime=555861479, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=516541290 }
18:18:10.570 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861504, position=Offset(0.0, 863.0), pressed=true, pressure=0.87301594, previousUptimeMillis=555861479, previousPosition=Offset(120.4, 1172.2), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=555861483, position=Offset(104.0, 1123.0)), HistoricalChange(uptimeMillis=555861487, position=Offset(87.0, 1070.0)), HistoricalChange(uptimeMillis=555861491, position=Offset(71.0, 1017.0)), HistoricalChange(uptimeMillis=555861495, position=Offset(46.0, 974.0)), HistoricalChange(uptimeMillis=555861500, position=Offset(25.0, 932.0))],scrollDelta=Offset(0.0, 0.0))
18:18:10.572 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_MOVE, actionButton=0, id[0]=0, x[0]=0.0, y[0]=863.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=AMBIGUOUS_GESTURE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=5, eventTime=555861504, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=989696186 }
18:18:10.573 Debug app.symfonik.music.player.debug V MediaGridKt$MediaGrid$1$1$1.invokeSuspend@89: pE: PointerInputChange(id=PointerId(value=15), uptimeMillis=555861508, position=Offset(0.0, 863.0), pressed=false, pressure=0.87301594, previousUptimeMillis=555861504, previousPosition=Offset(0.0, 863.0), previousPressed=true, isConsumed=false, type=Touch, historical=[],scrollDelta=Offset(0.0, 0.0))
18:18:10.575 Debug app.symfonik.music.player.debug V StartActivity.dispatchTouchEvent@377: dTE(true): MotionEvent { action=ACTION_UP, actionButton=0, id[0]=0, x[0]=0.0, y[0]=863.0, toolType[0]=TOOL_TYPE_FINGER, buttonState=0, classification=NONE, metaState=0, flags=0x0, edgeFlags=0x0, pointerCount=1, historySize=0, eventTime=555861508, downTime=555861375, deviceId=4, source=0x1002, displayId=0, eventId=866274337 }
to...@gmail.com <to...@gmail.com> #25
So after a lot of pain due to java.lang.NoSuchMethodError: No static method AnimatedContent(Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V in class Landroidx/compose/animation/AnimatedContentKt;
in 1.5 I made him test snapshot 9725230 and the issue is still present.
Attached same logs in case that other PR did change the events received.
le...@google.com <le...@google.com> #26
Thanks for the logs, I'll take a look and report back.
to...@gmail.com <to...@gmail.com> #27
Bump?
le...@google.com <le...@google.com> #28
Hey, I took some time looking into the logs, the classification is not really a problem, even though it's different. In my own device the classification is None and I don't see the problem.
Something that caught my attention was that in one of the log files you sent I see a number of Cancel events in the middle of Move events. This might indicate that Motorola's implementation of the Root View is somehow canceling the move events. Any cancelation in the motion events will cause the inner draggable to emit a velocity of 0 to the fling system, which might explain the hiccups your user is seeing.
I'm assuming these events come from the Root Activity in your app and no compose hierarchy is outside of it, this is important because these events will have come straight from the system instead of another compose hierarchy that might send cancel events. If this assumption is correct and you'd like to confirm you might add markers to the logs to indicate the start/end of the flings. You can do this from a NestedScrollConnection around one of your lists. You can emit a log onPreScroll and another onPostFling, this should capture the whole range of a drag+fling movement. If in the middle of the movement you see a MotionEvent action cancel, then this indicates that the system is canceling the movement. The ideal log should be a down event followed by a series of move events and finally an up event.
If this is a device issue, you may ask the user if there has been a system update which might explain why they've only started seeing this recently.
In any case, let us know what you find out. Thanks.
to...@gmail.com <to...@gmail.com> #29
If this is a device issue, you may ask the user if there has been a system update which might explain why they've only started seeing this recently.
That's the first thing I asked him when he report the issue, before doing all the investigation.
This is not hardware as 2 devices does this He have 0 issues on any other applications (But not sure he have other recent compose apps). Reverting to the commit just before that patch does fix the issue for those devices.
The app activity is just a single setContent{}
there's no views or anything else and yes I added the logs there as requested.
I can add more logs to see the start and end but I suppose this would just confirm the cancel events, not the source if it happens outside of Compose.
Is there any change to have a workaround or something I can as an hack like filtering / rewriting the wrong events? I suppose a call or a system dialog during a drag would trigger a valid cancel event too?
le...@google.com <le...@google.com> #30
Hi, we're still waiting for the device. In the meantime, we're addressing some fixes in our velocity tracker that may help you as well. We received a report of a case similar to yours (a single device, this time a watch). They reported that using our fix resolved the problem for them, so it might solve for your as well.
The fix is still being tested, so it hasn't landed as the default behavior, but you can still access it by flipping this flag to true:
to...@gmail.com <to...@gmail.com> #31
Thanks, is this in 1.5 B1 or will only be in 1.6 A1?
le...@google.com <le...@google.com> #32
They will be available in the next alpha.
le...@google.com <le...@google.com> #33
Hi, we just received the device. Could you provide an apk with a version of the app where the issue is happening? I tried using a simple LazyColum/LazyGrid, but they scroll fine. Thanks!
to...@gmail.com <to...@gmail.com> #34
le...@google.com <le...@google.com> #35
Hi, thanks I was able to reproduce the issue using your PlayStore version. Using a simple LazyColum/LazyGrid doesn't have the same problem, so this means that there's some specific setup on your screen that may be causing this issue. Is there anything else you can tell us about those screens? From using your app it seems you have some pointer input interactions in the list items? In any case, I'll try to check if there's something different about this device's motion events.
to...@gmail.com <to...@gmail.com> #36
From the user report this touches everything that is scrollable.
The only thing I can think of that touches most of the screens would be the nestedScroll. (The container may change)
Box(
modifier = Modifier
.fillMaxSize()
.nestedScroll(topButtonBarState.nestedScrollConnection),
)
val nestedScrollConnection = remember<NestedScrollConnection> {
object : NestedScrollConnection {
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
val delta = available.y
val newOffset = topBarOffsetPx.floatValue + delta
topBarOffsetPx.floatValue = newOffset.coerceIn(-topBarScrollDistancePx, 0f)
return Offset.Zero
}
}
}
Ho and yes most of the images can be long press to drag and drop:
@Composable
fun <T : Any> Draggable(
modifier: Modifier = Modifier,
dragDataProducer: () -> T,
content: @Composable (state: DraggableState) -> Unit,
) {
var iAmBeingDragged by remember { mutableStateOf(false) }
var iAmOverTarget by remember { mutableStateOf(false) }
var mySourcePosition by remember { mutableStateOf(Offset.Zero) }
val dragInfo = LocalDragInfo.current
val haptic = LocalHapticFeedback.current
LaunchedEffect(key1 = iAmOverTarget) {
if (iAmOverTarget) {
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
}
}
Box(
propagateMinConstraints = false, // we stretch content if we are stretched
modifier = modifier
.onGloballyPositioned {
mySourcePosition = it.localToWindow(Offset.Zero)
}
.pointerInput(mySourcePosition) {
detectDragGesturesAfterLongPress(
onDragStart = {
dragInfo.isDragging = true
dragInfo.sourcePosition = mySourcePosition
dragInfo.dragPosition = mySourcePosition + it
dragInfo.draggableComposable = { content(DraggableState.DRAGGABLE) }
dragInfo.draggedData = dragDataProducer()
iAmBeingDragged = true
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
},
onDragEnd = {
dragInfo.receivingAt?.let { receivingAt ->
if (receivingAt.contains(dragInfo.dragPosition + dragInfo.dragOffset)) {
dragInfo.draggedDataReceiver?.invoke(dragInfo.draggedData!!)
}
}
dragInfo.isDragging = false
dragInfo.dragOffset = Offset.Zero
iAmBeingDragged = false
},
onDragCancel = {
dragInfo.dragOffset = Offset.Zero
dragInfo.isDragging = false
iAmBeingDragged = false
},
onDrag = { change, dragAmount ->
change.consume()
dragInfo.dragOffset += Offset(dragAmount.x, dragAmount.y)
dragInfo.receivingAt?.let { receivingAt ->
iAmOverTarget = receivingAt.contains(dragInfo.dragPosition + dragInfo.dragOffset)
}
},
)
},
) {
content(if (iAmBeingDragged) DraggableState.NORMAL_DRAGGING else DraggableState.NORMAL)
}
}
to...@gmail.com <to...@gmail.com> #37
So just got another strange report today tied to the drag and drop posted above. Maybe it's linked as it seems there's also some wrong cancel events.
2023-06-06 01:26:42.504 Verbose/Logger: Information: XQ-CQ62/XQ-CQ62/33/13/XQ-CQ62/Sony/ 2023-06-06 01:26:42.505 Verbose/Logger: Information: 5.4.0 (1008[arm64-v8a,armeabi-v7a,armeabi]) - DisplayMetrics{density=2.8125, width=1080, height=2452, scaledDensity=2.8125, xdpi=449.704, ydpi=450.76} - FS:1.0 - AS:1.0
See video but the drag is randomly cancelled.
to...@gmail.com <to...@gmail.com> #38
Hum still no 1.6 release. Is there an ETA? (Like for next release day in 15) or is there some blocker due to U support and it will be longer?
I'd like to avoid playing with snapshots again to avoid too many side effects, but I'd still like to move on with the test :(
wb...@gmail.com <wb...@gmail.com> #39
From my logging with NestedScrollConnection, I see that in my case the onPreFling almost always has a zero available Velocity. If anybody has any idea on what could cause this?
to...@gmail.com <to...@gmail.com> #40
So the first issue seems fixed in 1.6 A1 and VelocityTrackerAddPointsFix
set to true just after SetContent
.
Is there known issues with this for the option to be disabled by default even if it's announced to be forced in RC?
Waiting for feedback about the second drag and drop issue.
to...@gmail.com <to...@gmail.com> #41
And got the confirmation that it fixes the other user drag and drop bug too.
Would love to have details about known issue / reasons it's off in A1 before putting that to open beta.
le...@google.com <le...@google.com> #42
Hey, I'm glad it fixes your issues. We will be conducting some experiments with the fix before landing it in full in the upcoming releases, that's why it's still turned off by default. The idea is to better understand the uses of our velocity tracker for further improvements. The final goal is that the flag will be removed and the final behavior will be with the fix.
to...@gmail.com <to...@gmail.com> #43
So there's no currently known blockers, just lack of tests and I can try in open beta and report back here? The open beta on that app is limited to 4K users but if I fix 2 users and break 3998 it won't be fun :)
le...@google.com <le...@google.com> #44
Aw, we do have tests in place. For context, this is a fix to the existing behavior that should approximate Compose velocities to the velocity calculation used by the platform. You should be safe and we will do a similar experiment on our side (that's why we're not turning it to true by default, we'd like to be extra sure the behavior is what we wanted it do be), but if you want to be even safer and you have the means I'd suggest you control the switching on/off of the flag using some remote config.
to...@gmail.com <to...@gmail.com> #45
That app have some targets providers that are full FOSS and their users don't like firebase/google trackers and want full offline functions so no remote config for that one.
I can add a temporary setting for the users to disable the feature if it's broken for them. Does changing the value instantly toggle the behavior or should I restart the app?
le...@google.com <le...@google.com> #46
It should be instant, since it's backed by state it will cause a recomposition.
to...@gmail.com <to...@gmail.com> #47
Ok perfect I'll do that then. Should we keep this issue opened and I report related issues here (if some occurs) or close and open new ones if needed?
le...@google.com <le...@google.com> #48
Yeah, I'll keep it open at least until we land the fix in full, and even then if your issue isn't fully fixed I'll keep it open :)
wb...@gmail.com <wb...@gmail.com> #49
I tried Compose 1.6alpha01 on an Android 7.1.1 device with the VelocityTrackerAddPointsFix set to true. On that device there is still no Fling present.
Eg a working device:
awaitPointerEvent: PointerInputChange(id=PointerId(value=9), uptimeMillis=293894052, position=Offset(238.5, 837.8), pressed=true, pressure=1.0, previousUptimeMillis=293894052, previousPosition=Offset(238.5, 837.8), previousPressed=false, isConsumed=false, type=Touch, historical=[],scrollDelta=Offset(0.0, 0.0))
awaitPointerEvent: PointerInputChange(id=PointerId(value=9), uptimeMillis=293894106, position=Offset(261.2, 921.8), pressed=true, pressure=1.0, previousUptimeMillis=293894052, previousPosition=Offset(238.5, 837.8), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=293894090, position=Offset(245.0, 750.5)), HistoricalChange(uptimeMillis=293894099, position=Offset(253.3, 780.3))],scrollDelta=Offset(0.0, 0.0))
onPreScroll available: Offset(0.0, 60.1) - Drag
onPostScroll available: Offset(0.0, 0.0) - Drag
onPostScroll consumed: Offset(0.0, 60.1)
awaitPointerEvent: PointerInputChange(id=PointerId(value=9), uptimeMillis=293894120, position=Offset(278.8, 987.7), pressed=true, pressure=1.0, previousUptimeMillis=293894106, previousPosition=Offset(261.2, 921.8), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=293894107, position=Offset(262.8, 814.3)), HistoricalChange(uptimeMillis=293894115, position=Offset(273.8, 852.3))],scrollDelta=Offset(0.0, 0.0))
onPreScroll available: Offset(0.0, 65.9) - Drag
onPostScroll available: Offset(0.0, 0.0) - Drag
onPostScroll consumed: Offset(0.0, 65.9)
awaitPointerEvent: PointerInputChange(id=PointerId(value=9), uptimeMillis=293894143, position=Offset(299.0, 1124.2), pressed=true, pressure=1.0, previousUptimeMillis=293894120, previousPosition=Offset(278.8, 987.7), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=293894123, position=Offset(281.8, 887.5)), HistoricalChange(uptimeMillis=293894132, position=Offset(289.8, 932.8)), HistoricalChange(uptimeMillis=293894140, position=Offset(297.0, 988.8))],scrollDelta=Offset(0.0, 0.0))
onPreScroll available: Offset(0.0, 136.5) - Drag
onPostScroll available: Offset(0.0, 0.0) - Drag
onPostScroll consumed: Offset(0.0, 136.5)
awaitPointerEvent: PointerInputChange(id=PointerId(value=9), uptimeMillis=293894157, position=Offset(307.5, 1255.0), pressed=true, pressure=1.0, previousUptimeMillis=293894143, previousPosition=Offset(299.0, 1124.2), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=293894148, position=Offset(303.3, 1058.3))],scrollDelta=Offset(0.0, 0.0))
awaitPointerEvent: PointerInputChange(id=PointerId(value=9), uptimeMillis=293894164, position=Offset(307.5, 1255.0), pressed=false, pressure=1.0, previousUptimeMillis=293894157, previousPosition=Offset(307.5, 1255.0), previousPressed=true, isConsumed=false, type=Touch, historical=[],scrollDelta=Offset(0.0, 0.0))
onPreScroll available: Offset(0.0, 130.8) - Drag
onPostScroll available: Offset(0.0, 0.0) - Drag
onPostScroll consumed: Offset(0.0, 130.8)
onPreFling available: (0.0, 7657.776) px/sec
onPreScroll available: Offset(0.0, 0.1) - Fling
onPostScroll available: Offset(0.0, 0.0) - Fling
onPostScroll consumed: Offset(0.0, 0.1)
...
onPostScroll consumed: Offset(0.0, 22.0)
onPreScroll available: Offset(0.0, 23.2) - Fling
onPostScroll available: Offset(0.0, 23.2) - Fling
onPostScroll consumed: Offset(0.0, 0.0)
onPostFling available: (0.0, 1901.2562) px/sec
onPostFling consumed: (0.0, 5756.5195) px/sec
The logs from the Android 7.1.x device:
awaitPointerEvent: PointerInputChange(id=PointerId(value=0), uptimeMillis=15408289, position=Offset(352.5, 1039.1), pressed=true, pressure=1.0, previousUptimeMillis=15408289, previousPosition=Offset(352.5, 1039.1), previousPressed=false, isConsumed=false, type=Touch, historical=[],scrollDelta=Offset(0.0, 0.0))
awaitPointerEvent: PointerInputChange(id=PointerId(value=0), uptimeMillis=15408307, position=Offset(353.0, 1034.7), pressed=true, pressure=1.0, previousUptimeMillis=15408289, previousPosition=Offset(352.5, 1039.1), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=15408302, position=Offset(352.5, 990.1))],scrollDelta=Offset(0.0, 0.0))
awaitPointerEvent: PointerInputChange(id=PointerId(value=0), uptimeMillis=15408323, position=Offset(355.5, 1014.6), pressed=true, pressure=1.0, previousUptimeMillis=15408307, previousPosition=Offset(353.0, 1034.7), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=15408312, position=Offset(353.5, 981.2))],scrollDelta=Offset(0.0, 0.0))
onPreScroll available: Offset(0.0, -9.5) - Drag
onPostScroll available: Offset(0.0, 0.0) - Drag
onPostScroll consumed: Offset(0.0, -9.5)
awaitPointerEvent: PointerInputChange(id=PointerId(value=0), uptimeMillis=15408395, position=Offset(398.4, 692.4), pressed=true, pressure=1.0, previousUptimeMillis=15408323, previousPosition=Offset(355.5, 1014.6), previousPressed=true, isConsumed=false, type=Touch, historical=[HistoricalChange(uptimeMillis=15408323, position=Offset(355.5, 965.2)), HistoricalChange(uptimeMillis=15408341, position=Offset(358.5, 937.2)), HistoricalChange(uptimeMillis=15408362, position=Offset(364.5, 892.2)), HistoricalChange(uptimeMillis=15408364, position=Offset(370.5, 845.3)), HistoricalChange(uptimeMillis=15408371, position=Offset(377.5, 784.3)), HistoricalChange(uptimeMillis=15408393, position=Offset(390.5, 714.4))],scrollDelta=Offset(0.0, 0.0))
onPreScroll available: Offset(0.0, -322.1) - Drag
onPostScroll available: Offset(0.0, 0.0) - Drag
onPostScroll consumed: Offset(0.0, -322.1)
awaitPointerEvent: PointerInputChange(id=PointerId(value=0), uptimeMillis=15408426, position=Offset(403.4, 541.5), pressed=true, pressure=1.0, previousUptimeMillis=15408395, previousPosition=Offset(398.4, 692.4), previousPressed=true, isConsumed=false, type=Touch, historical=[],scrollDelta=Offset(0.0, 0.0))
awaitPointerEvent: PointerInputChange(id=PointerId(value=0), uptimeMillis=15408472, position=Offset(403.4, 541.5), pressed=false, pressure=1.0, previousUptimeMillis=15408426, previousPosition=Offset(403.4, 541.5), previousPressed=true, isConsumed=false, type=Touch, historical=[],scrollDelta=Offset(0.0, 0.0))
onPreScroll available: Offset(0.0, -150.8) - Drag
onPostScroll available: Offset(0.0, 0.0) - Drag
onPostScroll consumed: Offset(0.0, -150.8)
onPreFling available: (0.0, 0.0) px/sec
onPostFling available: (0.0, 0.0) px/sec
onPostFling consumed: (0.0, 0.0) px/sec
Why is onPreFling available: (0.0, 0.0) px/sec always zero? I have a feeling this is what causes my issue. How would I be able to debug this further?
le...@google.com <le...@google.com> #50
Hi
wb...@gmail.com <wb...@gmail.com> #51
#50 as requested:
to...@gmail.com <to...@gmail.com> #52
Ok so it seems the new pointer fix does have side effects on fling. The native Compose one or the Chris banes Snapper.
I'm yet to build a repro and fully understand what's going on but on a LazyColumn with a small width and val flingBehavior = rememberSnapperFlingBehavior(listState, snapOffsetForItem = SnapOffsets.Start)
(Snapper version) then in some cases when you fling and end the fling gesture outside of the column the fling goes crazy.
When it happens typically, you fling up the lazycolumn start to scroll down as expected then quickly scroll up ultra fast up to the first item of the list.
Disabling VelocityTrackerAddPointsFix
restore proper behavior. This only occurs when the fling ends outside of the box of the column so no issue on full screen lazy column.
to...@gmail.com <to...@gmail.com> #53
Ok so no there other things broken with that option enabled :(
See attached videos OK is with that option off and NOK is with the option ON. As you can see the flings trigger erratic NestedScrollConnection data.
For that screen the NestedScrollConnection is :
internal class EnterAlwaysNestedScrollConnection(
private val offsetY: MutableState<Int>,
private val toolbarState: CollapsingToolbarState,
private val flingBehavior: FlingBehavior,
) : NestedScrollConnection {
private val scrollDelegate = ScrollDelegate(offsetY)
override fun onPreScroll(available: Offset, source: NestedScrollSource): Offset {
val dy = available.y
val toolbar = toolbarState.height.toFloat()
val offset = offsetY.value.toFloat()
val consume = if (dy < 0) {
val toolbarConsumption = toolbarState.dispatchRawDelta(dy)
val remaining = dy - toolbarConsumption
val offsetConsumption = remaining.coerceAtLeast(-toolbar - offset)
scrollDelegate.doScroll(offsetConsumption)
toolbarConsumption + offsetConsumption
} else {
val offsetConsumption = dy.coerceAtMost(-offset)
scrollDelegate.doScroll(offsetConsumption)
val toolbarConsumption = toolbarState.dispatchRawDelta(dy - offsetConsumption)
offsetConsumption + toolbarConsumption
}
return Offset(0f, consume)
}
override suspend fun onPreFling(available: Velocity): Velocity {
val left = if (available.y > 0) {
toolbarState.fling(flingBehavior, available.y)
} else {
available.y
}
return Velocity(x = 0f, y = available.y - left)
}
}
Thanks to Scaleway I've lost a tons of time in urgent servers migrations that I need to recover so won't be able to build a smaller repro project for now. But can provide details or anything useful to help fix those as the cure seems worse than the decease.
le...@google.com <le...@google.com> #54
Thanks for reporting this, I'll go back to trying to get a fix for the issue.
to...@gmail.com <to...@gmail.com> #55
Were you able to reproduce? I might be able to schedule a couple of hours on trying to repro end of next week if not.
le...@google.com <le...@google.com> #56
Hey, yeah, I have a possible fix, trying to get it landed before the next release. Thanks!
to...@gmail.com <to...@gmail.com> #57
Ok thanks.
On my side I'll go in prod next week with 1.6 A1 and VelocityTrackerAddPointsFix on, but auto disabled on the bugged parts of the app and that user can opt out.
This might brings more reports, but so far after a week and +/- 2K users having that version active in the beta no other issues reported.
ap...@google.com <ap...@google.com> #58
Branch: androidx-main
commit 238ca86f557c82eb5fb92aa3d3ac9e52b917b602
Author: Levi Albuquerque <levima@google.com>
Date: Wed Jul 05 11:39:01 2023
Use previous event when no historical is available in VT.
The calculation was redundant when adding events to the VT when there was no historical data. If there's no historical delta, we should use the previous event data to calculate the delta and add it to the reference offset.
Relnote: N/A
Bug: 269487059
Test: Previous tests should pass.
Change-Id: I710db9ae7f280293289272640f7757ff7b061c0d
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/input/nestedscroll/NestedScrollModifierTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/viewinterop/VelocityTrackingParityTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/VelocityTracker.kt
to...@gmail.com <to...@gmail.com> #59
So quickly tested alpha 02 and #52 is fixed.
But #53 is still completely broken.
The workaround I use on that screen:
DisposableEffect(Unit) {
val saved = VelocityTrackerAddPointsFix
VelocityTrackerAddPointsFix = false
onDispose {
VelocityTrackerAddPointsFix = saved
}
}
The good news is that I did not get any other report of any other issue. So if we can figure out #53 I guess this will be good.
le...@google.com <le...@google.com> #60
That's odd, the fix I landed on #58 was addressed because of your report #53, the normal flings on a list stopped working properly when VelocityTrackerAddPointsFix was true. With #58 this should be fixed + the original. I'll need to check it again in this case.
to...@gmail.com <to...@gmail.com> #61
The flings are the #52 and are fixed.
The #53 is about values sent to NestedScrollConnection
I'm on kid duty this week but can try to debug / log stuff in my app if you can't repro. I did 0 checks on that part so no idea if the issue is the onPreFling
or onPreScroll
Just tell me what you need.
to...@gmail.com <to...@gmail.com> #62
Some quick logs:
As you can see there's some inversion in the onPreScroll values and a complete reduce of the values too.
It happens after the onPreFling
That code is a quoted earlier:
override suspend fun onPreFling(available: Velocity): Velocity {
val left = if (available.y > 0) {
toolbarState.fling(flingBehavior, available.y)
} else {
// If velocity < 0, the main content should have a remaining scroll space
// so the scroll resumes to the onPreScroll(..., Fling) phase. Hence we do
// not need to process it at onPostFling() manually.
available.y
}
return Velocity(x = 0f, y = available.y - left)
}
The state fling
function is :
suspend fun fling(flingBehavior: FlingBehavior, velocity: Float): Float {
var left = velocity
scroll {
with(flingBehavior) {
left = performFling(left)
}
}
return left
}
I do not change fling or snap in that screen so it's probably using DefaultFlingBehavior
, not sure what is happening there but I hope you do :)
Logs:
Not working
Up
17:06:14.712 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -6.5) - Drag
17:06:14.724 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -94.5) - Drag
17:06:14.734 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -125.9) - Drag
17:06:14.744 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -351.8) - Drag
17:06:14.751 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -221.0) - Drag
17:06:14.761 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -200.1) - Drag
17:06:14.772 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreFling-QWom1Mo@231: onPreFling: (0.0, 3595.06) px/sec
17:06:15.091 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.0) - Fling
17:06:15.100 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 5.7) - Fling
17:06:15.109 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 5.4) - Fling
17:06:15.118 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 4.9) - Fling
17:06:15.125 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 4.8) - Fling
17:06:15.133 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 3.7) - Fling
17:06:15.142 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 3.2) - Fling
17:06:15.150 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 3.0) - Fling
17:06:15.158 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 2.3) - Fling
17:06:15.166 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 2.0) - Fling
17:06:15.175 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 1.9) - Fling
17:06:15.183 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 1.4) - Fling
17:06:15.191 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 1.2) - Fling
17:06:15.200 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 1.1) - Fling
17:06:15.208 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.8) - Fling
17:06:15.217 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.7) - Fling
17:06:15.225 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.5) - Fling
17:06:15.233 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.5) - Fling
17:06:15.241 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.3) - Fling
17:06:15.250 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.2) - Fling
17:06:15.257 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.1) - Fling
17:06:15.267 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.0) - Fling
Down
17:06:27.898 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 80.6) - Drag
17:06:27.910 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 175.1) - Drag
17:06:27.921 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 233.2) - Drag
17:06:27.929 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 240.1) - Drag
17:06:27.932 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreFling-QWom1Mo@231: onPreFling: (0.0, -5988.225) px/sec
17:06:27.932 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.0) - Fling
17:06:27.938 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -95.6) - Fling
17:06:27.946 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -47.5) - Fling
17:06:27.954 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -53.0) - Fling
17:06:27.963 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -46.6) - Fling
17:06:27.971 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -46.1) - Fling
17:06:27.979 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -51.0) - Fling
17:06:27.988 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -44.5) - Fling
17:06:27.996 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -43.6) - Fling
17:06:28.004 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -48.1) - Fling
17:06:28.013 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -41.8) - Fling
17:06:28.020 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -40.8) - Fling
17:06:28.029 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -39.8) - Fling
17:06:28.037 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -43.5) - Fling
17:06:28.045 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -37.6) - Fling
17:06:28.053 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -36.6) - Fling
17:06:28.062 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -39.9) - Fling
17:06:28.071 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -34.4) - Fling
17:06:28.079 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -33.4) - Fling
17:06:28.089 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -36.3) - Fling
17:06:28.095 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -31.4) - Fling
17:06:28.104 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -30.3) - Fling
17:06:28.112 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -32.9) - Fling
17:06:28.120 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -28.4) - Fling
17:06:28.129 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -27.5) - Fling
17:06:28.136 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -29.8) - Fling
Working: Up
17:07:22.088 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -112.5) - Drag
17:07:22.099 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -132.7) - Drag
17:07:22.109 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -164.8) - Drag
17:07:22.120 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -209.3) - Drag
17:07:22.127 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -467.4) - Drag
17:07:22.140 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreFling-QWom1Mo@231: onPreFling: (0.0, -35351.68) px/sec
17:07:22.140 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -0.8) - Fling
17:07:22.157 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -847.5) - Fling
17:07:22.183 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -881.7) - Fling
17:07:22.229 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1753.3) - Fling
17:07:22.280 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1728.7) - Fling
17:07:22.332 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1692.4) - Fling
17:07:22.382 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1649.3) - Fling
17:07:22.441 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1847.9) - Fling
17:07:22.498 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1769.5) - Fling
17:07:22.561 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1910.3) - Fling
17:07:22.621 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1587.8) - Fling
17:07:22.678 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1527.2) - Fling
17:07:22.725 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1198.0) - Fling
17:07:22.776 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -1165.7) - Fling
17:07:22.812 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -734.7) - Fling
17:07:22.846 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -730.4) - Fling
17:07:22.870 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -521.8) - Fling
17:07:22.897 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -488.6) - Fling
17:07:22.912 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -335.2) - Fling
17:07:22.933 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -485.2) - Fling
17:07:22.953 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -324.9) - Fling
17:07:22.973 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -295.8) - Fling
17:07:22.989 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -312.7) - Fling
17:07:23.007 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -446.4) - Fling
17:07:23.026 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -278.6) - Fling
17:07:23.041 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -293.8) - Fling
17:07:23.057 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -134.4) - Fling
17:07:23.066 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -284.4) - Fling
17:07:23.078 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -133.0) - Fling
17:07:23.089 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -145.4) - Fling
17:07:23.096 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -129.2) - Fling
17:07:23.111 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -256.4) - Fling
17:07:23.119 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -140.6) - Fling
17:07:23.135 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -250.0) - Fling
17:07:23.142 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -136.8) - Fling
17:07:23.158 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -241.9) - Fling
17:07:23.169 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -135.1) - Fling
17:07:23.179 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -117.0) - Fling
17:07:23.189 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -248.7) - Fling
17:07:23.202 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -114.6) - Fling
17:07:23.211 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -112.8) - Fling
17:07:23.218 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -126.9) - Fling
17:07:23.229 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -112.8) - Fling
17:07:23.238 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -109.8) - Fling
17:07:23.253 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -232.4) - Fling
17:07:23.262 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, -108.6) - Fling
Down
17:07:58.523 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 102.3) - Drag
17:07:58.530 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 186.1) - Drag
17:07:58.541 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 196.6) - Drag
17:07:58.542 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreFling-QWom1Mo@231: onPreFling: (0.0, 32128.457) px/sec
17:07:58.565 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 0.7) - Fling
17:07:58.581 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 513.0) - Fling
17:07:58.601 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 544.8) - Fling
17:07:58.624 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 800.0) - Fling
17:07:58.653 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 795.9) - Fling
17:07:58.680 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 1041.7) - Fling
17:07:58.712 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 1028.2) - Fling
17:07:58.743 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 769.8) - Fling
17:07:58.765 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 759.2) - Fling
17:07:58.793 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 746.7) - Fling
17:07:58.815 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 733.3) - Fling
17:07:58.843 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 721.4) - Fling
17:07:58.868 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 707.7) - Fling
17:07:58.902 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 912.1) - Fling
17:07:58.928 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 886.7) - Fling
17:07:58.960 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 652.4) - Fling
17:07:58.977 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 637.0) - Fling
17:07:59.005 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 621.3) - Fling
17:07:59.026 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 391.3) - Fling
17:07:59.044 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 597.1) - Fling
17:07:59.061 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 394.2) - Fling
17:07:59.079 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 390.3) - Fling
17:07:59.093 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 179.7) - Fling
17:07:59.107 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 381.1) - Fling
17:07:59.115 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 173.9) - Fling
17:07:59.129 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 347.8) - Fling
17:07:59.142 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 192.1) - Fling
17:07:59.156 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 337.8) - Fling
17:07:59.168 Debug app.symfonik.music.player.debug E EnterAlwaysNestedScrollConnection.onPreScroll-OzD1aCk@225: onPreScroll: Offset(0.0, 188.5) - Fling
ap...@google.com <ap...@google.com> #63
Branch: androidx-main
commit 06b392045c5d52f3d17751f594d8b017dec83b0e
Author: Levi Albuquerque <levima@google.com>
Date: Wed Aug 09 14:44:49 2023
Fix VelocityTracker test flakiness: VelocityTrackingParityTest
The historical events were being transformed twice and that influenced how the reference point was used in the tracker. Removed the historical transformation. Added a new test to check the parity between lists: flinging a similar list in both Views and Compose should get us to a similar item position.
Fixes: 293188485
Bug: 269487059
Test: Previous Tests Should pass and added new tests.
Change-Id: I3a6b8d84e3cede969716d0468c2f70854cb1434a
A compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/viewinterop/VelocityTrackingListParityTest.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/viewinterop/VelocityTrackingParityTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/input/pointer/MotionEventAdapter.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/VelocityTracker.kt
A compose/ui/ui/src/main/res/layout/android_compose_lists_fling.xml
A compose/ui/ui/src/main/res/layout/android_compose_lists_fling_item.xml
to...@gmail.com <to...@gmail.com> #64
Ok so back from holidays and tested with a recent snapshot 10683443 that contains this and it's still broken for #62 #53
BTW I also got a new strange crash with that snapshot :
le...@google.com <le...@google.com> #65
Hey, I'm looking into 53 now, I'll let you know if something's up. From what I understand in your logs in 62, "Not Working" happens when you activate the flag and "Working" when you disable it, right?
to...@gmail.com <to...@gmail.com> #66
Yes exactly.
to...@gmail.com <to...@gmail.com> #67
Are you able to reproduce with the given code or need more?
le...@google.com <le...@google.com> #68
Hey, yeah, I'm working on a fix for everything :D I'll update here once it lands.
le...@google.com <le...@google.com> #69
Hey, I submitted a fix for this last Friday so if you want to have a look before the next release I think you can just use a recent snapshot. The fix is still behind the same flag though. Let me know how it goes :)
to...@gmail.com <to...@gmail.com> #70
Works with 10758292, and could not find regressions in the other parts of the app :)
That was a long running issue thanks for all the fixes.
Completely unrelated but do you think you can help me have
to...@gmail.com <to...@gmail.com> #71
So I do not have a Samsung device but it seems on some device Samsung allows apps to run in popup windows.
When in that mode the app does not receive any input at all. Even when leaving that mode does not restore touches. Only kill app and restart.
No idea what to log if you can't reproduce. But will again need you here.
Edit: Seems this also happens with Lineage OS that offers the same feature. (But can't reproduce on pixels with freeform dev option enabled)
ap...@google.com <ap...@google.com> #72
Branch: androidx-main
commit 2c9e34d057b648833264cd86dd6c4a55cb5fca61
Author: Levi Albuquerque <levima@google.com>
Date: Thu May 25 16:50:07 2023
Flipping the VT bug fix flag
Now VelocityTracker will have the bug fix by default.
Relnote: VelocityTracker will now have the fix for adding points on by default. The fix can still be turned off by setting VelocityTrackerAddPointsFix to false if there's any issues.
Fixes: 284114350
Fixes: 269487059
Fixes: 282893051
Fixes: 295879271
Bug: 318621681
Test: N/A
Change-Id: Ib3877b1f81f19899dd91e20542fa589bf6ed5399
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/input/pointer/util/VelocityTracker.kt
Description
Jetpack Compose component(s) used: Most of them
Android Studio Build: Girafe
Kotlin version: 1.8.10
Steps to Reproduce or Code Sample to Reproduce:
I don't know how to reproduce, I'm pretty sure he changed some settings on the device but can't find anything in Compose code to figure out what.
That user on his device Moto G Power (2021) have lost all velocity in scrolling / fling actions.
It touches all lazyRow/Column with or without snapFling.
See attached video.
He's the only one to report that, so I suppose this is something similar to compose animation respecting the Android dev settings about animation scale. But I can't figure out to what setting / parameter this could be related.