From a13ba13fb54d36d08150f39b2f20bb2ebea78990 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Thu, 17 Mar 2022 18:30:39 +0300 Subject: [PATCH] Code review fixes. --- .../src/main/java/im/vector/app/core/utils/PermissionsTools.kt | 1 + ...gSettingsNavigator.kt => DefaultLocationSharingNavigator.kt} | 2 +- .../im/vector/app/features/location/LocationSharingFragment.kt | 2 +- ...nSharingSettingsNavigator.kt => LocationSharingNavigator.kt} | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) rename vector/src/main/java/im/vector/app/features/location/{DefaultLocationSharingSettingsNavigator.kt => DefaultLocationSharingNavigator.kt} (89%) rename vector/src/main/java/im/vector/app/features/location/{LocationSharingSettingsNavigator.kt => LocationSharingNavigator.kt} (94%) diff --git a/vector/src/main/java/im/vector/app/core/utils/PermissionsTools.kt b/vector/src/main/java/im/vector/app/core/utils/PermissionsTools.kt index d2e69a87e9..eada3a4f25 100644 --- a/vector/src/main/java/im/vector/app/core/utils/PermissionsTools.kt +++ b/vector/src/main/java/im/vector/app/core/utils/PermissionsTools.kt @@ -128,6 +128,7 @@ fun checkPermissions(permissionsToBeGranted: List, .setPositiveButton(R.string.ok) { _, _ -> activityResultLauncher.launch(missingPermissions.toTypedArray()) } + .setNegativeButton(R.string.action_not_now, null) .show() } else { // some permissions are not granted, ask permissions diff --git a/vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingSettingsNavigator.kt b/vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingNavigator.kt similarity index 89% rename from vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingSettingsNavigator.kt rename to vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingNavigator.kt index 5b8ae5b01a..8f424af9ec 100644 --- a/vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingSettingsNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/location/DefaultLocationSharingNavigator.kt @@ -19,7 +19,7 @@ package im.vector.app.features.location import android.app.Activity import im.vector.app.core.utils.openAppSettingsPage -class DefaultLocationSharingSettingsNavigator constructor(val activity: Activity?) : LocationSharingSettingsNavigator { +class DefaultLocationSharingNavigator constructor(val activity: Activity?) : LocationSharingNavigator { 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 479ffd796d..c4dccc1b73 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 locationSharingNavigator: LocationSharingSettingsNavigator by lazy { DefaultLocationSharingSettingsNavigator(activity) } + private val locationSharingNavigator: LocationSharingNavigator by lazy { DefaultLocationSharingNavigator(activity) } // Keep a ref to handle properly the onDestroy callback private var mapView: WeakReference? = null diff --git a/vector/src/main/java/im/vector/app/features/location/LocationSharingSettingsNavigator.kt b/vector/src/main/java/im/vector/app/features/location/LocationSharingNavigator.kt similarity index 94% rename from vector/src/main/java/im/vector/app/features/location/LocationSharingSettingsNavigator.kt rename to vector/src/main/java/im/vector/app/features/location/LocationSharingNavigator.kt index 6298bf312b..8927da9239 100644 --- a/vector/src/main/java/im/vector/app/features/location/LocationSharingSettingsNavigator.kt +++ b/vector/src/main/java/im/vector/app/features/location/LocationSharingNavigator.kt @@ -16,7 +16,7 @@ package im.vector.app.features.location -interface LocationSharingSettingsNavigator { +interface LocationSharingNavigator { var goingToAppSettings: Boolean fun quit() fun goToAppSettings()