diff --git a/OsmAnd/res/layout/bottom_sheet_speed_cameras.xml b/OsmAnd/res/layout/bottom_sheet_speed_cameras.xml new file mode 100644 index 0000000000..6fc553118f --- /dev/null +++ b/OsmAnd/res/layout/bottom_sheet_speed_cameras.xml @@ -0,0 +1,36 @@ + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/layout/preference_switch_with_alert.xml b/OsmAnd/res/layout/preference_switch_with_alert.xml new file mode 100644 index 0000000000..cdf10c32a6 --- /dev/null +++ b/OsmAnd/res/layout/preference_switch_with_alert.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index c7eb036115..384333fa4c 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -11,6 +11,16 @@ Thx - Hardy --> + Speed cameras alerts in some countries is prohibited by the law. + Uninstall + Keep active + In some countries or regions, the use of speed camera warning applications is prohibited by law. + \n\nYou need to make a choice depending on the law of your country. + \n\nSelect %1$s and you will receive alerts and warnings about speed cameras. + \n\nSelect %2$s. All data related to speed cameras: alerts, notifications, POIs will be deleted until OsmAnd is completely reinstalled. + Speed camera POI’s + Legal + Uninstall speed cameras Screen timeout Are you sure you want to irrevocably delete %d quick actions? Delete all? diff --git a/OsmAnd/res/xml/global_settings.xml b/OsmAnd/res/xml/global_settings.xml index de67e9fb54..b323527a39 100644 --- a/OsmAnd/res/xml/global_settings.xml +++ b/OsmAnd/res/xml/global_settings.xml @@ -60,4 +60,15 @@ app:fragment="net.osmand.plus.settings.fragments.ProxySettingsFragment" tools:icon="@drawable/ic_action_proxy" /> + + + + \ No newline at end of file diff --git a/OsmAnd/res/xml/screen_alerts.xml b/OsmAnd/res/xml/screen_alerts.xml index 58002ea240..c0c0219ab8 100644 --- a/OsmAnd/res/xml/screen_alerts.xml +++ b/OsmAnd/res/xml/screen_alerts.xml @@ -28,7 +28,7 @@ weakActivity = new WeakReference<>(activity); + alertSubTitle.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + FragmentActivity a = weakActivity.get(); + if (a != null) { + SpeedCamerasBottomSheet.showInstance(a.getSupportFragmentManager()); + } + } + }); + } } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java index 2d3ff2eb5e..084a55ce64 100644 --- a/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java +++ b/OsmAnd/src/net/osmand/plus/settings/fragments/VoiceAnnouncesFragment.java @@ -252,6 +252,8 @@ public class VoiceAnnouncesFragment extends BaseSettingsFragment { Object currentValue = ((ListPreferenceEx) preference).getValue(); imageView.setEnabled(preference.isEnabled() && !OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(currentValue)); } + } else if (settings.SPEAK_SPEED_CAMERA.getId().equals(preference.getKey())) { + ScreenAlertsFragment.setupSpeedCamerasAlert(app, requireMyActivity(), holder, isNightMode()); } }