diff --git a/README.md b/README.md index afa84f6..531194c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ [![language](https://img.shields.io/github/languages/top/BirjuVachhani/location-extension-android.svg?style=for-the-badge&colorB=f18e33)](https://kotlinlang.org/) [![Platform](https://img.shields.io/badge/Platform-Android-green.svg?style=for-the-badge)](https://www.android.com/) [![API](https://img.shields.io/badge/API-16%2B-F44336.svg?style=for-the-badge)](https://android-arsenal.com/api?level=16) +[![Release](https://jitpack.io/v/BirjuVachhani/locus-android.svg?style=flat-square)](https://jitpack.io/BirjuVachhani/locus-android) Locus is a tiny kotlin library for android which makes it super very easy to retrieve location with just few lines of code. Everything including permission model and Location settings resolution is handled internally which removes a lot of boilerplate code any developer have to write every time. @@ -14,7 +15,7 @@ See [Wiki](https://github.com/BirjuVachhani/locus-android/wiki) for more informa ## Features -* Android Q support +* Android R support (Report if any issue is found) * Completely written in Kotlin * Easy Initialization * Handles Permission Model @@ -45,7 +46,8 @@ allprojects { ``` dependencies { - implementation 'com.github.BirjuVachhani:locus-android:3.0.1' + implementation 'com.github.BirjuVachhani:locus-android:latest-version' + implementation 'com.google.android.gms:play-services-location:latest-version' } ``` @@ -69,10 +71,12 @@ You are most welcome to contribute to this project! Please have a look at [Contributing Guidelines](https://github.com/BirjuVachhani/locus-android/blob/master/CONTRIBUTING.md), before contributing and proposing a change. +Buy Me A Coffee + # License ``` - Copyright © 2019 BirjuVachhani + Copyright © 2020 BirjuVachhani Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/app/src/main/java/com/birjuvachhani/locationextensionsample/LocationService.kt b/app/src/main/java/com/birjuvachhani/locationextensionsample/LocationService.kt index 8547e05..ddad58c 100644 --- a/app/src/main/java/com/birjuvachhani/locationextensionsample/LocationService.kt +++ b/app/src/main/java/com/birjuvachhani/locationextensionsample/LocationService.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -33,7 +33,7 @@ import com.birjuvachhani.locus.LocusResult /* * Created by Birju Vachhani on 12 August 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ class LocationService : LifecycleService() { diff --git a/app/src/main/java/com/birjuvachhani/locationextensionsample/MainActivity.kt b/app/src/main/java/com/birjuvachhani/locationextensionsample/MainActivity.kt index 6b6c58b..a37b526 100644 --- a/app/src/main/java/com/birjuvachhani/locationextensionsample/MainActivity.kt +++ b/app/src/main/java/com/birjuvachhani/locationextensionsample/MainActivity.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -27,6 +27,11 @@ import com.google.android.gms.location.LocationRequest import kotlinx.android.synthetic.main.activity_main.* import java.util.* +/* + * Created by Birju Vachhani on 18 September 2019 + * Copyright © 2020 locus-android. All rights reserved. + */ + class MainActivity : AppCompatActivity(), ActivityCompat.OnRequestPermissionsResultCallback { private val TAG = this::class.java.simpleName diff --git a/app/src/main/java/com/birjuvachhani/locationextensionsample/ServiceStopBroadcastReceiver.kt b/app/src/main/java/com/birjuvachhani/locationextensionsample/ServiceStopBroadcastReceiver.kt index 3228197..01b4859 100644 --- a/app/src/main/java/com/birjuvachhani/locationextensionsample/ServiceStopBroadcastReceiver.kt +++ b/app/src/main/java/com/birjuvachhani/locationextensionsample/ServiceStopBroadcastReceiver.kt @@ -1,3 +1,17 @@ +/* + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.birjuvachhani.locationextensionsample import android.annotation.SuppressLint @@ -9,7 +23,7 @@ import com.birjuvachhani.locus.Locus /* * Created by Birju Vachhani on 23 September 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ internal class ServiceStopBroadcastReceiver : BroadcastReceiver() { diff --git a/locus/src/main/java/com/birjuvachhani/locus/Configuration.kt b/locus/src/main/java/com/birjuvachhani/locus/Configuration.kt index 31923a9..d9518ee 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/Configuration.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/Configuration.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,7 +21,7 @@ import kotlinx.android.parcel.Parcelize /* * Created by Birju Vachhani on 07 February 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/Constants.kt b/locus/src/main/java/com/birjuvachhani/locus/Constants.kt index 30d094d..864f397 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/Constants.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/Constants.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,7 @@ package com.birjuvachhani.locus /* * Created by Birju Vachhani on 06 February 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/Extensions.kt b/locus/src/main/java/com/birjuvachhani/locus/Extensions.kt index 75c1236..14ea4de 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/Extensions.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/Extensions.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,7 +21,7 @@ import androidx.lifecycle.Observer /* * Created by Birju Vachhani on 06 February 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/LocationBroadcastReceiver.kt b/locus/src/main/java/com/birjuvachhani/locus/LocationBroadcastReceiver.kt index 80fb865..ab419cb 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/LocationBroadcastReceiver.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/LocationBroadcastReceiver.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -23,7 +23,7 @@ import com.google.android.gms.location.LocationResult /* * Created by Birju Vachhani on 12 August 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/LocationProvider.kt b/locus/src/main/java/com/birjuvachhani/locus/LocationProvider.kt index 6bb3de5..e4946fb 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/LocationProvider.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/LocationProvider.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -25,7 +25,7 @@ import java.util.concurrent.atomic.AtomicBoolean /* * Created by Birju Vachhani on 10 April 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/Locus.kt b/locus/src/main/java/com/birjuvachhani/locus/Locus.kt index 54298d8..c95e724 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/Locus.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/Locus.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -37,7 +37,7 @@ import java.util.concurrent.atomic.AtomicBoolean /* * Created by Birju Vachhani on 09 November 2018 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ internal val isRequestingPermission = AtomicBoolean().apply { diff --git a/locus/src/main/java/com/birjuvachhani/locus/LocusActivity.kt b/locus/src/main/java/com/birjuvachhani/locus/LocusActivity.kt index d41c99b..e1fbf64 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/LocusActivity.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/LocusActivity.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -35,9 +35,13 @@ import com.google.android.gms.location.LocationSettingsRequest import com.google.android.gms.location.LocationSettingsResponse import com.google.android.gms.location.LocationSettingsStatusCodes +/* + * Created by Birju Vachhani on 17 July 2019 + * Copyright © 2020 locus-android. All rights reserved. + */ + /** * Activity that handles permission model as well as location settings resolution process - * @property localBroadcastManager Used to send permission related broadcasts * @property config Current configuration to be used for the library * @property pref SharedPreferences instance to managed permission model * @property permissions Permissions that needs to be requested based on the [config] diff --git a/locus/src/main/java/com/birjuvachhani/locus/LocusResult.kt b/locus/src/main/java/com/birjuvachhani/locus/LocusResult.kt index eeb51a6..e052de0 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/LocusResult.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/LocusResult.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,7 +19,7 @@ import android.location.Location /* * Created by Birju Vachhani on 05 February 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/Logger.kt b/locus/src/main/java/com/birjuvachhani/locus/Logger.kt index db6e2a9..170c35a 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/Logger.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/Logger.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,7 +19,7 @@ import android.util.Log /* * Created by Birju Vachhani on 19 July 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/PermissionBroadcastReceiver.kt b/locus/src/main/java/com/birjuvachhani/locus/PermissionBroadcastReceiver.kt index f3f1254..33a9327 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/PermissionBroadcastReceiver.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/PermissionBroadcastReceiver.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -19,7 +19,7 @@ import androidx.lifecycle.Observer /* * Created by Birju Vachhani on 16 September 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /** diff --git a/locus/src/main/java/com/birjuvachhani/locus/PermissionUtils.kt b/locus/src/main/java/com/birjuvachhani/locus/PermissionUtils.kt index 89163a9..491e77d 100644 --- a/locus/src/main/java/com/birjuvachhani/locus/PermissionUtils.kt +++ b/locus/src/main/java/com/birjuvachhani/locus/PermissionUtils.kt @@ -1,5 +1,5 @@ /* - * Copyright © 2019 Birju Vachhani (https://github.com/BirjuVachhani) + * Copyright © 2020 Birju Vachhani (https://github.com/BirjuVachhani) * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -24,7 +24,7 @@ import androidx.core.content.ContextCompat /* * Created by Birju Vachhani on 18 September 2019 - * Copyright © 2019 locus-android. All rights reserved. + * Copyright © 2020 locus-android. All rights reserved. */ /**