diff --git a/OsmAnd-java/src/net/osmand/plus/OsmandSettings.java b/OsmAnd-java/src/net/osmand/plus/OsmandSettings.java index 436203f23e..0dd8c724e0 100644 --- a/OsmAnd-java/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd-java/src/net/osmand/plus/OsmandSettings.java @@ -1414,6 +1414,10 @@ public class OsmandSettings { return OSMAND_THEME.get() == OSMAND_LIGHT_THEME; } + public boolean isLightContent(){ + return OSMAND_THEME.get() != OSMAND_DARK_THEME; + } + public final CommonPreference FLUORESCENT_OVERLAYS = new BooleanPreference("fluorescent_overlays", false).makeGlobal().cache(); diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml index a10ba26aef..cdba874430 100644 --- a/OsmAnd/AndroidManifest.xml +++ b/OsmAnd/AndroidManifest.xml @@ -21,7 +21,7 @@ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_location_found_dark.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_location_found_dark.png new file mode 100644 index 0000000000..d7fae7e988 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_location_found_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_location_found_light.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_location_found_light.png new file mode 100644 index 0000000000..515702bbb0 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_location_found_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_screen_rotation_dark.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_screen_rotation_dark.png new file mode 100644 index 0000000000..a17e7bb4e6 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_screen_rotation_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_screen_rotation_light.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_screen_rotation_light.png new file mode 100644 index 0000000000..d9d5ab984b Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_screen_rotation_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_muted_dark.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_muted_dark.png new file mode 100644 index 0000000000..c9b731c53a Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_muted_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_muted_light.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_muted_light.png new file mode 100644 index 0000000000..0414971729 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_muted_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_on_dark.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_on_dark.png new file mode 100644 index 0000000000..7b69ea56b5 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_on_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_on_light.png b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_on_light.png new file mode 100644 index 0000000000..d43e8a33ca Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_10_device_access_volume_on_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_1_navigation_next_item_dark.png b/OsmAnd/res/drawable-hdpi/a_1_navigation_next_item_dark.png new file mode 100644 index 0000000000..50b1587643 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_1_navigation_next_item_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_1_navigation_next_item_light.png b/OsmAnd/res/drawable-hdpi/a_1_navigation_next_item_light.png new file mode 100644 index 0000000000..e6495b29cf Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_1_navigation_next_item_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_1_navigation_previous_item_dark.png b/OsmAnd/res/drawable-hdpi/a_1_navigation_previous_item_dark.png new file mode 100644 index 0000000000..64538ce80b Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_1_navigation_previous_item_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_1_navigation_previous_item_light.png b/OsmAnd/res/drawable-hdpi/a_1_navigation_previous_item_light.png new file mode 100644 index 0000000000..23778ae9b7 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_1_navigation_previous_item_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_2_action_about_dark.png b/OsmAnd/res/drawable-hdpi/a_2_action_about_dark.png new file mode 100644 index 0000000000..6eaf08aecf Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_2_action_about_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_2_action_about_light.png b/OsmAnd/res/drawable-hdpi/a_2_action_about_light.png new file mode 100644 index 0000000000..8f39c428ac Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_2_action_about_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_2_action_search_dark.png b/OsmAnd/res/drawable-hdpi/a_2_action_search_dark.png new file mode 100644 index 0000000000..f12e005ebe Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_2_action_search_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_2_action_search_light.png b/OsmAnd/res/drawable-hdpi/a_2_action_search_light.png new file mode 100644 index 0000000000..e6b7045186 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_2_action_search_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_3_rating_important_dark.png b/OsmAnd/res/drawable-hdpi/a_3_rating_important_dark.png new file mode 100644 index 0000000000..11f8641448 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_3_rating_important_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_3_rating_important_light.png b/OsmAnd/res/drawable-hdpi/a_3_rating_important_light.png new file mode 100644 index 0000000000..7c25f35118 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_3_rating_important_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_6_social_share_dark.png b/OsmAnd/res/drawable-hdpi/a_6_social_share_dark.png new file mode 100644 index 0000000000..c329f58daa Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_6_social_share_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_6_social_share_light.png b/OsmAnd/res/drawable-hdpi/a_6_social_share_light.png new file mode 100644 index 0000000000..47ae186749 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_6_social_share_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_7_location_directions_dark.png b/OsmAnd/res/drawable-hdpi/a_7_location_directions_dark.png new file mode 100644 index 0000000000..b2c651277c Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_7_location_directions_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_7_location_directions_light.png b/OsmAnd/res/drawable-hdpi/a_7_location_directions_light.png new file mode 100644 index 0000000000..4407313f82 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_7_location_directions_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_7_location_map_dark.png b/OsmAnd/res/drawable-hdpi/a_7_location_map_dark.png new file mode 100644 index 0000000000..e5907072f0 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_7_location_map_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_7_location_map_light.png b/OsmAnd/res/drawable-hdpi/a_7_location_map_light.png new file mode 100644 index 0000000000..53795188b8 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_7_location_map_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_7_location_place_dark.png b/OsmAnd/res/drawable-hdpi/a_7_location_place_dark.png new file mode 100644 index 0000000000..01e10e0349 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_7_location_place_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_7_location_place_light.png b/OsmAnd/res/drawable-hdpi/a_7_location_place_light.png new file mode 100644 index 0000000000..459590a68d Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_7_location_place_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_9_av_make_available_offline_dark.png b/OsmAnd/res/drawable-hdpi/a_9_av_make_available_offline_dark.png new file mode 100644 index 0000000000..e6c7bf317d Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_9_av_make_available_offline_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_9_av_make_available_offline_light.png b/OsmAnd/res/drawable-hdpi/a_9_av_make_available_offline_light.png new file mode 100644 index 0000000000..00f2233cd9 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_9_av_make_available_offline_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_9_av_play_over_video_dark.png b/OsmAnd/res/drawable-hdpi/a_9_av_play_over_video_dark.png new file mode 100644 index 0000000000..7b0d4889cc Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_9_av_play_over_video_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_9_av_play_over_video_light.png b/OsmAnd/res/drawable-hdpi/a_9_av_play_over_video_light.png new file mode 100644 index 0000000000..b034459bc8 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_9_av_play_over_video_light.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_ic_menu_settings_dark.png b/OsmAnd/res/drawable-hdpi/a_ic_menu_settings_dark.png new file mode 100644 index 0000000000..5b7080a4c7 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_ic_menu_settings_dark.png differ diff --git a/OsmAnd/res/drawable-hdpi/a_ic_menu_settings_light.png b/OsmAnd/res/drawable-hdpi/a_ic_menu_settings_light.png new file mode 100644 index 0000000000..577e055878 Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/a_ic_menu_settings_light.png differ diff --git a/OsmAnd/res/drawable-large/bgs_icon.png b/OsmAnd/res/drawable-large/bgs_icon.png index 66d4e60fdb..f425295b92 100644 Binary files a/OsmAnd/res/drawable-large/bgs_icon.png and b/OsmAnd/res/drawable-large/bgs_icon.png differ diff --git a/OsmAnd/res/drawable-large/icon.png b/OsmAnd/res/drawable-large/icon.png index 03f015d795..fce7e29d18 100644 Binary files a/OsmAnd/res/drawable-large/icon.png and b/OsmAnd/res/drawable-large/icon.png differ diff --git a/OsmAnd/res/drawable-large/icon_small.png b/OsmAnd/res/drawable-large/icon_small.png index da46d51799..ace3167f0b 100644 Binary files a/OsmAnd/res/drawable-large/icon_small.png and b/OsmAnd/res/drawable-large/icon_small.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_location_found_dark.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_location_found_dark.png new file mode 100644 index 0000000000..52ca8ab7f3 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_location_found_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_location_found_light.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_location_found_light.png new file mode 100644 index 0000000000..605068ef81 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_location_found_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_screen_rotation_dark.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_screen_rotation_dark.png new file mode 100644 index 0000000000..19281320de Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_screen_rotation_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_screen_rotation_light.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_screen_rotation_light.png new file mode 100644 index 0000000000..446944239a Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_screen_rotation_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_muted_dark.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_muted_dark.png new file mode 100644 index 0000000000..67bc82038e Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_muted_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_muted_light.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_muted_light.png new file mode 100644 index 0000000000..512ac30859 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_muted_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_on_dark.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_on_dark.png new file mode 100644 index 0000000000..dfd2b33c73 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_on_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_on_light.png b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_on_light.png new file mode 100644 index 0000000000..777fab84ea Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_10_device_access_volume_on_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_1_navigation_next_item_dark.png b/OsmAnd/res/drawable-xhdpi/a_1_navigation_next_item_dark.png new file mode 100644 index 0000000000..7dc45c0d42 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_1_navigation_next_item_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_1_navigation_next_item_light.png b/OsmAnd/res/drawable-xhdpi/a_1_navigation_next_item_light.png new file mode 100644 index 0000000000..c36e050a39 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_1_navigation_next_item_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_1_navigation_previous_item_dark.png b/OsmAnd/res/drawable-xhdpi/a_1_navigation_previous_item_dark.png new file mode 100644 index 0000000000..e97e910e0c Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_1_navigation_previous_item_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_1_navigation_previous_item_light.png b/OsmAnd/res/drawable-xhdpi/a_1_navigation_previous_item_light.png new file mode 100644 index 0000000000..cf0b485f68 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_1_navigation_previous_item_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_2_action_about_dark.png b/OsmAnd/res/drawable-xhdpi/a_2_action_about_dark.png new file mode 100644 index 0000000000..4ee903f071 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_2_action_about_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_2_action_about_light.png b/OsmAnd/res/drawable-xhdpi/a_2_action_about_light.png new file mode 100644 index 0000000000..2641f142a4 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_2_action_about_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_2_action_search_dark.png b/OsmAnd/res/drawable-xhdpi/a_2_action_search_dark.png new file mode 100644 index 0000000000..3549f84dd8 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_2_action_search_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_2_action_search_light.png b/OsmAnd/res/drawable-xhdpi/a_2_action_search_light.png new file mode 100644 index 0000000000..804420aee7 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_2_action_search_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_3_rating_important_dark.png b/OsmAnd/res/drawable-xhdpi/a_3_rating_important_dark.png new file mode 100644 index 0000000000..7576cc1e2d Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_3_rating_important_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_3_rating_important_light.png b/OsmAnd/res/drawable-xhdpi/a_3_rating_important_light.png new file mode 100644 index 0000000000..da44dd82c3 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_3_rating_important_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_6_social_share_dark.png b/OsmAnd/res/drawable-xhdpi/a_6_social_share_dark.png new file mode 100644 index 0000000000..15549b04ef Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_6_social_share_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_6_social_share_light.png b/OsmAnd/res/drawable-xhdpi/a_6_social_share_light.png new file mode 100644 index 0000000000..cdafd8abca Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_6_social_share_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_7_location_directions_dark.png b/OsmAnd/res/drawable-xhdpi/a_7_location_directions_dark.png new file mode 100644 index 0000000000..cc6c511272 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_7_location_directions_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_7_location_directions_light.png b/OsmAnd/res/drawable-xhdpi/a_7_location_directions_light.png new file mode 100644 index 0000000000..7503b46fa7 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_7_location_directions_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_7_location_map_dark.png b/OsmAnd/res/drawable-xhdpi/a_7_location_map_dark.png new file mode 100644 index 0000000000..f5ce90a33e Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_7_location_map_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_7_location_map_light.png b/OsmAnd/res/drawable-xhdpi/a_7_location_map_light.png new file mode 100644 index 0000000000..95a75f0e9a Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_7_location_map_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_7_location_place_dark.png b/OsmAnd/res/drawable-xhdpi/a_7_location_place_dark.png new file mode 100644 index 0000000000..3de909f440 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_7_location_place_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_7_location_place_light.png b/OsmAnd/res/drawable-xhdpi/a_7_location_place_light.png new file mode 100644 index 0000000000..6dd002757d Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_7_location_place_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_9_av_make_available_offline_dark.png b/OsmAnd/res/drawable-xhdpi/a_9_av_make_available_offline_dark.png new file mode 100644 index 0000000000..6b197c30f2 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_9_av_make_available_offline_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_9_av_make_available_offline_light.png b/OsmAnd/res/drawable-xhdpi/a_9_av_make_available_offline_light.png new file mode 100644 index 0000000000..4cdbe873cd Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_9_av_make_available_offline_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_9_av_play_over_video_dark.png b/OsmAnd/res/drawable-xhdpi/a_9_av_play_over_video_dark.png new file mode 100644 index 0000000000..e53d5eb161 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_9_av_play_over_video_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_9_av_play_over_video_light.png b/OsmAnd/res/drawable-xhdpi/a_9_av_play_over_video_light.png new file mode 100644 index 0000000000..d527454c6d Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_9_av_play_over_video_light.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_ic_menu_settings_dark.png b/OsmAnd/res/drawable-xhdpi/a_ic_menu_settings_dark.png new file mode 100644 index 0000000000..02cfbad0b0 Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_ic_menu_settings_dark.png differ diff --git a/OsmAnd/res/drawable-xhdpi/a_ic_menu_settings_light.png b/OsmAnd/res/drawable-xhdpi/a_ic_menu_settings_light.png new file mode 100644 index 0000000000..aa33c3880b Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/a_ic_menu_settings_light.png differ diff --git a/OsmAnd/res/layout/list_menu_item_native.xml b/OsmAnd/res/layout/list_menu_item_native.xml new file mode 100644 index 0000000000..8670e1e4c6 --- /dev/null +++ b/OsmAnd/res/layout/list_menu_item_native.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml index a79c9e2d37..09120b2136 100644 --- a/OsmAnd/res/values-ru/strings.xml +++ b/OsmAnd/res/values-ru/strings.xml @@ -64,7 +64,7 @@ \n\tЧтобы получить достоверные данные необходимо загрузить WW15MGH.DAC через менеджер загрузок (оригинал - http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/binary/WW15MGH.DAC). - Здания не найдены. + Здания не найдены Выберите город Поиск по деревням и почт. индексу Выберите как отображать только дорожные карты: @@ -707,8 +707,8 @@ Координаты Показывать угол обзора в соответствии с компасом Угол обзора - Снять отметку. - Отметить точку. + Снять отметку + Отметить точку Включить 3D вид для карты 3D вид Показывать слой POI diff --git a/OsmAnd/src/net/osmand/access/ExplorableTextView.java b/OsmAnd/src/net/osmand/access/ExplorableTextView.java index 90bc15dbf4..12410deec2 100644 --- a/OsmAnd/src/net/osmand/access/ExplorableTextView.java +++ b/OsmAnd/src/net/osmand/access/ExplorableTextView.java @@ -1,7 +1,6 @@ package net.osmand.access; import net.osmand.plus.OsmandApplication; -import net.osmand.plus.OsmandSettings; import android.content.Context; import android.text.Layout; import android.text.method.ArrowKeyMovementMethod; diff --git a/OsmAnd/src/net/osmand/access/MapAccessibilityActions.java b/OsmAnd/src/net/osmand/access/MapAccessibilityActions.java index f076334718..e105548b25 100644 --- a/OsmAnd/src/net/osmand/access/MapAccessibilityActions.java +++ b/OsmAnd/src/net/osmand/access/MapAccessibilityActions.java @@ -1,6 +1,5 @@ package net.osmand.access; -import net.osmand.access.AccessibilityActionsProvider; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.views.OsmandMapTileView; import android.os.Build; diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java index e7c89679ef..79f7a68597 100644 --- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java @@ -4,8 +4,15 @@ import gnu.trove.list.array.TIntArrayList; import java.util.ArrayList; +import android.app.Activity; import android.content.Context; import android.content.DialogInterface; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.CheckBox; +import android.widget.ListAdapter; +import android.widget.TextView; public class ContextMenuAdapter { @@ -53,6 +60,14 @@ public class ContextMenuAdapter { registerSelectedItem(stringResId, -1, icon, listener, pos); } + public void registerItem(int stringResId, int icon, OnContextMenuClick listener) { + registerSelectedItem(stringResId, -1, icon, listener, -1); + } + + public void registerItem(int stringResId, OnContextMenuClick listener) { + registerSelectedItem(stringResId, -1, 0, listener, -1); + } + public void registerSelectedItem(int stringResId, int selected, int icon, OnContextMenuClick listener, int pos) { if(pos >= items.size() || pos < 0) { @@ -81,4 +96,34 @@ public class ContextMenuAdapter { return itemNames.toArray(new String[itemNames.size()]); } + public ListAdapter createListAdapter(final Activity activity, final int layoutId) { + final int padding = (int) (12 * activity.getResources().getDisplayMetrics().density + 0.5f); + ListAdapter listadapter = new ArrayAdapter(activity, layoutId, R.id.title, + getItemNames()) { + @Override + public View getView(int position, View convertView, ViewGroup parent) { + // User super class to create the View + View v = convertView; + if (v == null) { + v = activity.getLayoutInflater().inflate(layoutId, null); + } + TextView tv = (TextView) v.findViewById(R.id.title); + tv.setText(getItemName(position)); + + // Put the image on the TextView + if (getImageId(position) != 0) { + tv.setCompoundDrawablesWithIntrinsicBounds(getImageId(position), 0, 0, 0); + } else { + tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.list_activities_transparent, 0, 0, 0); + } + tv.setCompoundDrawablePadding(padding); + + final CheckBox ch = ((CheckBox) v.findViewById(R.id.check_item)); + ch.setVisibility(View.GONE); + return v; + } + }; + return listadapter; + } + } diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java index eb19b1bc7e..f07749a63c 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationProvider.java @@ -5,7 +5,6 @@ import java.util.Arrays; import java.util.Iterator; import java.util.List; - import net.osmand.GeoidAltitudeCorrection; import net.osmand.PlatformUtil; import net.osmand.access.NavigationInfo; @@ -59,7 +58,7 @@ public class OsmAndLocationProvider implements SensorEventListener { - private final boolean USE_KALMAN_FILTER = true; + private final boolean USE_KALMAN_FILTER = false; private final float KALMAN_COEFFICIENT = 0.02f; float avgValSin = 0; @@ -321,7 +320,7 @@ public class OsmAndLocationProvider implements SensorEventListener { float valRad = (float) (val / 180f * Math.PI); lastValSin = (float) Math.sin(valRad); lastValCos = (float) Math.cos(valRad); - lastHeadingCalcTime = System.currentTimeMillis(); +// lastHeadingCalcTime = System.currentTimeMillis(); if(heading == null && previousCompassIndA == 0) { Arrays.fill(previousCompassValuesA, lastValSin); Arrays.fill(previousCompassValuesB, lastValCos); @@ -353,14 +352,13 @@ public class OsmAndLocationProvider implements SensorEventListener { } public Float getHeading() { - if (heading != null && lastValSin != avgValSin && System.currentTimeMillis() - lastHeadingCalcTime > 700) { - avgValSin = lastValSin; - avgValCos = lastValCos; - lastHeadingCalcTime = System.currentTimeMillis(); - Arrays.fill(previousCompassValuesA, avgValSin); - Arrays.fill(previousCompassValuesB, avgValCos); - updateCompassVal(); - } +// if (heading != null && lastValSin != avgValSin && System.currentTimeMillis() - lastHeadingCalcTime > 700) { +// avgValSin = lastValSin; +// avgValCos = lastValCos; +// Arrays.fill(previousCompassValuesA, avgValSin); +// Arrays.fill(previousCompassValuesB, avgValCos); +// updateCompassVal(); +// } return heading; } diff --git a/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java b/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java index 49d280d2b7..afabaac1b1 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndLocationSimulation.java @@ -6,12 +6,10 @@ import java.util.List; import net.osmand.CallbackWithObject; import net.osmand.Location; -import net.osmand.plus.GPXUtilities; -import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.routing.RouteProvider; -import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.routing.RouteProvider.GPXRouteParams; +import net.osmand.plus.routing.RoutingHelper; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 6cada05459..f46ce983d6 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -11,11 +11,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import com.actionbarsherlock.app.ActionBar; -import com.actionbarsherlock.app.SherlockActivity; -import com.actionbarsherlock.app.SherlockExpandableListActivity; -import com.actionbarsherlock.app.SherlockListActivity; - import net.osmand.IndexConstants; import net.osmand.Location; import net.osmand.PlatformUtil; @@ -63,6 +58,11 @@ import android.os.Message; import android.text.format.DateFormat; import android.widget.Toast; +import com.actionbarsherlock.app.ActionBar; +import com.actionbarsherlock.app.SherlockActivity; +import com.actionbarsherlock.app.SherlockExpandableListActivity; +import com.actionbarsherlock.app.SherlockListActivity; + public class OsmandApplication extends Application implements ClientContext { public static final String EXCEPTION_PATH = "exception.log"; //$NON-NLS-1$ @@ -717,6 +717,7 @@ public class OsmandApplication extends Application implements ClientContext { } else if (osmandSettings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_DARK_ACTIONBAR_THEME) { t = R.style.OsmandLightDarkActionBarTheme; } + setLanguage(c); c.setTheme(t); if (osmandSettings.OSMAND_THEME.get() == OsmandSettings.OSMAND_LIGHT_DARK_ACTIONBAR_THEME && Build.VERSION.SDK_INT < Build.VERSION_CODES.ICE_CREAM_SANDWICH) { @@ -736,4 +737,17 @@ public class OsmandApplication extends Application implements ClientContext { } } + public void setLanguage(Context context) { + if (prefferedLocale != null) { + Configuration config = context.getResources().getConfiguration(); + String lang = prefferedLocale.getLanguage(); + if (!"".equals(lang) && !config.locale.getLanguage().equals(lang)) { + prefferedLocale = new Locale(lang); + Locale.setDefault(prefferedLocale); + config.locale = prefferedLocale; + context.getResources().updateConfiguration(config, context.getResources().getDisplayMetrics()); + } + } + } + } diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java index f2d0dc625d..d0f608013f 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java @@ -1,6 +1,7 @@ package net.osmand.plus; + import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -132,7 +133,7 @@ public abstract class OsmandPlugin { public void registerMapContextMenuActions(MapActivity mapActivity, double latitude, double longitude, ContextMenuAdapter adapter, Object selectedObj) {} - public void registerOptionsMenuItems(MapActivity mapActivity, OptionsMenuHelper helper) {} + public void registerOptionsMenuItems(MapActivity mapActivity, ContextMenuAdapter helper) {} public void loadLocalIndexes(List result, LoadLocalIndexTask loadTask) {}; @@ -243,7 +244,7 @@ public abstract class OsmandPlugin { } } - public static void registerOptionsMenu(MapActivity map, OptionsMenuHelper helper) { + public static void registerOptionsMenu(MapActivity map, ContextMenuAdapter helper) { for (OsmandPlugin plugin : activePlugins) { plugin.registerOptionsMenuItems(map, helper); } diff --git a/OsmAnd/src/net/osmand/plus/activities/ContributionVersionActivity.java b/OsmAnd/src/net/osmand/plus/activities/ContributionVersionActivity.java index 3f1433457c..b6dbfff1f5 100644 --- a/OsmAnd/src/net/osmand/plus/activities/ContributionVersionActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/ContributionVersionActivity.java @@ -24,7 +24,6 @@ import android.app.AlertDialog.Builder; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; -import android.graphics.Color; import android.net.Uri; import android.os.Bundle; import android.view.LayoutInflater; diff --git a/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java b/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java index 1a9e528959..fd5cb0b732 100644 --- a/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/DownloadTilesDialog.java @@ -9,7 +9,6 @@ import net.osmand.map.ITileSource; import net.osmand.map.MapTileDownloader; import net.osmand.map.MapTileDownloader.DownloadRequest; import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; -import net.osmand.util.MapUtils; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.Version; @@ -17,6 +16,7 @@ import net.osmand.plus.resources.ResourceManager; import net.osmand.plus.views.BaseMapLayer; import net.osmand.plus.views.MapTileLayer; import net.osmand.plus.views.OsmandMapTileView; +import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java b/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java index e59c5beb34..bb87ec4825 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/FavouritesActivity.java @@ -25,7 +25,6 @@ import net.osmand.plus.GPXUtilities; import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.WptPt; import net.osmand.plus.OsmAndFormatter; -import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.util.MapUtils; diff --git a/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java b/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java index 411a68d6d3..11cef9dfba 100644 --- a/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java +++ b/OsmAnd/src/net/osmand/plus/activities/FontFitTextView.java @@ -1,7 +1,6 @@ package net.osmand.plus.activities; import android.content.Context; -import android.graphics.Color; import android.graphics.Rect; import android.text.TextPaint; import android.util.AttributeSet; diff --git a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java index 5d193f8242..d8e4b0e330 100644 --- a/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java +++ b/OsmAnd/src/net/osmand/plus/activities/IntermediatePointsDialog.java @@ -4,11 +4,11 @@ import java.util.List; import net.osmand.access.AccessibleAlertBuilder; import net.osmand.data.LatLon; -import net.osmand.util.MapUtils; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.TargetPointsHelper; +import net.osmand.util.MapUtils; import android.app.Activity; import android.app.AlertDialog.Builder; import android.content.DialogInterface; diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java index e4fd1a5b2b..6a4556f2b3 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java @@ -13,8 +13,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import com.ibm.icu.text.DateFormat; - import net.osmand.IndexConstants; import net.osmand.binary.BinaryIndexPart; import net.osmand.binary.BinaryMapAddressReaderAdapter.AddressRegion; @@ -26,7 +24,6 @@ import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; import net.osmand.binary.BinaryMapTransportReaderAdapter.TransportIndex; import net.osmand.map.TileSourceManager; import net.osmand.map.TileSourceManager.TileSourceTemplate; -import net.osmand.util.MapUtils; import net.osmand.plus.GPXUtilities; import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.Track; @@ -40,9 +37,12 @@ import net.osmand.plus.SQLiteTileSource; import net.osmand.plus.activities.LocalIndexesActivity.LoadLocalIndexTask; import net.osmand.plus.voice.MediaCommandPlayerImpl; import net.osmand.plus.voice.TTSCommandPlayerImpl; +import net.osmand.util.MapUtils; import android.content.Context; import android.os.Build; +import com.ibm.icu.text.DateFormat; + public class LocalIndexHelper { private final OsmandApplication app; diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index f7f853f79c..6007d82f4b 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -53,8 +53,6 @@ import android.os.Message; import android.util.DisplayMetrics; import android.view.Gravity; import android.view.KeyEvent; -import android.view.Menu; -import android.view.MenuItem; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup.LayoutParams; @@ -108,9 +106,12 @@ public class MapActivity extends AccessibleActivity { @Override public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); app = getMyApplication(); - settings = app.getSettings(); + settings = app.getSettings(); + app.applyTheme(this); + super.onCreate(savedInstanceState); + + mapActions = new MapActivityActions(this); mapLayers = new MapActivityLayers(this); requestWindowFeature(Window.FEATURE_NO_TITLE); @@ -380,6 +381,9 @@ public class MapActivity extends AccessibleActivity { uiHandler.sendMessageDelayed(msg, LONG_KEYPRESS_DELAY); } return true; + } else if (keyCode == KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) { + mapActions.openOptionsMenuAsList(); + return true; } else if (keyCode == KeyEvent.KEYCODE_SEARCH && event.getRepeatCount() == 0) { Intent newIntent = new Intent(MapActivity.this, OsmandIntents.getSearchActivity()); // causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); @@ -616,24 +620,6 @@ public class MapActivity extends AccessibleActivity { return mapViewTrackingUtilities; } - @Override - public boolean onCreateOptionsMenu(Menu menu) { - return mapActions.onCreateOptionsMenu(menu); - } - - @Override - public boolean onPrepareOptionsMenu(Menu menu) { - boolean val = super.onPrepareOptionsMenu(menu); - mapActions.onPrepareOptionsMenu(menu); - return val; - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - return mapActions.onOptionsItemSelected(item) == true ? true : super.onOptionsItemSelected(item); - } - - protected void parseLaunchIntentLocation(){ Intent intent = getIntent(); if (intent != null && intent.getData() != null) { @@ -682,6 +668,7 @@ public class MapActivity extends AccessibleActivity { public void refreshMap() { getMapView().refreshMap(); } + } diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java index 1a8796478d..934ece37ad 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityActions.java @@ -31,8 +31,6 @@ import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; import net.osmand.plus.FavouritesDbHelper; import net.osmand.plus.GPXUtilities; import net.osmand.plus.GPXUtilities.GPXFile; -import net.osmand.plus.OptionsMenuHelper; -import net.osmand.plus.OptionsMenuHelper.OnOptionsMenuClick; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; @@ -70,11 +68,8 @@ import android.text.ClipboardManager; import android.text.Html; import android.util.FloatMath; import android.util.Log; -import android.view.Menu; -import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; -import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; @@ -111,7 +106,6 @@ public class MapActivityActions implements DialogProvider { private final MapActivity mapActivity; private OsmandSettings settings; private RoutingHelper routingHelper; - private OptionsMenuHelper optionsMenuHelper; public MapActivityActions(MapActivity mapActivity){ @@ -812,7 +806,7 @@ public class MapActivityActions implements DialogProvider { public void contextMenuPoint(final double latitude, final double longitude, final ContextMenuAdapter iadapter, Object selectedObj) { final ContextMenuAdapter adapter = iadapter == null ? new ContextMenuAdapter(mapActivity) : iadapter; - Builder builder = new AlertDialog.Builder(mapActivity); + adapter.registerItem(R.string.context_menu_item_navigate_point, R.drawable.list_activities_set_destination); final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper(); @@ -827,34 +821,9 @@ public class MapActivityActions implements DialogProvider { OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj); - final int padding = (int) (12 * mapActivity.getResources().getDisplayMetrics().density + 0.5f); - ListAdapter listadapter = new ArrayAdapter(mapActivity, R.layout.list_menu_item, R.id.title, - adapter.getItemNames()) { - @Override - public View getView(int position, View convertView, ViewGroup parent) { - // User super class to create the View - View v = convertView; - if (v == null) { - v = mapActivity.getLayoutInflater().inflate(R.layout.list_menu_item, null); - } - TextView tv = (TextView) v.findViewById(R.id.title); - tv.setText(adapter.getItemName(position)); - - // Put the image on the TextView - if (adapter.getImageId(position) != 0) { - tv.setCompoundDrawablesWithIntrinsicBounds(adapter.getImageId(position), 0, 0, 0); - } else { - tv.setCompoundDrawablesWithIntrinsicBounds(R.drawable.list_activities_transparent, 0, 0, 0); - } - tv.setCompoundDrawablePadding(padding); - - final CheckBox ch = ((CheckBox) v.findViewById(R.id.check_item)); - ch.setVisibility(View.GONE); - return v; - } - }; - - builder.setAdapter(listadapter, new DialogInterface.OnClickListener() { + final Builder builder = new AlertDialog.Builder(mapActivity); + ListAdapter listAdapter = adapter.createListAdapter(mapActivity, R.layout.list_menu_item); + builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { @@ -987,112 +956,92 @@ public class MapActivityActions implements DialogProvider { } } - public boolean onCreateOptionsMenu(Menu menu) { + + public void openOptionsMenuAsList() { + final ContextMenuAdapter cm = createOptionsMenu(); + final Builder bld = new AlertDialog.Builder(mapActivity); + ListAdapter listAdapter = cm.createListAdapter(mapActivity, R.layout.list_menu_item_native); + bld.setAdapter(listAdapter, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + OnContextMenuClick click = cm.getClickAdapter(which); + if (click != null) { + click.onContextMenuClick(cm.getItemId(which), which, false, dialog); + } + } + }); + bld.show(); + + } + + private ContextMenuAdapter createOptionsMenu() { final OsmandMapTileView mapView = mapActivity.getMapView(); final OsmandApplication app = mapActivity.getMyApplication(); - optionsMenuHelper = new OptionsMenuHelper(); - optionsMenuHelper.registerOptionsMenuItem(R.string.where_am_i, R.string.where_am_i, android.R.drawable.ic_menu_mylocation, - new OnOptionsMenuClick() { + ContextMenuAdapter optionsMenuHelper = new ContextMenuAdapter(app); + boolean light = app.getSettings().isLightContent(); + optionsMenuHelper.registerItem(R.string.where_am_i, + light ? R.drawable.a_10_device_access_location_found_light : R.drawable.a_10_device_access_location_found_dark, + new OnContextMenuClick() { @Override - public void prepareOptionsMenu(Menu menu, MenuItem item) { - } - @Override - public boolean onClick(MenuItem item) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (getMyApplication().getInternalAPI().accessibilityEnabled()) { whereAmIDialog(); } else { mapActivity.getMapViewTrackingUtilities().backToLocationImpl(); } - return true; } }); - optionsMenuHelper.registerOptionsMenuItem(R.string.menu_layers, R.string.menu_layers, android.R.drawable.ic_menu_mapmode, - new OnOptionsMenuClick() { + optionsMenuHelper.registerItem(R.string.menu_layers, + light ? R.drawable.a_7_location_map_light : R.drawable.a_7_location_map_dark, + new OnContextMenuClick() { @Override - public void prepareOptionsMenu(Menu menu, MenuItem item) { - } - @Override - public boolean onClick(MenuItem item) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { mapActivity.getMapLayers().openLayerSelectionDialog(mapView); - return true; } }); - optionsMenuHelper.registerOptionsMenuItem(R.string.settings_Button, R.string.settings_Button, android.R.drawable.ic_menu_preferences, - new OnOptionsMenuClick() { - @Override - public void prepareOptionsMenu(Menu menu, MenuItem item) { - } - @Override - public boolean onClick(MenuItem item) { - final Intent intentSettings = new Intent(mapActivity, OsmandIntents.getSettingsActivity()); - mapActivity.startActivity(intentSettings); - return true; - } - }); - optionsMenuHelper.registerOptionsMenuItem(R.string.stop_navigation, R.string.stop_navigation, android.R.drawable.ic_menu_close_clear_cancel, false, - new OnOptionsMenuClick() { - @Override - public void prepareOptionsMenu(Menu menu, MenuItem navigateToPointMenu) { - if (mapActivity.getPointToNavigate() != null) { - navigateToPointMenu.setTitle((routingHelper.isRouteCalculated() || routingHelper.isFollowingMode() || - routingHelper.isRouteBeingCalculated()) ? R.string.stop_routing : R.string.stop_navigation); - navigateToPointMenu.setVisible(true); - } else { - navigateToPointMenu.setVisible(false); - } - } - @Override - public boolean onClick(MenuItem item) { - stopNavigationActionConfirm(mapView); - return true; - } - }); - optionsMenuHelper.registerOptionsMenuItem(R.string.menu_mute_off, R.string.menu_mute_off, false, new OnOptionsMenuClick() { - @Override - public void prepareOptionsMenu(Menu menu, MenuItem muteMenu) { - if (routingHelper.getFinalLocation() != null && routingHelper.isFollowingMode()) { - boolean mute = routingHelper.getVoiceRouter().isMute(); - muteMenu.setTitle(mute ? R.string.menu_mute_on : R.string.menu_mute_off); - muteMenu.setIcon(mute ? R.drawable.ic_menu_soundoff : R.drawable.ic_menu_soundon); - muteMenu.setVisible(true); - } else { - muteMenu.setVisible(false); + boolean muteVisible = routingHelper.getFinalLocation() != null && routingHelper.isFollowingMode(); + if (muteVisible) { + boolean mute = routingHelper.getVoiceRouter().isMute(); + int t = mute ? R.string.menu_mute_on : R.string.menu_mute_off; + int icon; + if(mute) { + icon = light ? R.drawable.a_10_device_access_volume_muted_light: R.drawable.a_10_device_access_volume_muted_dark; + } else{ + icon = light ? R.drawable.a_10_device_access_volume_on_light: R.drawable.a_10_device_access_volume_on_dark; + } + optionsMenuHelper.registerItem(t, icon, new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + routingHelper.getVoiceRouter().setMute(!routingHelper.getVoiceRouter().isMute()); } - } - - @Override - public boolean onClick(MenuItem item) { - routingHelper.getVoiceRouter().setMute(!routingHelper.getVoiceRouter().isMute()); - return true; - } - }); - optionsMenuHelper.registerOptionsMenuItem(R.string.get_directions, R.string.get_directions, android.R.drawable.ic_menu_directions, - new OnOptionsMenuClick() { + }); + } + optionsMenuHelper.registerItem(routingHelper.isRouteCalculated() ? R.string.show_route: R.string.get_directions, + light ? R.drawable.a_7_location_directions_light : R.drawable.a_7_location_directions_dark, + new OnContextMenuClick() { @Override - public void prepareOptionsMenu(Menu menu, MenuItem directions) { - if(routingHelper.isRouteCalculated()){ - directions.setTitle(R.string.show_route); - } else { - directions.setTitle(R.string.get_directions); - } - - } - @Override - public boolean onClick(MenuItem item) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { if (routingHelper.isRouteCalculated()) { aboutRoute(); } else { getDirections(null, null, true); - } - return true; + } } }); - optionsMenuHelper.registerOptionsMenuItem(R.string.search_button, R.string.search_button, android.R.drawable.ic_menu_search, new OnOptionsMenuClick() { + optionsMenuHelper.registerItem(R.string.settings_Button, + light ? R.drawable.a_ic_menu_settings_light : R.drawable.a_ic_menu_settings_dark, + new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + final Intent intentSettings = new Intent(mapActivity, OsmandIntents.getSettingsActivity()); + mapActivity.startActivity(intentSettings); + } + }); + optionsMenuHelper.registerItem(R.string.search_button, + light ? R.drawable.a_2_action_search_light : R.drawable.a_2_action_search_dark, + new OnContextMenuClick() { @Override - public void prepareOptionsMenu(Menu menu, MenuItem item) { - } - @Override - public boolean onClick(MenuItem item) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { Intent newIntent = new Intent(mapActivity, OsmandIntents.getSearchActivity()); // causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); LatLon loc = mapActivity.getMapLocation(); @@ -1100,72 +1049,78 @@ public class MapActivityActions implements DialogProvider { newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude()); newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); mapActivity.startActivity(newIntent); - return true; - } - }); - optionsMenuHelper.registerOptionsMenuItem(R.string.target_points, R.string.target_points, new OnOptionsMenuClick() { - @Override - public void prepareOptionsMenu(Menu menu, MenuItem item) { - item.setVisible(getTargets().getIntermediatePoints().size() > 0); - } - @Override - public boolean onClick(MenuItem item) { - openIntermediatePointsDialog(); - return true; } }); - if (Version.isGpsStatusEnabled(app) && !Version.isBlackberry(app)) { - optionsMenuHelper.registerOptionsMenuItem(R.string.show_gps_status, R.string.show_gps_status, - android.R.drawable.ic_menu_compass, new OnOptionsMenuClick() { - @Override - public void prepareOptionsMenu(Menu menu, MenuItem item) { - } - - @Override - public boolean onClick(MenuItem item) { - startGpsStatusIntent(); - return false; - } - }); + optionsMenuHelper.registerItem(R.string.favorites_Button, + light ? R.drawable.a_3_rating_important_light : R.drawable.a_3_rating_important_dark, + new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + Intent newIntent = new Intent(mapActivity, OsmandIntents.getFavoritesActivity()); + // causes wrong position caching: newIntent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); + mapActivity.startActivity(newIntent); + } + }); + if (mapActivity.getPointToNavigate() != null) { + int nav = (routingHelper.isRouteCalculated() || routingHelper.isFollowingMode() || routingHelper.isRouteBeingCalculated()) ? + R.string.stop_routing : R.string.stop_navigation; + optionsMenuHelper.registerItem(nav, + light ? R.drawable.a_1_navigation_cancel_light : R.drawable.a_1_navigation_cancel_dark, + new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + stopNavigationActionConfirm(mapView); + } + }); } - optionsMenuHelper.registerOptionsMenuItem(R.string.show_point_options, R.string.show_point_options, new OnOptionsMenuClick() { + if (getTargets().getPointToNavigate() != null) { + optionsMenuHelper.registerItem(R.string.target_points, + light ? R.drawable.a_9_av_make_available_offline_light : R.drawable.a_9_av_make_available_offline_dark, + new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + openIntermediatePointsDialog(); + } + }); + } + + optionsMenuHelper.registerItem(R.string.show_point_options, + light ? R.drawable.a_7_location_place_light : R.drawable.a_7_location_place_dark, + new OnContextMenuClick() { @Override - public void prepareOptionsMenu(Menu menu, MenuItem item) { - } - @Override - public boolean onClick(MenuItem item) { + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { contextMenuPoint(mapView.getLatitude(), mapView.getLongitude()); - return true; - } - }); - final OsmAndLocationProvider loc = app.getLocationProvider(); - optionsMenuHelper.registerOptionsMenuItem(R.string.animate_route, R.string.animate_route, false, new OnOptionsMenuClick() { - @Override - public void prepareOptionsMenu(Menu menu, MenuItem animateMenu) { - animateMenu.setTitle(loc.getLocationSimulation().isRouteAnimating() ? R.string.animate_route_off : R.string.animate_route); - animateMenu.setVisible(app.getTargetPointsHelper().getPointToNavigate() != null); - } - - @Override - public boolean onClick(MenuItem item) { - // animate moving on route - loc.getLocationSimulation().startStopRouteAnimation(mapActivity); - return true; } }); + if (Version.isGpsStatusEnabled(app) && !Version.isBlackberry(app)) { + optionsMenuHelper.registerItem(R.string.show_gps_status, + light ? R.drawable.a_2_action_about_light : R.drawable.a_2_action_about_dark, + new OnContextMenuClick() { + + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + startGpsStatusIntent(); + } + }); + } + final OsmAndLocationProvider loc = app.getLocationProvider(); + if (app.getTargetPointsHelper().getPointToNavigate() != null) { + + optionsMenuHelper.registerItem(loc.getLocationSimulation().isRouteAnimating() ? R.string.animate_route_off + : R.string.animate_route, + light ? R.drawable.a_9_av_play_over_video_light : R.drawable.a_9_av_play_over_video_dark, + new OnContextMenuClick() { + + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + // animate moving on route + loc.getLocationSimulation().startStopRouteAnimation(mapActivity); + } + }); + } OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper); - - optionsMenuHelper.registerOptionsMenu(menu); - return true; - } - - public void onPrepareOptionsMenu(Menu menu) { - optionsMenuHelper.prepareOptionsMenu(menu); - } - - public boolean onOptionsItemSelected(MenuItem item) { - return optionsMenuHelper.onClick(item); + return optionsMenuHelper; } public void openIntermediatePointsDialog(){ diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java index 9cf958b954..0f5d019aff 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivityLayers.java @@ -35,7 +35,6 @@ import net.osmand.plus.SQLiteTileSource; import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin; import net.osmand.plus.render.MapVectorLayer; import net.osmand.plus.routing.RoutingHelper; -import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.views.ContextMenuLayer; import net.osmand.plus.views.FavoritesLayer; import net.osmand.plus.views.GPXLayer; diff --git a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java index 03f505479d..bec94345cd 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/SavingTrackHelper.java @@ -16,11 +16,11 @@ import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.Track; import net.osmand.plus.GPXUtilities.TrkSegment; import net.osmand.plus.GPXUtilities.WptPt; -import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.OsmandSettings; +import net.osmand.plus.monitoring.OsmandMonitoringPlugin; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java index 8d479cb16e..8873938fb2 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsBaseActivity.java @@ -20,7 +20,6 @@ import android.app.AlertDialog.Builder; import android.content.Context; import android.content.DialogInterface; import android.content.DialogInterface.OnMultiChoiceClickListener; -import android.content.Intent; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.EditTextPreference; @@ -32,8 +31,8 @@ import android.preference.PreferenceScreen; import android.widget.ArrayAdapter; import android.widget.Toast; -import com.actionbarsherlock.app.SherlockPreferenceActivity; import com.actionbarsherlock.app.ActionBar.OnNavigationListener; +import com.actionbarsherlock.app.SherlockPreferenceActivity; public abstract class SettingsBaseActivity extends SherlockPreferenceActivity implements OnPreferenceChangeListener, OnPreferenceClickListener { diff --git a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java index 4e73c1e104..0ebe193f7d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/SettingsGeneralActivity.java @@ -6,9 +6,9 @@ import java.util.List; import net.osmand.access.AccessibleToast; import net.osmand.plus.ApplicationMode; +import net.osmand.plus.ClientContext; import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings.MetricsConstants; -import net.osmand.plus.ClientContext; import net.osmand.plus.ProgressDialogImplementation; import net.osmand.plus.R; import net.osmand.plus.Version; @@ -29,8 +29,8 @@ import android.preference.CheckBoxPreference; import android.preference.EditTextPreference; import android.preference.ListPreference; import android.preference.Preference; -import android.preference.PreferenceScreen; import android.preference.Preference.OnPreferenceChangeListener; +import android.preference.PreferenceScreen; import android.widget.Toast; import com.actionbarsherlock.view.Window; diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java index d64dcf1ced..3b18c23005 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java @@ -6,8 +6,8 @@ import java.util.List; import net.osmand.ResultMatcher; import net.osmand.data.Building; import net.osmand.data.City; -import net.osmand.data.Street; import net.osmand.data.LatLon; +import net.osmand.data.Street; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.resources.RegionAddressRepository; diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java index 914c2eb7cc..478d6315b7 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchCityByNameActivity.java @@ -11,11 +11,11 @@ import net.osmand.ResultMatcher; import net.osmand.data.City; import net.osmand.data.City.CityType; import net.osmand.data.LatLon; -import net.osmand.util.MapUtils; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.resources.RegionAddressRepository; +import net.osmand.util.MapUtils; import android.os.AsyncTask; import android.os.Message; import android.view.Gravity; diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java index 43ec01f4da..7ce7923898 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPoiFilterActivity.java @@ -6,9 +6,6 @@ package net.osmand.plus.activities.search; import java.util.ArrayList; import java.util.List; -import com.actionbarsherlock.app.SherlockFragmentActivity; -import com.actionbarsherlock.app.SherlockListFragment; - import net.osmand.access.AccessibleToast; import net.osmand.data.LatLon; import net.osmand.plus.NameFinderPoiFilter; @@ -32,6 +29,9 @@ import android.widget.ListView; import android.widget.TextView; import android.widget.Toast; +import com.actionbarsherlock.app.SherlockFragmentActivity; +import com.actionbarsherlock.app.SherlockListFragment; + public class SearchPoiFilterActivity extends SherlockListFragment implements SearchActivityChild { diff --git a/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java b/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java index 7443cf32f6..14b26d7aba 100644 --- a/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java +++ b/OsmAnd/src/net/osmand/plus/base/FailSafeFuntions.java @@ -6,11 +6,11 @@ import java.util.ArrayList; import net.osmand.access.AccessibleAlertBuilder; import net.osmand.data.LatLon; import net.osmand.plus.GPXUtilities; +import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.TargetPointsHelper; -import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.routing.RouteProvider.GPXRouteParams; import android.app.AlertDialog; diff --git a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java index 4fca8f572d..676a4be767 100644 --- a/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java +++ b/OsmAnd/src/net/osmand/plus/base/MapViewTrackingUtilities.java @@ -1,7 +1,5 @@ package net.osmand.plus.base; -import android.content.Context; -import android.view.WindowManager; import net.osmand.Location; import net.osmand.StateChangedListener; import net.osmand.map.IMapLocationListener; @@ -15,6 +13,8 @@ import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.views.AnimateDraggingMapThread; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.util.MapUtils; +import android.content.Context; +import android.view.WindowManager; public class MapViewTrackingUtilities implements OsmAndLocationListener, IMapLocationListener, OsmAndCompassListener { private static final int AUTO_FOLLOW_MSG_ID = 8; diff --git a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java index 29131ef32b..a48b6a4d70 100644 --- a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java +++ b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java @@ -1,8 +1,5 @@ package net.osmand.plus.development; -import net.osmand.plus.OptionsMenuHelper; -import net.osmand.plus.OptionsMenuHelper.OnOptionsMenuClick; -import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; import net.osmand.plus.R; @@ -12,8 +9,6 @@ import android.content.Intent; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceScreen; -import android.view.Menu; -import android.view.MenuItem; public class OsmandDevelopmentPlugin extends OsmandPlugin { private static final String ID = "osmand.development"; diff --git a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java index 6b03aa5488..0e25db9239 100644 --- a/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java +++ b/OsmAnd/src/net/osmand/plus/development/TestVoiceActivity.java @@ -3,8 +3,6 @@ */ package net.osmand.plus.development; -import com.actionbarsherlock.app.SherlockActivity; - import net.osmand.access.AccessibleToast; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; @@ -23,6 +21,8 @@ import android.widget.ScrollView; import android.widget.TextView; import android.widget.Toast; +import com.actionbarsherlock.app.SherlockActivity; + /** * Test Voice activity */ diff --git a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java index 77bf1564f0..96a47ec80e 100644 --- a/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java +++ b/OsmAnd/src/net/osmand/plus/distancecalculator/DistanceCalculatorPlugin.java @@ -6,7 +6,6 @@ import java.util.List; import net.osmand.access.AccessibleToast; import net.osmand.data.LatLon; -import net.osmand.util.MapUtils; import net.osmand.plus.ApplicationMode; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; @@ -17,6 +16,7 @@ import net.osmand.plus.views.MapInfoLayer; import net.osmand.plus.views.OsmandMapLayer; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.mapwidgets.TextInfoWidget; +import net.osmand.util.MapUtils; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java index fcc23031af..d0386512a8 100644 --- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java +++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java @@ -23,8 +23,6 @@ import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.mapwidgets.BaseMapWidget; import net.osmand.plus.views.mapwidgets.TextInfoWidget; - - import android.content.DialogInterface; import android.content.DialogInterface.OnClickListener; import android.content.Intent; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java b/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java index dc5b39ace1..395c058734 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java @@ -7,7 +7,6 @@ import android.content.Intent; import android.os.Bundle; import android.preference.CheckBoxPreference; import android.preference.EditTextPreference; -import android.preference.ListPreference; import android.preference.Preference; import android.preference.Preference.OnPreferenceClickListener; import android.preference.PreferenceScreen; diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java index 602082aab0..a3858caa48 100644 --- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java +++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java @@ -8,8 +8,6 @@ import net.osmand.data.LatLon; import net.osmand.plus.ApplicationMode; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; -import net.osmand.plus.OptionsMenuHelper; -import net.osmand.plus.OptionsMenuHelper.OnOptionsMenuClick; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; @@ -19,10 +17,10 @@ import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.views.AnimateDraggingMapThread; import net.osmand.plus.views.MapInfoLayer; +import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.mapwidgets.BaseMapWidget; import net.osmand.plus.views.mapwidgets.TextInfoWidget; -import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.Dialog; @@ -31,8 +29,6 @@ import android.content.Intent; import android.graphics.Paint; import android.location.Location; import android.text.format.DateFormat; -import android.view.Menu; -import android.view.MenuItem; import android.view.View; import android.widget.CheckBox; import android.widget.ImageButton; @@ -420,26 +416,19 @@ public class ParkingPositionPlugin extends OsmandPlugin { } @Override - public void registerOptionsMenuItems(final MapActivity mapActivity, OptionsMenuHelper helper) { + public void registerOptionsMenuItems(final MapActivity mapActivity, ContextMenuAdapter helper) { if (parkingLayer != null) { - //NOTE: R.id.parking_lim_text - is used just as a stub - helper.registerOptionsMenuItem(R.string.osmand_parking_delete, R.string.osmand_parking_delete, android.R.drawable.ic_menu_mylocation, - new OnOptionsMenuClick() { - @Override - public void prepareOptionsMenu(Menu menu, MenuItem deleteParkingItem) { - if (getParkingPosition() != null) { - deleteParkingItem.setVisible(true); - } else { - deleteParkingItem.setVisible(false); - } - } - - @Override - public boolean onClick(MenuItem item) { - showDeleteDialog(mapActivity); - return true; - } - }); + if (getParkingPosition() != null) { + boolean l = app.getSettings().isLightContent(); + helper.registerItem(R.string.osmand_parking_delete, l ? R.drawable.a_1_navigation_cancel_light : R.drawable.a_1_navigation_cancel_dark, + new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + showDeleteDialog(mapActivity); + } + + }); + } } } diff --git a/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java b/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java index 3de6ee7414..9e40bb44e0 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java +++ b/OsmAnd/src/net/osmand/plus/render/MapVectorLayer.java @@ -1,11 +1,11 @@ package net.osmand.plus.render; -import net.osmand.util.MapUtils; import net.osmand.plus.RotatedTileBox; import net.osmand.plus.resources.ResourceManager; import net.osmand.plus.views.BaseMapLayer; import net.osmand.plus.views.MapTileLayer; import net.osmand.plus.views.OsmandMapTileView; +import net.osmand.util.MapUtils; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Paint; diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index 8903cee8bc..9b249fc145 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -15,7 +15,6 @@ import net.osmand.PlatformUtil; import net.osmand.binary.BinaryMapDataObject; import net.osmand.binary.BinaryMapIndexReader.TagValuePair; import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; -import net.osmand.osm.MapRenderingTypes; import net.osmand.plus.render.TextRenderer.TextDrawInfo; import net.osmand.render.RenderingRuleProperty; import net.osmand.render.RenderingRuleSearchRequest; diff --git a/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java index 4c5e72fca7..46d0014437 100644 --- a/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/AmenityIndexRepositoryBinary.java @@ -17,8 +17,8 @@ import net.osmand.data.Amenity; import net.osmand.data.AmenityType; import net.osmand.data.LatLon; import net.osmand.plus.PoiFilter; -import net.osmand.util.MapUtils; import net.osmand.util.Algorithms; +import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/resources/BaseLocationIndexRepository.java b/OsmAnd/src/net/osmand/plus/resources/BaseLocationIndexRepository.java index a3dc67bd7b..5ff273a0e2 100644 --- a/OsmAnd/src/net/osmand/plus/resources/BaseLocationIndexRepository.java +++ b/OsmAnd/src/net/osmand/plus/resources/BaseLocationIndexRepository.java @@ -6,8 +6,8 @@ import java.util.List; import net.osmand.IProgress; import net.osmand.PlatformUtil; -import net.osmand.data.MapObject; import net.osmand.data.LatLon; +import net.osmand.data.MapObject; import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepository.java b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepository.java index 01590af6b7..76c11c0547 100644 --- a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepository.java +++ b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepository.java @@ -7,9 +7,9 @@ import java.util.List; import net.osmand.ResultMatcher; import net.osmand.data.Building; import net.osmand.data.City; +import net.osmand.data.LatLon; import net.osmand.data.MapObject; import net.osmand.data.Street; -import net.osmand.data.LatLon; import net.osmand.util.MapUtils; diff --git a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java index 2fb0ff629f..2bf0a4f4f0 100644 --- a/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/RegionAddressRepositoryBinary.java @@ -19,9 +19,9 @@ import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; import net.osmand.data.Building; import net.osmand.data.City; +import net.osmand.data.LatLon; import net.osmand.data.MapObject; import net.osmand.data.Street; -import net.osmand.data.LatLon; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 336d3aaae8..207feedce1 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -27,12 +27,11 @@ import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.CachedOsmandIndexes; import net.osmand.data.Amenity; import net.osmand.data.AmenityType; +import net.osmand.data.LatLon; import net.osmand.data.TransportStop; import net.osmand.map.ITileSource; import net.osmand.map.MapTileDownloader; import net.osmand.map.MapTileDownloader.DownloadRequest; -import net.osmand.data.LatLon; -import net.osmand.util.MapUtils; import net.osmand.plus.BusyIndicator; import net.osmand.plus.NameFinderPoiFilter; import net.osmand.plus.OsmandApplication; @@ -54,6 +53,7 @@ import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.render.RenderingRulesStorage; import net.osmand.util.Algorithms; +import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; import org.xmlpull.v1.XmlPullParser; diff --git a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java index 465b1c85f6..6559b68c15 100644 --- a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java +++ b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepository.java @@ -3,9 +3,9 @@ package net.osmand.plus.resources; import java.util.List; import net.osmand.ResultMatcher; +import net.osmand.data.LatLon; import net.osmand.data.TransportRoute; import net.osmand.data.TransportStop; -import net.osmand.data.LatLon; public interface TransportIndexRepository { diff --git a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java index 84297e03d6..ff967f3e9f 100644 --- a/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/resources/TransportIndexRepositoryBinary.java @@ -13,9 +13,9 @@ import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.SearchRequest; +import net.osmand.data.LatLon; import net.osmand.data.TransportRoute; import net.osmand.data.TransportStop; -import net.osmand.data.LatLon; import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java index b867846874..9bff221d88 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapControlsLayer.java @@ -2,15 +2,18 @@ package net.osmand.plus.views; import net.londatiga.android.ActionItem; import net.londatiga.android.QuickAction; -import net.osmand.util.MapUtils; -import net.osmand.data.LatLon; import net.osmand.plus.ApplicationMode; +import net.osmand.plus.ContextMenuAdapter; +import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandSettings.CommonPreference; import net.osmand.plus.R; -import net.osmand.plus.activities.MainMenuActivity; import net.osmand.plus.activities.MapActivity; +import net.osmand.util.MapUtils; +import android.app.AlertDialog; +import android.app.AlertDialog.Builder; import android.content.Context; +import android.content.DialogInterface; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.PointF; @@ -31,6 +34,7 @@ import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.ImageView; import android.widget.LinearLayout; +import android.widget.ListAdapter; import android.widget.SeekBar; public class MapControlsLayer extends OsmandMapLayer { @@ -253,9 +257,10 @@ public class MapControlsLayer extends OsmandMapLayer { backToMenuButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - double lat = activity.getMapView().getLatitude(); - double lon = activity.getMapView().getLongitude(); - MainMenuActivity.backToMainMenuDialog(activity, new LatLon(lat, lon)); + // double lat = activity.getMapView().getLatitude(); + // double lon = activity.getMapView().getLongitude(); + // MainMenuActivity.backToMainMenuDialog(activity, new LatLon(lat, lon)); + activity.getMapActions().openOptionsMenuAsList(); } }); diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index 3178e1f405..97da44e5d6 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -10,17 +10,17 @@ import net.osmand.PlatformUtil; import net.osmand.access.AccessibilityActionsProvider; import net.osmand.access.AccessibleToast; import net.osmand.access.MapExplorer; +import net.osmand.data.LatLon; import net.osmand.map.IMapLocationListener; import net.osmand.map.MapTileDownloader.DownloadRequest; import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; -import net.osmand.data.LatLon; -import net.osmand.util.MapUtils; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.views.MultiTouchSupport.MultiTouchZoomListener; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; +import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java index 125f421e69..f329d15cfe 100644 --- a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java @@ -2,10 +2,10 @@ package net.osmand.plus.views; import net.osmand.Location; -import net.osmand.util.MapUtils; import net.osmand.plus.ApplicationMode; import net.osmand.plus.OsmAndLocationProvider; import net.osmand.plus.R; +import net.osmand.util.MapUtils; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; diff --git a/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java index a0155620d2..210caf6d28 100644 --- a/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/TransportInfoLayer.java @@ -3,9 +3,9 @@ package net.osmand.plus.views; import java.util.List; import net.osmand.access.AccessibleToast; +import net.osmand.data.LatLon; import net.osmand.data.TransportRoute; import net.osmand.data.TransportStop; -import net.osmand.data.LatLon; import net.osmand.plus.R; import net.osmand.plus.activities.TransportRouteHelper; import net.osmand.plus.resources.TransportIndexRepository.RouteInfoLocation; diff --git a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java index bdc63818e6..f48d24d793 100644 --- a/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/TransportStopsLayer.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.List; import net.osmand.access.AccessibleToast; -import net.osmand.data.TransportStop; import net.osmand.data.LatLon; +import net.osmand.data.TransportStop; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; -import net.osmand.plus.resources.TransportIndexRepository; import net.osmand.plus.R; +import net.osmand.plus.resources.TransportIndexRepository; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.Context; diff --git a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java index 64f799a561..5a0b81f047 100644 --- a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java +++ b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java @@ -9,16 +9,13 @@ import java.net.URL; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; -import net.osmand.access.AccessibleToast; import net.osmand.map.TileSourceManager.TileSourceTemplate; -import net.osmand.plus.R; import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; import android.graphics.Canvas; import android.graphics.RectF; -import android.widget.Toast; public class YandexTrafficAdapter extends MapTileAdapter { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/BaseMapWidget.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/BaseMapWidget.java index 29d4f1473d..2a33a395e2 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/BaseMapWidget.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/BaseMapWidget.java @@ -1,8 +1,8 @@ package net.osmand.plus.views.mapwidgets; import net.osmand.plus.ClientContext; -import net.osmand.plus.views.ShadowText; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; +import net.osmand.plus.views.ShadowText; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java index e0739b1120..67a8dfea37 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MapInfoWidgetsFactory.java @@ -5,15 +5,15 @@ import net.osmand.access.AccessibleToast; import net.osmand.binary.RouteDataObject; import net.osmand.plus.OsmAndFormatter; import net.osmand.plus.OsmAndLocationProvider; +import net.osmand.plus.OsmAndLocationProvider.GPSInfo; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; -import net.osmand.plus.OsmAndLocationProvider.GPSInfo; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RoutingHelper; +import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.ShadowText; -import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; @@ -26,9 +26,9 @@ import android.view.MotionEvent; import android.view.View; import android.widget.FrameLayout; import android.widget.ImageView; +import android.widget.LinearLayout.LayoutParams; import android.widget.TextView; import android.widget.Toast; -import android.widget.LinearLayout.LayoutParams; public class MapInfoWidgetsFactory { diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MiniMapWidget.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MiniMapWidget.java index d28a92a49d..be077b5fea 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/MiniMapWidget.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/MiniMapWidget.java @@ -3,8 +3,8 @@ package net.osmand.plus.views.mapwidgets; import net.osmand.plus.R; import net.osmand.plus.views.MapInfoLayer; -import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; +import net.osmand.plus.views.OsmandMapTileView; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; diff --git a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java index d7df87b855..4078cb7c98 100644 --- a/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java +++ b/OsmAnd/src/net/osmand/plus/views/mapwidgets/RouteInfoWidgetsFactory.java @@ -3,7 +3,6 @@ package net.osmand.plus.views.mapwidgets; import java.util.Arrays; - import net.osmand.Location; import net.osmand.binary.RouteDataObject; import net.osmand.data.LatLon; @@ -21,10 +20,10 @@ import net.osmand.plus.routing.RouteCalculationResult.NextDirectionInfo; import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.views.AnimateDraggingMapThread; +import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.RouteInfoLayer; import net.osmand.plus.views.TurnPathHelper; -import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.router.TurnType; import net.osmand.util.Algorithms; import android.content.Context;