From 6b75f1f2fa623f0da5a5b297e7fc39afab98b36b Mon Sep 17 00:00:00 2001 From: Jean-Baptiste CHARRON Date: Tue, 11 Oct 2022 19:11:04 +0200 Subject: [PATCH 1/7] [Android]Update appcompat to 1.6.0-rc01 Signed-off-by: Jean-Baptiste CHARRON --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: -- 2.45.3 From b0f408c20b4deca133c714e9d15f903d1e586641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Montan=C3=A9?= Date: Wed, 12 Oct 2022 11:24:37 +0200 Subject: [PATCH 2/7] Enable Catalan TTS, related with issue #3568 (#3583) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Enable Catalan TTS * Update CONTRIBUTORS Signed-off-by: Joan Montané --- CONTRIBUTORS | 1 + android/res/values/strings-tts.xml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 28433b4209..df0631b325 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -64,6 +64,7 @@ Strings and translations: Karina Kordon Konstantin Pastbin Metehan Özyürek + Joan Montané Project management: Alexander Matveenko diff --git a/android/res/values/strings-tts.xml b/android/res/values/strings-tts.xml index db497d06bd..0b93f980a6 100644 --- a/android/res/values/strings-tts.xml +++ b/android/res/values/strings-tts.xml @@ -18,6 +18,7 @@ translatable="false"> en ru + ca cs da de @@ -51,6 +52,7 @@ translatable="false"> English Русский + Català Čeština Dansk Deutsch -- 2.45.3 From c868ae5177cf4f842296ec78a08c988a44552edb Mon Sep 17 00:00:00 2001 From: Alexander Borsuk Date: Tue, 11 Oct 2022 12:46:55 +0200 Subject: [PATCH 3/7] [ios][tts] Do not crash in iOS 16 simulator if no voices are installed Signed-off-by: Alexander Borsuk --- iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm b/iphone/Maps/Core/TextToSpeech/MWMTextToSpeech.mm index f41ba7e433..9405202a28 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(LERROR, + LOG(LWARNING, ("The UI language and English are not available for TTS. MWMTextToSpeech is invalid.")); } } -- 2.45.3 From 91f21dec47f8a321f78cfc34f1886d4f49b243ca Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Wed, 12 Oct 2022 18:04:42 +0300 Subject: [PATCH 4/7] [iOS][android] Show "Routing options enabled" for all routers. Signed-off-by: Viktor Govako --- android/src/com/mapswithme/maps/routing/RoutingController.java | 3 +-- iphone/Maps/Core/Routing/MWMRouter.mm | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/android/src/com/mapswithme/maps/routing/RoutingController.java b/android/src/com/mapswithme/maps/routing/RoutingController.java index 66f260b94e..22dce08f72 100644 --- a/android/src/com/mapswithme/maps/routing/RoutingController.java +++ b/android/src/com/mapswithme/maps/routing/RoutingController.java @@ -216,8 +216,7 @@ public class RoutingController implements Initializable private boolean isDrivingOptionsBuildError() { - return !ResultCodesHelper.isMoreMapsNeeded(mLastResultCode) && isVehicleRouterType() - && RoutingOptions.hasAnyOptions(); + return !ResultCodesHelper.isMoreMapsNeeded(mLastResultCode) && RoutingOptions.hasAnyOptions(); } private void setState(State newState) diff --git a/iphone/Maps/Core/Routing/MWMRouter.mm b/iphone/Maps/Core/Routing/MWMRouter.mm index 8987f257ff..c132cad072 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 && self.type == MWMRouterTypeVehicle; + return [MWMRoutingOptions new].hasOptions; } + (void)avoidRoadTypeAndRebuild:(MWMRoadType)type { -- 2.45.3 From 16adc0b47f2650bc3b9f6e015b36a12f836b01f4 Mon Sep 17 00:00:00 2001 From: Roman Tsisyk Date: Wed, 12 Oct 2022 08:56:11 +0300 Subject: [PATCH 5/7] [android] Fix a crash in "Location is disabled" dialog Pass AppCompatActivity to AlertDialog instead of global Context. ``` FATAL EXCEPTION: main Process: app.organicmaps.debug, PID: 17897 java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:926) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:889) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:772) at androidx.appcompat.app.AppCompatDialog.setContentView(AppCompatDialog.java:95) at androidx.appcompat.app.AlertController.installContent(AlertController.java:232) at androidx.appcompat.app.AlertDialog.onCreate(AlertDialog.java:279) at android.app.Dialog.dispatchOnCreate(Dialog.java:436) at android.app.Dialog.show(Dialog.java:325) at androidx.appcompat.app.AlertDialog$Builder.show(AlertDialog.java:1009) at com.mapswithme.maps.location.LocationHelper.onLocationDisabled(LocationHelper.java:343) at com.mapswithme.maps.location.LocationHelper.onLocationResolutionRequired(LocationHelper.java:296) at com.mapswithme.maps.location.GoogleFusedLocationProvider.lambda$start$1$com-mapswithme-maps-location-GoogleFusedLocationProvider(GoogleFusedLocationProvider.java:98) at com.mapswithme.maps.location.GoogleFusedLocationProvider$$ExternalSyntheticLambda1.onFailure(Unknown Source:2) at com.google.android.gms.tasks.zzk.run(com.google.android.gms:play-services-tasks@@18.0.1:1) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7898) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) ``` Closes #3585 Signed-off-by: Roman Tsisyk --- .../mapswithme/maps/location/LocationHelper.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/android/src/com/mapswithme/maps/location/LocationHelper.java b/android/src/com/mapswithme/maps/location/LocationHelper.java index ce73dee32e..43160aa17f 100644 --- a/android/src/com/mapswithme/maps/location/LocationHelper.java +++ b/android/src/com/mapswithme/maps/location/LocationHelper.java @@ -323,22 +323,23 @@ public enum LocationHelper implements Initializable, AppBackgroundTrack mSavedLocation = null; nativeOnLocationError(ERROR_GPS_OFF); - if (mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) + if (mUiCallback == null || mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) return; - AlertDialog.Builder builder = new AlertDialog.Builder(mContext) + final AppCompatActivity activity = mUiCallback.requireActivity(); + AlertDialog.Builder builder = new AlertDialog.Builder(activity) .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(mContext); + final Intent intent = Utils.makeSystemLocationSettingIntent(activity); 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) -> mContext.startActivity(intent)); + builder.setPositiveButton(R.string.connection_settings, (dialog, which) -> activity.startActivity(intent)); } mErrorDialog = builder.show(); } @@ -352,10 +353,11 @@ public enum LocationHelper implements Initializable, AppBackgroundTrack if (!mActive || !LocationUtils.isLocationGranted(mContext) || !LocationUtils.areLocationServicesTurnedOn(mContext)) return; - if (mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) + if (mUiCallback == null || mErrorDialogAnnoying || (mErrorDialog != null && mErrorDialog.isShowing())) return; - mErrorDialog = new AlertDialog.Builder(mContext) + final AppCompatActivity activity = mUiCallback.requireActivity(); + mErrorDialog = new AlertDialog.Builder(activity) .setTitle(R.string.current_location_unknown_title) .setMessage(R.string.current_location_unknown_message) .setOnDismissListener(dialog -> mErrorDialog = null) -- 2.45.3 From 544ceb3db8523c3da4500c39a39d9c40b0df8b85 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste CHARRON Date: Tue, 11 Oct 2022 19:56:54 +0200 Subject: [PATCH 6/7] [android] Add Per-app language preferences Add properties in AndroidManifest Create locales config with all languages Signed-off-by: Jean-Baptiste CHARRON --- android/AndroidManifest.xml | 1 + android/res/xml/locales_config.xml | 45 ++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 android/res/xml/locales_config.xml 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/res/xml/locales_config.xml b/android/res/xml/locales_config.xml new file mode 100644 index 0000000000..0869c2d877 --- /dev/null +++ b/android/res/xml/locales_config.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.45.3 From b9a9d8a6d2ddfd84e344028c07162c7adf50b530 Mon Sep 17 00:00:00 2001 From: Alexander Borsuk <170263+biodranik@users.noreply.github.com> Date: Thu, 13 Oct 2022 14:55:42 +0200 Subject: [PATCH 7/7] Added newline --- android/res/xml/locales_config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/res/xml/locales_config.xml b/android/res/xml/locales_config.xml index 0869c2d877..59e05dbef9 100644 --- a/android/res/xml/locales_config.xml +++ b/android/res/xml/locales_config.xml @@ -42,4 +42,4 @@ - \ No newline at end of file + -- 2.45.3