diff options
author | Tobrun <tobrun.van.nuland@gmail.com> | 2016-08-31 21:27:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-31 21:27:01 +0200 |
commit | 57e7cc97d087b459facf7bbd49c1d05b7c4ca467 (patch) | |
tree | 96f87d70824676a3e4199a0c2d224243fe843964 | |
parent | fe28b57fe08bcd1069dad8fd47827da6bd835285 (diff) | |
download | qtlocation-mapboxgl-57e7cc97d087b459facf7bbd49c1d05b7c4ca467.tar.gz |
[android] - fix breaking build on master (#6225)
* [android] - fix breaking build, by implementing mapboxMap on VideoViewActivity
* fix layout file for auto generated tests
* [android] fix resource id
2 files changed, 15 insertions, 9 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/VideoViewActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/VideoViewActivity.java index 4496b257d3..96637fae87 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/VideoViewActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/VideoViewActivity.java @@ -14,11 +14,12 @@ import com.mapbox.mapboxsdk.maps.MapboxMap; import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; import com.mapbox.mapboxsdk.testapp.R; -import static android.media.MediaPlayer.*; +import static android.media.MediaPlayer.OnPreparedListener; public class VideoViewActivity extends AppCompatActivity { private MapView mapView; + private MapboxMap mapboxMap; private VideoView videoView; @Override @@ -48,8 +49,14 @@ public class VideoViewActivity extends AppCompatActivity { } }); - mapView = (MapView) findViewById(R.id.map_view); + mapView = (MapView) findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); + mapView.getMapAsync(new OnMapReadyCallback() { + @Override + public void onMapReady(MapboxMap mapboxMap) { + VideoViewActivity.this.mapboxMap = mapboxMap; + } + }); } @Override diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_video_view.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_video_view.xml index 25b589260e..979b30d2b4 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_video_view.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_video_view.xml @@ -1,6 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<RelativeLayout - xmlns:android="http://schemas.android.com/apk/res/android" +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:mapbox="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" @@ -12,7 +11,7 @@ android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="@color/primary" - android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/> + android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> <VideoView android:id="@+id/video_view" @@ -21,18 +20,18 @@ android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" - android:layout_margin="16dp"/> + android:layout_margin="16dp" /> <com.mapbox.mapboxsdk.maps.MapView - android:id="@+id/map_view" + android:id="@id/mapView" 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:attribution_gravity="top" mapbox:logo_gravity="top" mapbox:style_url="mapbox://styles/mapbox/streets-v9" - mapbox:zoom="13"/> + mapbox:zoom="13" /> </RelativeLayout>
\ No newline at end of file |