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

Annotate onMapReady with @NonNull #13307

Merged
merged 1 commit into from
Nov 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
* @param mapboxMap The public api controller of the map
*/
@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
for (OnMapReadyCallback onMapReadyCallback : mapReadyCallbackList) {
onMapReadyCallback.onMapReady(mapboxMap);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.mapbox.mapboxsdk.maps;

import android.support.annotation.NonNull;

/**
* Interface definition for a callback to be invoked when the map is ready to be used.
* <p>
Expand All @@ -16,5 +18,5 @@ public interface OnMapReadyCallback {
* @param mapboxMap An instance of MapboxMap associated with the {@link MapFragment} or
* {@link MapView} that defines the callback.
*/
void onMapReady(MapboxMap mapboxMap);
void onMapReady(@NonNull MapboxMap mapboxMap);
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
for (OnMapReadyCallback onMapReadyCallback : mapReadyCallbackList) {
onMapReadyCallback.onMapReady(mapboxMap);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Activity;
import android.os.Handler;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.annotation.WorkerThread;
import android.support.test.espresso.IdlingResource;

Expand Down Expand Up @@ -49,7 +50,7 @@ public MapboxMap getMapboxMap() {
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
Assert.assertNotNull("MapboxMap should not be null", mapboxMap);
this.mapboxMap = mapboxMap;
if (resourceCallback != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.graphics.RectF;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;
Expand Down Expand Up @@ -43,7 +44,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
MarkerViewsInRectangleActivity.this.mapboxMap = mapboxMap;
selectionBox.setOnClickListener(this);
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(52.0907, 5.1214), 16));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
Expand Down Expand Up @@ -74,7 +75,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;

map.setOnPolygonClickListener(polygon -> Toast.makeText(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.testapp.activity.camera;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;
Expand Down Expand Up @@ -71,7 +72,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;
mapboxMap.getUiSettings().setAttributionEnabled(false);
mapboxMap.getUiSettings().setLogoEnabled(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.util.LongSparseArray;
import android.support.v4.view.animation.FastOutLinearInInterpolator;
import android.support.v4.view.animation.FastOutSlowInInterpolator;
Expand Down Expand Up @@ -78,7 +79,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(final MapboxMap map) {
public void onMapReady(@NonNull final MapboxMap map) {
mapboxMap = map;
initFab();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.os.Handler;
import android.support.annotation.ColorInt;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
Expand Down Expand Up @@ -68,7 +69,7 @@ protected void onCreate(Bundle savedInstanceState) {
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
GestureDetectorActivity.this.mapboxMap = mapboxMap;
initializeMap();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(final MapboxMap map) {
public void onMapReady(@NonNull final MapboxMap map) {
mapboxMap = map;
mapboxMap.setMinZoomPreference(3);
mapboxMap.setMaxZoomPreference(5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;
UiSettings uiSettings = mapboxMap.getUiSettings();
uiSettings.setLogoEnabled(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.testapp.activity.espresso;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
Expand All @@ -24,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.testapp.activity.espresso;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;

import com.mapbox.mapboxsdk.maps.MapView;
Expand Down Expand Up @@ -28,7 +29,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.testapp.activity.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;

import com.mapbox.mapboxsdk.camera.CameraPosition;
Expand Down Expand Up @@ -69,7 +70,7 @@ public void onMapViewReady(MapView map) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mapbox.mapboxsdk.testapp.activity.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;

import com.mapbox.mapboxsdk.camera.CameraPosition;
Expand Down Expand Up @@ -70,7 +71,7 @@ public void onMapViewReady(MapView map) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
Expand Down Expand Up @@ -38,7 +39,7 @@ public void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;
mapboxMap.setStyleUrl(Style.OUTDOORS);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;

// Add info window adapter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
activateLocationComponent();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis

@SuppressLint("MissingPermission")
@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;

locationEngine = new LocationEngineProvider(this).obtainBestLocationEngineAvailable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void onRequestPermissionsResult(int requestCode, @NonNull String[] permis
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
locationEngine = new LocationEngineProvider(this).obtainBestLocationEngineAvailable();
locationEngine.addLocationEngineListener(this);
locationEngine.setPriority(LocationEnginePriority.HIGH_ACCURACY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(37.760545, -122.436055), 15));
}

Expand Down Expand Up @@ -227,7 +227,7 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
mapboxMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(37.760545, -122.436055), 15));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
Expand Down Expand Up @@ -95,7 +96,7 @@ private void setupMapView(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;

setupNavigationView(mapboxMap.getLayers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
Expand Down Expand Up @@ -39,7 +40,7 @@ protected void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;
mapboxMap.setLatLngBoundsForCameraTarget(ICELAND_BOUNDS);
mapboxMap.setMinZoomPreference(2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
Expand Down Expand Up @@ -48,7 +49,7 @@ public void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
this.mapboxMap = map;

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(final MapboxMap map) {
public void onMapReady(@NonNull final MapboxMap map) {
mapboxMap = map;
addSymbolClickListener();
new LoadDataTask(this).execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void onCreate(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap mapboxMap) {
public void onMapReady(@NonNull MapboxMap mapboxMap) {
this.mapboxMap = mapboxMap;

// Add a sdf image for the makers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBar;
Expand Down Expand Up @@ -96,7 +97,7 @@ private void setupMapView(Bundle savedInstanceState) {
}

@Override
public void onMapReady(MapboxMap map) {
public void onMapReady(@NonNull MapboxMap map) {
mapboxMap = map;

setupNavigationView(mapboxMap.getLayers());
Expand Down