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

Add compass view #177

Merged
merged 11 commits into from Dec 7, 2015
Merged

Add compass view #177

merged 11 commits into from Dec 7, 2015

Conversation

ecgreb
Copy link
Collaborator

@ecgreb ecgreb commented Dec 7, 2015

Adds a dynamic compass to all screens that allows the user to view current map orientation and reset to North.

  • Show compass when map is rotated
  • Hide compass when view is reset to North
  • Reset map orientation and animate compass on click
  • Show compass in default, search, route preview, and navigation modes
  • Replaces feature toString() with name() in direction list header (Route preview view list shows SimpleFeature destination #174)

Rather than attempting to re-position a single compass across multiple views both view_route_preview.xml and view_route_mode.xml declare their own separate instances of CompassView that are shown/hidden along with their parent views so only one is visible at a time. The combination of MainActivity and MainPresenter handle updating all 3 instances on map rotation and click.

Closes #78 and #174

image

* Convert north arrow to image button. Solves issue where buttons always appear on top of other views.
* Remove transparency for all overlay views.
* Adds intent extra constants for InstructionListActivity
* Adds fallback text if destination name is null
* Removes hardcoded strings
Rather than attempting to reposition a compass both view_route_preview.xml and `view_route_mode.xml` declare their own separate instances of `CompassView` that are shown/hidden along with their parent views. The combination of `MainActivity` and `MainPresenter` handle updating all 3 compasses on map rotation and click.
(findViewById(R.id.starting_point) as TextView).setText(bundle?.getString("destination"))
(findViewById(R.id.destination) as TextView).setText(R.string.current_location)
private fun setHeaderOrigins(destination: String, reverse: Boolean) {
val startTextView = findViewById(R.id.starting_point) as TextView
Copy link
Member

Choose a reason for hiding this comment

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

Yay programming

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

\o/

msmollin added a commit that referenced this pull request Dec 7, 2015
@msmollin msmollin merged commit 55c20c7 into master Dec 7, 2015
@ecgreb ecgreb deleted the 78-add-compass branch December 7, 2015 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants