Skip to content

Commit

Permalink
Added a FOSS flavor without Google's dependances
Browse files Browse the repository at this point in the history
Federico Iosue committed Feb 1, 2017
1 parent a68ed4d commit c2f2f27
Showing 7 changed files with 43 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'me.tatarka:gradle-retrolambda:3.2.5'
classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -17,8 +17,8 @@

MIN_SDK=14
TARGET_SDK=23
VERSION_NAME=5.2.19
VERSION_CODE=229
VERSION_NAME=5.2.20
VERSION_CODE=230
PACKAGE=it.feio.android.omninotes

# The following properties are empty defaults to allow build and can EVENTUALLY be overridden to allow:
9 changes: 8 additions & 1 deletion omniNotes/build.gradle
Original file line number Diff line number Diff line change
@@ -49,6 +49,12 @@ android {
}
}
}
productFlavors {
play {}
foss {
// packageName "de.janusz.journeyman.zinsrechner.pro"
}
}
lintOptions {
abortOnError false
disable 'MissingTranslation'
@@ -96,7 +102,8 @@ dependencies {
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.3'
compile 'com.pnikosis:materialish-progress:1.5'
compile 'com.github.paolorotolo:appintro:1.3.0'
compile 'io.nlopez.smartlocation:library:3.2.0'
playCompile 'io.nlopez.smartlocation:library:3.2.4'
fossCompile 'com.github.federicoiosue:smart-location-lib:3.2.5'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
compile 'com.artemzin.rxjava:proguard-rules:1.0.14.2'
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package it.feio.android.omninotes.helpers;

import android.content.Context;

import io.nlopez.smartlocation.location.LocationProvider;
import io.nlopez.smartlocation.location.providers.LocationManagerProvider;

public class GeoCodeProviderFactory {

public static LocationProvider getProvider(Context context) {
return new LocationManagerProvider();
}
}
Original file line number Diff line number Diff line change
@@ -24,10 +24,10 @@
import android.util.Log;
import io.nlopez.smartlocation.SmartLocation;
import io.nlopez.smartlocation.location.config.LocationParams;
import io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesWithFallbackProvider;
import io.nlopez.smartlocation.rx.ObservableFactory;
import it.feio.android.omninotes.BuildConfig;
import it.feio.android.omninotes.OmniNotes;
import it.feio.android.omninotes.helpers.GeoCodeProviderFactory;
import it.feio.android.omninotes.models.listeners.OnGeoUtilResultListener;
import org.json.JSONArray;
import org.json.JSONException;
@@ -88,9 +88,9 @@ public void onProviderDisabled(String provider) {


public static void getLocation(OnGeoUtilResultListener onGeoUtilResultListener) {
SmartLocation.LocationControl bod = SmartLocation.with(OmniNotes.getAppContext()).location(new
LocationGooglePlayServicesWithFallbackProvider(OmniNotes.getAppContext())).config(LocationParams
.NAVIGATION).oneFix();
SmartLocation.LocationControl bod = SmartLocation.with(OmniNotes.getAppContext())
.location(GeoCodeProviderFactory.getProvider(OmniNotes.getAppContext()))
.config(LocationParams.NAVIGATION).oneFix();

Observable<Location> locations = ObservableFactory.from(bod).timeout(2, TimeUnit.SECONDS);
locations.subscribe(new Subscriber<Location>() {
2 changes: 2 additions & 0 deletions omniNotes/src/main/res/values/integers.xml
Original file line number Diff line number Diff line change
@@ -24,4 +24,6 @@

<integer name="textview_max_lines">1</integer>
<integer name="textview_max_lines_expanded">2</integer>

<integer name="google_play_services_version">8115000</integer>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package it.feio.android.omninotes.helpers;

import android.content.Context;

import io.nlopez.smartlocation.location.LocationProvider;
import io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesWithFallbackProvider;

public class GeoCodeProviderFactory {

public static LocationProvider getProvider(Context context) {
return new LocationGooglePlayServicesWithFallbackProvider(context);
}
}

0 comments on commit c2f2f27

Please sign in to comment.