Naming convention fix.
This commit is contained in:
parent
d776f0c09c
commit
575d62a354
|
@ -19,7 +19,7 @@ package im.vector.app.features.location
|
||||||
import android.app.Activity
|
import android.app.Activity
|
||||||
import im.vector.app.core.utils.openAppSettingsPage
|
import im.vector.app.core.utils.openAppSettingsPage
|
||||||
|
|
||||||
class LocationSharingNavigator constructor(val activity: Activity?) : ILocationSharingNavigator {
|
class DefaultLocationSharingSettingsNavigator constructor(val activity: Activity?) : LocationSharingSettingsNavigator {
|
||||||
|
|
||||||
override var goingToAppSettings: Boolean = false
|
override var goingToAppSettings: Boolean = false
|
||||||
|
|
|
@ -54,7 +54,7 @@ class LocationSharingFragment @Inject constructor(
|
||||||
|
|
||||||
private val viewModel: LocationSharingViewModel by fragmentViewModel()
|
private val viewModel: LocationSharingViewModel by fragmentViewModel()
|
||||||
|
|
||||||
private val viewNavigator: ILocationSharingNavigator by lazy { LocationSharingNavigator(activity) }
|
private val locationSharingNavigator: LocationSharingSettingsNavigator by lazy { DefaultLocationSharingSettingsNavigator(activity) }
|
||||||
|
|
||||||
// Keep a ref to handle properly the onDestroy callback
|
// Keep a ref to handle properly the onDestroy callback
|
||||||
private var mapView: WeakReference<MapView>? = null
|
private var mapView: WeakReference<MapView>? = null
|
||||||
|
@ -83,7 +83,7 @@ class LocationSharingFragment @Inject constructor(
|
||||||
|
|
||||||
viewModel.observeViewEvents {
|
viewModel.observeViewEvents {
|
||||||
when (it) {
|
when (it) {
|
||||||
LocationSharingViewEvents.Close -> viewNavigator.quit()
|
LocationSharingViewEvents.Close -> locationSharingNavigator.quit()
|
||||||
LocationSharingViewEvents.LocationNotAvailableError -> handleLocationNotAvailableError()
|
LocationSharingViewEvents.LocationNotAvailableError -> handleLocationNotAvailableError()
|
||||||
is LocationSharingViewEvents.ZoomToUserLocation -> handleZoomToUserLocationEvent(it)
|
is LocationSharingViewEvents.ZoomToUserLocation -> handleZoomToUserLocationEvent(it)
|
||||||
}.exhaustive
|
}.exhaustive
|
||||||
|
@ -93,8 +93,8 @@ class LocationSharingFragment @Inject constructor(
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
views.mapView.onResume()
|
views.mapView.onResume()
|
||||||
if (viewNavigator.goingToAppSettings) {
|
if (locationSharingNavigator.goingToAppSettings) {
|
||||||
viewNavigator.goingToAppSettings = false
|
locationSharingNavigator.goingToAppSettings = false
|
||||||
// retry to start live location
|
// retry to start live location
|
||||||
tryStartLiveLocationSharing()
|
tryStartLiveLocationSharing()
|
||||||
}
|
}
|
||||||
|
@ -149,7 +149,7 @@ class LocationSharingFragment @Inject constructor(
|
||||||
.setTitle(R.string.location_not_available_dialog_title)
|
.setTitle(R.string.location_not_available_dialog_title)
|
||||||
.setMessage(R.string.location_not_available_dialog_content)
|
.setMessage(R.string.location_not_available_dialog_content)
|
||||||
.setPositiveButton(R.string.ok) { _, _ ->
|
.setPositiveButton(R.string.ok) { _, _ ->
|
||||||
viewNavigator.quit()
|
locationSharingNavigator.quit()
|
||||||
}
|
}
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
.show()
|
.show()
|
||||||
|
@ -160,7 +160,7 @@ class LocationSharingFragment @Inject constructor(
|
||||||
.setTitle(R.string.location_in_background_missing_permission_dialog_title)
|
.setTitle(R.string.location_in_background_missing_permission_dialog_title)
|
||||||
.setMessage(R.string.location_in_background_missing_permission_dialog_content)
|
.setMessage(R.string.location_in_background_missing_permission_dialog_content)
|
||||||
.setPositiveButton(R.string.settings) { _, _ ->
|
.setPositiveButton(R.string.settings) { _, _ ->
|
||||||
viewNavigator.goToAppSettings()
|
locationSharingNavigator.goToAppSettings()
|
||||||
}
|
}
|
||||||
.setNegativeButton(R.string.action_not_now, null)
|
.setNegativeButton(R.string.action_not_now, null)
|
||||||
.setCancelable(false)
|
.setCancelable(false)
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
package im.vector.app.features.location
|
package im.vector.app.features.location
|
||||||
|
|
||||||
interface ILocationSharingNavigator {
|
interface LocationSharingSettingsNavigator {
|
||||||
var goingToAppSettings: Boolean
|
var goingToAppSettings: Boolean
|
||||||
fun quit()
|
fun quit()
|
||||||
fun goToAppSettings()
|
fun goToAppSettings()
|
Loading…
Reference in New Issue