-
Notifications
You must be signed in to change notification settings - Fork 0
Integrate paging for Topic Screen
#25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Key changes: - Added `TopicPagingSource` to handle fetching paged data. - Modified `TopicViewModel` to use `Pager` for fetching and managing paged data. - Updated `TopicList` and `TopicScreenUI` to consume `LazyPagingItems`. - Added new dependencies for multiplatform paging (`cashapp-paging-common`, `cashapp-paging-compose-common`). - Updated `TopicRepository` with `getTopicsPage` function to support paged fetching. - Updated previews to reflect the new paged data structure.
Key changes: - Added `TopicPagingSource` to handle fetching paged data. - Modified `TopicViewModel` to use `Pager` for fetching and managing paged data. - Updated `TopicList` and `TopicScreenUI` to consume `LazyPagingItems`. - Added new dependencies for multiplatform paging (`cashapp-paging-common`, `cashapp-paging-compose-common`). - Updated `TopicRepository` with `getTopicsPage` function to support paged fetching. - Updated previews to reflect the new paged data structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in slack. Please review the PR yourself and improve quality overall, remove redundant code after switching to new implementation.
…ving the intermediate `UiState` and `fetchTopicList` logic. - Modify `TopicRepository.getTopicsPage` to return `List<TopicUi>`. - Make `TopicRepository.getTopics` private as it's now an internal detail. - Update UI components (`TopicList`, `TopicCard`, `TopicScreenUI`) and preview utils to reflect these changes. - Adjust `TopicPagingSource` to work with `TopicUi`. - Rename `ItemTopic` to `TopicUi` and move it to a separate file.
...onMain/kotlin/com/developersbreach/kotlindictionarymultiplatform/ui/screens/topic/TopicUi.kt
Outdated
Show resolved
Hide resolved
.../kotlin/com/developersbreach/kotlindictionarymultiplatform/ui/screens/topic/TopicScreenUI.kt
Outdated
Show resolved
Hide resolved
...lin/com/developersbreach/kotlindictionarymultiplatform/ui/screens/topic/TopicPagingSource.kt
Outdated
Show resolved
Hide resolved
...kotlin/com/developersbreach/kotlindictionarymultiplatform/ui/screens/topic/TopicViewModel.kt
Outdated
Show resolved
Hide resolved
...lin/com/developersbreach/kotlindictionarymultiplatform/ui/screens/topic/TopicPagingSource.kt
Show resolved
Hide resolved
- Move `TopicPagingSource` to the data layer. - Update `TopicViewModel`, `TopicList`, `TopicCard`, and `TopicScreen` to use the new `Topic` data class. - Adjust `TopicRepository` to return `Topic` objects. - Enhance `TopicPagingSource`'s `getRefreshKey` logic. - Update `PreviewUtils` to use the renamed `Topic` class. - Remove unused Android Paging dependency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review my commit, do you believe this is what you needed?
24f240e
Reviewed. |
No description provided.