Skip to content
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

Android annotations: Implement CollisionGroup #2304

Open
wants to merge 4 commits into
base: android-annotations
Choose a base branch
from

Conversation

fynngodau
Copy link
Collaborator

Android annotations API proposal implementation PR as a part of #1491. Closes #1495.


  • CollisionGroup is implemented per specification. In effect, it is somewhat of a wrapper around SymbolManager.
  • The CollisionGroupTest contains some tests I found to be helpful.
  • One annoyance is that I couldn't add an observable list as I hoped. Instead, the list of symbols is currently immutable, and can be set to a new value through assignment (which we listen to using Delegates.observable). We could decide to add add(Symbol), delete(Symbol), etc. instead.

Copy link

codecov bot commented Apr 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 59.85%. Comparing base (178454b) to head (3a207cc).
Report is 210 commits behind head on android-annotations.

Additional details and impacted files
@@                   Coverage Diff                    @@
##           android-annotations    #2304       +/-   ##
========================================================
- Coverage                85.73%   59.85%   -25.88%     
========================================================
  Files                      568      580       +12     
  Lines                    28027    28530      +503     
  Branches                     0    11093    +11093     
========================================================
- Hits                     24030    17078     -6952     
- Misses                    3997     4229      +232     
- Partials                     0     7223     +7223     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,121 @@
package org.maplibre.android.annotations

import okhttp3.internal.toImmutableList
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably not use internal packages.

import org.maplibre.android.annotations.data.Defaults
import kotlin.properties.Delegates

class CollisionGroup(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs some documentation.

Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add an example to the test app or modify an existing example?

@@ -1054,6 +1056,10 @@ public void addAnnotations(@NonNull KAnnotation... annotations) {
}
}

public void addCollisionGroup(@NonNull CollisionGroup collisionGroup) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a documentation comment.

@@ -1090,6 +1096,10 @@ public void removeAnnotations(@NonNull KAnnotation... annotations) {
}
}

public void removeCollisionGroup(@NonNull CollisionGroup collisionGroup) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a documentation comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants