Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Test activity for gestures manager - #11449

Merged
LukasPaczos merged 3 commits into
release-bobafrom
11406-gestures-test-activity
Mar 16, 2018
Merged

LukasPaczos merged 3 commits into
release-bobafrom
11406-gestures-test-activity

Conversation

@LukasPaczos

Copy link
Copy Markdown
Contributor

Closes #11406.
This activity can gradually expand as we add more features through the gestures library and MapGestureDetector.

@LukasPaczos LukasPaczos added the Android Mapbox Maps SDK for Android label Mar 14, 2018
@LukasPaczos
LukasPaczos requested a review from tobrun March 14, 2018 16:26
</application>

</manifest>
</manifest> No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we need to sync our checkstyle configuration for the formatter. To remove the unnecessary changes introduced in this file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought it's a good time as any other to actually fix the formatting of the Manifest file. Let me know if you'd still rather like to adjust the checkstyle configuration.

private AndroidGesturesManager gesturesManager;

private Marker marker = null;
private LatLng focalPointLatLng = null;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

obsolete null initialisation?

@LukasPaczos LukasPaczos Mar 15, 2018 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Do you think null initialization makes it clearer that this value will be nullified in the future to reflect its state? That was my intent here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm onboard if that is your way of showing that. For me the final keyword is the one that forces and notifies that something won't be set to null. In any case this is more about code style preference than technical reasoning.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thinking about this, you could also add @Nullable annotation to force null checks with lint


import static java.lang.annotation.RetentionPolicy.SOURCE;

public class GestureDetectorActivity extends AppCompatActivity {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

could you add some class level javadoc on what this test activity is testing?

eg.


/**
 * Test activity showcasing the data driven runtime style API.
 */

if (alert.getAlertType() == GestureAlert.TYPE_PROGRESS && gestureAlert.equals(alert)) {
return;
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not actionable but flagging that code for loops as above with inclusion of break/return increases cyclomatic complexity. This makes reading the code more difficult as it makes predicting the outcome harder.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Interesting, thanks for pointing this out.

@LukasPaczos
LukasPaczos force-pushed the 11406-gestures-test-activity branch from c8ec80f to fb0e233 Compare March 16, 2018 11:56
@LukasPaczos
LukasPaczos merged commit d59646f into release-boba Mar 16, 2018
@LukasPaczos
LukasPaczos deleted the 11406-gestures-test-activity branch March 16, 2018 12:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Android Mapbox Maps SDK for Android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants