android / android/architecture-samples
[master] Animation of refresh is not smooth
- Dominant language
- Kotlin
- Stars
- 45.8k
- Forks
- 11.9k
- PR merge metrics
- No merged PRs in 30d
Description
If swipe to refresh is done animation of removing and then adding items is done. It caused by the implementation of the
`
private suspend fun updateTasksFromRemoteDataSource() {
val remoteTasks = tasksRemoteDataSource.getTasks()
if (remoteTasks is Success) {
// Real apps might want to do a proper sync, deleting, modifying or adding each task.
tasksLocalDataSource.deleteAllTasks()
remoteTasks.data.forEach { task ->
tasksLocalDataSource.saveTask(task)
}
} else if (remoteTasks is Result.Error) {
throw remoteTasks.exception
}
}
`
All tasks are removed and then new downloaded task are added one by one. This operation are propagated through the observers to the RecyclerView.
Contributor guide
Research direction
Start with updateTasksFromRemoteDataSource() and trace how its local data-source changes reach the RecyclerView observers during swipe-to-refresh. Reproduce the refresh animation and inspect the existing task-list update flow; done means refreshing no longer visibly removes and re-adds every task one by one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100