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

fix: remove unnecessary warnings (#1256) #1257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -25,6 +25,8 @@
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;

import java.util.Objects;

public abstract class BaseDemoActivity extends FragmentActivity implements OnMapReadyCallback {
private GoogleMap mMap;
private boolean mIsRestore;
Expand All @@ -51,7 +53,7 @@ public void onMapReady(@NonNull GoogleMap map) {
}

private void setUpMap() {
((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMapAsync(this);
((SupportMapFragment) Objects.requireNonNull(getSupportFragmentManager().findFragmentById(R.id.map))).getMapAsync(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public enum HeatmapColors {
/**
* Stores the TileOverlay corresponding to each of the keywords that have been searched for.
*/
private Hashtable<String, TileOverlay> mOverlays = new Hashtable<String, TileOverlay>();
private Hashtable<String, TileOverlay> mOverlays = new Hashtable<>();

/**
* A layout containing checkboxes for each of the heatmaps rendered.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ private class LoadLocalKmlFile extends AsyncTask<String, Void, KmlLayer> {
protected KmlLayer doInBackground(String... strings) {
try {
return new KmlLayer(mMap, mResourceId, KmlDemoActivity.this);
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
} catch (XmlPullParserException | IOException e) {
e.printStackTrace();
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,7 @@ protected void startDemo(boolean isRestore) {
kmlPolygonLayer.setOnFeatureClickListener(feature -> Toast.makeText(MultiLayerDemoActivity.this,
"KML polygon clicked: " + feature.getProperty("name"),
Toast.LENGTH_SHORT).show());
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
} catch (XmlPullParserException | IOException e) {
e.printStackTrace();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class MyItemReader {
private static final String REGEX_INPUT_BOUNDARY_BEGINNING = "\\A";

public List<MyItem> read(InputStream inputStream) throws JSONException {
List<MyItem> items = new ArrayList<MyItem>();
List<MyItem> items = new ArrayList<>();
String json = new Scanner(inputStream).useDelimiter(REGEX_INPUT_BOUNDARY_BEGINNING).next();
JSONArray array = new JSONArray(json);
for (int i = 0; i < array.length(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,17 @@ class StreetViewDemoActivity : Activity() {

GlobalScope.launch(Dispatchers.Main) {
val response1 =
StreetViewUtils.fetchStreetViewData(LatLng(48.1425918, 11.5386121), BuildConfig.MAPS_API_KEY)
val response2 = StreetViewUtils.fetchStreetViewData(LatLng(8.1425918, 11.5386121), BuildConfig.MAPS_API_KEY)
StreetViewUtils.fetchStreetViewData(
LatLng(48.1425918, 11.5386121),
BuildConfig.MAPS_API_KEY
)
val response2 = StreetViewUtils.fetchStreetViewData(
LatLng(8.1425918, 11.5386121),
BuildConfig.MAPS_API_KEY
)

findViewById<TextView>(R.id.textViewFirstLocation).text = "Location 1 is supported in StreetView: $response1"
findViewById<TextView>(R.id.textViewSecondLocation).text = "Location 2 is supported in StreetView: $response2"
findViewById<TextView>(R.id.textViewFirstLocation).text = getString(R.string.location_1_is_supported_in_streetview, response1)
findViewById<TextView>(R.id.textViewSecondLocation).text = getString(R.string.location_1_is_supported_in_streetview, response2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are two different strings, can you modify it?

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected boolean shouldRenderAsCluster(@NonNull Cluster<MyItem> cluster) {
* certain zoom level and as a marker below a certain zoom level <i>even if the contents of
* the clusters themselves did not change</i>. In this case, we need to override this method
* to implement this new optimization behavior.
*
* <p>
* Note that always returning true from this method could potentially have negative
* performance implications as clusters will be re-rendered on each pass even if they don't
* change.
Expand Down
2 changes: 2 additions & 0 deletions demo/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,6 @@
<string name="button_radius">Radius</string>
<string name="button_gradient">Gradient</string>
<string name="button_opacity">Opacity</string>
<string name="location_1_is_supported_in_streetview">Location 1 is supported in StreetView: %1$s</string>
<string name="go">Go</string>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where is this used?

</resources>