Status Update
Comments
so...@google.com <so...@google.com> #2
Are you saying that loadState being null is more correct initial state compared to the current
```
CombinedLoadStates(
refresh = InitialLoadStates.refresh,
prepend = InitialLoadStates.prepend,
append = InitialLoadStates.append,
source = InitialLoadStates
)
private val IncompleteLoadState = LoadState.NotLoading(false)
private val InitialLoadStates = LoadStates(
IncompleteLoadState,
IncompleteLoadState,
IncompleteLoadState
)
```
ni...@google.com <ni...@google.com> #3
Ideally we would not pass any initial state because it will always have some case where it is wrong - we should ideally wait for a real event from Paging before sending it downstream to user.
For example the initial state:
CombinedLoadStates(
refresh = InitialLoadStates.refresh,
prepend = InitialLoadStates.prepend,
append = InitialLoadStates.append,
source = InitialLoadStates
)
...will always have null
mediator states, even if they are using RemoteMediator. This can mess up loadstate logic that is waiting for some combination of source + mediator loads to happen. It's easy to filter the initial case, but it gets complicated if they want to switchMap between multiple streams and they all start with this initial state. Or also consider the case when coming from cached state and needing to filter this out... it's bad developer UX.
So we could either set this to nullable to denote "no state" or we could have some constant we use that can be easily filtered out like "BogusLoadState" and then people can do .filter { it !== BogusLoadState }
nj...@google.com <nj...@google.com>
se...@gmail.com <se...@gmail.com> #4
Alternatively, if we can read whether we have RemoteMediator
or not, we could try this for initial state which would be a lot more accurate:
private val InitialLoadStates = LoadStates(
LoadState.Loading,
IncompleteLoadState,
IncompleteLoadState
)
CombinedLoadStates(
refresh = InitialLoadStates.refresh,
prepend = InitialLoadStates.prepend,
append = InitialLoadStates.append,
source = InitialLoadStates,
mediatr = ??
)
di...@gal-digital.de <di...@gal-digital.de> #5
Don't you mind trying it out? You are better person for figuring out how to get RemoteMediator from PagingDataDiffer. To be honest I don't even know what RemoteMediator is used for
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit b7f9085d0b13af5a346d0712bbf3bc5a680c2fc9
Author: Sanura N'Jaka <sanura@google.com>
Date: Thu Apr 28 22:10:36 2022
Changing LazyPagingItem's inital LoadState refresh to Loading
Rather than LazyPagingItem having the inital LoadState
refresh being set to LoadState.NotLoading, we want it
to be LoadState.Loading
RelNote: "`LazyPagingItems` now sets the initial
`loadState` to have a `LoadState.Loading` refresh."
Test: lazyPagingInitialLoadState
Fixes: 224855902
Change-Id: I55043244f92c8029e4667df2e23c5813dcf2f729
M paging/paging-compose/src/main/java/androidx/paging/compose/LazyPagingItems.kt
M paging/paging-compose/src/androidTest/java/androidx/paging/compose/LazyPagingItemsTest.kt
Description
This is recurrent question from several developers as you can see below...
The answer is always the same: "Use BasicTexfield". But we want everything from the Material TextField except the padding?
Could you please provide a way to set this padding? (see image attached)