MapIntent extends BaseIntent<MapIntent> { public MapIntent locationQuery(@Nullable final String query) { this.locationQuery = query; return this; }  MapIntent location(@FloatRange(from = LAT_MIN, to = LAT_MAX) final double lat, @FloatRange(from = LNG_MIN, to = LNG_MAX) final double lng); @FloatRange(from = LAT_MIN, to = LAT_MAX) double lat(); @FloatRange(from = LNG_MIN, to = LNG_MAX) double lng(); MapIntent locationQuery(@Nullable final String query); @NonNull String locationQuery(); MapIntent zoomLevel(@IntRange(from = ZOOM_LEVEL_MIN, to = ZOOM_LEVEL_MAX) final int level); @IntRange(from = 0, to = ZOOM_LEVEL_MAX) int zoomLevel(); MapIntent label(@Nullable final String label); @NonNull String label(); static final String URI_SCHEME; static final double LAT_MIN; static final double LAT_MAX; static final double LNG_MIN; static final double LNG_MAX; static final int ZOOM_LEVEL_MIN; static final int ZOOM_LEVEL_MAX; }
@Test public void testBuildWithLocationQuery() { final MapIntent mapIntent = new MapIntent(); mapIntent.locationQuery("Rome, Italy"); final Intent intent = mapIntent.build(context); assertThatIntentIsValid(intent); assertThat( intent.getData(), is(Uri.parse("geo:0,0?q=" + Uri.encode("Rome, Italy"))) ); }
@Test public void testLocationQueryText() { final MapIntent intent = new MapIntent(); intent.locationQuery("Iceland"); assertThat(intent.locationQuery(), is("Iceland")); }