Skip to content

Commit

Permalink
#45 Only shows the TextView name of the page when we have one selected
Browse files Browse the repository at this point in the history
  • Loading branch information
hallahan committed Apr 23, 2016
1 parent a7b94b7 commit 636f6ae
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,16 @@ private void findPage(ILatLng latLng) {
Geometry pageGeom = page.geometry();
if (pageGeom.contains(GEOMETRY_FACTORY.createPoint(coord))) {
foundPage(page);
return;
}
}
noPageFound();
}

private void noPageFound() {
if (activity != null && activity instanceof FPListener) {
((FPListener)activity).onMapCenterPageChangeMessage(null);
}
}

private void foundPage(FPPage page) {
Expand Down
7 changes: 6 additions & 1 deletion app/src/main/java/org/redcross/openmapkit/MapActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,12 @@ private boolean isAppInstalled(String uri) {

@Override
public void onMapCenterPageChangeMessage(String msg) {
fieldPapersMsg.setText(msg);
if (msg != null) {
fieldPapersMsg.setText(msg);
fieldPapersMsg.setVisibility(View.VISIBLE);
} else {
fieldPapersMsg.setVisibility(View.GONE);
}
}

}
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
android:id="@+id/fieldPapersMsg"
android:background="@color/black"
android:textColor="@color/osm_light_green"
android:paddingLeft="6dp" />
android:paddingLeft="6dp"
android:visibility="gone" />

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
Expand Down

0 comments on commit 636f6ae

Please sign in to comment.