Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compose LazyColumn not scrollable #2602

Open
rom1v opened this issue Aug 28, 2021 · 5 comments
Open

Compose LazyColumn not scrollable #2602

rom1v opened this issue Aug 28, 2021 · 5 comments

Comments

@rom1v
Copy link
Collaborator

rom1v commented Aug 28, 2021

  • scrcpy version: v1.18

Tracking issue from this StackOverflow post: https://stackoverflow.com/questions/68954790/why-is-lazycolumn-not-scrollable-using-mouse-but-recycler-view-is

I am using scrcpy to mirror and control my physical test mobile device using my desktop.

I am migrating an app from views to jetpack compose.
This is something I observed and I am curious why this happens so.

Using the desktop mouse scroll wheel, I am able to scroll a RecyclerView.

But I am not able to do so in a LazyColumn.

Note: I am able to scroll the LazyColumn using the mouse by click and drag.
Only the scroll wheel is not working.

https://stackoverflow.com/questions/68954790/why-is-lazycolumn-not-scrollable-using-mouse-but-recycler-view-is/68964204#comment121884201_68964204

I have not tried with OTG as I don't have one. In case you missed it, on the same desktop using scrcpy I am able to scroll the app when it had recycler view. The issue is when using compose LazyColumn. But I tried an alternative of scrcpy and that scrolls both recycler view and compose LazyColumn.

Minimal sample to reproduce: https://github.com/Abhimanyu14/compose-scroll

EDIT: oops, I missed the initial issue #2598. I keep this one because the discussions are there.

@rom1v
Copy link
Collaborator Author

rom1v commented Aug 28, 2021

I will try to take a look soon.

@rom1v
Copy link
Collaborator Author

rom1v commented Aug 28, 2021

@Abhimanyu14 Thank you very much for the sample, that's helpful: I reproduce the problem.

However, I didn't find a way to make it work (by changing the values passed in the MotionEvent here).

So I connected my mouse via bluetooth to the device to inject "real" scroll events (without scrcpy being involved at all), and the problem is exactly the same:

scroll.mp4

Therefore, the problem is probably with Compose.

rom1v added a commit that referenced this issue Aug 28, 2021
This has no practical impact (AFAIK), but a scroll events should come
from a mouse.

Refs #2602 <#2602>
@Abhimanyu14
Copy link

This a software similar to scrcpy.
And this scrolls both Views and Composables.

compose.mov

@rom1v
Copy link
Collaborator Author

rom1v commented Aug 29, 2021

Which software is it?

Could you create a custom view in a sample Android app and log scroll and touch events? Which events does it trigger on scrolling? (I'm pretty sure it's not scroll events, but I'm interested in what it does)

@Abhimanyu14
Copy link

Which software is it?

Could you create a custom view in a sample Android app and log scroll and touch events? Which events does it trigger on scrolling? (I'm pretty sure it's not scroll events, but I'm interested in what it does)

Software - https://www.apowersoft.com/phone-mirror

TeofilisMartisius pushed a commit to TeofilisMartisius/scrcpy that referenced this issue Aug 30, 2021
This has no practical impact (AFAIK), but a scroll events should come
from a mouse.

Refs Genymobile#2602 <Genymobile#2602>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants