Skip to content

Commit

Permalink
Use getFindMe api (#377)
Browse files Browse the repository at this point in the history
* use getFindMe api

* fix checkstyle

* fix overlaymanager tests
  • Loading branch information
sarahsnow1 authored May 19, 2017
1 parent 65795f7 commit 11b7aa6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.mapzen.android.graphics;

import com.mapzen.R;
import com.mapzen.android.graphics.model.Marker;
import com.mapzen.android.graphics.model.Polygon;
import com.mapzen.android.graphics.model.Polyline;
Expand Down Expand Up @@ -936,13 +935,13 @@ private MapData addPointToMarkerMapData(Marker marker) {
}

@Override public boolean onPan(float startX, float startY, float endX, float endY) {
final View findMe = mapView.findViewById(R.id.mz_find_me);
final View findMe = mapView.getFindMe();
findMe.setActivated(false);
return false;
}

@Override public boolean onFling(float posX, float posY, float velocityX, float velocityY) {
final View findMe = mapView.findViewById(R.id.mz_find_me);
final View findMe = mapView.getFindMe();
findMe.setActivated(false);
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,14 @@ public void addPolyline_shouldRequireTwoPoints() {
}

@Test public void onPan_shouldDeactivateFindMe() throws Exception {
when(mapView.getFindMe()).thenReturn(findMeButton);
findMeButton.setActivated(true);
overlayManager.onPan(1f, 2f, 3f, 4f);
assertThat(findMeButton.isActivated()).isFalse();
}

@Test public void onFling_shouldDeactivateFindMe() throws Exception {
when(mapView.getFindMe()).thenReturn(findMeButton);
findMeButton.setActivated(true);
overlayManager.onFling(1f, 2f, 3f, 4f);
assertThat(findMeButton.isActivated()).isFalse();
Expand Down

0 comments on commit 11b7aa6

Please sign in to comment.