Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Fixing wearable black screen (#627)
Browse files Browse the repository at this point in the history
* initial commit

gradle updates

* 7.1.1 refactoring in missing activities
  • Loading branch information
Langston Smith authored Feb 15, 2019
1 parent 11d6731 commit aa528e2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
3 changes: 1 addition & 2 deletions MapboxAndroidWearDemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dependencies {

compileOnly wearDependencies.googleWearable
implementation wearDependencies.supportGoogleWearable

implementation wearDependencies.wearableUi
implementation wearDependencies.gpsWearable
implementation wearDependencies.gpsLocation

Expand All @@ -55,7 +55,6 @@ dependencies {
// Firebase
implementation dependenciesList.firebaseCrash
implementation dependenciesList.firebasePerf

implementation project(':SharedCode')
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
import com.mapbox.mapboxsdk.maps.Style;
import com.mapbox.mapboxsdk.offline.OfflineManager;
import com.mapbox.mapboxsdk.offline.OfflineRegion;
import com.mapbox.mapboxsdk.offline.OfflineRegionError;
Expand Down Expand Up @@ -69,18 +70,23 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public void onMapReady(@NonNull MapboxMap mapboxMap) {
map = mapboxMap;
// Set up the OfflineManager
offlineManager = OfflineManager.getInstance(OfflineMapActivity.this);
downloadRegion.setOnClickListener(new View.OnClickListener() {
map.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
@Override
public void onClick(View view) {
downloadRegionDialog();
}
});
listRegions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
downloadedRegionList();
public void onStyleLoaded(@NonNull Style style) {
// Set up the OfflineManager
offlineManager = OfflineManager.getInstance(OfflineMapActivity.this);
downloadRegion.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
downloadRegionDialog();
}
});
listRegions.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
downloadedRegionList();
}
});
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.mapbox.mapboxsdk.maps.MapView;
import com.mapbox.mapboxsdk.maps.MapboxMap;
import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
import com.mapbox.mapboxsdk.maps.Style;

/**
* Show a map in your app using the Mapbox Android SDK.
Expand All @@ -35,10 +36,16 @@ protected void onCreate(Bundle savedInstanceState) {

@Override
public void onMapReady(@NonNull MapboxMap mapboxMap) {
mapboxMap.setStyle(Style.MAPBOX_STREETS, new Style.OnStyleLoaded() {
@Override
public void onStyleLoaded(@NonNull Style style) {

// Customize map with markers, polylines, etc.
// Customize map with markers, polylines, etc.


}
});

}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
<android.support.wear.widget.SwipeDismissFrameLayout
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"
Expand All @@ -17,4 +17,4 @@
mapbox:mapbox_cameraTargetLng="-73.99155"
mapbox:mapbox_cameraZoom="11"/>

</FrameLayout>
</android.support.wear.widget.SwipeDismissFrameLayout>
4 changes: 3 additions & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ ext {

wearVersion = [
googleWearable : '2.0.4',
googlePlayService: '11.0.4'
googlePlayService: '11.0.4',
wearableUi : '27.0.0',
]

pluginVersion = [
Expand Down Expand Up @@ -127,6 +128,7 @@ ext {

wearDependencies = [
googleWearable : "com.google.android.wearable:wearable:${wearVersion.googleWearable}",
wearableUi : "com.android.support:wear:${wearVersion.wearableUi}",
supportGoogleWearable: "com.google.android.support:wearable:${wearVersion.googleWearable}",
gpsWearable : "com.google.android.gms:play-services-wearable:${wearVersion.googlePlayService}",
gpsLocation : "com.google.android.gms:play-services-location:${wearVersion.googlePlayService}"
Expand Down

0 comments on commit aa528e2

Please sign in to comment.