diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingNavigator.kt b/vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingSettingsNavigator.kt similarity index 89% rename from vector/src/main/java/im/vector/app/features/location/LocationSharingNavigator.kt rename to vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingSettingsNavigator.kt index b4412710e3..5b8ae5b01a 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingSettingsNavigator.kt @@ -19,7 +19,7 @@ package im.vector.app.features.location import android.app.Activity 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 diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt index bbef06c11e..12a84ac147 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingFragment.kt @@ -54,7 +54,7 @@ class LocationSharingFragment @Inject constructor( 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 private var mapView: WeakReference? = null @@ -83,7 +83,7 @@ class LocationSharingFragment @Inject constructor( viewModel.observeViewEvents { when (it) { - LocationSharingViewEvents.Close -> viewNavigator.quit() + LocationSharingViewEvents.Close -> locationSharingNavigator.quit() LocationSharingViewEvents.LocationNotAvailableError -> handleLocationNotAvailableError() is LocationSharingViewEvents.ZoomToUserLocation -> handleZoomToUserLocationEvent(it) }.exhaustive @@ -93,8 +93,8 @@ class LocationSharingFragment @Inject constructor( override fun onResume() { super.onResume() views.mapView.onResume() - if (viewNavigator.goingToAppSettings) { - viewNavigator.goingToAppSettings = false + if (locationSharingNavigator.goingToAppSettings) { + locationSharingNavigator.goingToAppSettings = false // retry to start live location tryStartLiveLocationSharing() } @@ -149,7 +149,7 @@ class LocationSharingFragment @Inject constructor( .setTitle(R.string.location_not_available_dialog_title) .setMessage(R.string.location_not_available_dialog_content) .setPositiveButton(R.string.ok) { _, _ -> - viewNavigator.quit() + locationSharingNavigator.quit() } .setCancelable(false) .show() @@ -160,7 +160,7 @@ class LocationSharingFragment @Inject constructor( .setTitle(R.string.location_in_background_missing_permission_dialog_title) .setMessage(R.string.location_in_background_missing_permission_dialog_content) .setPositiveButton(R.string.settings) { _, _ -> - viewNavigator.goToAppSettings() + locationSharingNavigator.goToAppSettings() } .setNegativeButton(R.string.action_not_now, null) .setCancelable(false) diff --git a/vector/src/main/java/im/vector/app/features/location/ILocationSharingNavigator.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingSettingsNavigator.kt similarity index 94% rename from vector/src/main/java/im/vector/app/features/location/ILocationSharingNavigator.kt rename to vector/src/main/java/im/vector/app/features/location/LocationSharingSettingsNavigator.kt index 91c62618dd..6298bf312b 100644 --- a/vector/src/main/java/im/vector/app/features/location/ILocationSharingNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingSettingsNavigator.kt @@ -16,7 +16,7 @@ package im.vector.app.features.location -interface ILocationSharingNavigator { +interface LocationSharingSettingsNavigator { var goingToAppSettings: Boolean fun quit() fun goToAppSettings()