Skip to content

Add symbol plugin - #642

Merged
tobrun merged 1 commit into
masterfrom
tvn-symbol-plugin
Sep 4, 2018
Merged

tobrun merged 1 commit into
masterfrom
tvn-symbol-plugin

Conversation

@tobrun

@tobrun tobrun commented Sep 4, 2018

Copy link
Copy Markdown
Member

This PR adds integration of https://github.com/mapbox/mapbox-gl-native/tree/tvn-code-gen-symbols as separate plugion so we can kick the tires on it. Initially this annotation plugin only contains code for showing a symbol, next steps would be to include fill/circle/line support.

@tobrun tobrun self-assigned this Sep 4, 2018
@tobrun
tobrun requested a review from LukasPaczos September 4, 2018 10:13
@tobrun
tobrun force-pushed the tvn-symbol-plugin branch 2 times, most recently from 0cfc444 to b86b471 Compare September 4, 2018 12:39
@tobrun

tobrun commented Sep 4, 2018

Copy link
Copy Markdown
Member Author

Tests were added as part of b86b471

@LukasPaczos LukasPaczos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks awesome, thanks for the idea and execution @tobrun!
Minor changes requested.

try {
Timber.e("@Before test: register idle resource");
idlingResource = new OnMapReadyIdlingResource(rule.getActivity());
Espresso.registerIdlingResources(idlingResource);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe this is deprecated, we can use IdlingRegistry instead.

@Before
public void beforeTest() {
try {
Timber.e("@Before test: register idle resource");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about adding the TestName rule, similarly to this in before and after?

@@ -0,0 +1,367 @@
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This note needs to be updated.

assertNotNull(symbolManager);

symbolManager.setSymbolAvoidEdges(true);
assertEquals((Boolean) symbolManager.getSymbolAvoidEdges(), (Boolean) true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can use asserTrue/assertFalse in this and similar test cases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is generated code, same outcome

@@ -0,0 +1,365 @@
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This note needs to be updated.

@@ -0,0 +1,566 @@
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This note needs to be updated.

@@ -0,0 +1,646 @@
// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This note needs to be updated.

*/
public void updateSource() {
// todo move feature creation to a background thread?
List<Feature> features = new ArrayList<>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe we can reuse a single features list instead of creating a new one with each update?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

sure

assertNotNull(symbolManager);

symbolManager.setSymbolSpacing(0.3f);
assertEquals((Float) symbolManager.getSymbolSpacing(), (Float) 0.3f);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This and other casts are redundant.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

this is not true, as removing the cast can lead to ambiguous assertEquals call, don't feel this should be fixed with this PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the solution here would be to add a message to the assert calls

@LukasPaczos LukasPaczos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚢

@tobrun
tobrun merged commit 0ecff07 into master Sep 4, 2018
@tobrun
tobrun deleted the tvn-symbol-plugin branch September 4, 2018 18:28
@LukasPaczos LukasPaczos added this to the annotation-0.1.0 milestone Sep 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants