From 097bd7c334c445ee5874d035a5ba31607ccc5b00 Mon Sep 17 00:00:00 2001 From: AndrewTomash Date: Tue, 8 Jan 2019 02:40:26 +0200 Subject: [PATCH] 1.1.0 release --- README.md | 59 ++++++++----------- bintray.gradle | 7 +++ deps.gradle | 2 +- .../exception/LocationSettingsException.kt | 1 - 4 files changed, 32 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 3b4100f..62a99de 100644 --- a/README.md +++ b/README.md @@ -23,47 +23,24 @@ allprojects { **Step 2.** Add the dependency ##### For Android studio 3.0 -**Recommended**: This will use all libraries that you defined +**Recommended**: This will use all libraries that you defined ``` dependencies { - implementation 'com.android.support:appcompat-v7:YOUR_SUPPORT_LIBRARY_VERSION' - implementation 'com.android.support:design:YOUR_SUPPORT_LIBRARY_VERSION' implementation 'io.reactivex.rxjava2:rxandroid:YOUR_RX_ANDROID_VERSION' implementation 'io.reactivex.rxjava2:rxjava:YOUR_RX_JAVA_2_VERSION' implementation 'com.google.android.gms:play-services-location:YOUR_GOOGLE_PLAY_VERSION' - implementation ('codes.titanium:locgetter:1.0.3',{ + implementation ('codes.titanium:locgetter:1.1.0',{ transitive = false }) } +``` -``` **Not recommended:** This will use all dependencies from library, may increase apk size, increase methods count and lead to compile errors ``` dependencies { - implementation 'codes.titanium:locgetter:1.0.3' + implementation 'codes.titanium:locgetter:1.1.0' } -``` - -#### For Android studio 2.3 -**Recommended**: This will use all libraries that you defined -``` -dependencies { - compile 'com.android.support:appcompat-v7:YOUR_SUPPORT_LIBRARY_VERSION' - compile 'com.android.support:design:YOUR_SUPPORT_LIBRARY_VERSION' - compile 'io.reactivex.rxjava2:rxandroid:YOUR_RX_ANDROID_VERSION' - compile 'io.reactivex.rxjava2:rxjava:YOUR_RX_JAVA_2_VERSION' - compile 'com.google.android.gms:play-services-location:YOUR_GOOGLE_PLAY_VERSION' - compile ('codes.titanium:locgetter:1.0.3',{ - transitive = false - }) -} -``` -**Not recommended:** This will use all dependencies from library, may increase apk size, increase methods count and lead to compile errors -``` -dependencies { - compile 'codes.titanium:locgetter:1.0.3' -} -``` +``` Basic Usage ----------- @@ -83,9 +60,8 @@ All you need is to create **LocationGetter** instance using **LocationGetterBuil Optional you can add to builder: -* LocationRequest to customize location updates -* GoogleApiClient to use instance of your google api client * Logger to get logs of everything happening inside LocationGetter +* Accept mock locations behavior Start getting locations using one of methods for e.g. @@ -99,17 +75,30 @@ locationGetter.getLatestLocation() More examples can be found in sample package with sample app. -Helper activity +Error handling --------------- -You can extend your activity from **BaseLocationActivity** and get access to extended behavior with some features. +All exceptions are handled in library. + +In case of no permissions -> user will be asked to give permissions, if user declines -> NoLocationPermission will be thrown -1. Catch exceptions via onLocationError to handle settings and permissions errors -2. Get callbacks with user locations permission granted/revoked and locations settings granted/revoke -3. Show dialog on google api available +In case of turned off location -> user will be asked to turn it on, if user declines -> LocationSettingsException will be thrown +Accept mock locations behavior +--- +By default mock locations are accepted. +You can filter all mock locations that are received by location manager. Just set acceptMockLocations to false when you are building location getter. + +In case if mock location will be received MockLocationException will be thrown with that mocked location and you can decide what to do with it. Release notes ------------- +### 1.1.0 +> * Major refactor +> * Removed a lot of redundant APIs +> * No more need of activity to handle exceptions +> * Optimizations +> * Feature - mock locations filter + ### 1.0.3 > * Updated Readme > * Updated dependencies bump diff --git a/bintray.gradle b/bintray.gradle index c57198c..3d9ba49 100644 --- a/bintray.gradle +++ b/bintray.gradle @@ -9,6 +9,13 @@ tasks.withType(Javadoc) { options.addStringOption('encoding', 'UTF-8') options.addStringOption('charSet', 'UTF-8') } +tasks.whenTaskAdded { task -> + if (task.name == 'javadoc') { + task.configure { + failOnError false + } + } +} android { compileSdkVersion versions.compileSdkVersion } diff --git a/deps.gradle b/deps.gradle index edba9c4..3f01a66 100644 --- a/deps.gradle +++ b/deps.gradle @@ -3,7 +3,7 @@ ext.versions = [ compileSdkVersion: 28, minSdk: 16, buildToolsVersion: '28.0.3', - publishVersion : '1.0.3', + publishVersion : '1.1.0', buildCode : 4, kotlinVersion : '1.3.11', //libs diff --git a/locgetter/src/main/java/com/titanium/locgetter/exception/LocationSettingsException.kt b/locgetter/src/main/java/com/titanium/locgetter/exception/LocationSettingsException.kt index b17592b..e12eea0 100644 --- a/locgetter/src/main/java/com/titanium/locgetter/exception/LocationSettingsException.kt +++ b/locgetter/src/main/java/com/titanium/locgetter/exception/LocationSettingsException.kt @@ -1,4 +1,3 @@ package com.titanium.locgetter.exception - class LocationSettingsException : RuntimeException() \ No newline at end of file