Fix topic scrollbar item count for news loading and error states

Account for TopicToolbar and TopicHeader when computing itemsAvailable for TopicUiState.Success.
pull/2117/head
Saad Khan 6 days ago
parent 4ed499289a
commit 67cdbe8c3d

@ -190,9 +190,9 @@ private fun topicItemsSize(
TopicUiState.Error -> 2 // Toolbar and error message
TopicUiState.Loading -> 1 // Loading bar
is TopicUiState.Success -> when (newsUiState) {
NewsUiState.Error -> 0 // Nothing
NewsUiState.Loading -> 1 // Loading bar
is NewsUiState.Success -> 2 + newsUiState.news.size // Toolbar, header
NewsUiState.Error -> 3 // Toolbar, header, and error message
NewsUiState.Loading -> 3 // Toolbar, header, and loading indicator
is NewsUiState.Success -> 2 + newsUiState.news.size // Toolbar, header, and news items
}
}

Loading…
Cancel
Save