mirror of
https://github.com/googlemaps/android-samples.git
synced 2025-12-08 18:02:20 +00:00
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:
parent
eae63f9561
commit
ab79c2a7ba
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
build/
|
||||
.idea
|
||||
.gradle
|
||||
*.iml
|
||||
local.properties
|
||||
.DS_Store
|
||||
@ -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'
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
|
||||
@ -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>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user