Prefix library resources to avoid naming conflicts (#6878)

* [android] - add library resource prefix

* update SDK resources with prefix

* fixup tests
This commit is contained in:
Tobrun
2016-11-02 12:41:22 +01:00
committed by GitHub
parent 9ad5dd1585
commit 4d0c42e36a
97 changed files with 397 additions and 400 deletions

View File

@@ -63,7 +63,7 @@ public class CameraPositionActivity extends AppCompatActivity implements OnMapRe
Context context = v.getContext();
final View dialogContent = LayoutInflater.from(context).inflate(R.layout.dialog_camera_position, null);
AlertDialog.Builder builder = new AlertDialog.Builder(
context, com.mapbox.mapboxsdk.R.style.AttributionAlertDialogStyle);
context, com.mapbox.mapboxsdk.R.style.mapbox_AlertDialogStyle);
builder.setTitle(R.string.dialog_camera_position);
builder.setView(onInflateDialogContent(dialogContent));
builder.setPositiveButton("Animate", new DialogInterface.OnClickListener() {

View File

@@ -78,7 +78,7 @@ public class MyLocationTintActivity extends AppCompatActivity implements Locatio
@Override
public void onClick(View view) {
myLocationViewSettings.setAccuracyTintColor(ContextCompat.getColor(
MyLocationTintActivity.this, R.color.my_location_ring));
MyLocationTintActivity.this, R.color.mapbox_my_location_ring));
myLocationViewSettings.setForegroundTintColor(ContextCompat.getColor(
MyLocationTintActivity.this, R.color.mapbox_blue));
}

View File

@@ -16,10 +16,10 @@
android:id="@id/mapView"
android:layout_below="@id/toolbar"
android:layout_width="match_parent"
app:center_latitude="52.519003"
app:center_longitude="13.400972"
app:style_url="@string/style_mapbox_streets"
app:zoom="16"
app:mapbox_center_latitude="52.519003"
app:mapbox_center_longitude="13.400972"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="16"
android:layout_height="match_parent"/>
<android.support.design.widget.FloatingActionButton

View File

@@ -17,9 +17,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
app:center_latitude="51.502615"
app:center_longitude="4.972326"
app:style_url="@string/style_light"
app:zoom="6" />
app:mapbox_center_latitude="51.502615"
app:mapbox_center_longitude="4.972326"
app:mapbox_style_url="@string/mapbox_style_light"
app:mapbox_zoom="6" />
</RelativeLayout>

View File

@@ -17,9 +17,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar"
app:center_latitude="51.50325"
app:center_longitude="-0.11968"
app:zoom="15" />
app:mapbox_center_latitude="51.50325"
app:mapbox_center_longitude="-0.11968"
app:mapbox_zoom="15" />
<LinearLayout
android:layout_width="match_parent"

View File

@@ -21,7 +21,7 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:style_url="@string/style_mapbox_streets" />
app:mapbox_style_url="@string/mapbox_style_mapbox_streets" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"

View File

@@ -16,9 +16,9 @@
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:my_location_foreground_tint="@color/primary"
app:my_location_accuracy_tint="@color/primary"
app:style_url="@string/style_mapbox_streets"
app:zoom="15" />
app:mapbox_my_location_foreground_tint="@color/primary"
app:mapbox_my_location_accuracy_tint="@color/primary"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="15" />
</LinearLayout>

View File

@@ -16,10 +16,10 @@
android:id="@id/mapView"
android:layout_below="@id/toolbar"
android:layout_width="match_parent"
app:center_latitude="52.519003"
app:center_longitude="13.400972"
app:style_url="@string/style_mapbox_streets"
app:zoom="16"
app:mapbox_center_latitude="52.519003"
app:mapbox_center_longitude="13.400972"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="16"
android:layout_height="match_parent"/>
<android.support.design.widget.FloatingActionButton

View File

@@ -16,6 +16,6 @@
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:style_url="@string/style_mapbox_streets" />
app:mapbox_style_url="@string/mapbox_style_mapbox_streets" />
</LinearLayout>

View File

@@ -26,12 +26,12 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:center_latitude="51.506675"
app:center_longitude="-0.128699"
app:compass_fade_facing_north="false"
app:direction="90"
app:tilt="40"
app:zoom="10" />
app:mapbox_center_latitude="51.506675"
app:mapbox_center_longitude="-0.128699"
app:mapbox_compass_fade_facing_north="false"
app:mapbox_direction="90"
app:mapbox_tilt="40"
app:mapbox_zoom="10" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"

View File

@@ -17,9 +17,9 @@
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="5"
app:center_latitude="38.90962"
app:center_longitude="-77.04341"
app:zoom="15" />
app:mapbox_center_latitude="38.90962"
app:mapbox_center_longitude="-77.04341"
app:mapbox_zoom="15" />
<TextView
android:id="@+id/message"

View File

@@ -16,9 +16,9 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:center_latitude="38.897705003219784"
app:center_longitude="-77.03655168667463"
app:style_url="@string/style_mapbox_streets"
app:zoom="15" />
app:mapbox_center_latitude="38.897705003219784"
app:mapbox_center_longitude="-77.03655168667463"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="15" />
</LinearLayout>

View File

@@ -16,9 +16,9 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:center_latitude="47.798202"
app:center_longitude="7.573781"
app:style_url="@string/style_mapbox_streets"
app:zoom="4" />
app:mapbox_center_latitude="47.798202"
app:mapbox_center_longitude="7.573781"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="4" />
</LinearLayout>

View File

@@ -16,9 +16,9 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:center_latitude="47.798202"
app:center_longitude="7.573781"
app:style_url="@string/style_mapbox_streets"
app:zoom="4" />
app:mapbox_center_latitude="47.798202"
app:mapbox_center_longitude="7.573781"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="4" />
</LinearLayout>

View File

@@ -14,10 +14,10 @@
<com.mapbox.mapboxsdk.maps.MapView
android:id="@id/mapView"
app:center_latitude="50.871062"
app:center_longitude="1.583210"
app:direction="220"
app:zoom="10"
app:mapbox_center_latitude="50.871062"
app:mapbox_center_longitude="1.583210"
app:mapbox_direction="220"
app:mapbox_zoom="10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar" />

View File

@@ -22,11 +22,11 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:center_latitude="38.87031"
app:mapbox_center_latitude="38.87031"
android:layout_below="@id/toolbar"
app:center_longitude="-77.00897"
app:style_url="@string/style_mapbox_streets"
app:zoom="10" />
app:mapbox_center_longitude="-77.00897"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="10" />
<TextView
android:id="@+id/countView"

View File

@@ -16,10 +16,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
app:center_latitude="38.907192"
app:center_longitude="-77.036871"
app:style_url="@string/style_mapbox_streets"
app:zoom="12" />
app:mapbox_center_latitude="38.907192"
app:mapbox_center_longitude="-77.036871"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="12" />
<TextView
android:id="@+id/countView"

View File

@@ -52,9 +52,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
app:center_latitude="38.907192"
app:center_longitude="-77.036871"
app:style_url="@string/style_mapbox_streets"
app:zoom="12" />
app:mapbox_center_latitude="38.907192"
app:mapbox_center_longitude="-77.036871"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="12" />
</RelativeLayout>

View File

@@ -17,9 +17,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
app:center_latitude="-1.063510"
app:center_longitude=" 32.895425"
app:style_url="@string/style_satellite_streets"
app:zoom="4" />
app:mapbox_center_latitude="-1.063510"
app:mapbox_center_longitude=" 32.895425"
app:mapbox_style_url="@string/mapbox_style_satellite_streets"
app:mapbox_zoom="4" />
</RelativeLayout>

View File

@@ -42,9 +42,9 @@
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:my_location_foreground_tint="@color/primary"
app:my_location_accuracy_tint="@color/primary"
app:style_url="@string/style_mapbox_streets"
app:zoom="15" />
app:mapbox_my_location_foreground_tint="@color/primary"
app:mapbox_my_location_accuracy_tint="@color/primary"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="15" />
</LinearLayout>

View File

@@ -17,11 +17,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar"
app:attribution_tint="@android:color/holo_green_dark"
app:center_latitude="47.798202"
app:center_longitude="7.573781"
app:style_url="@string/style_mapbox_streets"
app:zoom="4" />
app:mapbox_attribution_tint="@android:color/holo_green_dark"
app:mapbox_center_latitude="47.798202"
app:mapbox_center_longitude="7.573781"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="4" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"

View File

@@ -17,12 +17,12 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
app:attribution_gravity="top|end"
app:center_latitude="45.1855569"
app:center_longitude="5.7215506"
app:logo_gravity="top|end"
app:logo_margin_right="10dp"
app:style_url="@string/style_mapbox_streets"
app:zoom="11" />
app:mapbox_attribution_gravity="top|end"
app:mapbox_center_latitude="45.1855569"
app:mapbox_center_longitude="5.7215506"
app:mapbox_logo_gravity="top|end"
app:mapbox_logo_margin_right="10dp"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="11" />
</RelativeLayout>

View File

@@ -80,10 +80,10 @@
android:id="@id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:center_latitude="37.176546"
app:center_longitude="-3.599007"
app:style_url="@string/style_emerald"
app:zoom="15" />
app:mapbox_center_latitude="37.176546"
app:mapbox_center_longitude="-3.599007"
app:mapbox_style_url="@string/mapbox_style_emerald"
app:mapbox_zoom="15" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"

View File

@@ -16,10 +16,10 @@
android:id="@id/mapView"
android:layout_below="@id/toolbar"
android:layout_width="match_parent"
app:center_latitude="52.519003"
app:center_longitude="13.400972"
app:style_url="@string/style_mapbox_streets"
app:zoom="16"
app:mapbox_center_latitude="52.519003"
app:mapbox_center_longitude="13.400972"
app:mapbox_style_url="@string/mapbox_style_mapbox_streets"
app:mapbox_zoom="16"
android:layout_height="match_parent"/>
<android.support.design.widget.FloatingActionButton

View File

@@ -17,7 +17,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
app:style_url="@string/style_light" />
app:mapbox_style_url="@string/mapbox_style_light" />
<FrameLayout
android:id="@+id/container"

View File

@@ -27,11 +27,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
mapbox:attribution_gravity="top"
mapbox:center_latitude="34.4021"
mapbox:center_longitude="-119.7081"
mapbox:logo_gravity="top"
mapbox:style_url="mapbox://styles/mapbox/streets-v9"
mapbox:zoom="13" />
mapbox:mapbox_attribution_gravity="top"
mapbox:mapbox_center_latitude="34.4021"
mapbox:mapbox_center_longitude="-119.7081"
mapbox:mapbox_logo_gravity="top"
mapbox:mapbox_style_url="mapbox://styles/mapbox/streets-v9"
mapbox:mapbox_zoom="13" />
</RelativeLayout>

View File

@@ -10,9 +10,9 @@
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
mapbox:center_latitude="47.6077"
mapbox:center_longitude="-122.3421"
mapbox:style_url="mapbox://styles/mapbox/streets-v9"
mapbox:zoom="11"/>
mapbox:mapbox_center_latitude="47.6077"
mapbox:mapbox_center_longitude="-122.3421"
mapbox:mapbox_style_url="mapbox://styles/mapbox/streets-v9"
mapbox:mapbox_zoom="11"/>
</LinearLayout>

View File

@@ -46,11 +46,11 @@ public class CameraPositionTest {
float tilt = 44;
TypedArray typedArray = mock(TypedArray.class);
when(typedArray.getFloat(R.styleable.MapView_direction, 0.0f)).thenReturn(bearing);
when(typedArray.getFloat(R.styleable.MapView_center_latitude, 0.0f)).thenReturn(latitude);
when(typedArray.getFloat(R.styleable.MapView_center_longitude, 0.0f)).thenReturn(longitude);
when(typedArray.getFloat(R.styleable.MapView_zoom, 0.0f)).thenReturn(zoom);
when(typedArray.getFloat(R.styleable.MapView_tilt, 0.0f)).thenReturn(tilt);
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_direction, 0.0f)).thenReturn(bearing);
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_center_latitude, 0.0f)).thenReturn(latitude);
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_center_longitude, 0.0f)).thenReturn(longitude);
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_zoom, 0.0f)).thenReturn(zoom);
when(typedArray.getFloat(R.styleable.mapbox_MapView_mapbox_tilt, 0.0f)).thenReturn(tilt);
doNothing().when(typedArray).recycle();
CameraPosition cameraPosition = new CameraPosition.Builder(typedArray).build();