Status Update
Comments
je...@google.com <je...@google.com>
ma...@google.com <ma...@google.com> #2
Hello, can you please attach a sample that reproduces your error?
ca...@gmail.com <ca...@gmail.com> #3
I’ve attached two screen recordings demonstrating the mediator's behavior during the first and second launches after installation. Additionally,
mo...@google.com <mo...@google.com>
ke...@gmail.com <ke...@gmail.com> #4
Based on first_launch_after_installation.mp4
, your paging state is indeed showing null
for nextKey, so it makes sense that Paging concluded there are no more items to load.
So I think the question is why the PagingState
contains only an empty page and null
values. My guess is either
- RemoteMediator REFRESH actually returned empty data - what is the returned
allNewsItems
value on initial REFRESH? - RemoteMediator REFRESH successfully loaded data and inserted it into database, but Paging hasn't processed that yet by the time Append is triggered, so PagingState is empty.
The second case doesn't seem likely though.
If you attach an executable app, I can look into this further.
Otherwise, you may gain more insight through Paging logs with adb shell setprop log.tag.Paging VERBOSE
. You can also try implementing RemoteKeys
in this
Description
Description: Right now once you've consumed an event, but then realized that that event can't be used for your gesture, it's impossible to pass the next events (all events until all pointers are up) to child composables that listen to pointer events. So if you have a draggable child composable it will stop receiving pointer events until all the pointers are up (
awaitAllPointersUp()
inside of theforEachGesture {}
)Use Case: Let's say I have a composable with
Modifier.pointerInput {}
which is a parent of aHorizontalPager
. I want to implement a special horizontal left-to-right drag gesture that will instead of scrolling theHorizontalPager
do something else (drag the drawer for example). That gesture will only be possible in some part of the screen (let's say a rect300x300 px
at bottom left of the screen). So basically when the finger is inside of that zone I want to do the next steps:PointerEventPass.Initial
) and check whether it hits the special zone (300x300px).HorizontalPager's
draggable modifier will get triggered andHorizontalPager
will start being dragged).POINTER_DOWN
event and send it into the HorizontalPager (I don't necessary have to know who I'm sending the event to, the API may just send it to all the children and they will figure it out on their own). Then I want to pass all the subsequentPOINTER_MOVE
events into theHorizontalPager
as well until the pointer is up or canceled.Right now it's impossible to do this without relying on hacks like using
NestedScrollConnection
(to block theHorizontalPager's
scrolling until the touch slop is reached) or emulating gestures by sending them viaLocalView.current.dispatchTouchEvent()
.It would be really nice to have an API which would allow sending
PointerInputChanges
to children composables. This would make gesture handling in Jetpack Compose even more convenient. Maybe you already have something like this planned but it's just not public yet.