Skip to content

Commit

Permalink
[ISSUE #304] Correct issue with Google GeocodingDataSource initializa…
Browse files Browse the repository at this point in the history
…tion (#306)

* [ISSUE #304] Correct issue with Google GeocodingDataSource initialization

* changed version to 7.2.0

* correct lint issues
  • Loading branch information
ferranpons authored Jun 25, 2020
1 parent e21d909 commit d678395
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ Include the dependency in your app `build.gradle`:

```groovy
dependencies {
implementation 'com.schibstedspain.android:leku:7.1.0'
implementation 'com.schibstedspain.android:leku:7.2.0'
}
```

Alternatively, if you are using a different version of Google Play Services and AndroidX use this instead:

```groovy
implementation ('com.schibstedspain.android:leku:7.1.0') {
implementation ('com.schibstedspain.android:leku:7.2.0') {
exclude group: 'com.google.android.gms'
exclude group: 'androidx.appcompat'
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
<string name="launch_legacy_map_picker" translatable="false">LAUNCH LEGACY MAP LOCATION ACTIVITY</string>
<string name="launch_map_picker_with_pois" translatable="false">LAUNCH MAP WITH POIS</string>
<string name="launch_map_picker_with_style" translatable="false">LAUNCH MAP WITH STYLE</string>
<string name="leku_lib_version" translatable="false">version 7.1.0</string>
<string name="leku_lib_version" translatable="false">version 7.2.0</string>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath 'com.android.tools.build:gradle:4.0.0'

classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.0"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ Include the dependency in your app `build.gradle`:

```groovy
dependencies {
implementation 'com.schibstedspain.android:leku:7.1.0'
implementation 'com.schibstedspain.android:leku:7.2.0'
}
```

Alternatively, if you are using a different version of Google Play Services and AndroidX use this instead:

```groovy
implementation ('com.schibstedspain.android:leku:7.1.0') {
implementation ('com.schibstedspain.android:leku:7.2.0') {
exclude group: 'com.google.android.gms'
exclude group: 'androidx.appcompat'
}
Expand Down
10 changes: 5 additions & 5 deletions leku/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "androidx.appcompat:appcompat:1.1.0"
implementation "com.google.android.material:material:1.2.0-alpha06"
implementation "com.google.android.material:material:1.3.0-alpha01"

def playServicesVersion = '17.0.0'
implementation ("com.google.android.gms:play-services-maps:$playServicesVersion") {
Expand All @@ -91,22 +91,22 @@ dependencies {
exclude group: "com.android.support"
}

implementation ("com.google.android.libraries.places:places:2.2.0") {
implementation ("com.google.android.libraries.places:places:2.3.0") {
exclude group: "com.android.support"
}

implementation "com.google.maps:google-maps-services:0.2.9"

implementation 'io.reactivex.rxjava3:rxjava:3.0.3'
implementation 'io.reactivex.rxjava3:rxjava:3.0.4'
implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
implementation 'nl.littlerobots.rxlint:rxlint:1.7.4'


def espressoVersion = '3.1.0'
def espressoVersion = '3.2.0'
androidTestImplementation "androidx.test.espresso:espresso-core:$espressoVersion"
androidTestImplementation "androidx.test.espresso:espresso-intents:$espressoVersion"

def supportTestVersion = '1.1.0'
def supportTestVersion = '1.2.0'
androidTestImplementation "androidx.test:runner:$supportTestVersion"
androidTestImplementation "androidx.test:rules:$supportTestVersion"
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ class LocationPickerActivity : AppCompatActivity(),
placesDataSource = GooglePlacesDataSource(Places.createClient(this))
}
val geocoder = Geocoder(this, Locale.getDefault())
apiInteractor = GoogleGeocoderDataSource(NetworkClient(), AddressBuilder())
if (apiInteractor == null) {
apiInteractor = GoogleGeocoderDataSource(NetworkClient(), AddressBuilder())
}
val geocoderRepository = GeocoderRepository(AndroidGeocoderDataSource(geocoder), apiInteractor!!)
val timeZoneDataSource = GoogleTimeZoneDataSource(
GeoApiContext.Builder().apiKey(GoogleTimeZoneDataSource.getApiKey(this)).build())
Expand Down Expand Up @@ -891,6 +893,7 @@ class LocationPickerActivity : AppCompatActivity(),
setLayoutVisibilityFromBundle(savedInstanceState)
}
if (savedInstanceState.keySet().contains(GEOLOC_API_KEY)) {
apiInteractor = GoogleGeocoderDataSource(NetworkClient(), AddressBuilder())
apiInteractor?.setApiKey(savedInstanceState.getString(GEOLOC_API_KEY, ""))
}
if (savedInstanceState.keySet().contains(PLACES_API_KEY)) {
Expand Down Expand Up @@ -962,7 +965,8 @@ class LocationPickerActivity : AppCompatActivity(),
poisList = transitionBundle.getParcelableArrayList(POIS_LIST)
}
if (transitionBundle.keySet().contains(GEOLOC_API_KEY)) {
apiInteractor!!.setApiKey(transitionBundle.getString(GEOLOC_API_KEY, ""))

apiInteractor?.setApiKey(transitionBundle.getString(GEOLOC_API_KEY, ""))
}
if (transitionBundle.keySet().contains(PLACES_API_KEY)) {
googlePlacesApiKey = transitionBundle.getString(PLACES_API_KEY, "")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.schibstedspain.leku.utils;

import android.annotation.SuppressLint;
import android.content.Context;
import android.location.Location;

Expand All @@ -22,6 +23,7 @@ private LastKnownLocationObservableOnSubscribe(Context ctx) {
super(ctx);
}

@SuppressLint("MissingPermission")
@Override
protected void onLocationProviderClientReady(FusedLocationProviderClient locationProviderClient,
final ObservableEmitter<? super Location> emitter) {
Expand Down
2 changes: 1 addition & 1 deletion version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MAJOR=7
MINOR=1
MINOR=2
PATCH=0

0 comments on commit d678395

Please sign in to comment.