Releases: psteiger/LocationFetcher
9.0.0
8.2.2
8.2.1
Release 8.2.1
- Update
AGP
to 7.1.3,Gradle
to 7.4.2 - Only collect location from API if user is collecting
LocationFetcher.location
. The previous restriction
(only collect ifLifecycle.State
>=STARTED
) still holds, so the new
logic for collecting from API is:Lifecycle.State
>=STARTED
- User is collecting
LocationFetcher.location
8.2.0
- Created demo application.
- Removed default values for
LocationRequest
. (Fixes bug whereinterval
is not respected). - Removed
GPS
andNetwork
providers from default providers config. We now only keepFused
provider by default (which is an abstraction overGPS
andNetwork
providers). This gives more expected behavior relating to theLocationRequest
configs. - Changed
fastestInterval
,interval
andmaxWaitTime
types to Duration instead ofLong
. - Other minor changes.
8.1.1
-
Add support for
Fragment
alongside the
already supportedComponentActivity
andContext
. -
Add builders with support for lazy rationales.
These builders allow building
LocationFetcher
passing in
a rationale producer instead of a rationale string.
This enables the possibility for usinggetString
in
a field assignment in aComponentActivity
/Fragment
:class MyFragment : Fragment() { private val locationFetcher = locationFetcher({ getString(R.string.rationale) }) { // ... config } }
-
Bump versions:
Kotlin: 1.6.0-RC2 -> 1.6.10
com.android.library
: 7.1.0-beta02 -> 7.1.2
kotlinx.coroutines
: 1.5.2 -> 1.6.0
play-services-location
: 18.0.0 -> 19.0.1
activity-ktx
: 1.4.0-rc01 -> 1.4.0
fragment-ktx
: 1.4.0-rc01 -> 1.4.1
appcompat
: 1.4.0-rc01 -> 1.4.1
lifecycle
: 2.4.0 -> 2.4.1
8.1.0
-
Add support for
Fragment
alongside the
already supportedComponentActivity
andContext
. -
Add builders with support for lazy rationales.
These builders allow building
LocationFetcher
passing in
a rationale producer instead of a rationale string.
This enables the possibility for usinggetString
in
a field assignment in aComponentActivity
/Fragment
:class MyFragment : Fragment() { private val locationFetcher = locationFetcher({ getString(R.string.rationale) }) { // ... config } }
-
Bump versions:
Kotlin: 1.6.0-RC2 -> 1.6.10
com.android.library
: 7.1.0-beta02 -> 7.1.2
kotlinx.coroutines
: 1.5.2 -> 1.6.0
play-services-location
: 18.0.0 -> 19.0.1
activity-ktx
: 1.4.0-rc01 -> 1.4.0
fragment-ktx
: 1.4.0-rc01 -> 1.4.1
appcompat
: 1.4.0-rc01 -> 1.4.1
lifecycle
: 2.4.0 -> 2.4.1
8.0.0
What's Changed
Full Changelog: 7.0.0...8.0.0
Breaking changes
- Location flow, permission flow and settings flow are now SharedFlow. Using StateFlow is conceptually wrong because it does not necessarily mean the current state. If you used
.value
on the previous flows, you can now usereplayCache.last()
. LocationFetcher.location
is now aSharedFlow<Either<Nel<Error>, Location>>
. It now reports the errors in the left side of theEither
value in case it failed to obtain a location.LocationFetcher.permissionStatus
andLocationFetcher.settingsStatus
are nowSharedFlow<Boolean>
. The old enumsPermissionStatus
andSettingsStatus
are now deprecated.- Removed
LocationFetcher.requestLocationPermissionOnLifecycle
andLocationFetcher.requestEnableLocationSettingsOnLifecycle
configs fromLocationFetcher.Config
. Instead of requesting permissions and setting enablement on their own, it's now requested automatically once the location flows is subscribed to. - Removed the possibility to ask for location indefinitely. We now use (and require) a rationale for asking for location. If user denies the permission once, the rationale is shown and we ask the permission one more time. If the user denies it, we respect the user decision and don't ask again. This is in accordance with Google's best practices and policies on location fetching. The rationale is a
String
passed to theLocationFetcher
builders.
Other changes
- Added
LocationFetcher.shouldShowRationale(): Boolean
. Should return true after user denied location permission once. It's used internally to decide whether to show a rationale to the user before asking for permission again, but it's also exposed as an API.
8.0.0-alpha08
8.0.0-alpha08
8.0.0-alpha07
8.0.0-alpha07
8.0.0-alpha06
8.0.0-alpha06