-
Notifications
You must be signed in to change notification settings - Fork 493
Conversation
@@ -125,6 +125,13 @@ | |||
android:value="com.mapbox.mapboxandroiddemo.MainActivity"/> | |||
</activity> | |||
<activity | |||
android:name=".examples.plugins.TrafficPluginActivity" | |||
android:label="@string/activity_mas_traffic_plugin_title"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change this title activity_mas_traffic_plugin_title
to activity_plugin_traffic_title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
case R.id.nav_plugins: | ||
exampleItemModel.add(new ExampleItemModel( | ||
R.string.activity_mas_traffic_plugin_title, | ||
R.string.activity_mas_traffic_plugin_description, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activity_plugin_traffic_description
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -343,6 +344,16 @@ private void listItems(int id) { | |||
currentCategory = R.id.nav_extrusions; | |||
break; | |||
|
|||
case R.id.nav_plugins: | |||
exampleItemModel.add(new ExampleItemModel( | |||
R.string.activity_mas_traffic_plugin_title, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activity_plugin_traffic_title
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
R.string.activity_mas_traffic_plugin_title, | ||
R.string.activity_mas_traffic_plugin_description, | ||
new Intent(MainActivity.this, TrafficPluginActivity.class), | ||
R.string.activity_mas_traffic_plugin_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
activity_plugin_traffic_url
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
mapView.getMapAsync(new OnMapReadyCallback() { | ||
@Override | ||
public void onMapReady(MapboxMap mapboxMap) { | ||
TrafficPluginActivity.this.map = mapboxMap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need to clarify the variable location since it's a different name then the local mapboxMap
, TrafficPluginActivity.this.map
should just be map = mapboxMap;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@Override | ||
public void onMapReady(MapboxMap mapboxMap) { | ||
TrafficPluginActivity.this.map = mapboxMap; | ||
TrafficPluginActivity.this.trafficPlugin = new TrafficPlugin(mapView, mapboxMap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same goes for this traffic plugin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
} | ||
}); | ||
|
||
FloatingActionButton trafficToggleButton = (FloatingActionButton) findViewById(R.id.traffic_toggle_fab); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you only need to fab id to set the listener, you can make this shorter by directly getting the fab and setting the click listener: findViewById(R.id.traffic_toggle_fab).setOnClickListener(...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't assign it to a variable. You are trying to cast a click listener floating action button. remove everything in front of findViewById
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -0,0 +1,38 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seperate <android.support.constraint.ConstraintLayout
and xmlns:android="http://schemas.android.com/apk/res/android"
onto different lines so the indentions proper.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
mapbox:mapbox_cameraZoom="9.579712" | ||
mapbox:mapbox_styleUrl="@string/mapbox_style_dark"/> | ||
|
||
<android.support.design.widget.FloatingActionButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the vector icons black, lets tint it to white instead so it matches the UI a bit more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
build.gradle
Outdated
@@ -11,6 +11,7 @@ buildscript { | |||
allprojects { | |||
repositories { | |||
jcenter() | |||
mavenCentral() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for including the new repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it because that's what the plugin instructions seemed to say. Maybe I misread/misunderstood though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JCenter is a superset of Maven Central, therefore, if JCenter is in your repository, you most likely won't need to also include mavenCentral.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Fixes #223
Added this example and put it in a new
Plugins
section