Last active
August 6, 2020 15:11
-
-
Save shakalaca/17ec323667c5b2abca1e3ff74af195bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt b/app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt | |
index 16ac44a..61d77ca 100644 | |
--- a/app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt | |
+++ b/app/src/main/java/com/example/android/codelabs/paging/ui/SearchRepositoriesViewModel.kt | |
@@ -55,7 +55,11 @@ class SearchRepositoriesViewModel(private val repository: GithubRepository) : Vi | |
if (before == null) { | |
// we're at the beginning of the list | |
- return@insertSeparators UiModel.SeparatorItem("${after.roundedStarCount}0.000+ stars") | |
+ if (after.roundedStarCount >= 1) { | |
+ return@insertSeparators UiModel.SeparatorItem("${after.roundedStarCount}0.000+ stars") | |
+ } else { | |
+ return@insertSeparators UiModel.SeparatorItem("< 10.000+ stars") | |
+ } | |
} | |
// check between 2 items | |
if (before.roundedStarCount > after.roundedStarCount) { | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment