diff --git a/README.md b/README.md index 69efd5e4..dec08c35 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Include the dependency in your app `build.gradle`: ```groovy dependencies { - compile 'com.schibstedspain.android:leku:3.0.0' + compile 'com.schibstedspain.android:leku:3.1.0' } ``` diff --git a/app/build.gradle b/app/build.gradle index 3c7f9607..6d67c171 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,6 +11,7 @@ android { targetSdkVersion 25 versionCode 1 versionName "1.0" + vectorDrawables.useSupportLibrary = true } buildTypes { release { diff --git a/build.gradle b/build.gradle index 5b7539d2..f5d0cf18 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:2.3.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3' classpath "org.jfrog.buildinfo:build-info-extractor-gradle:3.1.1" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ba754146..53e1b626 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Tue Aug 30 11:45:10 CEST 2016 +#Fri Mar 17 11:33:48 CET 2017 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip diff --git a/leku/build.gradle b/leku/build.gradle index 3f3beff7..2c6c50f9 100644 --- a/leku/build.gradle +++ b/leku/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'com.novoda.bintray-release' apply from: '../quality.gradle' group = 'com.schibstedspain.android' -version = '3.0.0' +version = '3.1.0' android { compileSdkVersion 25 @@ -17,6 +17,7 @@ android { versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" consumerProguardFiles 'lib-proguard-rules.txt' + vectorDrawables.useSupportLibrary = true } buildTypes { release { @@ -68,7 +69,7 @@ publish { userOrg = 'schibstedspain' groupId = 'com.schibstedspain.android' artifactId = 'leku' - publishVersion = '3.0.0' + publishVersion = '3.1.0' desc = 'Location picker component for Android. It returns a latitude,longitude and an address based on the location picked in the LocationPickerActivity provided.' website = 'https://github.com/SchibstedSpain/leku' } diff --git a/leku/src/main/java/com/schibstedspain/leku/LocationPickerActivity.java b/leku/src/main/java/com/schibstedspain/leku/LocationPickerActivity.java index 9e59dcd4..ca3c060b 100644 --- a/leku/src/main/java/com/schibstedspain/leku/LocationPickerActivity.java +++ b/leku/src/main/java/com/schibstedspain/leku/LocationPickerActivity.java @@ -57,6 +57,9 @@ import java.util.Map; import pl.charmas.android.reactivelocation.ReactiveLocationProvider; +import static com.google.android.gms.maps.GoogleMap.MAP_TYPE_NORMAL; +import static com.google.android.gms.maps.GoogleMap.MAP_TYPE_SATELLITE; + public class LocationPickerActivity extends AppCompatActivity implements OnMapReadyCallback, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener, GoogleMap.OnMapLongClickListener, @@ -245,6 +248,12 @@ private void setUpFloatingButtons() { }); FloatingActionButton btnAcceptLocation = (FloatingActionButton) findViewById(R.id.btnAccept); btnAcceptLocation.setOnClickListener(v -> returnCurrentPosition()); + + FloatingActionButton btnSatellite = (FloatingActionButton) findViewById(R.id.btnSatellite); + btnSatellite.setOnClickListener(view -> { + map.setMapType(map.getMapType() == MAP_TYPE_SATELLITE ? MAP_TYPE_NORMAL : MAP_TYPE_SATELLITE); + btnSatellite.setImageResource(map.getMapType() == MAP_TYPE_SATELLITE ? R.drawable.ic_satellite_off : R.drawable.ic_satellite_on); + }); } private void updateValuesFromBundle(Bundle savedInstanceState) { @@ -876,7 +885,7 @@ private String getFullAddressString(Address address) { private void setDefaultMapSettings() { if (map != null) { - map.setMapType(GoogleMap.MAP_TYPE_NORMAL); + map.setMapType(MAP_TYPE_NORMAL); map.setOnMapLongClickListener(this); map.setOnMapClickListener(this); map.getUiSettings().setCompassEnabled(false); diff --git a/leku/src/main/res/drawable/ic_satellite_off.xml b/leku/src/main/res/drawable/ic_satellite_off.xml new file mode 100644 index 00000000..a5f08855 --- /dev/null +++ b/leku/src/main/res/drawable/ic_satellite_off.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/leku/src/main/res/drawable/ic_satellite_on.xml b/leku/src/main/res/drawable/ic_satellite_on.xml new file mode 100644 index 00000000..0f8bd4f4 --- /dev/null +++ b/leku/src/main/res/drawable/ic_satellite_on.xml @@ -0,0 +1,9 @@ + + + diff --git a/leku/src/main/res/layout-land/activity_location_picker.xml b/leku/src/main/res/layout-land/activity_location_picker.xml index 063a29d7..21d15370 100644 --- a/leku/src/main/res/layout-land/activity_location_picker.xml +++ b/leku/src/main/res/layout-land/activity_location_picker.xml @@ -50,6 +50,22 @@ android:animateLayoutChanges="true" > + + + + + + + + + + + +