Clean up AndroidWearMap sample and update to Google Play Services 7.8.

Use MapFragment instead of SupportMapFragment and add a
.gitingore file.

Change-Id: Id89502cb8fdaa1898e30435e8f09ab6cdd4e986a
This commit is contained in:
Jan-Felix Schmakeit 2015-07-06 11:21:55 +10:00
parent 465f7c85f8
commit e602f8f67f
4 changed files with 16 additions and 11 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
build/
.idea
.gradle
*.iml
local.properties
.DS_Store

View File

@ -18,13 +18,13 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.example.androidwearmap"
minSdkVersion 21
targetSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
@ -45,5 +45,5 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.1.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.google.android.gms:play-services:7.8.0'
}

View File

@ -18,13 +18,13 @@ package com.example.androidwearmap;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapFragment;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.wearable.view.DismissOverlayView;
import android.view.View;
import android.view.WindowInsets;
@ -33,7 +33,7 @@ import android.widget.FrameLayout;
/**
* Sample that shows how to set up a basic Google Map on Android Wear.
*/
public class MainActivity extends FragmentActivity implements OnMapReadyCallback,
public class MainActivity extends Activity implements OnMapReadyCallback,
GoogleMap.OnMapLongClickListener {
private static final LatLng SYDNEY = new LatLng(-33.85704, 151.21522);
@ -90,9 +90,8 @@ public class MainActivity extends FragmentActivity implements OnMapReadyCallback
mDismissOverlay.showIntroIfNecessary();
// Obtain the MapFragment and set the async listener to be notified when the map is ready.
SupportMapFragment mapFragment =
(SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
MapFragment mapFragment =
(MapFragment) getFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}

View File

@ -33,7 +33,7 @@
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
android:name="com.google.android.gms.maps.MapFragment"/>
</FrameLayout>