-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
16632 show items on group selection #17404
Changes from all commits
7db580a
aa1ccfa
906f221
0ca1afa
6d8001a
e60c26e
d9a71e2
2c267e6
2cf37c9
be40bed
2c9b03d
025fb41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,11 +44,13 @@ class FavoriteGroupsScreen( | |
.setBrowsable(true) | ||
.setOnClickListener { onClickFavoriteGroup(null) } | ||
.build()) | ||
var collectionSize = 1 | ||
for (group in favoriteGroups) { | ||
if (collectionSize == contentLimit) { | ||
break | ||
} | ||
if (contentLimit < 2) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically yes. If ConstraintManager gives such value |
||
return | ||
} | ||
val favoriteGroupsSize = favoriteGroups.size | ||
val limitedFavoriteGroups = | ||
favoriteGroups.subList(0, favoriteGroupsSize.coerceAtMost(contentLimit - 2)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why -2 if other screens -1? |
||
for (group in limitedFavoriteGroups) { | ||
val title = group.getDisplayName(app) | ||
val groupIcon = app.favoritesHelper.getColoredIconForGroup(group.name); | ||
val icon = CarIcon.Builder( | ||
|
@@ -60,7 +62,6 @@ class FavoriteGroupsScreen( | |
.setBrowsable(true) | ||
.setOnClickListener { onClickFavoriteGroup(group) } | ||
.build()) | ||
collectionSize++ | ||
} | ||
} | ||
|
||
|
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.
Why 100? Possible crash
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.
We use system value from ConstraintManager. This value limits that value to reduce probability of crash