android / android/codelab-android-paging

List blinking when I restore state in fragment

Abierto
#167 7 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Kotlin
Estrellas
509
Forks
268
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

I have two fragments and bottom navigation. Every fragment contain list with paging. I use RemoteMediator to get data from api.
If I use launch in fragment then I always recreate list if I navigate between first and second fragment.
```
lifecycleScope.launch {
viewModel.items.collectLatest {
adapter?.submitData(it)
}
}
```

If I use launchWhenCreated or launchWhenStarted then list save it state, but when I navigate between first and second fragment it show blank list for maybe 1 second and it's create visual blinking.
How can I save paging 3 list state and show list immediately on fragment created?

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comienza con la recopilación del ciclo de vida del fragmento mostrada en el issue y la configuración de Paging respaldada por RemoteMediator. Reproduce la navegación entre los dos fragmentos y determina después si la lista restaurada se renderiza inmediatamente, sin un intervalo en blanco ni un parpadeo visual.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
android, kotlin
Área
mobile
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.