diff --git a/CONTRIBUTORS b/CONTRIBUTORS index df0631b325..28433b4209 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -64,7 +64,6 @@ Strings and translations: Karina Kordon Konstantin Pastbin Metehan Özyürek - Joan Montané Project management: Alexander Matveenko diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 46497ea8ea..7b8a8946a3 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -58,6 +58,7 @@ android:dataExtractionRules="@xml/backup_content_v31" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" + android:localeConfig="@xml/locales_config" android:theme="@style/MwmTheme" android:supportsRtl="true" android:networkSecurityConfig="@xml/network_security_config" diff --git a/android/build.gradle b/android/build.gradle index d3647888e9..da0937c38b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -83,7 +83,7 @@ dependencies { } implementation 'androidx.annotation:annotation:1.5.0' - implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'androidx.appcompat:appcompat:1.6.0-rc01' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.fragment:fragment:1.5.3' // Lifecycle is added as a workaround for duplicate classes error caused by some outdated dependency: diff --git a/android/res/values/strings-tts.xml b/android/res/values/strings-tts.xml index 0b93f980a6..db497d06bd 100644 --- a/android/res/values/strings-tts.xml +++ b/android/res/values/strings-tts.xml @@ -18,7 +18,6 @@ translatable="false"> en ru - ca cs da de @@ -52,7 +51,6 @@ translatable="false"> English Русский - Català Čeština Dansk Deutsch diff --git a/android/res/xml/locales_config.xml b/android/res/xml/locales_config.xml new file mode 100644 index 0000000000..59e05dbef9 --- /dev/null +++ b/android/res/xml/locales_config.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/src/com/mapswithme/maps/location/LocationHelper.java b/android/src/com/mapswithme/maps/location/LocationHelper.java index 43160aa17f..ce73dee32e 100644 --- a/android/src/com/mapswithme/maps/location/LocationHelper.java +++ b/android/src/com/mapswithme/maps/location/LocationHelper.java @@ -323,23 +323,22 @@ public enum LocationHelper implements Initializable, AppBackgroundTrack mSavedLocation = null; nativeOnLocationError(ERROR_GPS_OFF); - if (mUiCallback == null || mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) + if (mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) return; - final AppCompatActivity activity = mUiCallback.requireActivity(); - AlertDialog.Builder builder = new AlertDialog.Builder(activity) + AlertDialog.Builder builder = new AlertDialog.Builder(mContext) .setTitle(R.string.enable_location_services) .setMessage(R.string.location_is_disabled_long_text) .setOnDismissListener(dialog -> mErrorDialog = null) .setOnCancelListener(dialog -> setLocationErrorDialogAnnoying(true)) .setNegativeButton(R.string.close, (dialog, which) -> setLocationErrorDialogAnnoying(true)); - final Intent intent = Utils.makeSystemLocationSettingIntent(activity); + final Intent intent = Utils.makeSystemLocationSettingIntent(mContext); if (intent != null) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY); intent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); - builder.setPositiveButton(R.string.connection_settings, (dialog, which) -> activity.startActivity(intent)); + builder.setPositiveButton(R.string.connection_settings, (dialog, which) -> mContext.startActivity(intent)); } mErrorDialog = builder.show(); } @@ -353,11 +352,10 @@ public enum LocationHelper implements Initializable, AppBackgroundTrack if (!mActive || !LocationUtils.isLocationGranted(mContext) || !LocationUtils.areLocationServicesTurnedOn(mContext)) return; - if (mUiCallback == null || mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) + if (mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) return; - final AppCompatActivity activity = mUiCallback.requireActivity(); - mErrorDialog = new AlertDialog.Builder(activity) + mErrorDialog = new AlertDialog.Builder(mContext) .setTitle(R.string.current_location_unknown_title) .setMessage(R.string.current_location_unknown_message) .setOnDismissListener(dialog -> mErrorDialog = null) diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 22dce08f72..66f260b94e 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -216,7 +216,8 @@ public class RoutingController implements Initializable private boolean isDrivingOptionsBuildError() { - return !ResultCodesHelper.isMoreMapsNeeded(mLastResultCode) && RoutingOptions.hasAnyOptions(); + return !ResultCodesHelper.isMoreMapsNeeded(mLastResultCode) && isVehicleRouterType() + && RoutingOptions.hasAnyOptions(); } private void setState(State newState) diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index c132cad072..8987f257ff 100644 --- a/iphone/Maps/Core/Routing/MWMRouter.mm +++ b/iphone/Maps/Core/Routing/MWMRouter.mm @@ -575,7 +575,7 @@ char const *kRenderAltitudeImagesQueueLabel = "mapsme.mwmrouter.renderAltitudeIm } + (BOOL)hasActiveDrivingOptions { - return [MWMRoutingOptions new].hasOptions; + return [MWMRoutingOptions new].hasOptions && self.type == MWMRouterTypeVehicle; } + (void)avoidRoadTypeAndRebuild:(MWMRoadType)type { diff --git a/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm b/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm index 9405202a28..f41ba7e433 100644 --- a/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm +++ b/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm @@ -191,7 +191,7 @@ using Observers = NSHashTable; else [MWMRouter setTurnNotificationsLocale:@(twineLang.c_str())]; } else { - LOG(LWARNING, + LOG(LERROR, ("The UI language and English are not available for TTS. MWMTextToSpeech is invalid.")); } }