diff --git a/OsmAnd-java/src/main/java/net/osmand/IndexConstants.java b/OsmAnd-java/src/main/java/net/osmand/IndexConstants.java
index 2c2802af69..26a4e252ed 100644
--- a/OsmAnd-java/src/main/java/net/osmand/IndexConstants.java
+++ b/OsmAnd-java/src/main/java/net/osmand/IndexConstants.java
@@ -41,6 +41,8 @@ public class IndexConstants {
public static final String FONT_INDEX_EXT_ZIP = ".otf.zip"; //$NON-NLS-1$
public static final String OSMAND_SETTINGS_FILE_EXT = ".osf";
+
+ public static final String ROUTING_FILE_EXT = ".xml";
public static final String RENDERER_INDEX_EXT = ".render.xml"; //$NON-NLS-1$
diff --git a/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java b/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java
index 2fbfd4b531..a48300e207 100644
--- a/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java
+++ b/OsmAnd-java/src/main/java/net/osmand/router/RoutingConfiguration.java
@@ -133,6 +133,17 @@ public class RoutingConfiguration {
}
+ public String getRoutingProfileKeyByFileName(String fileName) {
+ if (fileName != null && routers != null) {
+ for (Map.Entry router : routers.entrySet()) {
+ if (fileName.equals(router.getValue().getFilename())) {
+ return router.getKey();
+ }
+ }
+ }
+ return null;
+ }
+
public Map getAllRouters() {
return routers;
}
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt
index 4dc883bed3..1eda69b2dd 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt
@@ -14,7 +14,7 @@ import net.osmand.telegram.notifications.NotificationHelper
import net.osmand.telegram.utils.AndroidUtils
import net.osmand.telegram.utils.UiUtils
-class TelegramApplication : Application(), OsmandHelperListener {
+class TelegramApplication : Application() {
val telegramHelper = TelegramHelper.instance
lateinit var settings: TelegramSettings private set
@@ -54,6 +54,7 @@ class TelegramApplication : Application(), OsmandHelperListener {
listOf("ic_action_location_sharing_app"),
listOf(-1)
)
+ showLocationHelper.setupMapLayer()
showLocationHelper.addDirectionContextMenuButton()
showLocationHelper.startShowingLocation()
showLocationHelper.addOrUpdateStatusWidget(-1, false)
@@ -141,13 +142,6 @@ class TelegramApplication : Application(), OsmandHelperListener {
return internetConnectionAvailable
}
- override fun onOsmandConnectionStateChanged(connected: Boolean) {
- if (connected) {
- showLocationHelper.setupMapLayer()
- showLocationHelper.addDirectionContextMenuButton()
- }
- }
-
private fun startTelegramService(intent: Int, serviceOffInterval: Long = 0) {
var i = intent
var interval = serviceOffInterval
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt
index 227215c03c..5ed8aea183 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramSettings.kt
@@ -851,22 +851,7 @@ class TelegramSettings(private val app: TelegramApplication) {
lastChatsInfo.forEach { lastInfo ->
val obj = JSONObject()
obj.put(LastChatInfo.CHAT_ID_KEY, lastInfo.chatId)
- obj.put(LastChatInfo.PERIODS_KEY, convertPeriodsToJson(lastInfo.periods))
- jArray.put(obj)
- }
- jArray
- } catch (e: JSONException) {
- log.error(e)
- null
- }
- }
-
- private fun convertPeriodsToJson(periods: LinkedList): JSONArray? {
- return try {
- val jArray = JSONArray()
- for (i in 0 until periods.count()) {
- val obj = JSONObject()
- obj.put(i.toString(), periods[i])
+ obj.put(LastChatInfo.PERIOD_KEY, lastInfo.period)
jArray.put(obj)
}
jArray
@@ -947,12 +932,7 @@ class TelegramSettings(private val app: TelegramApplication) {
val obj = json.getJSONObject(i)
val lastInfo = LastChatInfo().apply {
chatId = obj.optLong(LastChatInfo.CHAT_ID_KEY)
- periods = LinkedList()
- val jsonArray = obj.getJSONArray(LastChatInfo.PERIODS_KEY)
- for (j in 0 until jsonArray.length()) {
- val o = jsonArray.get(j) as JSONObject
- periods.addLast(o.optLong(j.toString()))
- }
+ period = obj.optLong(LastChatInfo.PERIOD_KEY)
}
lastChatsInfo.addLast(lastInfo)
}
@@ -964,16 +944,14 @@ class TelegramSettings(private val app: TelegramApplication) {
addItemToSuggested(id, time)
} else {
val index = lastChatsInfo.indexOf(lastInfo)
- lastChatsInfo[index].periods = addTimeToPeriods(lastChatsInfo[index].periods, time)
+ lastChatsInfo[index].period = time
}
}
private fun addItemToSuggested(id: Long, time: Long) {
val newLastInfo = LastChatInfo().apply {
chatId = id
- periods = LinkedList().apply {
- addFirst(time)
- }
+ period = time
}
if (lastChatsInfo.size < 5) {
lastChatsInfo.addFirst(newLastInfo)
@@ -983,30 +961,6 @@ class TelegramSettings(private val app: TelegramApplication) {
}
}
- private fun addTimeToPeriods(periods: LinkedList?, time: Long): LinkedList {
- if (periods?.isNotEmpty() != null) {
- return if (periods.size < 5) {
- periods.addFirst(time)
- periods
- } else {
- periods.removeLast()
- periods.addFirst(time)
- periods
- }
- }
- return LinkedList().apply { addFirst(time) }
- }
-
- fun calcLivePeriod(periods: LinkedList): Long {
- val sortedPeriods = periods.toLongArray()
- sortedPeriods.sort()
- return if (sortedPeriods.size % 2 == 0) {
- (sortedPeriods[sortedPeriods.size / 2] + sortedPeriods[sortedPeriods.size / 2 - 1]) / 2
- } else {
- sortedPeriods[sortedPeriods.size / 2]
- }
- }
-
private fun getLiveNowChats() = app.telegramHelper.getMessagesByChatIds(locHistoryTime).keys
private fun updatePrefs() {
@@ -1512,11 +1466,11 @@ class TelegramSettings(private val app: TelegramApplication) {
class LastChatInfo {
var chatId = -1L
- var periods = LinkedList()
+ var period = -1L
companion object {
internal const val CHAT_ID_KEY = "chatId"
- internal const val PERIODS_KEY = "periods"
+ internal const val PERIOD_KEY = "period"
}
}
}
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt
index 0fdb748018..d8096cb6cc 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/helpers/ShowLocationHelper.kt
@@ -35,6 +35,7 @@ class ShowLocationHelper(private val app: TelegramApplication) {
const val MIN_OSMAND_CALLBACK_VERSION_CODE = 320
const val MIN_OSMAND_CREATE_IMPORT_DIRS_VERSION_CODE = 340
+ const val MIN_OSMAND_SHARE_WIDGET_ICON_VERSION_CODE = 356
const val MAP_CONTEXT_MENU_BUTTON_ID = 1
const val MAP_CONTEXT_MENU_BUTTONS_PARAMS_ID = "DIRECTION"
@@ -46,6 +47,8 @@ class ShowLocationHelper(private val app: TelegramApplication) {
private const val STATUS_WIDGET_ID = "status_widget"
private const val STATUS_WIDGET_MENU_ICON = "widget_location_sharing_night"
+ private const val STATUS_WIDGET_MENU_ICON_OLD = "ic_action_relative_bearing"
+ private const val STATUS_WIDGET_ICON_OLD = "widget_relative_bearing_day"
private const val STATUS_WIDGET_ANIM_ICON_DAY = "anim_widget_location_sharing_day"
private const val STATUS_WIDGET_ANIM_ICON_NIGHT = "anim_widget_location_sharing_night"
private const val STATUS_WIDGET_ON_ANIM_ICON_DAY = "anim_widget_location_sharing_on_day"
@@ -209,8 +212,13 @@ class ShowLocationHelper(private val app: TelegramApplication) {
}
fun addOrUpdateStatusWidget(time: Long, isSending: Boolean) {
- val iconDay: String
- val iconNight: String
+ var iconDay: String
+ var iconNight: String
+ val menuIcon = if (isOsmandHasStatusWidgetIcon()) {
+ STATUS_WIDGET_MENU_ICON
+ } else {
+ STATUS_WIDGET_MENU_ICON_OLD
+ }
val text = when {
time > 0L -> {
iconDay = STATUS_WIDGET_ANIM_ICON_DAY
@@ -234,6 +242,10 @@ class ShowLocationHelper(private val app: TelegramApplication) {
app.getString(R.string.shared_string_start)
}
}
+ if (!isOsmandHasStatusWidgetIcon()) {
+ iconDay = STATUS_WIDGET_ICON_OLD
+ iconNight = STATUS_WIDGET_ICON_OLD
+ }
val subText = when {
time > 0 -> {
if (text.length > 2) {
@@ -246,7 +258,7 @@ class ShowLocationHelper(private val app: TelegramApplication) {
}
osmandAidlHelper.addMapWidget(
STATUS_WIDGET_ID,
- STATUS_WIDGET_MENU_ICON,
+ menuIcon,
app.getString(R.string.status_widget_title),
iconDay,
iconNight,
@@ -456,6 +468,11 @@ class ShowLocationHelper(private val app: TelegramApplication) {
return version >= MIN_OSMAND_CREATE_IMPORT_DIRS_VERSION_CODE
}
+ fun isOsmandHasStatusWidgetIcon(): Boolean {
+ val version = AndroidUtils.getAppVersionCode(app, app.settings.appToConnectPackage)
+ return version >= MIN_OSMAND_SHARE_WIDGET_ICON_VERSION_CODE
+ }
+
fun startShowMessagesTask(chatId: Long, vararg messages: TdApi.Message) {
if (app.settings.isShowingChatOnMap(chatId)) {
ShowMessagesTask(app).executeOnExecutor(executor, *messages)
@@ -564,4 +581,4 @@ class ShowLocationHelper(private val app: TelegramApplication) {
osmandAidlHelper.removeMapPoint(MAP_LAYER_ID, "${chatId}_${content.deviceName}")
}
}
-}
\ No newline at end of file
+}
diff --git a/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt b/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt
index 154116af0b..fab7f1db77 100644
--- a/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt
+++ b/OsmAnd-telegram/src/net/osmand/telegram/ui/MyLocationTabFragment.kt
@@ -580,7 +580,7 @@ class MyLocationTabFragment : Fragment(), TelegramListener {
val lastInfo = lastChatsInfo.find { it.chatId == chatId }
if (chat != null && lastInfo != null) {
val index = lastChatsInfo.indexOf(lastInfo)
- lastItems.add(LastChat(chat, settings.calcLivePeriod(lastChatsInfo[index].periods)))
+ lastItems.add(LastChat(chat, lastChatsInfo[index].period))
}
}
return lastItems
diff --git a/OsmAnd/AndroidManifest.xml b/OsmAnd/AndroidManifest.xml
index 62cca425a5..5dbe852c0b 100644
--- a/OsmAnd/AndroidManifest.xml
+++ b/OsmAnd/AndroidManifest.xml
@@ -323,6 +323,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle
index b8ee55cad3..e52705773c 100644
--- a/OsmAnd/build.gradle
+++ b/OsmAnd/build.gradle
@@ -45,10 +45,10 @@ android {
defaultConfig {
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 15
targetSdkVersion 28
- versionCode 350
+ versionCode 356
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
multiDexEnabled true
- versionName "3.5.0"
+ versionName "3.5.6"
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName
diff --git a/OsmAnd/res/drawable-hdpi/map_action_openstreetmap_logo.png b/OsmAnd/res/drawable-hdpi/map_action_openstreetmap_logo.png
new file mode 100644
index 0000000000..a1a2c1b061
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_action_openstreetmap_logo.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_action_world_globe.png b/OsmAnd/res/drawable-hdpi/map_action_world_globe.png
new file mode 100644
index 0000000000..6ad36c2b3a
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_action_world_globe.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-hdpi/map_bicycle_bearing.png
deleted file mode 100644
index 4a3ea967ad..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index aa15798537..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location.png
deleted file mode 100644
index 5fb9d3f902..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_center.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_center.png
deleted file mode 100644
index 189087522d..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost.png
deleted file mode 100644
index bebc1fa6ac..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index 9ded796ac4..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_night.png
deleted file mode 100644
index 5b9bb8558d..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index a3bcf1a835..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_bearing.png b/OsmAnd/res/drawable-hdpi/map_car_bearing.png
deleted file mode 100644
index 9cb7a8bdeb..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_bearing_center.png b/OsmAnd/res/drawable-hdpi/map_car_bearing_center.png
deleted file mode 100644
index a64378bdf4..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_car_bearing_night.png
deleted file mode 100644
index 4a1f583170..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location.png b/OsmAnd/res/drawable-hdpi/map_car_location.png
deleted file mode 100644
index 6b1c783ccf..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_center.png b/OsmAnd/res/drawable-hdpi/map_car_location_center.png
deleted file mode 100644
index 6bcc605ba3..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_lost.png b/OsmAnd/res/drawable-hdpi/map_car_location_lost.png
deleted file mode 100644
index 7b80f695ae..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_car_location_lost_night.png
deleted file mode 100644
index fba15e4b75..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_night.png b/OsmAnd/res/drawable-hdpi/map_car_location_night.png
deleted file mode 100644
index 5ee3fa3054..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index bae7aa9e95..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location.png b/OsmAnd/res/drawable-hdpi/map_default_location.png
deleted file mode 100644
index c07988087a..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_center.png b/OsmAnd/res/drawable-hdpi/map_default_location_center.png
deleted file mode 100644
index e0d6878129..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_lost.png b/OsmAnd/res/drawable-hdpi/map_default_location_lost.png
deleted file mode 100644
index 4ff643f9cd..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_default_location_lost_night.png
deleted file mode 100644
index 7d097bbc6a..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_night.png b/OsmAnd/res/drawable-hdpi/map_default_location_night.png
deleted file mode 100644
index 80b7f18d5e..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index f852001c23..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_bottom.png b/OsmAnd/res/drawable-hdpi/map_location_bicycle_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_bicycle_location_bottom.png
rename to OsmAnd/res/drawable-hdpi/map_location_bicycle_bottom.png
diff --git a/OsmAnd/res/drawable-hdpi/map_location_bicycle_center.png b/OsmAnd/res/drawable-hdpi/map_location_bicycle_center.png
new file mode 100644
index 0000000000..fa9db76c80
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_location_bicycle_center.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_top.png b/OsmAnd/res/drawable-hdpi/map_location_bicycle_top.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_bicycle_location_top.png
rename to OsmAnd/res/drawable-hdpi/map_location_bicycle_top.png
diff --git a/OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle.png b/OsmAnd/res/drawable-hdpi/map_location_bicycle_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_bicycle_location_view_angle.png
rename to OsmAnd/res/drawable-hdpi/map_location_bicycle_view_angle.png
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_bottom.png b/OsmAnd/res/drawable-hdpi/map_location_car_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_car_location_bottom.png
rename to OsmAnd/res/drawable-hdpi/map_location_car_bottom.png
diff --git a/OsmAnd/res/drawable-hdpi/map_location_car_center.png b/OsmAnd/res/drawable-hdpi/map_location_car_center.png
new file mode 100644
index 0000000000..3fe4224e0c
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_location_car_center.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_top.png b/OsmAnd/res/drawable-hdpi/map_location_car_top.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_car_location_top.png
rename to OsmAnd/res/drawable-hdpi/map_location_car_top.png
diff --git a/OsmAnd/res/drawable-hdpi/map_car_location_view_angle.png b/OsmAnd/res/drawable-hdpi/map_location_car_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_car_location_view_angle.png
rename to OsmAnd/res/drawable-hdpi/map_location_car_view_angle.png
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_bottom.png b/OsmAnd/res/drawable-hdpi/map_location_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_default_location_bottom.png
rename to OsmAnd/res/drawable-hdpi/map_location_default_bottom.png
diff --git a/OsmAnd/res/drawable-hdpi/map_location_default_center.png b/OsmAnd/res/drawable-hdpi/map_location_default_center.png
new file mode 100644
index 0000000000..d982b5ba2a
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_location_default_center.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_top.png b/OsmAnd/res/drawable-hdpi/map_location_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_default_location_top.png
rename to OsmAnd/res/drawable-hdpi/map_location_default_top.png
diff --git a/OsmAnd/res/drawable-hdpi/map_default_location_view_angle.png b/OsmAnd/res/drawable-hdpi/map_location_default_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_default_location_view_angle.png
rename to OsmAnd/res/drawable-hdpi/map_location_default_view_angle.png
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-hdpi/map_nautical_bearing.png
deleted file mode 100644
index 72e427c437..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_center.png b/OsmAnd/res/drawable-hdpi/map_nautical_bearing_center.png
deleted file mode 100644
index 9e9d79e0c2..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_nautical_bearing_night.png
deleted file mode 100644
index c7d4e436be..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location.png b/OsmAnd/res/drawable-hdpi/map_nautical_location.png
deleted file mode 100644
index 4a8b8aebc5..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-hdpi/map_nautical_location_night.png
deleted file mode 100644
index 80baedcf73..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index 6940b54e60..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index 744054c178..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_navigation_car_bottom.png b/OsmAnd/res/drawable-hdpi/map_navigation_car_bottom.png
new file mode 100644
index 0000000000..a0864094e3
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_navigation_car_bottom.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_navigation_car_center.png b/OsmAnd/res/drawable-hdpi/map_navigation_car_center.png
new file mode 100644
index 0000000000..1fd71cf7b1
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_navigation_car_center.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_navigation_car_top.png b/OsmAnd/res/drawable-hdpi/map_navigation_car_top.png
new file mode 100644
index 0000000000..065dc2097a
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_navigation_car_top.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_bearing_bottom.png b/OsmAnd/res/drawable-hdpi/map_navigation_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_car_bearing_bottom.png
rename to OsmAnd/res/drawable-hdpi/map_navigation_default_bottom.png
diff --git a/OsmAnd/res/drawable-hdpi/map_navigation_default_center.png b/OsmAnd/res/drawable-hdpi/map_navigation_default_center.png
new file mode 100644
index 0000000000..eee499e1f4
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_navigation_default_center.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_car_bearing_top.png b/OsmAnd/res/drawable-hdpi/map_navigation_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_car_bearing_top.png
rename to OsmAnd/res/drawable-hdpi/map_navigation_default_top.png
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_bottom.png b/OsmAnd/res/drawable-hdpi/map_navigation_nautical_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_nautical_bearing_bottom.png
rename to OsmAnd/res/drawable-hdpi/map_navigation_nautical_bottom.png
diff --git a/OsmAnd/res/drawable-hdpi/map_navigation_nautical_center.png b/OsmAnd/res/drawable-hdpi/map_navigation_nautical_center.png
new file mode 100644
index 0000000000..3b3ed315cd
Binary files /dev/null and b/OsmAnd/res/drawable-hdpi/map_navigation_nautical_center.png differ
diff --git a/OsmAnd/res/drawable-hdpi/map_nautical_bearing_top.png b/OsmAnd/res/drawable-hdpi/map_navigation_nautical_top.png
similarity index 100%
rename from OsmAnd/res/drawable-hdpi/map_nautical_bearing_top.png
rename to OsmAnd/res/drawable-hdpi/map_navigation_nautical_top.png
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing.png
deleted file mode 100644
index de606621f1..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 35dfdc4cbc..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location.png
deleted file mode 100644
index b7704ef9d7..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index cce0ef4dda..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index 5d3ec7b8c5..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_night.png
deleted file mode 100644
index b6a70a93ea..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index a97d40ba4f..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index 24175e4361..0000000000
Binary files a/OsmAnd/res/drawable-hdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_action_openstreetmap_logo.png b/OsmAnd/res/drawable-mdpi/map_action_openstreetmap_logo.png
new file mode 100644
index 0000000000..8283adb943
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_action_openstreetmap_logo.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_action_world_globe.png b/OsmAnd/res/drawable-mdpi/map_action_world_globe.png
new file mode 100644
index 0000000000..f12948b7a8
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_action_world_globe.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-mdpi/map_bicycle_bearing.png
deleted file mode 100644
index 62859e38e8..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index 1afc4fd220..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location.png
deleted file mode 100644
index f75b8d6c36..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_center.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_center.png
deleted file mode 100644
index ef8f08ae14..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost.png
deleted file mode 100644
index 6cc51190e7..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index aea1ded6a8..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_night.png
deleted file mode 100644
index 93701bbefd..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index 72bf3e9096..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_bearing.png b/OsmAnd/res/drawable-mdpi/map_car_bearing.png
deleted file mode 100644
index 1abb480e56..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_bearing_center.png b/OsmAnd/res/drawable-mdpi/map_car_bearing_center.png
deleted file mode 100644
index 26eaaa57db..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_car_bearing_night.png
deleted file mode 100644
index ee70f4dcda..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location.png b/OsmAnd/res/drawable-mdpi/map_car_location.png
deleted file mode 100644
index 90c9699bf3..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_center.png b/OsmAnd/res/drawable-mdpi/map_car_location_center.png
deleted file mode 100644
index 7dea360749..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_lost.png b/OsmAnd/res/drawable-mdpi/map_car_location_lost.png
deleted file mode 100644
index 683b71d211..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_car_location_lost_night.png
deleted file mode 100644
index 4bcae2b836..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_night.png b/OsmAnd/res/drawable-mdpi/map_car_location_night.png
deleted file mode 100644
index d0f0a6c887..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index 091e1c6a41..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location.png b/OsmAnd/res/drawable-mdpi/map_default_location.png
deleted file mode 100644
index 9c868ee438..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_center.png b/OsmAnd/res/drawable-mdpi/map_default_location_center.png
deleted file mode 100644
index 63066b1c98..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_lost.png b/OsmAnd/res/drawable-mdpi/map_default_location_lost.png
deleted file mode 100644
index 2282c4a44f..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_default_location_lost_night.png
deleted file mode 100644
index 9319b73dbd..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_night.png b/OsmAnd/res/drawable-mdpi/map_default_location_night.png
deleted file mode 100644
index cf722851ad..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index 6cb0d7799d..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_bottom.png b/OsmAnd/res/drawable-mdpi/map_location_bicycle_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_bicycle_location_bottom.png
rename to OsmAnd/res/drawable-mdpi/map_location_bicycle_bottom.png
diff --git a/OsmAnd/res/drawable-mdpi/map_location_bicycle_center.png b/OsmAnd/res/drawable-mdpi/map_location_bicycle_center.png
new file mode 100644
index 0000000000..57816a9e49
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_location_bicycle_center.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_top.png b/OsmAnd/res/drawable-mdpi/map_location_bicycle_top.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_bicycle_location_top.png
rename to OsmAnd/res/drawable-mdpi/map_location_bicycle_top.png
diff --git a/OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle.png b/OsmAnd/res/drawable-mdpi/map_location_bicycle_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_bicycle_location_view_angle.png
rename to OsmAnd/res/drawable-mdpi/map_location_bicycle_view_angle.png
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_bottom.png b/OsmAnd/res/drawable-mdpi/map_location_car_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_car_location_bottom.png
rename to OsmAnd/res/drawable-mdpi/map_location_car_bottom.png
diff --git a/OsmAnd/res/drawable-mdpi/map_location_car_center.png b/OsmAnd/res/drawable-mdpi/map_location_car_center.png
new file mode 100644
index 0000000000..ca9151546b
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_location_car_center.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_top.png b/OsmAnd/res/drawable-mdpi/map_location_car_top.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_car_location_top.png
rename to OsmAnd/res/drawable-mdpi/map_location_car_top.png
diff --git a/OsmAnd/res/drawable-mdpi/map_car_location_view_angle.png b/OsmAnd/res/drawable-mdpi/map_location_car_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_car_location_view_angle.png
rename to OsmAnd/res/drawable-mdpi/map_location_car_view_angle.png
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_bottom.png b/OsmAnd/res/drawable-mdpi/map_location_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_default_location_bottom.png
rename to OsmAnd/res/drawable-mdpi/map_location_default_bottom.png
diff --git a/OsmAnd/res/drawable-mdpi/map_location_default_center.png b/OsmAnd/res/drawable-mdpi/map_location_default_center.png
new file mode 100644
index 0000000000..54dbb300ad
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_location_default_center.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_top.png b/OsmAnd/res/drawable-mdpi/map_location_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_default_location_top.png
rename to OsmAnd/res/drawable-mdpi/map_location_default_top.png
diff --git a/OsmAnd/res/drawable-mdpi/map_default_location_view_angle.png b/OsmAnd/res/drawable-mdpi/map_location_default_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_default_location_view_angle.png
rename to OsmAnd/res/drawable-mdpi/map_location_default_view_angle.png
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-mdpi/map_nautical_bearing.png
deleted file mode 100644
index f5226ce658..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_center.png b/OsmAnd/res/drawable-mdpi/map_nautical_bearing_center.png
deleted file mode 100644
index 6e31e68016..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_nautical_bearing_night.png
deleted file mode 100644
index 1cac77b7c5..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location.png b/OsmAnd/res/drawable-mdpi/map_nautical_location.png
deleted file mode 100644
index ccf25980c1..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-mdpi/map_nautical_location_night.png
deleted file mode 100644
index 0ab169798e..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index ec345eb578..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index b51a6fcee2..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_navigation_car_bottom.png b/OsmAnd/res/drawable-mdpi/map_navigation_car_bottom.png
new file mode 100644
index 0000000000..1259b9a747
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_navigation_car_bottom.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_navigation_car_center.png b/OsmAnd/res/drawable-mdpi/map_navigation_car_center.png
new file mode 100644
index 0000000000..9c276f19ea
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_navigation_car_center.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_navigation_car_top.png b/OsmAnd/res/drawable-mdpi/map_navigation_car_top.png
new file mode 100644
index 0000000000..1f6f73b3ac
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_navigation_car_top.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_bearing_bottom.png b/OsmAnd/res/drawable-mdpi/map_navigation_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_car_bearing_bottom.png
rename to OsmAnd/res/drawable-mdpi/map_navigation_default_bottom.png
diff --git a/OsmAnd/res/drawable-mdpi/map_navigation_default_center.png b/OsmAnd/res/drawable-mdpi/map_navigation_default_center.png
new file mode 100644
index 0000000000..3c3b8dc658
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_navigation_default_center.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_car_bearing_top.png b/OsmAnd/res/drawable-mdpi/map_navigation_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_car_bearing_top.png
rename to OsmAnd/res/drawable-mdpi/map_navigation_default_top.png
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_bottom.png b/OsmAnd/res/drawable-mdpi/map_navigation_nautical_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_nautical_bearing_bottom.png
rename to OsmAnd/res/drawable-mdpi/map_navigation_nautical_bottom.png
diff --git a/OsmAnd/res/drawable-mdpi/map_navigation_nautical_center.png b/OsmAnd/res/drawable-mdpi/map_navigation_nautical_center.png
new file mode 100644
index 0000000000..7153af9cc4
Binary files /dev/null and b/OsmAnd/res/drawable-mdpi/map_navigation_nautical_center.png differ
diff --git a/OsmAnd/res/drawable-mdpi/map_nautical_bearing_top.png b/OsmAnd/res/drawable-mdpi/map_navigation_nautical_top.png
similarity index 100%
rename from OsmAnd/res/drawable-mdpi/map_nautical_bearing_top.png
rename to OsmAnd/res/drawable-mdpi/map_navigation_nautical_top.png
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing.png
deleted file mode 100644
index a98dfca003..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 871e03b2c3..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location.png
deleted file mode 100644
index 484250a849..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index 508891f25a..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index d49881be8a..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_night.png
deleted file mode 100644
index 3b6ce6b62e..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index 52017305cf..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index 033d44960b..0000000000
Binary files a/OsmAnd/res/drawable-mdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_action_openstreetmap_logo.png b/OsmAnd/res/drawable-xhdpi/map_action_openstreetmap_logo.png
new file mode 100644
index 0000000000..5556cf200f
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_action_openstreetmap_logo.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_action_world_globe.png b/OsmAnd/res/drawable-xhdpi/map_action_world_globe.png
new file mode 100644
index 0000000000..5b2b24f48a
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_action_world_globe.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing.png
deleted file mode 100644
index 4ae946f120..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index db4067d686..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location.png
deleted file mode 100644
index 5c7c7c69f5..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_center.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_center.png
deleted file mode 100644
index 09eceefe2a..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost.png
deleted file mode 100644
index fcaabf6ad0..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index bab8271450..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_night.png
deleted file mode 100644
index 2f1e763b2d..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index cc9d043ada..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_bearing.png b/OsmAnd/res/drawable-xhdpi/map_car_bearing.png
deleted file mode 100644
index ec0255883c..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_bearing_center.png b/OsmAnd/res/drawable-xhdpi/map_car_bearing_center.png
deleted file mode 100644
index 906ec0426d..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_car_bearing_night.png
deleted file mode 100644
index 5254993ee9..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location.png b/OsmAnd/res/drawable-xhdpi/map_car_location.png
deleted file mode 100644
index 7286a3b653..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_center.png b/OsmAnd/res/drawable-xhdpi/map_car_location_center.png
deleted file mode 100644
index a6e3ea1a9f..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_car_location_lost.png
deleted file mode 100644
index 3d8b63d148..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_car_location_lost_night.png
deleted file mode 100644
index 0ce19dc964..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_night.png b/OsmAnd/res/drawable-xhdpi/map_car_location_night.png
deleted file mode 100644
index cec82e2a7e..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index 65f4e655c9..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location.png b/OsmAnd/res/drawable-xhdpi/map_default_location.png
deleted file mode 100644
index e353ebff84..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_center.png b/OsmAnd/res/drawable-xhdpi/map_default_location_center.png
deleted file mode 100644
index 4367f4c64f..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_default_location_lost.png
deleted file mode 100644
index 224ab74273..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_default_location_lost_night.png
deleted file mode 100644
index b9db6a188c..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_night.png b/OsmAnd/res/drawable-xhdpi/map_default_location_night.png
deleted file mode 100644
index 4312481b95..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index 9ed2f18387..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_bottom.png b/OsmAnd/res/drawable-xhdpi/map_location_bicycle_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_bicycle_location_bottom.png
rename to OsmAnd/res/drawable-xhdpi/map_location_bicycle_bottom.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_location_bicycle_center.png b/OsmAnd/res/drawable-xhdpi/map_location_bicycle_center.png
new file mode 100644
index 0000000000..bfc3321bbd
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_location_bicycle_center.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_top.png b/OsmAnd/res/drawable-xhdpi/map_location_bicycle_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_bicycle_location_top.png
rename to OsmAnd/res/drawable-xhdpi/map_location_bicycle_top.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle.png b/OsmAnd/res/drawable-xhdpi/map_location_bicycle_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_bicycle_location_view_angle.png
rename to OsmAnd/res/drawable-xhdpi/map_location_bicycle_view_angle.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_bottom.png b/OsmAnd/res/drawable-xhdpi/map_location_car_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_car_location_bottom.png
rename to OsmAnd/res/drawable-xhdpi/map_location_car_bottom.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_location_car_center.png b/OsmAnd/res/drawable-xhdpi/map_location_car_center.png
new file mode 100644
index 0000000000..4202db3ab5
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_location_car_center.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_top.png b/OsmAnd/res/drawable-xhdpi/map_location_car_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_car_location_top.png
rename to OsmAnd/res/drawable-xhdpi/map_location_car_top.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_location_view_angle.png b/OsmAnd/res/drawable-xhdpi/map_location_car_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_car_location_view_angle.png
rename to OsmAnd/res/drawable-xhdpi/map_location_car_view_angle.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_bottom.png b/OsmAnd/res/drawable-xhdpi/map_location_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_default_location_bottom.png
rename to OsmAnd/res/drawable-xhdpi/map_location_default_bottom.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_location_default_center.png b/OsmAnd/res/drawable-xhdpi/map_location_default_center.png
new file mode 100644
index 0000000000..ea47d0986d
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_location_default_center.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_top.png b/OsmAnd/res/drawable-xhdpi/map_location_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_default_location_top.png
rename to OsmAnd/res/drawable-xhdpi/map_location_default_top.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_default_location_view_angle.png b/OsmAnd/res/drawable-xhdpi/map_location_default_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_default_location_view_angle.png
rename to OsmAnd/res/drawable-xhdpi/map_location_default_view_angle.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-xhdpi/map_nautical_bearing.png
deleted file mode 100644
index 84492536d2..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_center.png b/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_center.png
deleted file mode 100644
index ebcfa3dcec..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_night.png
deleted file mode 100644
index 4a5d566a9f..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location.png
deleted file mode 100644
index eb4ee41d99..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location_night.png
deleted file mode 100644
index 5925133490..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index db4d3d4a75..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index 908e52b411..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_navigation_car_bottom.png b/OsmAnd/res/drawable-xhdpi/map_navigation_car_bottom.png
new file mode 100644
index 0000000000..5622eea485
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_navigation_car_bottom.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_navigation_car_center.png b/OsmAnd/res/drawable-xhdpi/map_navigation_car_center.png
new file mode 100644
index 0000000000..58a76bb2fc
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_navigation_car_center.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_navigation_car_top.png b/OsmAnd/res/drawable-xhdpi/map_navigation_car_top.png
new file mode 100644
index 0000000000..9756f85b59
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_navigation_car_top.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_bearing_bottom.png b/OsmAnd/res/drawable-xhdpi/map_navigation_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_car_bearing_bottom.png
rename to OsmAnd/res/drawable-xhdpi/map_navigation_default_bottom.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_navigation_default_center.png b/OsmAnd/res/drawable-xhdpi/map_navigation_default_center.png
new file mode 100644
index 0000000000..87b2d06397
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_navigation_default_center.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_car_bearing_top.png b/OsmAnd/res/drawable-xhdpi/map_navigation_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_car_bearing_top.png
rename to OsmAnd/res/drawable-xhdpi/map_navigation_default_top.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_bottom.png b/OsmAnd/res/drawable-xhdpi/map_navigation_nautical_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_nautical_bearing_bottom.png
rename to OsmAnd/res/drawable-xhdpi/map_navigation_nautical_bottom.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_navigation_nautical_center.png b/OsmAnd/res/drawable-xhdpi/map_navigation_nautical_center.png
new file mode 100644
index 0000000000..b87c219533
Binary files /dev/null and b/OsmAnd/res/drawable-xhdpi/map_navigation_nautical_center.png differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_nautical_bearing_top.png b/OsmAnd/res/drawable-xhdpi/map_navigation_nautical_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xhdpi/map_nautical_bearing_top.png
rename to OsmAnd/res/drawable-xhdpi/map_navigation_nautical_top.png
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing.png
deleted file mode 100644
index 37b064a8b7..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 37fba19f8b..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location.png
deleted file mode 100644
index c2cdd3879d..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index dfd5c4c658..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index 0aef4663d1..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_night.png
deleted file mode 100644
index 3eba24a741..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index b448d1c0d6..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index e433ed7e0b..0000000000
Binary files a/OsmAnd/res/drawable-xhdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_action_openstreetmap_logo.png b/OsmAnd/res/drawable-xxhdpi/map_action_openstreetmap_logo.png
new file mode 100644
index 0000000000..11213d2703
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_action_openstreetmap_logo.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_action_world_globe.png b/OsmAnd/res/drawable-xxhdpi/map_action_world_globe.png
new file mode 100644
index 0000000000..3a8107e477
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_action_world_globe.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing.png
deleted file mode 100644
index a7d11cd28d..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing_night.png
deleted file mode 100644
index d20656fced..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location.png
deleted file mode 100644
index 292fb260c4..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_center.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_center.png
deleted file mode 100644
index 2f34bb4cf4..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost.png
deleted file mode 100644
index 35f3ecb1a4..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost_night.png
deleted file mode 100644
index 79b685dcc7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_night.png
deleted file mode 100644
index 7281c69a60..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle_night.png
deleted file mode 100644
index c3e2a1d2f7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_car_bearing.png
deleted file mode 100644
index c89f205923..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_center.png b/OsmAnd/res/drawable-xxhdpi/map_car_bearing_center.png
deleted file mode 100644
index 2e4bd781b7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_bearing_night.png
deleted file mode 100644
index 6a57c27d92..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location.png b/OsmAnd/res/drawable-xxhdpi/map_car_location.png
deleted file mode 100644
index 8b12c334f2..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_center.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_center.png
deleted file mode 100644
index 5c51d05a34..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_lost.png
deleted file mode 100644
index bfd71b27a2..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_lost_night.png
deleted file mode 100644
index 46a316ec88..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_night.png
deleted file mode 100644
index a7d730da0e..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle_night.png
deleted file mode 100644
index 3eb0592c29..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location.png b/OsmAnd/res/drawable-xxhdpi/map_default_location.png
deleted file mode 100644
index 13061d7682..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_center.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_center.png
deleted file mode 100644
index bb91309b8e..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_lost.png
deleted file mode 100644
index 5ad2db4c02..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_lost_night.png
deleted file mode 100644
index e396e0e66c..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_night.png
deleted file mode 100644
index 3473c7d99e..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle_night.png
deleted file mode 100644
index 165f484907..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_bottom.png b/OsmAnd/res/drawable-xxhdpi/map_location_bicycle_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_bicycle_location_bottom.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_bicycle_bottom.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_location_bicycle_center.png b/OsmAnd/res/drawable-xxhdpi/map_location_bicycle_center.png
new file mode 100644
index 0000000000..0713820cb4
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_location_bicycle_center.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_top.png b/OsmAnd/res/drawable-xxhdpi/map_location_bicycle_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_bicycle_location_top.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_bicycle_top.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle.png b/OsmAnd/res/drawable-xxhdpi/map_location_bicycle_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_bicycle_location_view_angle.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_bicycle_view_angle.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_bottom.png b/OsmAnd/res/drawable-xxhdpi/map_location_car_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_car_location_bottom.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_car_bottom.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_location_car_center.png b/OsmAnd/res/drawable-xxhdpi/map_location_car_center.png
new file mode 100644
index 0000000000..6f30e3a987
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_location_car_center.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_top.png b/OsmAnd/res/drawable-xxhdpi/map_location_car_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_car_location_top.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_car_top.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle.png b/OsmAnd/res/drawable-xxhdpi/map_location_car_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_car_location_view_angle.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_car_view_angle.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_bottom.png b/OsmAnd/res/drawable-xxhdpi/map_location_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_default_location_bottom.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_default_bottom.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_location_default_center.png b/OsmAnd/res/drawable-xxhdpi/map_location_default_center.png
new file mode 100644
index 0000000000..248c07554d
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_location_default_center.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_top.png b/OsmAnd/res/drawable-xxhdpi/map_location_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_default_location_top.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_default_top.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle.png b/OsmAnd/res/drawable-xxhdpi/map_location_default_view_angle.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_default_location_view_angle.png
rename to OsmAnd/res/drawable-xxhdpi/map_location_default_view_angle.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing.png
deleted file mode 100644
index 01533ae4f7..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_center.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_center.png
deleted file mode 100644
index 44c5ce44d8..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_night.png
deleted file mode 100644
index e6687ff69a..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location.png
deleted file mode 100644
index 4e19b38778..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location_night.png
deleted file mode 100644
index 8800e0c2b8..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle.png
deleted file mode 100644
index 28f4b540fe..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle_night.png
deleted file mode 100644
index c1b505218b..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_nautical_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_navigation_car_bottom.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_car_bottom.png
new file mode 100644
index 0000000000..9ee6711178
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_navigation_car_bottom.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_navigation_car_center.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_car_center.png
new file mode 100644
index 0000000000..41ebfab2c0
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_navigation_car_center.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_navigation_car_top.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_car_top.png
new file mode 100644
index 0000000000..2ac90c5519
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_navigation_car_top.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_bottom.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_car_bearing_bottom.png
rename to OsmAnd/res/drawable-xxhdpi/map_navigation_default_bottom.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_navigation_default_center.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_default_center.png
new file mode 100644
index 0000000000..00a5038623
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_navigation_default_center.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_car_bearing_top.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_car_bearing_top.png
rename to OsmAnd/res/drawable-xxhdpi/map_navigation_default_top.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_bottom.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_nautical_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_bottom.png
rename to OsmAnd/res/drawable-xxhdpi/map_navigation_nautical_bottom.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_navigation_nautical_center.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_nautical_center.png
new file mode 100644
index 0000000000..5a1ecfd8ab
Binary files /dev/null and b/OsmAnd/res/drawable-xxhdpi/map_navigation_nautical_center.png differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_top.png b/OsmAnd/res/drawable-xxhdpi/map_navigation_nautical_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxhdpi/map_nautical_bearing_top.png
rename to OsmAnd/res/drawable-xxhdpi/map_navigation_nautical_top.png
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing.png
deleted file mode 100644
index 812436c026..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing_night.png
deleted file mode 100644
index 9ec8b8e195..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_bearing_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location.png
deleted file mode 100644
index 702898ca17..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost.png
deleted file mode 100644
index 5724c476a9..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost_night.png
deleted file mode 100644
index 1a4dd14e4a..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_lost_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_night.png
deleted file mode 100644
index 9bab37fd86..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle.png
deleted file mode 100644
index 304d21fe3d..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle_night.png b/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle_night.png
deleted file mode 100644
index 615088cf0a..0000000000
Binary files a/OsmAnd/res/drawable-xxhdpi/map_pedestrian_location_view_angle_night.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_action_openstreetmap_logo.png b/OsmAnd/res/drawable-xxxhdpi/map_action_openstreetmap_logo.png
new file mode 100644
index 0000000000..a839fa92e6
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_action_openstreetmap_logo.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_action_world_globe.png b/OsmAnd/res/drawable-xxxhdpi/map_action_world_globe.png
new file mode 100644
index 0000000000..1f121a8240
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_action_world_globe.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_bicycle_location_center.png b/OsmAnd/res/drawable-xxxhdpi/map_bicycle_location_center.png
deleted file mode 100644
index 18cf1d50bd..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/map_bicycle_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_car_bearing_center.png b/OsmAnd/res/drawable-xxxhdpi/map_car_bearing_center.png
deleted file mode 100644
index be0332383f..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/map_car_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_car_location_center.png b/OsmAnd/res/drawable-xxxhdpi/map_car_location_center.png
deleted file mode 100644
index 70fe9f45a0..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/map_car_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_default_location_center.png b/OsmAnd/res/drawable-xxxhdpi/map_default_location_center.png
deleted file mode 100644
index 5f247463bc..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/map_default_location_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_bicycle_location_bottom.png b/OsmAnd/res/drawable-xxxhdpi/map_location_bicycle_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_bicycle_location_bottom.png
rename to OsmAnd/res/drawable-xxxhdpi/map_location_bicycle_bottom.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_location_bicycle_center.png b/OsmAnd/res/drawable-xxxhdpi/map_location_bicycle_center.png
new file mode 100644
index 0000000000..e7677b9c69
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_location_bicycle_center.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_bicycle_location_top.png b/OsmAnd/res/drawable-xxxhdpi/map_location_bicycle_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_bicycle_location_top.png
rename to OsmAnd/res/drawable-xxxhdpi/map_location_bicycle_top.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_car_location_bottom.png b/OsmAnd/res/drawable-xxxhdpi/map_location_car_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_car_location_bottom.png
rename to OsmAnd/res/drawable-xxxhdpi/map_location_car_bottom.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_location_car_center.png b/OsmAnd/res/drawable-xxxhdpi/map_location_car_center.png
new file mode 100644
index 0000000000..d723f1b709
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_location_car_center.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_car_location_top.png b/OsmAnd/res/drawable-xxxhdpi/map_location_car_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_car_location_top.png
rename to OsmAnd/res/drawable-xxxhdpi/map_location_car_top.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_default_location_bottom.png b/OsmAnd/res/drawable-xxxhdpi/map_location_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_default_location_bottom.png
rename to OsmAnd/res/drawable-xxxhdpi/map_location_default_bottom.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_location_default_center.png b/OsmAnd/res/drawable-xxxhdpi/map_location_default_center.png
new file mode 100644
index 0000000000..29f37937df
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_location_default_center.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_default_location_top.png b/OsmAnd/res/drawable-xxxhdpi/map_location_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_default_location_top.png
rename to OsmAnd/res/drawable-xxxhdpi/map_location_default_top.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_nautical_bearing_center.png b/OsmAnd/res/drawable-xxxhdpi/map_nautical_bearing_center.png
deleted file mode 100644
index 54fd3a255c..0000000000
Binary files a/OsmAnd/res/drawable-xxxhdpi/map_nautical_bearing_center.png and /dev/null differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_bottom.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_bottom.png
new file mode 100644
index 0000000000..7ed881ecc4
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_bottom.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_center.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_center.png
new file mode 100644
index 0000000000..99ebf524f0
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_center.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_top.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_top.png
new file mode 100644
index 0000000000..8587fc7ac3
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_navigation_car_top.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_car_bearing_bottom.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_default_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_car_bearing_bottom.png
rename to OsmAnd/res/drawable-xxxhdpi/map_navigation_default_bottom.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_navigation_default_center.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_default_center.png
new file mode 100644
index 0000000000..abd9a13037
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_navigation_default_center.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_car_bearing_top.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_default_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_car_bearing_top.png
rename to OsmAnd/res/drawable-xxxhdpi/map_navigation_default_top.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_nautical_bearing_bottom.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_nautical_bottom.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_nautical_bearing_bottom.png
rename to OsmAnd/res/drawable-xxxhdpi/map_navigation_nautical_bottom.png
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_navigation_nautical_center.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_nautical_center.png
new file mode 100644
index 0000000000..9e059e7a15
Binary files /dev/null and b/OsmAnd/res/drawable-xxxhdpi/map_navigation_nautical_center.png differ
diff --git a/OsmAnd/res/drawable-xxxhdpi/map_nautical_bearing_top.png b/OsmAnd/res/drawable-xxxhdpi/map_navigation_nautical_top.png
similarity index 100%
rename from OsmAnd/res/drawable-xxxhdpi/map_nautical_bearing_top.png
rename to OsmAnd/res/drawable-xxxhdpi/map_navigation_nautical_top.png
diff --git a/OsmAnd/res/drawable/bg_select_icon_button.xml b/OsmAnd/res/drawable/bg_select_icon_button.xml
new file mode 100644
index 0000000000..f037ae97e1
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_select_icon_button.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
diff --git a/OsmAnd/res/drawable/bg_select_icon_button_outline.xml b/OsmAnd/res/drawable/bg_select_icon_button_outline.xml
new file mode 100644
index 0000000000..b0af330779
--- /dev/null
+++ b/OsmAnd/res/drawable/bg_select_icon_button_outline.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_location_bicycle.xml b/OsmAnd/res/drawable/map_location_bicycle.xml
new file mode 100644
index 0000000000..69e37b2bed
--- /dev/null
+++ b/OsmAnd/res/drawable/map_location_bicycle.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_location_car.xml b/OsmAnd/res/drawable/map_location_car.xml
new file mode 100644
index 0000000000..6a0e7d9b38
--- /dev/null
+++ b/OsmAnd/res/drawable/map_location_car.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_location_default.xml b/OsmAnd/res/drawable/map_location_default.xml
new file mode 100644
index 0000000000..80a35ade43
--- /dev/null
+++ b/OsmAnd/res/drawable/map_location_default.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_navigation_car.xml b/OsmAnd/res/drawable/map_navigation_car.xml
new file mode 100644
index 0000000000..8b4e5f9635
--- /dev/null
+++ b/OsmAnd/res/drawable/map_navigation_car.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_navigation_default.xml b/OsmAnd/res/drawable/map_navigation_default.xml
new file mode 100644
index 0000000000..5e2ac3ffa5
--- /dev/null
+++ b/OsmAnd/res/drawable/map_navigation_default.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/drawable/map_navigation_nautical.xml b/OsmAnd/res/drawable/map_navigation_nautical.xml
new file mode 100644
index 0000000000..376ccc54c3
--- /dev/null
+++ b/OsmAnd/res/drawable/map_navigation_nautical.xml
@@ -0,0 +1,18 @@
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/global_preference_toolbar.xml b/OsmAnd/res/layout/global_preference_toolbar.xml
index 961d6c2a7e..6a5d37f661 100644
--- a/OsmAnd/res/layout/global_preference_toolbar.xml
+++ b/OsmAnd/res/layout/global_preference_toolbar.xml
@@ -23,16 +23,37 @@
android:contentDescription="@string/access_shared_string_navigate_up"
android:src="@drawable/ic_action_mode_back" />
-
+ android:paddingRight="@dimen/content_padding">
+
+
+
+
+
+
diff --git a/OsmAnd/res/layout/osm_login_data.xml b/OsmAnd/res/layout/osm_login_data.xml
new file mode 100644
index 0000000000..aca7353f6a
--- /dev/null
+++ b/OsmAnd/res/layout/osm_login_data.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/plan_route_info.xml b/OsmAnd/res/layout/plan_route_info.xml
index 37da3bafa0..6c62f16368 100644
--- a/OsmAnd/res/layout/plan_route_info.xml
+++ b/OsmAnd/res/layout/plan_route_info.xml
@@ -110,7 +110,7 @@
android:layout_marginEnd="@dimen/favorites_icon_right_margin"
android:layout_marginRight="@dimen/favorites_icon_right_margin"
android:layout_marginBottom="@dimen/list_header_text_left_margin"
- android:src="@drawable/map_default_location" />
+ android:src="@drawable/ic_action_location_color" />
+ android:src="@drawable/ic_action_location_color" />
+ android:src="@drawable/ic_action_location_color" />
+ android:padding="7dp">
+ android:layout_margin="4dp" />
\ No newline at end of file
diff --git a/OsmAnd/res/layout/preference_radio_button.xml b/OsmAnd/res/layout/preference_radio_button.xml
index f512a7b2ef..db80396b11 100644
--- a/OsmAnd/res/layout/preference_radio_button.xml
+++ b/OsmAnd/res/layout/preference_radio_button.xml
@@ -41,7 +41,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
- android:fadingEdge="horizontal"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
diff --git a/OsmAnd/res/layout/preference_select_icon_button.xml b/OsmAnd/res/layout/preference_select_icon_button.xml
new file mode 100644
index 0000000000..ac80040512
--- /dev/null
+++ b/OsmAnd/res/layout/preference_select_icon_button.xml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/layout/preference_switch_with_descr.xml b/OsmAnd/res/layout/preference_switch_with_descr.xml
index d87f77d2bc..5818638e11 100644
--- a/OsmAnd/res/layout/preference_switch_with_descr.xml
+++ b/OsmAnd/res/layout/preference_switch_with_descr.xml
@@ -38,7 +38,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
- android:fadingEdge="horizontal"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
diff --git a/OsmAnd/res/layout/preference_with_descr.xml b/OsmAnd/res/layout/preference_with_descr.xml
index f8ac00eb23..f9e01e34a9 100644
--- a/OsmAnd/res/layout/preference_with_descr.xml
+++ b/OsmAnd/res/layout/preference_with_descr.xml
@@ -48,7 +48,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
- android:fadingEdge="horizontal"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
diff --git a/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml b/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml
index 9ee9933fe4..9503b17288 100644
--- a/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml
+++ b/OsmAnd/res/layout/preference_with_descr_dialog_and_switch.xml
@@ -38,7 +38,7 @@
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
- android:singleLine="true"
+ android:maxLines="2"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
osmand:typeface="@string/font_roboto_regular" />
diff --git a/OsmAnd/res/layout/profile_edit_list_item.xml b/OsmAnd/res/layout/profile_edit_list_item.xml
index 180ebbad6f..51f763ee1a 100644
--- a/OsmAnd/res/layout/profile_edit_list_item.xml
+++ b/OsmAnd/res/layout/profile_edit_list_item.xml
@@ -53,7 +53,6 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
- android:fadingEdge="horizontal"
android:singleLine="true"
android:textColor="?android:textColorPrimary"
android:textSize="@dimen/default_list_text_size"
diff --git a/OsmAnd/res/values-ar/strings.xml b/OsmAnd/res/values-ar/strings.xml
index a55120758a..ec4075ff76 100644
--- a/OsmAnd/res/values-ar/strings.xml
+++ b/OsmAnd/res/values-ar/strings.xml
@@ -3149,7 +3149,6 @@
غير محدد
صعوبة الطريق
يرجى مشاركة ملاحظاتك وتقييم أعمالنا على Google Play.
- موافق
خدمة تحميل أوسماند
أرجواني
أيقونة
@@ -3198,7 +3197,7 @@
%1$d الملفات (%2$s) موجودة بالموقع السابق \'%3$s\'.
نقل الخرائط
عدم النقل
- المسار على الأقدام حوالي٪1$s ، وقد يكون أسرع من وسائل النقل العام
+ المسار على الأقدام حوالي%1$s ، وقد يكون أسرع من وسائل النقل العام
لسوء الحظ ، لم يستطع أوسماند العثور علي مسار مناسب للإعدادات الخاصة بك.
حاول التنقل مشيا على الأقدام.
حاول تغيير الإعدادات.
@@ -3215,7 +3214,7 @@
حدد البيانات التي تسمح لأوسماند بمشاركتها.
يساعدنا في فهم أي الخرائط من المناطق والبلدان الأكثر شعبية.
يساعدنا في فهم ميزات أوسماند الأكثر شيوعا.
- انقر فوق \"السماح\" إذا كنت توافق على٪1$s
+ انقر فوق \"السماح\" إذا كنت توافق على%1$s
الخصوصية والأمان
اختر البيانات للمشاركة
لا ، شكراً
@@ -3312,7 +3311,7 @@
ثم %1$s
%1$s • وفر %2$s
تطبيق فقط على \"%1$s\"
- إعدادات التوجيه في ملف التعريف المحدد \"٪1$s\".
+ إعدادات التوجيه في ملف التعريف المحدد \"%1$s\".
حد العرض
حدد الحد المسموح به لعرض السيارة على الطرق.
محاكاة موقعك باستخدام مسار GPX مسجل.
diff --git a/OsmAnd/res/values-be/strings.xml b/OsmAnd/res/values-be/strings.xml
index c858ec64e4..78a571fc23 100644
--- a/OsmAnd/res/values-be/strings.xml
+++ b/OsmAnd/res/values-be/strings.xml
@@ -97,14 +97,14 @@
Вэб-сайт
Тэлефон
Запіс падарожжа
- Налады запісу вашых падарожжаў.
+ Наладзьце запіс вашых паездак.
Паказвае налады ўключэння фонавага адсочвання і навігацыі праз перыядычнае абуджэнне GPS прылады (з выключаным экранам).
Усталёўка версіі
Абраць выгляд дадатку.
Выгляд
Налады адмысловых магчымасцяў
Абраць адрас
- Абярыце ўлюбёнае
+ Абярыце ўлюбёную мясціну
Мадыфікацыі OSM
Слой рэльефу мясцовасці
Інфармацыя GPS
@@ -117,7 +117,7 @@
няма
OpenMaps Еўропа
Пласт з рэльефам мясцовасці
- Ізалініі вышынь
+ Контурныя лініі
Аўдыё/відэа даныя
Сапраўды спыніць навігацыю?
Сапраўды выдаліць пункт прызначэння (і прамежкавыя пункты)\?
@@ -131,7 +131,7 @@
Убудова Dropbox
Змяніць парадак
Калі ласка, падумайце пра набыццё ўбудовы «Contour lines» для падтрымкі далейшай распрацоўкі.
- Убудова Ізалініі вышынь
+ Убудова контурных ліній
Выбар па запыце
Запіс відэа
Запіс аўдыё
@@ -168,11 +168,11 @@
Убудова для стварэння аўдыё/відэа нататак падчас падарожжаў, з дапамогай кнопкі на мапе альбо праз кантэкстнае меню на любым месцы на мапе.
Аўдыё/відэа нататкі
частак
- Ізалініі вышынь
+ Контурныя лініі
Контурныя лініі
Іншыя мапы
Толькі дарогі
- Ізалініі вышынь
+ Контурныя лініі
Стандартныя мапы
Мапа толькі дарог
Межы
@@ -238,85 +238,85 @@
OsmAnd Мапы і навігацыя
Глабальная мабільная мапа і навігатар для аўтаномных і сеціўных мапаў OSM
OsmAnd (OSM Automated Navigation Directions)
-\n
-\n
+\n
+\n
\nOsmAnd — навігацыйны дадатак з адкрытым кодам з доступам да разнастайных даных ад OpenStreetMap (OSM). Усе даныя (вектарныя і растравыя) можна захаваць на картцы памяці для аўтаномнага выкарыстання. Таксама падтрымліваецца аўтаномная і сеціўная маршрутызацыя, уключаючы пакрокавае галасавое суправаджэнне.
-\n
-\n
-\n
+\n
+\n
+\n
\nНекалькі асноўных магчымасцяў:
-\n
+\n
\n - паўнавартасная праца без інтэрнэт-злучэння (захоўвае вектарныя або растравыя даныя ў памяці прылады);
-\n
+\n
\n - кампактная вектарная мапа ўсяго свету;
-\n
+\n
\n - спампоўванне мапаў краін або рэгіёну непасрэдна ў дадатку;
-\n
-\n - магчымасць адлюстравання звестак на мапе, напрыклад пласт для пракладкі маршруту або пласт з запісам GPX-следу, з POI, улюбёнымі, ізалініямі вышынь, грамадскім транспартам, дадатковымі мапамі з магчымасцю налады ўзроўню празрыстасці;
-\n
+\n
+\n - магчымасць адлюстравання звестак на мапе, напрыклад пласт для пракладкі маршруту або пласт з запісам GPX-следу, з POI, улюбёнымі мясцінамі, ізалініямі вышынь, грамадскім транспартам, дадатковымі мапамі з магчымасцю налады ўзроўню празрыстасці;
+\n
\n - аўтаномны пошук адрасоў і POI;
-\n
+\n
\n - пракладка маршрутаў па-за сецівам на кароткія адлегласці (эксперыментальная функцыя);
-\n
+\n
\n - рэжымы для пешаходнай, аўтамабільнай і роваравай навігацыі з:
-\n
+\n
\n - магчымасцю аўтаматычнага пераключэння дзённага/начнога адлюстравання;
-\n
+\n
\n - аўтамаштабаваннем мапы ў адпаведнасці з хуткасцю руху;
-\n
+\n
\n - магчымасцю арыентацыі мапы па компасе або кірунку руху,
-\n
+\n
\n - паказам руху па палосах і абмежаванняў хуткасці, запісанае і сінтэзуемае галасавое суправаджэнне.
-\n
-\n
+\n
+\n
\nАбмежаванні бясплатнай версіі:
-\n
+\n
\n - колькасць спамповак мапаў абмежаваная;
-\n
+\n
\n - адсутнічае пазасеціўны доступ да інфармацыі з Вікіпедыі для POI.
-\n
-\n
+\n
+\n
\nOsmAnd актыўна развіваецца, яго далейшае развіццё забяспечваецца фінансавымі паступленнямі ад яго карыстальнікаў, за кошт якіх адбываецца далейшая распрацоўка і тэставанне новых функцый. Калі ласка, разгледзьце магчымасць набыцця OsmAnd+ або падтрымайце распрацоўку пэўных функцый, або зрабіце дабрачынны ўнёсак на https://osmand.net.
OsmAnd+ Мапы і навігацыя
Глабальная мабільная мапа і навігатар для аўтаномных і сеціўных мапаў OSM
OsmAnd+ (OSM Automated Navigation Directions)
-\n
-\n
-\n
+\n
+\n
+\n
\n OsmAnd+ — навігацыйны дадатак з адкрытым кодам з доступам да разнастайных даных ад OpenStreetMap (OSM). Усе даныя (вектарныя і растравыя) можна захаваць на картцы памяці для далейшага аўтаномнага выкарыстання. Таксама падтрымліваецца аўтаномная і сеціўная маршрутызацыя, уключаючы пакрокавае галасавое суправаджэнне.
-\n
-\n
-\n
+\n
+\n
+\n
\n OsmAnd+ — гэта платная версія, купляючы якую вы падтрымліваеце праект, фінансуеце распрацоўку новых функцый, і атрымліваеце апошнія абнаўленні.
-\n
-\n
-\n
+\n
+\n
+\n
\n Некалькі асноўных магчымасцяў:
-\n
+\n
\n - поўнасцю аўтаномная праца (захаванне вектарных або растравых мапаў у памяці прылады);
-\n
+\n
\n - кампактная вектарная мапа для ўсяго cвету;
-\n
+\n
\n - неабмежаваная колькасць спампоўванняў мапаў асобнай краіны або рэгіёну непасрэдна ў дадатку;
-\n
+\n
\n - магчымасць аўтаномнай працы з данымі Вікіпедыі (спампоўванне POI з Вікіпедыі) з\'яўляецца цудоўным інструментам для падарожнікаў;
-\n
+\n
\n - магчымасць адлюстравання звестак на мапе, напрыклад пласт для пракладкі маршруту або пласт з запісам GPX-следу, з POI, улюбёнымі, ізалініямі вышынь, грамадскім транспартам, дадатковымі мапамі з магчымасцю налады ўзроўню празрыстасці;
-\n
-\n
-\n
+\n
+\n
+\n
\n - аўтаномны пошук адрасоў і POI;
-\n
+\n
\n - аўтаномная пракладка маршрутаў для сярэдніх адлегласцяў;
-\n
+\n
\n - рэжымы для пешаходнай, аўтамабільнай і роварнай навігацыі з:
-\n
+\n
\n - пераключэннем паміж дзённым і начным рэжымамі;
-\n
+\n
\n - маштабаваннем мапы ў адпаведнасці з хуткасцю руху;
-\n
+\n
\n - арыентацыяй мапы па компасе або кірунку руху;
-\n
+\n
\n - паказ палос руху і абмежаванняў хуткасці, галасавое суправаджэнне
\n
Стварыць фільтр POI
@@ -409,7 +409,7 @@
Рэжым візуалізацыі
Аптымізаваць мапу для
Мінімальны ўзровень маштабу з адлюстраваннем ізаліній вышынь:
- Паказваць ізалініі вышынь
+ Паказваць контурныя лініі
Адлюстроўваць больш дэталяў на мапе.
Паказаць больш дэталяў мапы
Даныя маршрутызацыі
@@ -418,7 +418,7 @@
Пошук па адрасе
Каардынаты
Пошук грамадскага транспарту
- Спосаб пошуку ўлюбёных
+ Спосаб пошуку ва ўлюбёных мясцінах
Аўтаномная навігацыя OsmAnd часова недаступная.
Левабаковы рух
Для краін, дзе людзі ездзяць па леваму боку дарогі.
@@ -437,11 +437,11 @@
Выкарвстоўваць сеціўныя мапы (cпампаваць і захоўваць фрагменты на картцы памяці).
Сеціўныя мапы
Наладзіць крыніцы сеціўных або кэшаваных растравых мапаў.
- З дапамогай гэтай убудовы вы можаце атрымаць доступ да мноства тыпаў сеціўных мапаў (тайлавых альбо растравых), ад папярэдне створаных фрагментаў OpenStreetMap (Mapnik) да спадарожнікавых здымкаў і пластоў адмысловага прызначэння, такіх як мапы надвор\'я, кліматычныя мапы, геалагічныя мапы, пласты зацямнення вышынь і г.д.
+ Пры дапамозе гэтай убудовы вы можаце атрымаць доступ да мноства тыпаў сеціўных мапаў (тайлавых альбо растравых), ад папярэдне вызначаных фрагментаў OpenStreetMap (Mapnik) да спадарожнікавых здымкаў і пластоў адмысловага прызначэння, такіх як мапы надвор\'я, кліматычныя мапы, геалагічныя мапы, пласты зацямнення вышынь і г.д.
\n
-\nЛюбая з гэтых мапаў можа быць выкарыстана ў якасці асноўнай (базавай) мапы для адлюстравання на экране OsmAnd або ў выглядзе накладкі / падкладкі да іншай базавай мапы (стандартнай аўтаномнай мапы OsmAnd). Для таго каб зрабіць любую падкладку больш бачнай, некаторыя элементы вектарнай мапы OsmAnd могуць быць па жаданні лёгка схаваныя праз меню «Налады мапы».
+\nЛюбую з гэтых мапаў можна выкарыстаць у якасці асноўнай (базавай) мапы для адлюстравання на экране OsmAnd або ў выглядзе накладкі / падкладкі да іншай базавай мапы (стандартнай аўтаномнай мапы OsmAnd). Для таго, каб зрабіць любую падкладку больш бачнай, некаторыя элементы вектарнай мапы OsmAnd можна лёгка схаваць праз меню \"Наладзіць мапу\".
\n
-\nТайлавыя мапы могуць быць атрыманыя непасрэдна з дапамогай сеціўных крыніц або могуць быць падрыхтаваныя для выкарыстання ў аўтаномным рэжыме (і ўласнаручна скапіяваныя ў каталог даных OsmAnd) як база даных SQLite, якую можна атрымаць з дапамогай розных інструментаў падрыхтоўкі мапаў іншых вытворцаў.
+\nТайлавыя мапы можна атрымаць непасрэдна з сеціўных крыніц або можна падрыхтаваць для выкарыстання ў аўтаномным рэжыме (і ўласнаручна скапіяваць у каталог даных OsmAnd) як базу даных SQLite, якую можна атрымаць пры дапамозе розных інструментаў падрыхтоўкі мапаў іншых вытворцаў.
Убудова дадае падтрымку дадатковых магчымасцяў непасрэдна ў OsmAnd. Гэта палягчае, напрыклад, рэгуляванне хуткасці вымаўлення для голасу TTS, наладку накіраванасці экрана навігацыі, кіраванне маштабам пры дапамозе трэкбола або выкарыстанне галасавых загадаў зваротнай сувязі для аўтаматычнага агалошвання вашага месцазнаходжання.
Убудова адлюстроўвае параметры для распрацоўкі і адладкі функцый, такіх як, праверка або мадэляванне маршруту, адлюстраванне прадукцыйнасці адмалёўкі, праверка галасавых падказак. Гэта налады для распрацоўшчыкаў і не патрэбныя звычайнаму карыстальніку.
Убудовы
@@ -552,7 +552,7 @@
Галасавыя падказкі (TTS, пажадана)
Вікіпедыя (пазасеціўная)
Вызначанае карыстальнікам
- Файл з экспартаванымі ўлюбёнымі ўжо існуе. Замяніць яго\?
+ Файл з экспартаванымі ўлюбёнымі мясцінамі ўжо існуе. Замяніць яго\?
Налады профілю
Навігацыя
Вызначыць параметры навігацыі.
@@ -602,7 +602,7 @@
Вызначэнне становішча…
Маё становішча (знойдзена)
Адрас…
- Улюбёныя…
+ Улюбёныя мясціны…
Нявызначана
Цяперашні цэнтр мапы
Пачатак:
@@ -615,7 +615,7 @@
Адправіць у OSM
Паказаць больш дэталяў мапы
Паказаць некаторыя дэталі вектарнай мапы (дарогі і іншыя) на меншым маштабе.
- Улюбёныя пункты выдаленыя.
+ Улюбёныя мясціны выдаленыя.
Вы збіраецеся выдаліць %1$d улюбёных і %2$d груп улюбёных. Вы ўпэўненыя\?
Дом
Сябры
@@ -750,7 +750,7 @@
\nНавігацыя часова пераключаецца на сэрвіс CloudMade.
Вызначаны каталог не знойдзены.
Каталог захоўвання даных
- Усе аўтаномныя даныя ў старой усталяванай праграме будуць падтрымлівацца новай, але ўлюбёныя пункты патрэбна экспартаваць са старой версіі і імпартаваць у новую.
+ Усе аўтаномныя даныя ў старым усталяваным дадатку будуць падтрымлівацца новым, але ўлюбёныя мясціны патрэбна экспартаваць са старой версіі і імпартаваць у новую.
Зборка {0} ўсталяваная ({1}).
Спампоўваецца зборка…
Усталяваць OsmAnd - {0} з {1} {2} МБ?
@@ -807,10 +807,10 @@
Абраць выроўніванне мапы.
Арыентацыя мапы
Падрабязнасці маршруту
- Улюбёныя імпартаваныя
- GPX-файл з улюбёнымі не знойдзены ў {0}
- Улюбёныя захаваныя ў {0}
- Улюбёныя месцы для захавання адсутнічаюць
+ Улюбёныя мясціны паспяхова імпартаваныя
+ GPX-файл з улюбёнымі мясцінамі не знойдзены ў {0}
+ Улюбёныя мясціны захаваныя ў {0}
+ Улюбёныя мясціны для захавання адсутнічаюць
Не атрымалася загрузіць GPX
Даслаць справаздачу
На картцы памяці не атрымалася знайсці спампаваных мапаў.
@@ -925,7 +925,7 @@
Спампоўваецца спіс даступных рэгіёнаў…
Не ўдалося атрымаць спіс рэгіёнаў з https://osmand.net.
Улюбёны пункт быў зменены
- Улюбёныя месцы адсутнічаюць
+ Улюбёныя мясціны адсутнічаюць
Замяніць
Паказаць маршрут
Запуск суправаджэння
@@ -1023,13 +1023,13 @@
Скрыжаванне
Абнавіць мапу
Стварыць POI
- Увядзіце назву ўлюбёнага
+ Увядзіце назву ўлюбёнай мясціны
Улюбёнае
- Улюбёны пункт «{0}» дададзены.
- Рэдагаваць улюбёнае
- Выдаліць улюбёнае
- Выдаліць улюбёны пункт «%s»\?
- Улюбёны пункт {0} выдалены.
+ Улюбёная мясціна \"{0}\" паспяхова дададзеная.
+ Рэдагаваць мясціну
+ Выдаліць мясціну
+ Выдаліць улюбёную мясціну \"%s\"\?
+ Улюбёная мясціна {0} выдаленая.
Пароль OSM (неабавязковы)
Паведамленне
Імя аўтара
@@ -1118,13 +1118,13 @@
Выкарыстаць паказаны след для навігацыі?
Маршрутная інфармацыя
Аддаваць перавагу аўтамагістралям
- Пазбягаць платных дарог
+ Без платных дарог
Пазбягаць платных дарог
- Пазбягаць грунтовых дарог
- Пазбягаць грунтовых дарог.
- Пазбягаць паромных перапраў
- Пазбягаць перапраў
- Пазбягаць аўтамагістраляў
+ Без грунтавых дарог
+ Пазбягаць грунтавых дарог
+ Без паромных перапраў
+ Пазбягаць паромных перапраў
+ Без аўтамагістраляў
Пазбягаць аўтамагістраляў
Абмежаванне вагі
Пазначыць дазволеную вагу аўтамабіля на маршрутах.
@@ -1132,7 +1132,7 @@
Капіяванне даных OsmAnd у новае месца (%s)…
Капіяванне даных OsmAnd…
Грузавік
- Задайце хуткасць вымаўлення для TTS.
+ Задайце хуткасць вымаўлення для text-to-speech.
Хуткасць вымаўлення
Адключыць складаную маршрутызацыю
Адмалёўка мапы
@@ -1150,7 +1150,7 @@
Навігацыйныя знакі ўсяго свету
Плацяжы Bitcoin ўсяго свету
Дадаць наступным пунктам прызначэння
- Абраць месца прызначэння
+ Вызначыць пункт прызначэння
Налады маршруту
Пазасеціўны разлік маршруту ў OsmAnd
Налады навігацыі
@@ -1182,18 +1182,20 @@
Паўтараць навігацыйныя інструкцыі праз рэгулярныя прамежкі часу.
Паўтараць навігацыйныя інструкцыі
Абвяшчэнне прыбыцця
- Гэтая ўбудова паказвае як ізалініі вышынь, так і рэльеф на стандартных мапах OsmAnd. Гэтыя магчымасці спатрэбяцца спартоўцам, турыстам, падарожнікам і ўсім, хто цікавіцца структурай рэльефу мясцовасці.
+ Гэтая ўбудова паказвае як контурныя лініі, так і рэльеф на стандартных мапах OsmAnd. Гэтыя магчымасці спатрэбяцца спартоўцам, турыстам, падарожнікам і ўсім, хто цікавіцца структурай рэльефу мясцовасці.
\n
\nГлабальныя даныя (паміж 70 ° на поўначы і 70 ° на поўдні) грунтуюцца на вымярэннях SRTM (Shuttle Radar Topography Mission) і ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), даных інструменту візуалізацыі Terra, флагманскага спадарожніка сістэмы назірання Зямлі ад NASA. ASTER — гэта вынік сумеснай працы NASA, міністэрства эканомікі Японіі, міністэрства гандлю і прамысловасці Японіі (METI), агенцтва касмічных сістэм Японіі (J-spacesystems).
- "Гэтая ўбудова паказвае як ізалініі вышынь, так і рэльеф на стандартных мапах OsmAnd. Гэта, магчыма, спатрэбіцца спартоўцам, турыстам, падарожнікам і ўсім, хто цікавіцца структурай рэльефу мясцовасці. (Звярніце ўвагу, што даныя вышынь і рэльефу асобныя, дадаткова даступныя да спампоўвання, пасля актывацыі ўбудовы.)
+ Гэтая ўбудова паказвае як контурныя лініі, так і рэльеф на стандартных мапах OsmAnd. Гэта, магчыма, спатрэбіцца спартоўцам, турыстам, падарожнікам і ўсім, хто цікавіцца структурай рэльефу мясцовасці. (Звярніце ўвагу, што даныя вышынь і рэльефу асобныя, дадаткова даступныя да спампоўвання, пасля актывацыі ўбудовы.)
+\n
\n
-\nГлабальныя даныя (паміж 70 ° на поўначы і 70 ° на поўдні) грунтуюцца на вымярэннях SRTM (Shuttle Radar Topography Mission) і ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), даных інструмента візуалізацыі Terra, флагманскага спадарожніка сістэмы назірання Зямлі ад NASA. ASTER — гэта вынік сумеснай працы NASA, міністэрства эканомікі Японіі, міністэрства гандлю і прамысловасці Японіі (METI), агенцтва касмічных сістэм Японіі (J-spacesystems)."
+\n
+\nГлабальныя даныя (паміж 70 ° на поўначы і 70 ° на поўдні) грунтуюцца на вымярэннях SRTM (Shuttle Radar Topography Mission) і ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer), даных інструмента візуалізацыі Terra, флагманскага спадарожніка сістэмы назірання Зямлі ад NASA. ASTER — гэта вынік сумеснай працы NASA, міністэрства эканомікі Японіі, міністэрства гандлю і прамысловасці Японіі (METI), агенцтва касмічных сістэм Японіі (J-spacesystems).
Як хутка вы хочаце чуць паведамленне аб прыбыцці?
Улюбёныя мясціны, якімі падзяліліся праз OsmAnd
Разлічыць маршрут паміж пунктамі
дзён
Злучэнне
- Захаваць даныя як GPX-файл альбо імпартаваць пункты ва ўлюбёныя\?
+ Захаваць даныя як GPX-файл альбо імпартаваць пункты ва ўлюбёныя мясціны\?
Ружовы
Карычневы
Выбар колеру
@@ -1226,15 +1228,15 @@
\nДоўга ўтрымлівайце, каб убачыць на мапе"
Аўтаматычна пачаць навігацыю
Перапад вышынь: %1$s
- Захаваць як групу ўлюбёных
- Абярыце прызначэнне
+ Захаваць як групу ўлюбёных мясцін
+ Вызначыць пункты прызначэння
Назвы POI-накладкі
Паказваць кнопкі маштабавання
Паказваць кнопкі маштабавання падчас навігацыі.
Сартаваць паводле адлегласці
Сартаваць паводле назвы
- GPX-файлаў не абрана. Абраць працяжным націскам.
- Абраць для паказу
+ Абярыце GPX-файл працяжным націскам.
+ Абярыце след
Спамповак не знойдзена. Калі ласка, праверце вашае злучэнне з Інтэрнэтам.
Будынкі
Не аўтамабільныя дарогі
@@ -1291,11 +1293,11 @@
Прагляд мапы
Аўтамабіль
Ровар
- Пешаход
+ Пешшу
Спампаваць мапы, што адсутнічаюць, %1$s (%2$d МБ)\?
Пункты шляху
Дарожныя папярэджанні
- Улюбёныя месцы паблізу
+ Улюбёныя мясціны паблізу
Навакольныя POI
Усе
Паездкі
@@ -1324,10 +1326,10 @@
Памер тэксту
Дапушчальнае значэнне перавышэння хуткасці
Абярыце дапушчальнае значэнне перавышэння хуткасці, пры якім вы атрымаеце галасавое паведамленне.
- Назва ўлюбёнага месца была змененая на \"%1$s\" для магчымасці захавання радка з эматыконам ў файл.
+ Назва ўлюбёнай мясціны была змененая на \"%1$s\" для магчымасці захавання радка з эматыконам ў файл.
Паказаць маршрут
- Дубляванне назвы ўлюбёнага месца
- Назва ўлюбёнага месца была змененая на \"%1$s\", каб пазбегнуць паўтарэння.
+ Дубляванне назвы ўлюбёнай мясціны
+ Назва ўлюбёнай мясціны была змененая на \"%1$s\", каб пазбегнуць паўтарэння.
Націсніце на любы элемент спіса для прагляду больш падрабязнай інфармацыі, доўга ўтрымлівайце, каб змясціць у архіў ці выдаліць. Дзейныя даныя прылады (%1$s вольна):
Ананімны карыстальнік
Вы ўвайшлі як %1$s
@@ -1479,7 +1481,7 @@
Запомніць выбар
Абнавіць
Спампаваць
- Спампоўваецца…
+ Спампоўванне…
Спампаваная
Памылка ўводу/вываду
Нечаканая памылка
@@ -1490,9 +1492,9 @@
Паказаць усе
Паказаць на мапе
Мапа
- Улюбёнае
- Улюбёныя
- Дадаць ва «Улюбёныя»
+ Улюбёныя мясціны
+ Улюбёныя мясціны
+ Дадаць ва ўлюбёныя мясціны
Мае мясціны
Аўдыё
Відэа
@@ -1526,7 +1528,7 @@
Змяніць назву не атрымалася.
д. таму абнаўлялі
Дата выпуску
- Улюбёныя
+ Улюбёныя мясціны
Ачысціць гісторыю\?
Задайце час затрымкі на экране планавання маршруту.
Пачаць пакрокавае суправаджэнне праз…
@@ -1710,8 +1712,8 @@
%1$s спамповак засталося
Вікіпедыя
Дарогі
- Звесткі пра ўлюбёнае
- Дадаць улюбёнае
+ Звесткі пра ўлюбёную мясціну
+ Дадаць ва улюбёныя
Запіс падарожжа
Навігацыя
Працуе ў фоне
@@ -1731,7 +1733,7 @@
хв/м
хв/км
м/с
- Ізалініі вышынь выключаныя
+ Контурныя лініі выключаныя
Спампоўваецца - %1$d файл
Паказваць банер бясплатнай версіі нават у платнай версіі.
Паказваць банэр бясплатнай версіі
@@ -1829,9 +1831,9 @@
Доступ з мапы
Выдаліць пункт шляху GPX\?
Рэдагаваць пункт шляху GPX
- Пазбягаць лесвіц
+ Без лесвіц
Пазбягаць лесвіц
- Пазбягаць перасячэння меж
+ Без перасячэння меж
Выкарыстоўваць панэль кіравання
Панэль кіравання ці меню
Калі ласка, ўвядзіце правільны тып POI або мініце яго.
@@ -2041,7 +2043,7 @@
Пачаць
Паліўна-ашчадны маршрут
Разлічвае паліва-ашчадны маршрут (звычайна найкарацейшы).
- Вы сапраўды хочаце замяніць улюбёнае %1$s\?
+ Вы сапраўды хочаце замяніць улюбёную мясціну %1$s\?
Абнавіць усе мапы зараз?
Ачысціць кэш сеціўных мапаў
Не правяраць новыя версій і зніжкі ад OsmAnd.
@@ -2151,14 +2153,14 @@
Дадаць пункт да следу
Дадаць дзеянне
Рэдагаваць дзеянне
- Дадаць улюбёнае
+ Дадаць ва ўлюбёныя
Дадаць дзеянне
Выдаліць дзеянне
Сапраўды выдаліць дзеянне \"%s\"\?
Месца
- Паказаць/схаваць улюбёныя
- Паказаць улюбёныя\'
- Схаваць улюбёныя
+ Паказаць/схаваць улюбёныя мясціны
+ Паказаць улюбёныя мясціны
+ Схаваць улюбёныя мясціны
Паказаць/схаваць POI
Паказаць %1$s
Схаваць %1$s
@@ -2334,7 +2336,7 @@
Схаваць OSM-нататкі
Пераключальнік адлюстравання OSM-нататак на мапе.
Адсартавана па адлегласці
- Пошук ва ўлюбёных
+ Пошук ва ўлюбёных мясцінах
Убудова
Набудзьце і ўсталюйце ўбудову \"Контурныя лініі\" для адлюстравання градыентаў вертыкальных абласцей.
Каляровая схема
@@ -2355,9 +2357,10 @@
\n• Адаптуе мапу ў напрамку вашага руху (ці компаса)
\n• Паказвае, дзе вы знаходзіцеся і куды вы глядзіце
\n• Дзяліцеся сваім месцазнаходжаннем, каб сябры змаглі знайсці вас
-\n• Захоўвае вашы самыя важныя месцы ва «Ўлюбёных»
+\n• Захоўвае вашы самыя важныя месцы ва ўлюбёных мясцінах
\n• Дазваляе вам абраць як адлюстроўваць назвы на мапе: на англійскай мове, мясцовай мове, ці фанетычным напісаннем
-\n• Адлюстроўвае адмысловыя сеціўныя тайлы, спадарожнікавыя здымкі (з Bing), розныя адзнакі, як турыстычныя/навігацыйныя GPX-сляды і дадатковыя пласты з наладжваемай празрыстасцю
+\n• Адлюстроўвае адмысловыя сеціўныя тайлы, спадарожнікавыя здымкі (з Bing), розныя адзнакі, як турыстычныя/навігацыйныя GPX-сляды і дадатковыя пласты з наладжваемай празрыстасцю
+\n
Язда на ровары
\n • Вы можаце знайсці роварныя шляхі на мапе
\n • GPS-навігацыя ў роварным рэжыме будуе маршрут выкарыстоўваючы роварныя шляхі
@@ -2527,7 +2530,7 @@
Дадаць лінію
Дадаць GPX-файлы
Імпартаваць GPX-файлы ці запісаныя сляды.
- Дадаць улюбёныя
+ Дадаць улюбёныя мясціны
Імпартаваць улюбёныя ці дадаць з адзнак на мапе.
Імпартаваць GPX-файл
Файл %1$s не змяшчае пункты шляху, імпартаваць як след\?
@@ -2598,7 +2601,7 @@
Назад
Праглядзець
Пункты шляху дададзеныя ў адзнакі мапы
- могуць быць імпартаваныя як «Улюбёныя» ці як GPX-файл.
+ могуць быць імпартаваныя як улюбёныя мясціны ці як GPX-файл.
Імпартаваць як GPX-файл
Імпартаваць як улюбёныя
Імпартаваць файл
@@ -2612,15 +2615,15 @@
Змяніць назву адзнакі
Два
Адзін
- Абярыце катэгорыю ўлюбёных, каб дадаць у адзнакі.
+ Абярыце катэгорыю ўлюбёных мясцін, каб дадаць у адзнакі.
Пункты следу
- Катэгорыя ўлюбёных
+ Катэгорыя ўлюбёных мясцін
Дадаць групу
- Імпартаваць групы з улюбёных ці GPX-пунктаў.
+ Імпартаваць групы з улюбёных мясцін ці GPX-пунктаў.
Стварыце адзнакі на мапе!
Дакраніцеся да патрэбнага месца, а потым націсніце кнопку адзнакі.
Імпартаваць групы
- Імпартаваць групы ўлюбёных ці пункты шляху як адзнакі.
+ Імпартаваць групы ўлюбёных мясцін ці пункты шляху як адзнакі.
Адзнакі, пазначаныя як пройдзенныя, з\'явяцца на гэтым экране.
Паказвае лініі накірунку ад вашага становішча да актыўнай адзнакі.
Паказвае адну ці дзьве стрэлкі, якія паказваюць накірунак да актыўных адзнак.
@@ -3098,7 +3101,6 @@
Вызначце максімальную колькасць змен
Колькасць змен
Калі ласка, пакінце водгук і ацаніце нашу працу на Google Play.
- Добра
Палітыка прыватнасці
Дапамажыце нам палепшыць OsmAnd
Абярыце тып даных, якімі хочаце падзяліцца:
diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml
index 3583a48f35..9be3296704 100644
--- a/OsmAnd/res/values-ca/strings.xml
+++ b/OsmAnd/res/values-ca/strings.xml
@@ -3045,7 +3045,6 @@ Abasta l\'àrea: %1$s x %2$s
Buscant GPS
Giny de coordenades
Si us plau, comenteu que us sembla i puntueu la nostra feina a Google Play.
- D\'acord
Política de privadesa
Ajudeu-nos a millorar OsmAnd
Autoritzeu a OsmAnd a recopilar i processar dades anònimes d\'ús de l\'aplicació. No es recollirà cap dada sobre la vostra ubicació ni dels llocs que consulteu al mapa.
diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml
index c8b443cc90..650e9cbd57 100644
--- a/OsmAnd/res/values-cs/strings.xml
+++ b/OsmAnd/res/values-cs/strings.xml
@@ -3007,7 +3007,6 @@ Zobrazená oblast: %1$s x %2$s
Druh dopravy
Vyhledávání GPS
Nástroj souřadnic
- OK
Zásady soukromí
Pomozte nám OsmAnd vylepšit
Zvolte typ dat, který chcete sdílet:
diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml
index a5ebd8857c..0dbbad56f4 100644
--- a/OsmAnd/res/values-da/strings.xml
+++ b/OsmAnd/res/values-da/strings.xml
@@ -3040,7 +3040,6 @@ Repræsenterer område: %1$s x %2$s
Søger efter GPS
Koordinat modul
Del erfaringer og bedøm vores arbejde på Google Play.
- OK
Privatlivspolitik
Hjælp med at gøre OsmAnd bedre
Tillad OsmAnd at indsamle og behandle anonyme programdata. Vi indsamler ikke eller lagrer data om placering eller om steder på kortet.
diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml
index 83c953df78..79a8d11fa0 100644
--- a/OsmAnd/res/values-de/strings.xml
+++ b/OsmAnd/res/values-de/strings.xml
@@ -3039,7 +3039,6 @@ Lon %2$s
Suche GPS
Koordinaten-Widget
Bitte geben Sie uns Feedback und bewerten Sie unsere Arbeit auf Google Play.
- OK
Datenschutzrichtlinie
Helfen Sie uns, OsmAnd besser zu machen
Gestatten Sie OsmAnd, anonyme App-Nutzungsdaten zu sammeln und zu verarbeiten. Wir sammeln keine Daten zu Ihrem Standort oder zu irgendwelchen Orten, die Sie sich auf der Karte ansehen.
diff --git a/OsmAnd/res/values-el/strings.xml b/OsmAnd/res/values-el/strings.xml
index 73a0380935..bf8ff9d2b0 100644
--- a/OsmAnd/res/values-el/strings.xml
+++ b/OsmAnd/res/values-el/strings.xml
@@ -3114,7 +3114,6 @@
Αναζήτηση GPS
Γραφικό στοιχείο συντεταγμένων
Παρακαλούμε, στείλτε μας την αναπληροφόρηση και αξιολογηστε την εργασία μας στο Google Play.
- Εντάξει
Πολιτική απορρήτου
Βοηθήστε μας να βελτιώσουμε το OsmAnd
Να επιτρέπεται στο OsmAnd να συλλέγει και να επεξεργάζεται ανώνυμα δεδομένα χρήσης της εφαρμογής. Δεν συλλέγουμε, ούτε αποθηκεύουμε δεδομένα για την θέση σας, ή για τις τοποθεσίες που κοιτάτε στον χάρτη.
diff --git a/OsmAnd/res/values-eo/strings.xml b/OsmAnd/res/values-eo/strings.xml
index 7446abe19e..d41ecf28a7 100644
--- a/OsmAnd/res/values-eo/strings.xml
+++ b/OsmAnd/res/values-eo/strings.xml
@@ -3015,7 +3015,6 @@ Indikas lokon: %1$s x %2$s"
Fenestraĵo de koordinatoj
Frapetu ree por ŝanĝi map‑orientiĝon
Bonvolu kunhavigi vian opinion kaj taksi nian laboron ĉe Google Play.
- Bone
privatecan politikon
Helpu al ni igi OsmAnd pli bona
Bonvolu permesi al OsmAnd kolekti kaj pritrakti anonimajn datumojn pri uzado. Neniuj datumoj pri via pozicio kaj pri foliumataj lokoj estas kolektataj.
diff --git a/OsmAnd/res/values-es-rAR/strings.xml b/OsmAnd/res/values-es-rAR/strings.xml
index c689ca6074..27a6ff62cd 100644
--- a/OsmAnd/res/values-es-rAR/strings.xml
+++ b/OsmAnd/res/values-es-rAR/strings.xml
@@ -3036,7 +3036,6 @@ Lon %2$s
Buscando GPS
Widget de coordenadas
Por favor, comparte tus comentarios y califica nuestro trabajo en Google Play.
- Valorar
Política de privacidad
Ayúdanos a mejorar OsmAnd
Permite que OsmAnd recopile y procese datos de uso anónimos de la aplicación. No recopilamos datos sobre las ubicaciones que ve en el mapa.
diff --git a/OsmAnd/res/values-es-rUS/strings.xml b/OsmAnd/res/values-es-rUS/strings.xml
index 7fdedcba69..f0a0a704db 100644
--- a/OsmAnd/res/values-es-rUS/strings.xml
+++ b/OsmAnd/res/values-es-rUS/strings.xml
@@ -3030,7 +3030,6 @@ Lon %2$s
Widget de coordenadas
Buscando GPS
Por favor, comparte tus comentarios y califica nuestro trabajo en Google Play.
- Valorar
Política de privacidad
Ayúdanos a mejorar OsmAnd
Permite que OsmAnd recopile y procese datos de uso anónimos de la aplicación. No recopilamos datos sobre las ubicaciones que ve en el mapa.
diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml
index 7c22e410b4..7cec1ae1f0 100644
--- a/OsmAnd/res/values-es/strings.xml
+++ b/OsmAnd/res/values-es/strings.xml
@@ -3054,7 +3054,6 @@
Precisión horizontal: %1$s, vertical: %2$s
Precisión horizontal: %s
Por favor, comparte tus comentarios y califica nuestro trabajo en Google Play.
- Valorar
Política de privacidad
Ayúdanos a mejorar OsmAnd
Permite que OsmAnd recopile y procese datos de uso anónimos de la aplicación. No recopilamos datos sobre las ubicaciones que ve en el mapa.
diff --git a/OsmAnd/res/values-et/strings.xml b/OsmAnd/res/values-et/strings.xml
index 2e9f3aa6b6..e575b2957c 100644
--- a/OsmAnd/res/values-et/strings.xml
+++ b/OsmAnd/res/values-et/strings.xml
@@ -698,7 +698,6 @@
GPS-i otsimine
Koordinaatide vidin
Palun jaga oma tagasisidet ja hinda meie tööd Google Play keskkonnas.
- OK
Privaatsuspoliitika
Aita meil teha OsmAnd paremaks
Luba OsmAndil koguda ja töödelda anonüümseid rakenduse kasutamise andmeid. Teie asukoha või kaardil vaadeldavate asukohtade kohta andmeid ei koguta.
diff --git a/OsmAnd/res/values-eu/strings.xml b/OsmAnd/res/values-eu/strings.xml
index a2a1da8a52..62b8025f7b 100644
--- a/OsmAnd/res/values-eu/strings.xml
+++ b/OsmAnd/res/values-eu/strings.xml
@@ -3016,7 +3016,6 @@ Area honi dagokio: %1$s x %2$s
GPSa bilatzen
Koordenatuen trepeta
Eman zure iritzia eta baloratu gure lana Google Play-n.
- Ados
Lagundu gaitzazu OsmAnd hobetzen
Aukeratu ze motako datuak partekatu nahi dituzun:
Deskargatutako mapak
diff --git a/OsmAnd/res/values-fa/strings.xml b/OsmAnd/res/values-fa/strings.xml
index 9bdf0f7e48..8b178c28dd 100644
--- a/OsmAnd/res/values-fa/strings.xml
+++ b/OsmAnd/res/values-fa/strings.xml
@@ -3062,7 +3062,6 @@
جستوجوی GPS
ابزارک مختصات
لطفاً در گوگلپلی دربارهٔ کار ما نظر و امتیاز بدهید.
- باشد
سیاست حریم خصوصی
یاریمان کنید تا OsmAnd را بهتر کنیم
به OsmAnd اجازه بدهید دربارهٔ نحوهٔ استفاده از برنامه دادههای ناشناس جمعآوری و پردازش کند. دربارهٔ موقعیت شما یا جاهایی که روی نقشه میبینید دادهای جمعآوری نمیکنیم.
diff --git a/OsmAnd/res/values-fr/strings.xml b/OsmAnd/res/values-fr/strings.xml
index 6f20c4a2ff..e461fbd9e3 100644
--- a/OsmAnd/res/values-fr/strings.xml
+++ b/OsmAnd/res/values-fr/strings.xml
@@ -3038,7 +3038,6 @@ représentant la zone : %1$s x %2$s
icône
Données collectées
Merci de nous donner votre avis et d\'évaluer notre travail sur Google Play.
- OK
Aidez-nous à analyser quelles sont les fonctions d\'OsmAnd les plus utilisées.
Sélectionnez une icône
Vous devez d\'abord indiquer un nom de profil.
diff --git a/OsmAnd/res/values-gl/strings.xml b/OsmAnd/res/values-gl/strings.xml
index 1a7c0f0c1a..2d87d12986 100644
--- a/OsmAnd/res/values-gl/strings.xml
+++ b/OsmAnd/res/values-gl/strings.xml
@@ -3063,7 +3063,6 @@ Lon %2$s
Estase a procurar o GPS
Trebello de coordenadas
Por favor, comparte os teus comentarios e valora na Google Play o noso traballo.
- Dacordo
Política de privacidade
Axúdanos a mellorar o OsmAnd
Permite que o OsmAnd recompile e procese datos anónimos de uso da aplicación. Non recompilamos datos sobre a túa ubicación, nin sobre os lugares que ves no mapa.
diff --git a/OsmAnd/res/values-he/strings.xml b/OsmAnd/res/values-he/strings.xml
index cfd3ced71e..9582f445aa 100644
--- a/OsmAnd/res/values-he/strings.xml
+++ b/OsmAnd/res/values-he/strings.xml
@@ -3074,7 +3074,6 @@
פרופיל חדש
קריסה
הטעינה האחרונה של OsmAnd קרסה. נא לסייע לנו לשפר את OsmAnd על ידי שיתוף הודעת השגיאה.
- אישור
מדיניות פרטיות
נשמח לקבל סיוע בשיפור OsmAnd
נא לבחור את סוג הנתונים שברצונך לשתף:
diff --git a/OsmAnd/res/values-hi/strings.xml b/OsmAnd/res/values-hi/strings.xml
index 1d9f81837d..936cba2484 100644
--- a/OsmAnd/res/values-hi/strings.xml
+++ b/OsmAnd/res/values-hi/strings.xml
@@ -49,7 +49,6 @@
जीपीएस की खोज
निर्देशांक विजेट
कृपया अपनी प्रतिक्रिया साझा करके हमें 30 सेकंड दें और Google Play पर हमारे काम को रेटिंग दें।
- मूल्यांकन करें
गोपनीयता नीति
हमें OsmAnd को बेहतर बनाने में मदद करें!
चुनें कि आप किस प्रकार का डेटा साझा करना चाहते हैं:
diff --git a/OsmAnd/res/values-hu/strings.xml b/OsmAnd/res/values-hu/strings.xml
index cb3cba869e..43ce8f74ea 100644
--- a/OsmAnd/res/values-hu/strings.xml
+++ b/OsmAnd/res/values-hu/strings.xml
@@ -2997,7 +2997,6 @@ Ha szereted az OsmAndot és az OSM-et, és szeretnéd támogatni a fejlődésük
Koordináta-widget
Az Kedvencek vagy GPX-útpontok csoportjaként hozzáadott és elhagyottként megjelölt jelölők a térképen maradnak. A jelölők akkor tűnnek el a térképről, ha a csoport nem aktív (ki van kapcsolva).
Kérlek, adj visszajelzést vagy értékelést a Google Play-en.
- OK
Adatvédelmi irányelvek
Segítsen, hogy jobbá tehessük az OsmAndot
Engedélyezze, hogy az OsmAnd névtelen alkalmazáshasználati adatokat gyűjtsön és dolgozzon fel. Nem gyűjtünk vagy tárolunk adatokat a helyzetéről vagy az Ön által a térképen megtekintett helyekről.
diff --git a/OsmAnd/res/values-id/strings.xml b/OsmAnd/res/values-id/strings.xml
index 566e3cf7b8..1db6439b0f 100644
--- a/OsmAnd/res/values-id/strings.xml
+++ b/OsmAnd/res/values-id/strings.xml
@@ -464,7 +464,6 @@
Hindari jalan beku dan arungan sungai.
Keluar di
Luangkan waktu 30 detik, beri masukan dan nilai aplikasi kami di Google Play.
- Nilai
Kebijakan Privasi
Bantu kami membuat OsmAnd lebih baik!
Izinkan OsmAnd untuk mengumpulkan dan memproses data penggunaan aplikasi secara anonim. Kami tidak mengumpulkan atau menyimpan data lokasi anda, atau data lokasi yang anda lihat di peta.
diff --git a/OsmAnd/res/values-is/strings.xml b/OsmAnd/res/values-is/strings.xml
index ea31d75473..bb0137fcfc 100644
--- a/OsmAnd/res/values-is/strings.xml
+++ b/OsmAnd/res/values-is/strings.xml
@@ -3038,7 +3038,6 @@ Stendur fyrir svæði: %1$s x %2$s
Tegund samgangna
Leita að GPS
Viðmótshluti fyrir hnit
- Í lagi
Meðferð persónuupplýsinga
Hjálpaðu okkur við að gera OsmAnd betra
Sótt kort
diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml
index 869f4bee80..b0e829db9d 100644
--- a/OsmAnd/res/values-it/strings.xml
+++ b/OsmAnd/res/values-it/strings.xml
@@ -3137,7 +3137,6 @@ Rappresenta l\'area: %1$s x %2$s
Piste per slittino.
Interruzione
Per favore condividi il tuo feedback e dai un voto al nostro lavoro su Google Play.
- OK
Politica della privacy
Servizio di download OsmAnd
Permetti a OsmAnd di raccogliere ed elaborare anonimamente dati di utilizzo dell\'applicazione. Nessuna informazione circa la tua posizione o i luoghi che visualizzi nella mappa vengono raccolti.
diff --git a/OsmAnd/res/values-ja/strings.xml b/OsmAnd/res/values-ja/strings.xml
index d86329f96f..3f5ffef2db 100644
--- a/OsmAnd/res/values-ja/strings.xml
+++ b/OsmAnd/res/values-ja/strings.xml
@@ -3084,7 +3084,6 @@ POIの更新は利用できません
交通機関の種類
GPS検索
フィードバックの共有や、Google Playでの評価をお願いします。
- OK
OsmAndの改善にご協力ください
OsmAnd側で匿名にてアプリ使用データの収集および処理ができるようにします。マップに表示されている自身の位置やその他場所に関するデータは収集されません。
\n
diff --git a/OsmAnd/res/values-lv/strings.xml b/OsmAnd/res/values-lv/strings.xml
index 6925788a45..00debf5c9f 100644
--- a/OsmAnd/res/values-lv/strings.xml
+++ b/OsmAnd/res/values-lv/strings.xml
@@ -2575,7 +2575,6 @@ No Afganistānas līdz Zimbabvei, no Austrālijas līdz ASV, Argentīna, Brazīl
Spiežot darbības pogu, tiks pārslēgts dienas un nakts režīms
Smaiļošana pa upēm
"Lūdzu veltiet 30 sekundes laika atsauksmēm un novērtējiet mūsu darbu Google Play."
- Novērtēt
Privātuma politika
Palīdziet mums veidot OsmAnd labāku!
OsmAnd lejupielādes serviss
diff --git a/OsmAnd/res/values-my/strings.xml b/OsmAnd/res/values-my/strings.xml
index 2cb43999b6..be686ece0f 100644
--- a/OsmAnd/res/values-my/strings.xml
+++ b/OsmAnd/res/values-my/strings.xml
@@ -198,7 +198,6 @@
GPS ရှာဖွေခြင်း
Coordinates ဝစ်ဂျက်
စက္ကန့် ၃၀လောက်အချိန်ပေးပြီး Google Play မှာ ကျွန်ုပ်တို့၏ application ကို သင်၏ထင်မြင်ချက်များ တင်ပြပေးပါ။
- သတ်မှတ်ချက်
တစ်ကိုယ်ရေ မူဝါဒ
ကျွန်တော်တို့ရဲ့ OsmAnd ကိုပိုကောင်းအောင်ကူညီပါ!
သင်မျှဝေလိုသည့်အချက်အလက်အမျိုးအစားကိုရွေးချယ်ပါ။
diff --git a/OsmAnd/res/values-nb/strings.xml b/OsmAnd/res/values-nb/strings.xml
index 4ec679813e..c226ecf399 100644
--- a/OsmAnd/res/values-nb/strings.xml
+++ b/OsmAnd/res/values-nb/strings.xml
@@ -3037,7 +3037,6 @@
Søker etter GPS
Koordinat-miniprogram
Del din tilbakemelding og legg til en vurdering på Google Play.
- OK
Personvernspraksis
Hjelp oss å forbedre OsmAnd.
Tillat OsmAnd å samle inn og behandle anonym programbruksdata. Vi samler ikke inn eller lagrer data om din plassering, eller om plasseringer ser på på kartet.
diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml
index bbe3ff601e..aecebb50c9 100644
--- a/OsmAnd/res/values-nl/strings.xml
+++ b/OsmAnd/res/values-nl/strings.xml
@@ -2953,7 +2953,6 @@ voor Gebied: %1$s x %2$s
Probeer de wandelroute.
Probeer de instellingen te wijzigen.
Looproute berekenen
- Ok
Help ons OsmAnd beter te maken
Privacy en veiligheid
Kies welke gegevens je deelt
diff --git a/OsmAnd/res/values-oc/strings.xml b/OsmAnd/res/values-oc/strings.xml
index bda263590e..8db78dec1f 100644
--- a/OsmAnd/res/values-oc/strings.xml
+++ b/OsmAnd/res/values-oc/strings.xml
@@ -223,7 +223,6 @@
Legit
Servidor de descargament d\'OsmAnd
Donatz-nos lèu, per plaser, vòstre avejaire, vòstrei comentaris e avaloratz lo produch dins Google Play.
- Avalorar
Politica per la vida privada
Ajudatz-nos per melhorar OsmAnd !
Indicatz quinei menas de dadas volètz partejar:
diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml
index 7352597b2f..55e905dd69 100644
--- a/OsmAnd/res/values-pl/strings.xml
+++ b/OsmAnd/res/values-pl/strings.xml
@@ -3028,7 +3028,6 @@ Reprezentuje obszar: %1$s x %2$s
Wyszukiwanie GPS
Widżet współrzędnych
Podziel się opinią i oceń naszą pracę w Google Play.
- Ok
Polityka prywatności
Pomóż nam uczynić OsmAnd lepszym
Pozwól OsmAnd zbierać i przetwarzać anonimowe dane użytkowe aplikacji. Nie przechowujemy danych dotyczących twojego położenia ani lokalizacji, które widziałeś na mapie.
diff --git a/OsmAnd/res/values-pt-rBR/strings.xml b/OsmAnd/res/values-pt-rBR/strings.xml
index 71d8868f5d..8e6f95a3ed 100644
--- a/OsmAnd/res/values-pt-rBR/strings.xml
+++ b/OsmAnd/res/values-pt-rBR/strings.xml
@@ -3018,7 +3018,6 @@ Pôr do Sol: %2$s
Pesquisando GPS
Widget de coordenadas
Compartilhe seus comentários e avalie nosso trabalho no Google Play.
- OK
Política de privacidade
Ajude-nos a fazer o OsmAnd melhor
Permita OsmAnd coletar e processar dados anônimos de uso do aplicativo. Não são recolhidos dados sobre a sua posição ou localidades que você vê no mapa.
diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml
index 6fed020d9a..55fa242a73 100644
--- a/OsmAnd/res/values-pt/strings.xml
+++ b/OsmAnd/res/values-pt/strings.xml
@@ -3033,7 +3033,6 @@
Procurando GPS
Widget de coordenadas
Por favor compartilhe os seus comentários e avalie o nosso trabalho no Google Play.
- OK
Política de privacidade
Ajude-nos a melhorar o OsmAnd
Permitir que OsmAnd colete e processe dados anônimos de uso de app. Nenhuns dados sobre a sua posição, nem sobre as localizações que visualiza no mapa são recolhidos.
diff --git a/OsmAnd/res/values-ro/strings.xml b/OsmAnd/res/values-ro/strings.xml
index 36d5a86a09..32aa71b28c 100644
--- a/OsmAnd/res/values-ro/strings.xml
+++ b/OsmAnd/res/values-ro/strings.xml
@@ -2305,7 +2305,6 @@
Tip transport
Căutare GPS
Acordați-ne 30 de secunde, trimiteți părerea dvs. și evaluați munca noastră pe Google Play.
- Evaluați
Politica de confidențialitate
Ajutați-ne să facem OsmAnd mai bun!
Alegeți ce tip de date doriți să partajați:
diff --git a/OsmAnd/res/values-ru/phrases.xml b/OsmAnd/res/values-ru/phrases.xml
index c431149358..d9f3e4afb5 100644
--- a/OsmAnd/res/values-ru/phrases.xml
+++ b/OsmAnd/res/values-ru/phrases.xml
@@ -3644,5 +3644,19 @@
Сеть
Парковочное место
+ Шлаковый конус
+ Стратовулкан
+ Щитовой
+ Маар
+ Калдера
+ Лавовый купол
+ Грязевой
+ Последнее извержение
+ Потухший
+ Спящий
+ Активный
+ Неактивный
+ Число извержений
+
\ No newline at end of file
diff --git a/OsmAnd/res/values-ru/strings.xml b/OsmAnd/res/values-ru/strings.xml
index 94384d2ee5..05c178b475 100644
--- a/OsmAnd/res/values-ru/strings.xml
+++ b/OsmAnd/res/values-ru/strings.xml
@@ -3127,7 +3127,7 @@
Предпочитаемая сложность
Служба скачивания OsmAnd
Пурпурный
- OK
+ Оценить
Показать компас линейку
Скрыть компас линейку
Мин. скорость
diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml
index 09af46fdd5..e933637353 100644
--- a/OsmAnd/res/values-sc/strings.xml
+++ b/OsmAnd/res/values-sc/strings.xml
@@ -3032,7 +3032,6 @@ Pro praghere iscrie su còdighe intreu
Chirchende su GPS
Widget de sas coordinatas
Pro praghere cumpartzi s\'opinione tua e vota su traballu nostru in Google Play.
- AB
Polìtica de riservadesa
Agiuda·nos a megiorare OsmAnd
Permiti a OsmAnd de collire e protzessare datos anònimos a pitzu de s\'impreu de s\'aplicatzione. Non collimus o sarvamus datos a pitzu de sa positzione tua, o a pitzu de cale si siat positzione chi pompias in sa mapa.
diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml
index 957a36d5cc..7b9d23c687 100644
--- a/OsmAnd/res/values-sk/strings.xml
+++ b/OsmAnd/res/values-sk/strings.xml
@@ -3014,7 +3014,6 @@ Zodpovedá oblasti: %1$s x %2$s
Hľadá sa GPS
Nástroj súradníc
Prosím podeľte sa so spätnou väzbou a ohodnoťte našu prácu na Google Play.
- OK
Ochrana súkromia
Pomôžte nám vylepšiť OsmAnd
Umožnite OsmAndu zbierať a spracovať anonymné údaje o používaní aplikácie. Nezbierame žiadne údaje o vašej polohe, ani o miestach, ktoré si prezeráte na mape.
diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml
index c87a3b706b..3d2c2254ea 100644
--- a/OsmAnd/res/values-sl/strings.xml
+++ b/OsmAnd/res/values-sl/strings.xml
@@ -3121,7 +3121,6 @@ Koda predstavlja območje: %1$s x %2$s
Pokaži področja z omejitvijo izpustov
Upoštevaj začasne omejitve
Privzeto
- Ocena
Prevoz s podzemno železnico
Pokaži kompas
Skrij kompas
diff --git a/OsmAnd/res/values-sr/strings.xml b/OsmAnd/res/values-sr/strings.xml
index 43f6ea4bd6..983f2e7d09 100644
--- a/OsmAnd/res/values-sr/strings.xml
+++ b/OsmAnd/res/values-sr/strings.xml
@@ -3011,7 +3011,6 @@
Тип превоза
Тражим GPS
Справица за координате
- У реду
Политика приватности
Помозите нам да побољшамо OsmAnd
Одаберите које типове података желите да делите:
diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml
index 3c1fbb8339..f93d333fa6 100644
--- a/OsmAnd/res/values-sv/strings.xml
+++ b/OsmAnd/res/values-sv/strings.xml
@@ -2767,7 +2767,6 @@ Vänligen tillhandahåll fullständig kod
Mellanliggande destinationer
Ankomst klockan %1$s
Vänligen dela din feedback och betygsätt vårt arbete på Google Play.
- Okej
Sekretesspolicy
Hjälp oss att göra OsmAnd bättre
Tillåt OsmAnd att samla in och bearbeta data för anonym appanvändning. Inga data om din position eller dina platser du visar på kartan samlas in.
diff --git a/OsmAnd/res/values-tr/strings.xml b/OsmAnd/res/values-tr/strings.xml
index 3d9a30b8ab..d7a1357c8a 100644
--- a/OsmAnd/res/values-tr/strings.xml
+++ b/OsmAnd/res/values-tr/strings.xml
@@ -2618,7 +2618,6 @@
\n OsmAnd+ uygulamanın ücretli versiyonudur. Satın alarak, projeyi desteklemekte, yeni özelliklerin geliştirilmesini finanse etmekte ve en son güncellemeleri almaktasınız.
\n
\n Ana özelliklerden bazıları:
- Tamam
OsmAnd\'ın anonim uygulama kullanım verilerini toplamasına ve işlemesine izin ver. Konumunuz veya haritada görüntülediğiniz yerler hakkında veri toplanmaz.
\n
\n\'Ayarlar\' → \'Gizlilik ve Güvenlik\' bölümünde istediğiniz zaman yapılandırın.
diff --git a/OsmAnd/res/values-uk/strings.xml b/OsmAnd/res/values-uk/strings.xml
index a243a06cf6..b475f1563e 100644
--- a/OsmAnd/res/values-uk/strings.xml
+++ b/OsmAnd/res/values-uk/strings.xml
@@ -3025,7 +3025,6 @@
Пошук GPS
Віджет координат
Поділіться своїми відгуками та оцініть нашу роботу в Google Play.
- Добре
Політика конфіденційності
Допоможіть нам зробити OsmAnd кращим
Дозвольте OsmAnd збирати та обробляти анонімні дані про використання додатку. Ми не збираємо і не зберігаємо дані про ваше розташування або будь-які інші розташування, які ви переглядаєте на мапі.
diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml
index 52a9a0ffee..25c9dbdfaa 100644
--- a/OsmAnd/res/values-zh-rTW/strings.xml
+++ b/OsmAnd/res/values-zh-rTW/strings.xml
@@ -3019,7 +3019,6 @@
正在搜尋 GPS
座標小工具
請在 Google Play 上分享您的回饋與為我們的努力進行評分。
- 確定
隱私權政策
協助我們讓 OsmAnd 變得更好
允許 OsmAnd 蒐集與處理匿名應用程式使用資料。不會蒐集關於您的位置或是您在地圖上檢視了哪些地點的資料。
diff --git a/OsmAnd/res/values/colors.xml b/OsmAnd/res/values/colors.xml
index eef24cac63..93da10b6a0 100644
--- a/OsmAnd/res/values/colors.xml
+++ b/OsmAnd/res/values/colors.xml
@@ -202,15 +202,6 @@
#0080FF
-
- #320000FF
-
- #88536dfe
- #280000FF
-
- #66536dfe
- #707CDC
-
#B4B319FF
#B400FFFF
diff --git a/OsmAnd/res/values/phrases.xml b/OsmAnd/res/values/phrases.xml
index 349b9b43a4..989b50f5d7 100644
--- a/OsmAnd/res/values/phrases.xml
+++ b/OsmAnd/res/values/phrases.xml
@@ -129,6 +129,8 @@
Cash withdrawal
Type
Open air
+ Type
+ Status
Store
@@ -4161,4 +4163,18 @@
URL
+ Scoria
+ Stratovolcano
+ Shield
+ Maar
+ Caldera
+ Lava dome
+ Dirt
+ Last eruption
+ Extinct
+ Dormant
+ Active
+ Inactive
+ Number of eruptions
+
diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml
index 89b6bd1019..93ca5c4889 100644
--- a/OsmAnd/res/values/strings.xml
+++ b/OsmAnd/res/values/strings.xml
@@ -11,6 +11,31 @@
Thx - Hardy
-->
+ \'%1$s\' file doesn\'t contain routing rules, please choose another file.
+ Not supported file type. You need to select a file with %1$s extension.
+ Import from file
+ Import routing file
+ Import profile
+ Navigation, logging accuracy
+ Picture size, audio and video quality
+ Login, password, offline editing
+ Choose icon, color and name
+ Allow you to share current location using trip recording.
+ Online tracking
+ Logging accuracy
+ You can find all your recorded tracks in Menu — My place — Tracks or in OsmAd folder using file manager.
+ You can find all your notes in Menu — My places — Notes
+ Video notes
+ Photo notes
+ Route recalculation
+ Announce
+ Username and password
+ This plugin settings are global, and apply to all profiles.
+ OpenStreetMap Editing
+ You can view all your unuploaded edits or osm bugs in Menu — My places — OSM Edits. Uploaded points don’t show in OsmAnd.
+ OSM
+ You will see the icon only while navigation or while moving.
+ Map icon appears only on the map, and changing while navigation to navigation icon.
%1$s %2$s
%1$s: %2$s
By clicking %1$s, you will lose all your changes.
@@ -278,7 +303,7 @@
Magenta
Icon
Please share your feedback and rate our work on Google Play.
- OK
+ Rate
Privacy Policy
Help us make OsmAnd better
Allow OsmAnd to collect and process anonymous app usage data. No data about your position or locations you view on the map are collected.\n\nConfigure any time in \'Settings\' → \'Privacy and Security\'.
@@ -1687,7 +1712,7 @@
This plugin provides a map widget allowing creation of paths by tapping the map, or by using or modifying existing GPX files, to plan a trip and measure the distance between points. The results can be saved as a GPX file, which can later be used for guidance.
Accessibility
This plugin makes the device\'s accessibility features available directly in OsmAnd. It facilitates e.g. adjusting the speech rate for text-to-speech voices, configuring directional-pad screen navigation, using a trackball for zoom control, or text-to-speech feedback, for example to auto announcing your position.
- OSM editing
+ OpenStreetMap editing
Via this plugin OsmAnd can be used to make OSM contributions like creating or modifying OSM POI objects, opening or commenting OSM Notes, and contributing recorded GPX files. OSM is a community driven, global public domain mapping project. For details please refer to https://openstreetmap.org. Active participation is appreciated, and contributions can be made directly from OsmAnd, if you specify your personal OSM credentials in the app.
This plugin displays settings for development and debugging features like to test or simulate routing, the rendering performance, or voice prompting. These settings are intended for developers and are not needed for the general user.
OsmAnd development
diff --git a/OsmAnd/res/xml/accessibility_settings.xml b/OsmAnd/res/xml/accessibility_settings.xml
new file mode 100644
index 0000000000..c11ba73e18
--- /dev/null
+++ b/OsmAnd/res/xml/accessibility_settings.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/xml/configure_profile.xml b/OsmAnd/res/xml/configure_profile.xml
index ff98b3a1c4..4d0f997500 100644
--- a/OsmAnd/res/xml/configure_profile.xml
+++ b/OsmAnd/res/xml/configure_profile.xml
@@ -59,7 +59,6 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/xml/monitoring_settings.xml b/OsmAnd/res/xml/monitoring_settings.xml
new file mode 100644
index 0000000000..993ea0ea10
--- /dev/null
+++ b/OsmAnd/res/xml/monitoring_settings.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/xml/multimedia_notes.xml b/OsmAnd/res/xml/multimedia_notes.xml
new file mode 100644
index 0000000000..79bdc03b31
--- /dev/null
+++ b/OsmAnd/res/xml/multimedia_notes.xml
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/xml/osm_editing.xml b/OsmAnd/res/xml/osm_editing.xml
new file mode 100644
index 0000000000..369b05b2cf
--- /dev/null
+++ b/OsmAnd/res/xml/osm_editing.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OsmAnd/res/xml/profile_appearance.xml b/OsmAnd/res/xml/profile_appearance.xml
index 067429aaa9..9c042ddeaa 100644
--- a/OsmAnd/res/xml/profile_appearance.xml
+++ b/OsmAnd/res/xml/profile_appearance.xml
@@ -49,15 +49,15 @@
android:layout="@layout/simple_divider_item"
android:selectable="false" />
-
+ android:selectable="false"/>
\ No newline at end of file
diff --git a/OsmAnd/res/xml/settings_main_screen.xml b/OsmAnd/res/xml/settings_main_screen.xml
index c9fecde00e..71cbd86fa3 100644
--- a/OsmAnd/res/xml/settings_main_screen.xml
+++ b/OsmAnd/res/xml/settings_main_screen.xml
@@ -46,12 +46,12 @@
android:title="@string/new_profile"
tools:icon="@drawable/ic_action_plus" />
-
+ android:title="@string/import_profile"
+ tools:icon="@drawable/ic_action_import" />
0) {
+ hasNameNumberSection = true;
+ break;
+ } else {
+ break;
+ }
+ i--;
+ } while (i >= 0);
+ int newNumberValue = Integer.parseInt(hasNameNumberSection ? numberSection.toString() : "0") + 1;
+
+ String newName;
+ if (newNumberValue == 1) {
+ newName = nameWithoutExt + " " + newNumberValue + ext;
+ } else {
+ newName = nameWithoutExt.substring(0, i) + " " + newNumberValue + ext;
+ }
+
+ return newName;
+ }
}
diff --git a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
index fab0dae811..d95064493d 100644
--- a/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
+++ b/OsmAnd/src/net/osmand/access/AccessibilityPlugin.java
@@ -1,9 +1,5 @@
package net.osmand.access;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
import android.app.Activity;
import android.media.AudioManager;
import android.media.SoundPool;
@@ -12,7 +8,11 @@ import android.support.annotation.NonNull;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
-import net.osmand.plus.activities.MapActivity;
+import net.osmand.plus.settings.BaseSettingsFragment;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
public class AccessibilityPlugin extends OsmandPlugin {
@@ -28,7 +28,7 @@ public class AccessibilityPlugin extends OsmandPlugin {
public AccessibilityPlugin(OsmandApplication app) {
this.app = app;
}
-
+
@Override
public boolean init(@NonNull final OsmandApplication app, Activity activity) {
sounds = new SoundPool(1, AudioManager.STREAM_MUSIC, 0);
@@ -55,16 +55,21 @@ public class AccessibilityPlugin extends OsmandPlugin {
return app.getString(R.string.shared_string_accessibility);
}
- @Override
- public void registerLayers(MapActivity activity) {
- }
-
-
@Override
public Class extends Activity> getSettingsActivity() {
return SettingsAccessibilityActivity.class;
}
+ @Override
+ public Class extends BaseSettingsFragment> getSettingsFragment() {
+ return AccessibilitySettingsFragment.class;
+ }
+
+ @Override
+ public String getPrefsDescription() {
+ return app.getString(R.string.accessibility_prefs_descr);
+ }
+
@Override
public void disable(OsmandApplication app) {
if (sounds != null) {
@@ -98,5 +103,4 @@ public class AccessibilityPlugin extends OsmandPlugin {
return 0;
}
}
-
-}
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java b/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
new file mode 100644
index 0000000000..6e1868124f
--- /dev/null
+++ b/OsmAnd/src/net/osmand/access/AccessibilitySettingsFragment.java
@@ -0,0 +1,165 @@
+package net.osmand.access;
+
+import android.support.v7.preference.Preference;
+import android.support.v7.preference.PreferenceScreen;
+
+import net.osmand.plus.R;
+import net.osmand.plus.access.AccessibilityMode;
+import net.osmand.plus.access.RelativeDirectionStyle;
+import net.osmand.plus.settings.BaseSettingsFragment;
+import net.osmand.plus.settings.OnPreferenceChanged;
+import net.osmand.plus.settings.preferences.ListPreferenceEx;
+import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
+
+public class AccessibilitySettingsFragment extends BaseSettingsFragment implements OnPreferenceChanged {
+
+ private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
+ private static final String RESET_TO_DEFAULT = "reset_to_default";
+
+ @Override
+ protected void setupPreferences() {
+ setupAccessibilityModePref();
+ setupSpeechRatePref();
+
+ setupSmartAutoAnnouncePref();
+ setupAutoAnnouncePeriodPref();
+
+ setupDisableOffRouteRecalculationPref();
+ setupDisableWrongDirectionRecalculationPref();
+
+ setupDirectionStylePref();
+ setupDirectionAudioFeedbackPref();
+ setupDirectionHapticFeedbackPref();
+
+ setupCopyProfileSettingsPref();
+ setupResetToDefaultPref();
+
+ updateAccessibilityOptions();
+ }
+
+ private void setupAccessibilityModePref() {
+ AccessibilityMode[] accessibilityModes = AccessibilityMode.values();
+ String[] entries = new String[accessibilityModes.length];
+ Integer[] entryValues = new Integer[accessibilityModes.length];
+
+ for (int i = 0; i < entries.length; i++) {
+ entries[i] = accessibilityModes[i].toHumanString(app);
+ entryValues[i] = accessibilityModes[i].ordinal();
+ }
+
+ ListPreferenceEx accessibilityMode = (ListPreferenceEx) findPreference(settings.ACCESSIBILITY_MODE.getId());
+ accessibilityMode.setEntries(entries);
+ accessibilityMode.setEntryValues(entryValues);
+ accessibilityMode.setDescription(R.string.accessibility_mode_descr);
+ }
+
+ private void setupSpeechRatePref() {
+ Float[] entryValues = new Float[] {0.5f, 0.75f, 1f, 1.25f, 1.5f, 2f};
+ String[] entries = new String[entryValues.length];
+
+ for (int i = 0; i < entries.length; i++) {
+ entries[i] = (int) (entryValues[i] * 100) + " %";
+ }
+
+ ListPreferenceEx speechRate = (ListPreferenceEx) findPreference(settings.SPEECH_RATE.getId());
+ speechRate.setEntries(entries);
+ speechRate.setEntryValues(entryValues);
+ speechRate.setIcon(getContentIcon(R.drawable.ic_world_globe_dark));
+ speechRate.setDescription(R.string.speech_rate_descr);
+ }
+
+ private void setupSmartAutoAnnouncePref() {
+ SwitchPreferenceEx smartAutoAnnounce = (SwitchPreferenceEx) findPreference(settings.ACCESSIBILITY_SMART_AUTOANNOUNCE.getId());
+ smartAutoAnnounce.setDescription(getString(R.string.access_smart_autoannounce_descr));
+ }
+
+ private void setupAutoAnnouncePeriodPref() {
+ int[] seconds = new int[] {5, 10, 15, 20, 30, 45, 60, 90};
+ int[] minutes = new int[] {2, 3, 5};
+
+ Integer[] entryValues = new Integer[seconds.length + minutes.length];
+ String[] entries = new String[entryValues.length];
+ int k = 0;
+ for (int second : seconds) {
+ entryValues[k] = second * 1000;
+ entries[k] = second + " " + getString(R.string.int_seconds);
+ k++;
+ }
+ for (int minute : minutes) {
+ entryValues[k] = (minute * 60) * 1000;
+ entries[k] = minute + " " + getString(R.string.int_min);
+ k++;
+ }
+
+ ListPreferenceEx autoAnnouncePeriod = (ListPreferenceEx) findPreference(settings.ACCESSIBILITY_AUTOANNOUNCE_PERIOD.getId());
+ autoAnnouncePeriod.setEntries(entries);
+ autoAnnouncePeriod.setEntryValues(entryValues);
+ autoAnnouncePeriod.setDescription(R.string.access_autoannounce_period_descr);
+ }
+
+ private void setupDisableOffRouteRecalculationPref() {
+ SwitchPreferenceEx disableOffRouteRecalculation = (SwitchPreferenceEx) findPreference(settings.DISABLE_OFFROUTE_RECALC.getId());
+ disableOffRouteRecalculation.setDescription(getString(R.string.access_disable_offroute_recalc_descr));
+ }
+
+ private void setupDisableWrongDirectionRecalculationPref() {
+ SwitchPreferenceEx disableWrongDirectionRecalculation = (SwitchPreferenceEx) findPreference(settings.DISABLE_WRONG_DIRECTION_RECALC.getId());
+ disableWrongDirectionRecalculation.setDescription(getString(R.string.access_disable_wrong_direction_recalc_descr));
+ }
+
+ private void setupDirectionStylePref() {
+ RelativeDirectionStyle[] relativeDirectionStyles = RelativeDirectionStyle.values();
+ String[] entries = new String[relativeDirectionStyles.length];
+ Integer[] entryValues = new Integer[relativeDirectionStyles.length];
+
+ for (int i = 0; i < entries.length; i++) {
+ entries[i] = relativeDirectionStyles[i].toHumanString(app);
+ entryValues[i] = relativeDirectionStyles[i].ordinal();
+ }
+
+ ListPreferenceEx directionStyle = (ListPreferenceEx) findPreference(settings.DIRECTION_STYLE.getId());
+ directionStyle.setEntries(entries);
+ directionStyle.setEntryValues(entryValues);
+ directionStyle.setDescription(R.string.settings_direction_style_descr);
+ }
+
+ private void setupDirectionAudioFeedbackPref() {
+ SwitchPreferenceEx directionAudioFeedback = (SwitchPreferenceEx) findPreference(settings.DIRECTION_AUDIO_FEEDBACK.getId());
+ directionAudioFeedback.setDescription(getString(R.string.access_direction_audio_feedback_descr));
+ }
+
+ private void setupDirectionHapticFeedbackPref() {
+ SwitchPreferenceEx directionHapticFeedback = (SwitchPreferenceEx) findPreference(settings.DIRECTION_HAPTIC_FEEDBACK.getId());
+ directionHapticFeedback.setDescription(getString(R.string.access_direction_haptic_feedback_descr));
+ }
+
+ private void setupCopyProfileSettingsPref() {
+ Preference copyProfilePrefs = findPreference(COPY_PLUGIN_SETTINGS);
+ copyProfilePrefs.setIcon(getActiveIcon(R.drawable.ic_action_copy));
+ }
+
+ private void setupResetToDefaultPref() {
+ Preference resetToDefault = findPreference(RESET_TO_DEFAULT);
+ resetToDefault.setIcon(getActiveIcon(R.drawable.ic_action_reset_to_default_dark));
+ }
+
+ @Override
+ public void onPreferenceChanged(String prefId) {
+ if (settings.ACCESSIBILITY_MODE.getId().equals(prefId)) {
+ updateAccessibilityOptions();
+ }
+ }
+
+ private void updateAccessibilityOptions() {
+ boolean accessibilityEnabled = app.accessibilityEnabledForMode(getSelectedAppMode());
+ PreferenceScreen screen = getPreferenceScreen();
+ if (screen != null) {
+ for (int i = 0; i < screen.getPreferenceCount(); i++) {
+ Preference preference = screen.getPreference(i);
+ String prefId = preference.getKey();
+ if (!settings.ACCESSIBILITY_MODE.getId().equals(prefId) && !settings.SPEECH_RATE.getId().equals(prefId))
+ preference.setEnabled(accessibilityEnabled);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java
index 095a819a2a..ce7bb80b77 100644
--- a/OsmAnd/src/net/osmand/plus/AppInitializer.java
+++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java
@@ -58,7 +58,6 @@ import net.osmand.plus.voice.TTSCommandPlayerImpl;
import net.osmand.plus.wikivoyage.data.TravelDbHelper;
import net.osmand.render.RenderingRulesStorage;
import net.osmand.router.RoutingConfiguration;
-import net.osmand.router.RoutingConfiguration.Builder;
import net.osmand.util.Algorithms;
import net.osmand.util.OpeningHoursParser;
@@ -141,6 +140,10 @@ public class AppInitializer implements IProgress {
void onFinish(AppInitializer init);
}
+
+ public interface LoadRoutingFilesCallback {
+ void onRoutingFilesLoaded();
+ }
public AppInitializer(OsmandApplication app) {
@@ -579,9 +582,19 @@ public class AppInitializer implements IProgress {
@SuppressLint("StaticFieldLeak")
private void getLazyRoutingConfig() {
- new AsyncTask() {
+ loadRoutingFiles(app, new LoadRoutingFilesCallback() {
@Override
- protected Builder doInBackground(Void... voids) {
+ public void onRoutingFilesLoaded() {
+ notifyEvent(InitEvents.ROUTING_CONFIG_INITIALIZED);
+ }
+ });
+ }
+
+ public static void loadRoutingFiles(final OsmandApplication app, final LoadRoutingFilesCallback callback) {
+ new AsyncTask() {
+
+ @Override
+ protected RoutingConfiguration.Builder doInBackground(Void... voids) {
File routingFolder = app.getAppPath(IndexConstants.ROUTING_PROFILES_DIR);
RoutingConfiguration.Builder builder = RoutingConfiguration.getDefault();
if (routingFolder.isDirectory()) {
@@ -602,10 +615,10 @@ public class AppInitializer implements IProgress {
}
@Override
- protected void onPostExecute(Builder builder) {
+ protected void onPostExecute(RoutingConfiguration.Builder builder) {
super.onPostExecute(builder);
app.updateRoutingConfig(builder);
- notifyEvent(InitEvents.ROUTING_CONFIG_INITIALIZED);
+ callback.onRoutingFilesLoaded();
}
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
diff --git a/OsmAnd/src/net/osmand/plus/ApplicationMode.java b/OsmAnd/src/net/osmand/plus/ApplicationMode.java
index b1bae228da..00d0c0c695 100644
--- a/OsmAnd/src/net/osmand/plus/ApplicationMode.java
+++ b/OsmAnd/src/net/osmand/plus/ApplicationMode.java
@@ -72,64 +72,87 @@ public class ApplicationMode {
private String routingProfile = "";
private RouteService routeService = RouteService.OSMAND;
-
private float defaultSpeed = 10f;
private float initialDefaultSpeed = defaultSpeed;
private int minDistanceForTurn = 50;
private int arrivalDistance = 90;
private int offRouteDistance = 350;
- private int bearingIconDay = R.drawable.map_pedestrian_bearing;
- private int bearingIconNight = R.drawable.map_pedestrian_bearing_night;
- private int headingIconDay = R.drawable.map_pedestrian_location_view_angle;
- private int headingIconNight = R.drawable.map_pedestrian_location_view_angle_night;
- private int locationIconDay = R.drawable.map_pedestrian_location;
- private int locationIconNight = R.drawable.map_pedestrian_location_night;
- private int locationIconDayLost = R.drawable.map_pedestrian_location_lost;
- private int locationIconNightLost = R.drawable.map_pedestrian_location_lost_night;
+ private NavigationIcon navigationIcon = NavigationIcon.DEFAULT;
+ private LocationIcon locationIcon = LocationIcon.DEFAULT;
private ApplicationMode(int key, String stringKey) {
this.keyName = key;
this.stringKey = stringKey;
}
-
/*
* DEFAULT("Browse map"), CAR("Car"), BICYCLE("Bicycle"), PEDESTRIAN("Pedestrian"); NAUTICAL("boat"); PUBLIC_TRANSPORT("Public transport"); AIRCRAFT("Aircraft")
*/
- public static final ApplicationMode DEFAULT = createBase(R.string.app_mode_default, "default").speed(1.5f, 5).arrivalDistance(90).defLocation().
- icon(R.drawable.ic_world_globe_dark, R.drawable.map_world_globe_dark, "ic_world_globe_dark").reg();
+ public static final ApplicationMode DEFAULT = createBase(R.string.app_mode_default, "default")
+ .speed(1.5f, 5).arrivalDistance(90)
+ .locationIcon(LocationIcon.DEFAULT).navigationIcon(NavigationIcon.DEFAULT)
+ .icon(R.drawable.ic_world_globe_dark, R.drawable.map_world_globe_dark, "ic_world_globe_dark").reg();
- public static final ApplicationMode CAR = createBase(R.string.app_mode_car, "car").speed(12.5f, 35).carLocation().
- icon(R.drawable.ic_action_car_dark, R.drawable.map_action_car_dark, "ic_action_car_dark").setRoutingProfile("car").description(R.string.base_profile_descr_car).reg();
+ public static final ApplicationMode CAR = createBase(R.string.app_mode_car, "car")
+ .speed(12.5f, 35)
+ .locationIcon(LocationIcon.CAR).navigationIcon(NavigationIcon.DEFAULT)
+ .icon(R.drawable.ic_action_car_dark, R.drawable.map_action_car_dark, "ic_action_car_dark")
+ .setRoutingProfile("car").description(R.string.base_profile_descr_car).reg();
- public static final ApplicationMode BICYCLE = createBase(R.string.app_mode_bicycle, "bicycle").speed(2.77f, 15).arrivalDistance(60).offRouteDistance(50).bicycleLocation().
- icon(R.drawable.ic_action_bicycle_dark, R.drawable.map_action_bicycle_dark,"ic_action_bicycle_dark").setRoutingProfile("bicycle").description(R.string.base_profile_descr_bicycle).reg();
+ public static final ApplicationMode BICYCLE = createBase(R.string.app_mode_bicycle, "bicycle")
+ .speed(2.77f, 15).arrivalDistance(60).offRouteDistance(50)
+ .locationIcon(LocationIcon.BICYCLE).navigationIcon(NavigationIcon.DEFAULT)
+ .icon(R.drawable.ic_action_bicycle_dark, R.drawable.map_action_bicycle_dark, "ic_action_bicycle_dark")
+ .setRoutingProfile("bicycle").description(R.string.base_profile_descr_bicycle).reg();
- public static final ApplicationMode PEDESTRIAN = createBase(R.string.app_mode_pedestrian, "pedestrian").speed(1.11f, 5).arrivalDistance(45).offRouteDistance(20).
- icon(R.drawable.ic_action_pedestrian_dark, R.drawable.map_action_pedestrian_dark, "ic_action_pedestrian_dark").setRoutingProfile("pedestrian").description(R.string.base_profile_descr_pedestrian).reg();
+ public static final ApplicationMode PEDESTRIAN = createBase(R.string.app_mode_pedestrian, "pedestrian")
+ .speed(1.11f, 5).arrivalDistance(45).offRouteDistance(20)
+ .icon(R.drawable.ic_action_pedestrian_dark, R.drawable.map_action_pedestrian_dark, "ic_action_pedestrian_dark")
+ .setRoutingProfile("pedestrian").description(R.string.base_profile_descr_pedestrian).reg();
- public static final ApplicationMode PUBLIC_TRANSPORT = createBase(R.string.app_mode_public_transport, "public_transport").
- icon(R.drawable.ic_action_bus_dark, R.drawable.map_action_bus_dark,"ic_action_bus_dark").setRoutingProfile("public_transport").description(R.string.base_profile_descr_public_transport).reg();
+ public static final ApplicationMode PUBLIC_TRANSPORT = createBase(R.string.app_mode_public_transport, "public_transport")
+ .icon(R.drawable.ic_action_bus_dark, R.drawable.map_action_bus_dark, "ic_action_bus_dark")
+ .setRoutingProfile("public_transport").description(R.string.base_profile_descr_public_transport).reg();
- public static final ApplicationMode BOAT = createBase(R.string.app_mode_boat, "boat").speed(1.38f, 20).nauticalLocation().
- icon(R.drawable.ic_action_sail_boat_dark, R.drawable.map_action_sail_boat_dark, "ic_action_sail_boat_dark").setRoutingProfile("boat").description(R.string.base_profile_descr_boat).reg();
+ public static final ApplicationMode BOAT = createBase(R.string.app_mode_boat, "boat")
+ .speed(1.38f, 20)
+ .locationIcon(LocationIcon.DEFAULT).navigationIcon(NavigationIcon.NAUTICAL)
+ .icon(R.drawable.ic_action_sail_boat_dark, R.drawable.map_action_sail_boat_dark, "ic_action_sail_boat_dark")
+ .setRoutingProfile("boat").description(R.string.base_profile_descr_boat).reg();
- public static final ApplicationMode AIRCRAFT = createBase(R.string.app_mode_aircraft, "aircraft").speed(40f, 100).carLocation().
- icon(R.drawable.ic_action_aircraft, R.drawable.map_action_aircraft,"ic_action_aircraft").setRouteService(RouteService.STRAIGHT).setRoutingProfile("STRAIGHT_LINE_MODE").description(R.string.base_profile_descr_aircraft).reg();
-
- public static final ApplicationMode SKI = createBase(R.string.app_mode_skiing, "ski").speed(1.38f, 15).arrivalDistance(60).offRouteDistance(50).bicycleLocation().
- icon(R.drawable.ic_action_skiing, R.drawable.ic_action_skiing,"ic_action_skiing").setRoutingProfile("ski").description(R.string.base_profile_descr_ski).reg();
+ public static final ApplicationMode AIRCRAFT = createBase(R.string.app_mode_aircraft, "aircraft")
+ .speed(40f, 100)
+ .locationIcon(LocationIcon.CAR).navigationIcon(NavigationIcon.DEFAULT)
+ .icon(R.drawable.ic_action_aircraft, R.drawable.map_action_aircraft, "ic_action_aircraft").setRouteService(RouteService.STRAIGHT)
+ .setRoutingProfile("STRAIGHT_LINE_MODE").description(R.string.base_profile_descr_aircraft).reg();
+ public static final ApplicationMode SKI = createBase(R.string.app_mode_skiing, "ski")
+ .speed(1.38f, 15).arrivalDistance(60).offRouteDistance(50)
+ .locationIcon(LocationIcon.BICYCLE).navigationIcon(NavigationIcon.DEFAULT)
+ .icon(R.drawable.ic_action_skiing, R.drawable.map_action_skiing, "ic_action_skiing")
+ .setRoutingProfile("ski").description(R.string.base_profile_descr_ski).reg();
private static class ApplicationModeBean {
- @Expose String stringKey;
- @Expose String userProfileName;
- @Expose String parent;
- @Expose String iconName = "map_world_globe_dark";
- @Expose ProfileIconColors iconColor = ProfileIconColors.DEFAULT;
- @Expose String routingProfile = null;
- @Expose RouteService routeService = RouteService.OSMAND;
- @Expose int order;
+ @Expose
+ String stringKey;
+ @Expose
+ String userProfileName;
+ @Expose
+ String parent;
+ @Expose
+ String iconName = "map_world_globe_dark";
+ @Expose
+ ProfileIconColors iconColor = ProfileIconColors.DEFAULT;
+ @Expose
+ String routingProfile = null;
+ @Expose
+ RouteService routeService = RouteService.OSMAND;
+ @Expose
+ LocationIcon locationIcon = LocationIcon.DEFAULT;
+ @Expose
+ NavigationIcon navigationIcon = NavigationIcon.DEFAULT;
+ @Expose
+ int order;
}
private static void initRegVisibility() {
@@ -165,7 +188,6 @@ public class ApplicationMode {
regWidgetAvailability(WIDGET_MAX_SPEED, CAR);
regWidgetAvailability(WIDGET_ALTITUDE, all);
-
// all = null everything
regWidgetAvailability(WIDGET_COMPASS, all);
regWidgetAvailability(WIDGET_MARKER_1, none);
@@ -182,7 +204,6 @@ public class ApplicationMode {
// regWidgetAvailability(WIDGET_STREET_NAME, all);
}
-
public static class ApplicationModeBuilder {
private ApplicationMode applicationMode;
@@ -206,14 +227,8 @@ public class ApplicationMode {
m.minDistanceForTurn = m.parentAppMode.minDistanceForTurn;
m.arrivalDistance = m.parentAppMode.arrivalDistance;
m.offRouteDistance = m.parentAppMode.offRouteDistance;
- m.bearingIconDay = m.parentAppMode.bearingIconDay;
- m.bearingIconNight = m.parentAppMode.bearingIconNight;
- m.headingIconDay = m.parentAppMode.headingIconDay;
- m.headingIconNight = m.parentAppMode.headingIconNight;
- m.locationIconDay = m.parentAppMode.locationIconDay;
- m.locationIconNight = m.parentAppMode.locationIconNight;
- m.locationIconDayLost = m.parentAppMode.locationIconDayLost;
- m.locationIconNightLost = m.parentAppMode.locationIconNightLost;
+ m.navigationIcon = m.parentAppMode.navigationIcon;
+ m.locationIcon = m.parentAppMode.locationIcon;
values.add(applicationMode);
if (applicationMode.getOrder() == 0 && !values.isEmpty()) {
applicationMode.setOrder(values.size());
@@ -250,61 +265,16 @@ public class ApplicationMode {
public ApplicationModeBuilder parent(ApplicationMode parent) {
applicationMode.parentAppMode = parent;
- if (parent == CAR || parent == AIRCRAFT) {
- this.carLocation();
- } else if (parent == BICYCLE || parent == SKI) {
- this.bicycleLocation();
- } else if (parent == BOAT) {
- this.nauticalLocation();
- } else {
- this.defLocation();
- }
return this;
}
- public ApplicationModeBuilder carLocation() {
- applicationMode.bearingIconDay = R.drawable.map_car_bearing;
- applicationMode.bearingIconNight = R.drawable.map_car_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_car_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_car_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_car_location;
- applicationMode.locationIconNight = R.drawable.map_car_location_night;
- applicationMode.locationIconDayLost = R.drawable.map_car_location_lost;
- applicationMode.locationIconNightLost = R.drawable.map_car_location_lost_night;
+ public ApplicationModeBuilder locationIcon(LocationIcon locationIcon) {
+ applicationMode.locationIcon = locationIcon;
return this;
}
- public ApplicationModeBuilder bicycleLocation() {
- applicationMode.bearingIconDay = R.drawable.map_bicycle_bearing;
- applicationMode.bearingIconNight = R.drawable.map_bicycle_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_bicycle_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_bicycle_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_bicycle_location;
- applicationMode.locationIconNight = R.drawable.map_bicycle_location_night;
- applicationMode.locationIconDayLost = R.drawable.map_bicycle_location_lost;
- applicationMode.locationIconNightLost = R.drawable.map_bicycle_location_lost_night;
- return this;
- }
-
- public ApplicationModeBuilder defLocation() {
- applicationMode.bearingIconDay = R.drawable.map_pedestrian_bearing;
- applicationMode.bearingIconNight = R.drawable.map_pedestrian_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_default_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_default_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_pedestrian_location;
- applicationMode.locationIconNight = R.drawable.map_pedestrian_location_night;
- applicationMode.locationIconDayLost = R.drawable.map_pedestrian_location_lost;
- applicationMode.locationIconNightLost = R.drawable.map_pedestrian_location_lost_night;
- return this;
- }
-
- public ApplicationModeBuilder nauticalLocation() {
- applicationMode.bearingIconDay = R.drawable.map_nautical_bearing;
- applicationMode.bearingIconNight = R.drawable.map_nautical_bearing_night;
- applicationMode.headingIconDay = R.drawable.map_nautical_location_view_angle;
- applicationMode.headingIconNight = R.drawable.map_nautical_location_view_angle_night;
- applicationMode.locationIconDay = R.drawable.map_nautical_location;
- applicationMode.locationIconNight = R.drawable.map_nautical_location_night;
+ public ApplicationModeBuilder navigationIcon(NavigationIcon navigationIcon) {
+ applicationMode.navigationIcon = navigationIcon;
return this;
}
@@ -508,36 +478,12 @@ public class ApplicationMode {
return getDefaultSpeed() > 10;
}
- public int getResourceBearingDay() {
- return bearingIconDay;
+ public NavigationIcon getNavigationIcon() {
+ return navigationIcon;
}
- public int getResourceBearingNight() {
- return bearingIconNight;
- }
-
- public int getResourceHeadingDay() {
- return headingIconDay;
- }
-
- public int getResourceHeadingNight() {
- return headingIconNight;
- }
-
- public int getResourceLocationDay() {
- return locationIconDay;
- }
-
- public int getResourceLocationNight() {
- return locationIconNight;
- }
-
- public int getResourceLocationDayLost() {
- return locationIconDayLost;
- }
-
- public int getResourceLocationNightLost() {
- return locationIconNightLost;
+ public LocationIcon getLocationIcon() {
+ return locationIcon;
}
public String getStringKey() {
@@ -548,7 +494,6 @@ public class ApplicationMode {
return keyName;
}
-
public String getCustomProfileName() {
return userProfileName;
}
@@ -619,12 +564,13 @@ public class ApplicationMode {
return routingProfile;
}
-
- @DrawableRes public int getIconRes() {
+ @DrawableRes
+ public int getIconRes() {
return iconRes;
}
- @DrawableRes public int getMapIconRes() {
+ @DrawableRes
+ public int getMapIconRes() {
return iconMapRes;
}
@@ -655,9 +601,9 @@ public class ApplicationMode {
}
private static void initDefaultSpeed(OsmandApplication app) {
- for(ApplicationMode m : values) {
+ for (ApplicationMode m : values) {
float spd = app.getSettings().DEFAULT_SPEED.getModeValue(m);
- if(spd > 0) {
+ if (spd > 0) {
m.defaultSpeed = spd;
}
}
@@ -693,6 +639,8 @@ public class ApplicationMode {
b.icon(app, mb.iconName);
b.setColor(mb.iconColor);
b.setOrder(mb.order);
+ b.locationIcon(mb.locationIcon);
+ b.navigationIcon(mb.navigationIcon);
return b;
}
@@ -705,6 +653,8 @@ public class ApplicationMode {
mb.stringKey = stringKey;
mb.routeService = routeService;
mb.routingProfile = routingProfile;
+ mb.locationIcon = locationIcon;
+ mb.navigationIcon = navigationIcon;
mb.order = order;
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
return gson.toJson(mb);
@@ -712,7 +662,8 @@ public class ApplicationMode {
private static void initDefaultModesParams(OsmandApplication app) {
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
- Type t = new TypeToken>() {}.getType();
+ Type t = new TypeToken>() {
+ }.getType();
List defaultAppModeBeans = gson.fromJson(app.getSettings().DEFAULT_APP_PROFILES.get(), t);
if (!Algorithms.isEmpty(defaultAppModeBeans)) {
@@ -724,15 +675,18 @@ public class ApplicationMode {
applicationMode.iconColor = modeBean.iconColor;
applicationMode.routingProfile = modeBean.routingProfile;
applicationMode.routeService = modeBean.routeService;
+ applicationMode.locationIcon = modeBean.locationIcon;
+ applicationMode.navigationIcon = modeBean.navigationIcon;
applicationMode.order = modeBean.order;
}
}
}
}
- private static void initCustomModes(OsmandApplication app){
+ private static void initCustomModes(OsmandApplication app) {
Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create();
- Type t = new TypeToken>() {}.getType();
+ Type t = new TypeToken>() {
+ }.getType();
List customProfiles = gson.fromJson(app.getSettings().CUSTOM_APP_PROFILES.get(), t);
if (!Algorithms.isEmpty(customProfiles)) {
@@ -743,6 +697,8 @@ public class ApplicationMode {
.setRoutingProfile(m.routingProfile)
.icon(app, m.iconName)
.setColor(m.iconColor)
+ .locationIcon(m.locationIcon)
+ .navigationIcon(m.navigationIcon)
.setOrder(m.order)
.customReg();
}
@@ -787,9 +743,10 @@ public class ApplicationMode {
mb.routeService = mode.routeService;
mb.routingProfile = mode.routingProfile;
mb.order = mode.order;
+ mb.locationIcon = mode.locationIcon;
+ mb.navigationIcon = mode.navigationIcon;
modeBeans.add(mb);
}
-
return modeBeans;
}
@@ -804,13 +761,14 @@ public class ApplicationMode {
mode.routingProfile = builder.applicationMode.routingProfile;
mode.routeService = builder.applicationMode.routeService;
mode.iconColor = builder.applicationMode.iconColor;
+ mode.locationIcon = builder.applicationMode.locationIcon;
+ mode.navigationIcon = builder.applicationMode.navigationIcon;
mode.order = builder.applicationMode.order;
} else {
mode = builder.customReg();
initRegVisibility();
}
saveAppModesToSettings(app.getSettings(), mode.isCustomProfile());
-
return mode;
}
@@ -860,17 +818,20 @@ public class ApplicationMode {
}
public enum ProfileIconColors {
- DEFAULT(R.string.rendering_value_default_name, R.color.profile_icon_color_blue_light_default, R.color.profile_icon_color_blue_dark_default),
+ DEFAULT(R.string.rendering_value_default_name, R.color.profile_icon_color_blue_light_default, R.color.profile_icon_color_blue_dark_default),
PURPLE(R.string.rendering_value_purple_name, R.color.profile_icon_color_purple_light, R.color.profile_icon_color_purple_dark),
- GREEN(R.string.rendering_value_green_name, R.color.profile_icon_color_green_light, R.color.profile_icon_color_green_dark),
- BLUE(R.string.rendering_value_blue_name, R.color.profile_icon_color_blue_light, R.color.profile_icon_color_blue_dark),
+ GREEN(R.string.rendering_value_green_name, R.color.profile_icon_color_green_light, R.color.profile_icon_color_green_dark),
+ BLUE(R.string.rendering_value_blue_name, R.color.profile_icon_color_blue_light, R.color.profile_icon_color_blue_dark),
RED(R.string.rendering_value_red_name, R.color.profile_icon_color_red_light, R.color.profile_icon_color_red_dark),
DARK_YELLOW(R.string.rendering_value_darkyellow_name, R.color.profile_icon_color_yellow_light, R.color.profile_icon_color_yellow_dark),
MAGENTA(R.string.shared_string_color_magenta, R.color.profile_icon_color_magenta_light, R.color.profile_icon_color_magenta_dark);
- @StringRes private int name;
- @ColorRes private int dayColor;
- @ColorRes private int nightColor;
+ @StringRes
+ private int name;
+ @ColorRes
+ private int dayColor;
+ @ColorRes
+ private int nightColor;
ProfileIconColors(@StringRes int name, @ColorRes int dayColor, @ColorRes int nightColor) {
this.name = name;
@@ -888,6 +849,7 @@ public class ApplicationMode {
}
public enum ProfileIcons {
+ DEFAULT(R.drawable.ic_world_globe_dark, R.string.app_mode_default, "ic_world_globe_dark"),
CAR(R.drawable.ic_action_car_dark, R.string.app_mode_car, "ic_action_car_dark"),
TAXI(R.drawable.ic_action_taxi, R.string.app_mode_taxi, "ic_action_taxi"),
TRUCK(R.drawable.ic_action_truck_dark, R.string.app_mode_truck, "ic_action_truck_dark"),
@@ -912,7 +874,8 @@ public class ApplicationMode {
CAMPER(R.drawable.ic_action_camper, R.string.app_mode_camper, "ic_action_camper"),
PICKUP_TRUCK(R.drawable.ic_action_pickup_truck, R.string.app_mode_pickup_truck, "ic_action_pickup_truck"),
WAGON(R.drawable.ic_action_wagon, R.string.app_mode_wagon, "ic_action_wagon"),
- UTV(R.drawable.ic_action_utv, R.string.app_mode_utv, "ic_action_utv");
+ UTV(R.drawable.ic_action_utv, R.string.app_mode_utv, "ic_action_utv"),
+ OSM(R.drawable.ic_action_osmand_logo, R.string.app_mode_osm, "ic_action_osmand_logo");
@DrawableRes
private int resId;
@@ -952,7 +915,48 @@ public class ApplicationMode {
return pi.resStringId;
}
}
- return CAR.getResStringId();
+ return DEFAULT.getResStringId();
+ }
+ }
+
+ public enum LocationIcon {
+ DEFAULT(R.drawable.map_location_default, R.drawable.map_location_default_view_angle),
+ CAR(R.drawable.map_location_car, R.drawable.map_location_car_view_angle),
+ BICYCLE(R.drawable.map_location_bicycle, R.drawable.map_location_bicycle_view_angle);
+
+ LocationIcon(@DrawableRes int iconId, @DrawableRes int headingIconId) {
+ this.iconId = iconId;
+ this.headingIconId = headingIconId;
+ }
+
+ @DrawableRes
+ private final int iconId;
+ @DrawableRes
+ private final int headingIconId;
+
+ public int getIconId() {
+ return iconId;
+ }
+
+ public int getHeadingIconId() {
+ return headingIconId;
+ }
+ }
+
+ public enum NavigationIcon {
+ DEFAULT(R.drawable.map_navigation_default),
+ NAUTICAL(R.drawable.map_navigation_nautical),
+ CAR(R.drawable.map_navigation_car);
+
+ NavigationIcon(@DrawableRes int iconId) {
+ this.iconId = iconId;
+ }
+
+ @DrawableRes
+ private final int iconId;
+
+ public int getIconId() {
+ return iconId;
}
}
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
index 0fdffdf8cb..68b232df3d 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java
@@ -50,7 +50,7 @@ import net.osmand.plus.api.SQLiteAPI;
import net.osmand.plus.api.SQLiteAPIImpl;
import net.osmand.plus.base.MapViewTrackingUtilities;
import net.osmand.plus.dialogs.CrashBottomSheetDialogFragment;
-import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
+import net.osmand.plus.dialogs.RateUsBottomSheetDialogFragment;
import net.osmand.plus.download.DownloadIndexesThread;
import net.osmand.plus.download.DownloadService;
import net.osmand.plus.download.IndexItem;
@@ -244,8 +244,8 @@ public class OsmandApplication extends MultiDexApplication {
if (routingHelper != null) {
routingHelper.getVoiceRouter().onApplicationTerminate();
}
- if(RateUsBottomSheetDialog.shouldShow(this)) {
- osmandSettings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.IGNORED);
+ if(RateUsBottomSheetDialogFragment.shouldShow(this)) {
+ osmandSettings.RATE_US_STATE.set(RateUsBottomSheetDialogFragment.RateUsState.IGNORED);
}
getNotificationHelper().removeNotifications(false);
}
@@ -871,10 +871,14 @@ public class OsmandApplication extends MultiDexApplication {
public OsmandRegions getRegions() {
return regions;
}
-
+
public boolean accessibilityEnabled() {
- final AccessibilityMode mode = getSettings().ACCESSIBILITY_MODE.get();
- if(OsmandPlugin.getEnabledPlugin(AccessibilityPlugin.class) == null) {
+ return accessibilityEnabledForMode(getSettings().APPLICATION_MODE.get());
+ }
+
+ public boolean accessibilityEnabledForMode(ApplicationMode appMode) {
+ final AccessibilityMode mode = getSettings().ACCESSIBILITY_MODE.getModeValue(appMode);
+ if (OsmandPlugin.getEnabledPlugin(AccessibilityPlugin.class) == null) {
return false;
}
if (mode == AccessibilityMode.ON) {
diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
index a5c4004aff..9aa4551a84 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java
@@ -36,6 +36,7 @@ import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
import net.osmand.plus.osmedit.OsmEditingPlugin;
import net.osmand.plus.parkingpoint.ParkingPositionPlugin;
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.skimapsplugin.SkiMapsPlugin;
import net.osmand.plus.srtmplugin.SRTMPlugin;
import net.osmand.plus.views.OsmandMapTileView;
@@ -61,10 +62,10 @@ public abstract class OsmandPlugin {
public abstract String getId();
- public abstract String getDescription();
-
public abstract String getName();
+ public abstract String getDescription();
+
public abstract int getAssetResourceName();
@DrawableRes
@@ -72,7 +73,17 @@ public abstract class OsmandPlugin {
return R.drawable.ic_extension_dark;
}
- public abstract Class extends Activity> getSettingsActivity();
+ public Class extends Activity> getSettingsActivity() {
+ return null;
+ }
+
+ public Class extends BaseSettingsFragment> getSettingsFragment() {
+ return null;
+ }
+
+ public String getPrefsDescription() {
+ return null;
+ }
public String getVersion() {
return "";
diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
index 17268ba03e..32bd59b209 100644
--- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java
+++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java
@@ -35,7 +35,7 @@ import net.osmand.plus.access.RelativeDirectionStyle;
import net.osmand.plus.api.SettingsAPI;
import net.osmand.plus.api.SettingsAPI.SettingsEditor;
import net.osmand.plus.api.SettingsAPIImpl;
-import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
+import net.osmand.plus.dialogs.RateUsBottomSheetDialogFragment;
import net.osmand.plus.helpers.SearchHistoryHelper;
import net.osmand.plus.mapillary.MapillaryPlugin;
import net.osmand.plus.mapmarkers.CoordinateInputFormats.Format;
@@ -833,17 +833,23 @@ public class OsmandSettings {
}
@Override
- protected Boolean getValue(Object prefs, Boolean defaultValue) {
- return ctx.accessibilityEnabled() ?
- super.getValue(prefs, defaultValue) :
- defaultValue;
+ public Boolean get() {
+ return ctx.accessibilityEnabled() ? super.get() : getDefaultValue();
}
@Override
- protected boolean setValue(Object prefs, Boolean val) {
- return ctx.accessibilityEnabled() ?
- super.setValue(prefs, val) :
- false;
+ public Boolean getModeValue(ApplicationMode mode) {
+ return ctx.accessibilityEnabledForMode(mode) ? super.getModeValue(mode) : getDefaultValue();
+ }
+
+ @Override
+ public boolean set(Boolean obj) {
+ return ctx.accessibilityEnabled() && super.set(obj);
+ }
+
+ @Override
+ public boolean setModeValue(ApplicationMode mode, Boolean obj) {
+ return ctx.accessibilityEnabledForMode(mode) && super.setModeValue(mode, obj);
}
}
@@ -1179,9 +1185,6 @@ public class OsmandSettings {
public final CommonPreference NUMBER_OF_STARTS_FIRST_XMAS_SHOWN = new IntPreference("number_of_starts_first_xmas_shown", 0).makeGlobal();
- // this value string is synchronized with settings_pref.xml preference name
- public final CommonPreference USE_INTERNET_TO_DOWNLOAD_TILES = new BooleanPreference("use_internet_to_download_tiles", true).makeGlobal().cache();
-
public final OsmandPreference AVAILABLE_APP_MODES = new StringPreference("available_application_modes", "car,bicycle,pedestrian,public_transport,").makeGlobal().cache();
public final OsmandPreference LAST_FAV_CATEGORY_ENTERED = new StringPreference("last_fav_category", "").makeGlobal();
@@ -1374,16 +1377,16 @@ public class OsmandSettings {
// this value string is synchronized with settings_pref.xml preference name
// cache of metrics constants as they are used very often
public final OsmandPreference DIRECTION_STYLE = new EnumIntPreference(
- "direction_style", RelativeDirectionStyle.SIDEWISE, RelativeDirectionStyle.values()).makeGlobal().cache();
+ "direction_style", RelativeDirectionStyle.SIDEWISE, RelativeDirectionStyle.values()).makeProfile().cache();
// this value string is synchronized with settings_pref.xml preference name
// cache of metrics constants as they are used very often
public final OsmandPreference ACCESSIBILITY_MODE = new EnumIntPreference(
- "accessibility_mode", AccessibilityMode.DEFAULT, AccessibilityMode.values()).makeGlobal().cache();
+ "accessibility_mode", AccessibilityMode.DEFAULT, AccessibilityMode.values()).makeProfile().cache();
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference SPEECH_RATE =
- new FloatPreference("speech_rate", 1f).makeGlobal();
+ new FloatPreference("speech_rate", 1f).makeProfile();
public final OsmandPreference ARRIVAL_DISTANCE_FACTOR =
new FloatPreference("arrival_distance_factor", 1f).makeProfile();
@@ -1409,27 +1412,27 @@ public class OsmandSettings {
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference ACCESSIBILITY_SMART_AUTOANNOUNCE =
- new BooleanAccessibilityPreference("accessibility_smart_autoannounce", true).makeGlobal();
+ new BooleanAccessibilityPreference("accessibility_smart_autoannounce", true).makeProfile();
// this value string is synchronized with settings_pref.xml preference name
// cache of metrics constants as they are used very often
- public final OsmandPreference ACCESSIBILITY_AUTOANNOUNCE_PERIOD = new IntPreference("accessibility_autoannounce_period", 10000).makeGlobal().cache();
+ public final OsmandPreference ACCESSIBILITY_AUTOANNOUNCE_PERIOD = new IntPreference("accessibility_autoannounce_period", 10000).makeProfile().cache();
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference DISABLE_OFFROUTE_RECALC =
- new BooleanAccessibilityPreference("disable_offroute_recalc", false).makeGlobal();
+ new BooleanAccessibilityPreference("disable_offroute_recalc", false).makeProfile();
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference DISABLE_WRONG_DIRECTION_RECALC =
- new BooleanAccessibilityPreference("disable_wrong_direction_recalc", false).makeGlobal();
+ new BooleanAccessibilityPreference("disable_wrong_direction_recalc", false).makeProfile();
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference DIRECTION_AUDIO_FEEDBACK =
- new BooleanAccessibilityPreference("direction_audio_feedback", false).makeGlobal();
+ new BooleanAccessibilityPreference("direction_audio_feedback", false).makeProfile();
// this value string is synchronized with settings_pref.xml preference name
public final OsmandPreference DIRECTION_HAPTIC_FEEDBACK =
- new BooleanAccessibilityPreference("direction_haptic_feedback", false).makeGlobal();
+ new BooleanAccessibilityPreference("direction_haptic_feedback", false).makeProfile();
// magnetic field doesn'torkmost of the time on some phones
public final OsmandPreference USE_MAGNETIC_FIELD_SENSOR_COMPASS = new BooleanPreference("use_magnetic_field_sensor_compass", false).makeProfile().cache();
@@ -3208,19 +3211,19 @@ public class OsmandSettings {
public final OsmandPreference NUMBER_OF_FREE_DOWNLOADS = new IntPreference(NUMBER_OF_FREE_DOWNLOADS_ID, 0).makeGlobal();
- // For DashRateUsFragment
+ // For RateUsDialog
public final OsmandPreference LAST_DISPLAY_TIME =
new LongPreference("last_display_time", 0).makeGlobal().cache();
public final OsmandPreference LAST_CHECKED_UPDATES =
new LongPreference("last_checked_updates", 0).makeGlobal();
- public final OsmandPreference NUMBER_OF_APPLICATION_STARTS =
- new IntPreference("number_of_app_starts", 0).makeGlobal().cache();
+ public final OsmandPreference NUMBER_OF_APP_STARTS_ON_DISLIKE_MOMENT =
+ new IntPreference("number_of_app_starts_on_dislike_moment", 0).makeGlobal().cache();
- public final OsmandPreference RATE_US_STATE =
+ public final OsmandPreference RATE_US_STATE =
new EnumIntPreference<>("rate_us_state",
- RateUsBottomSheetDialog.RateUsState.INITIAL_STATE, RateUsBottomSheetDialog.RateUsState.values())
+ RateUsBottomSheetDialogFragment.RateUsState.INITIAL_STATE, RateUsBottomSheetDialogFragment.RateUsState.values())
.makeGlobal();
public final CommonPreference DEFAULT_APP_PROFILES =
diff --git a/OsmAnd/src/net/osmand/plus/SettingsHelper.java b/OsmAnd/src/net/osmand/plus/SettingsHelper.java
index c95a8d5312..61509da462 100644
--- a/OsmAnd/src/net/osmand/plus/SettingsHelper.java
+++ b/OsmAnd/src/net/osmand/plus/SettingsHelper.java
@@ -83,7 +83,7 @@ public class SettingsHelper {
private ImportAsyncTask importTask;
public interface SettingsImportListener {
- void onSettingsImportFinished(boolean succeed, boolean empty);
+ void onSettingsImportFinished(boolean succeed, boolean empty, @NonNull List items);
}
public interface SettingsExportListener {
@@ -913,7 +913,7 @@ public class SettingsHelper {
@Override
protected void onPreExecute() {
if (importing) {
- finishImport(listener, false, false);
+ finishImport(listener, false, false, items);
}
importing = true;
importSuspended = false;
@@ -948,7 +948,7 @@ public class SettingsHelper {
if (processedItems.size() > 0) {
new ImportItemsAsyncTask(file, listener, processedItems).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
} else {
- finishImport(listener, false, true);
+ finishImport(listener, false, true, items);
}
return;
}
@@ -1063,16 +1063,16 @@ public class SettingsHelper {
@Override
protected void onPostExecute(Boolean success) {
- finishImport(listener, success, false);
+ finishImport(listener, success, false, items);
}
}
- private void finishImport(@Nullable SettingsImportListener listener, boolean success, boolean empty) {
+ private void finishImport(@Nullable SettingsImportListener listener, boolean success, boolean empty, List items) {
importing = false;
importSuspended = false;
importTask = null;
if (listener != null) {
- listener.onSettingsImportFinished(success, empty);
+ listener.onSettingsImportFinished(success, empty, items);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
index 8699027ea0..36e8bcc4f2 100644
--- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java
@@ -64,6 +64,7 @@ import net.osmand.plus.helpers.AndroidUiHelper;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
import net.osmand.plus.monitoring.OsmandMonitoringPlugin;
import net.osmand.plus.myplaces.FavoritesActivity;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.plus.views.mapwidgets.TextInfoWidget;
@@ -538,25 +539,25 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
this.app = app;
OsmandSettings settings = app.getSettings();
ApplicationMode.regWidgetVisibility("audionotes", (ApplicationMode[]) null);
- AV_EXTERNAL_RECORDER = settings.registerBooleanPreference("av_external_recorder", false).makeGlobal();
- AV_EXTERNAL_PHOTO_CAM = settings.registerBooleanPreference("av_external_cam", true).makeGlobal();
- AV_VIDEO_FORMAT = settings.registerIntPreference("av_video_format", VIDEO_OUTPUT_MP4).makeGlobal();
- AV_VIDEO_QUALITY = settings.registerIntPreference("av_video_quality", VIDEO_QUALITY_DEFAULT).makeGlobal();
- AV_AUDIO_FORMAT = settings.registerIntPreference("av_audio_format", AUDIO_FORMAT_DEFAULT).makeGlobal();
- AV_AUDIO_BITRATE = settings.registerIntPreference("av_audio_bitrate", AUDIO_BITRATE_DEFAULT).makeGlobal();
- AV_DEFAULT_ACTION = settings.registerIntPreference("av_default_action", AV_DEFAULT_ACTION_CHOOSE).makeGlobal();
+ AV_EXTERNAL_RECORDER = settings.registerBooleanPreference("av_external_recorder", false);
+ AV_EXTERNAL_PHOTO_CAM = settings.registerBooleanPreference("av_external_cam", true);
+ AV_VIDEO_FORMAT = settings.registerIntPreference("av_video_format", VIDEO_OUTPUT_MP4);
+ AV_VIDEO_QUALITY = settings.registerIntPreference("av_video_quality", VIDEO_QUALITY_DEFAULT);
+ AV_AUDIO_FORMAT = settings.registerIntPreference("av_audio_format", AUDIO_FORMAT_DEFAULT);
+ AV_AUDIO_BITRATE = settings.registerIntPreference("av_audio_bitrate", AUDIO_BITRATE_DEFAULT);
+ AV_DEFAULT_ACTION = settings.registerIntPreference("av_default_action", AV_DEFAULT_ACTION_CHOOSE);
// camera picture size:
- AV_CAMERA_PICTURE_SIZE = settings.registerIntPreference("av_camera_picture_size", AV_PHOTO_SIZE_DEFAULT).makeGlobal();
+ AV_CAMERA_PICTURE_SIZE = settings.registerIntPreference("av_camera_picture_size", AV_PHOTO_SIZE_DEFAULT);
// camera focus type:
- AV_CAMERA_FOCUS_TYPE = settings.registerIntPreference("av_camera_focus_type", AV_CAMERA_FOCUS_AUTO).makeGlobal();
+ AV_CAMERA_FOCUS_TYPE = settings.registerIntPreference("av_camera_focus_type", AV_CAMERA_FOCUS_AUTO);
// camera sound:
- AV_PHOTO_PLAY_SOUND = settings.registerBooleanPreference("av_photo_play_sound", true).makeGlobal();
+ AV_PHOTO_PLAY_SOUND = settings.registerBooleanPreference("av_photo_play_sound", true);
- SHOW_RECORDINGS = settings.registerBooleanPreference("show_recordings", true).makeGlobal();
+ SHOW_RECORDINGS = settings.registerBooleanPreference("show_recordings", true);
- AV_RECORDER_SPLIT = settings.registerBooleanPreference("av_recorder_split", false).makeGlobal();
- AV_RS_CLIP_LENGTH = settings.registerIntPreference("av_rs_clip_length", CLIP_LENGTH_DEFAULT).makeGlobal();
- AV_RS_STORAGE_SIZE = settings.registerIntPreference("av_rs_storage_size", STORAGE_SIZE_DEFAULT).makeGlobal();
+ AV_RECORDER_SPLIT = settings.registerBooleanPreference("av_recorder_split", false);
+ AV_RS_CLIP_LENGTH = settings.registerIntPreference("av_rs_clip_length", CLIP_LENGTH_DEFAULT);
+ AV_RS_STORAGE_SIZE = settings.registerIntPreference("av_rs_storage_size", STORAGE_SIZE_DEFAULT);
}
@Override
@@ -1788,6 +1789,15 @@ public class AudioVideoNotesPlugin extends OsmandPlugin {
return SettingsAudioVideoActivity.class;
}
+ @Override
+ public Class extends BaseSettingsFragment> getSettingsFragment() {
+ return MultimediaNotesFragment.class;
+ }
+
+ @Override
+ public String getPrefsDescription() {
+ return app.getString(R.string.multimedia_notes_prefs_descr);
+ }
@Override
public void onMapActivityExternalResult(int requestCode, int resultCode, Intent data) {
diff --git a/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java
new file mode 100644
index 0000000000..3abdb37e56
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/audionotes/MultimediaNotesFragment.java
@@ -0,0 +1,368 @@
+package net.osmand.plus.audionotes;
+
+import android.content.Intent;
+import android.hardware.Camera;
+import android.media.CamcorderProfile;
+import android.media.MediaRecorder;
+import android.os.Build;
+import android.os.StatFs;
+import android.support.v7.preference.Preference;
+
+import net.osmand.PlatformUtil;
+import net.osmand.plus.OsmAndAppCustomization;
+import net.osmand.plus.OsmandPlugin;
+import net.osmand.plus.R;
+import net.osmand.plus.settings.BaseSettingsFragment;
+import net.osmand.plus.settings.preferences.ListPreferenceEx;
+import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
+
+import org.apache.commons.logging.Log;
+
+import java.io.File;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AUDIO_BITRATE_DEFAULT;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_AUTO;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_CONTINUOUS;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_EDOF;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_HIPERFOCAL;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_INFINITY;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.AV_CAMERA_FOCUS_MACRO;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.NOTES_TAB;
+import static net.osmand.plus.audionotes.AudioVideoNotesPlugin.cameraPictureSizeDefault;
+
+public class MultimediaNotesFragment extends BaseSettingsFragment {
+
+ private static final Log log = PlatformUtil.getLog(MultimediaNotesFragment.class);
+
+ private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
+ private static final String RESET_TO_DEFAULT = "reset_to_default";
+ private static final String OPEN_NOTES = "open_notes";
+
+ @Override
+ protected void setupPreferences() {
+ AudioVideoNotesPlugin plugin = OsmandPlugin.getPlugin(AudioVideoNotesPlugin.class);
+
+ if (plugin != null) {
+
+ Camera cam = openCamera();
+ if (cam != null) {
+ setupExternalPhotoCamPref(plugin);
+ setupCameraPictureSizePref(cam, plugin);
+ setupCameraFocusTypePref(cam, plugin);
+ setupPhotoPlaySoundPref(plugin);
+ cam.release();
+ }
+
+ setupAudioFormatPref(plugin);
+ setupAudioBitratePref(plugin);
+
+ setupExternalRecorderPref(plugin);
+ setupVideoQualityPref(plugin);
+
+ setupRecorderSplitPref(plugin);
+ setupClipLengthPref(plugin);
+ setupStorageSizePref(plugin);
+
+ setupOpenNotesDescrPref();
+ setupOpenNotesPref();
+
+ setupCopyProfileSettingsPref();
+ setupResetToDefaultPref();
+ }
+ }
+
+ private void setupExternalPhotoCamPref(AudioVideoNotesPlugin plugin) {
+ SwitchPreferenceEx externalPhotoCam = (SwitchPreferenceEx) findPreference(plugin.AV_EXTERNAL_PHOTO_CAM.getId());
+ externalPhotoCam.setDescription(getString(R.string.av_use_external_camera_descr));
+ externalPhotoCam.setIcon(getActiveIcon(R.drawable.ic_action_photo_dark));
+ }
+
+ private void setupCameraPictureSizePref(Camera cam, AudioVideoNotesPlugin plugin) {
+ Camera.Parameters parameters = cam.getParameters();
+
+ // Photo picture size
+ // get supported sizes
+ List psps = parameters.getSupportedPictureSizes();
+ // list of megapixels of each resolution
+ List mpix = new ArrayList();
+ // list of index each resolution in list, returned by getSupportedPictureSizes()
+ List picSizesValues = new ArrayList();
+ // fill lists for sort
+ for (int index = 0; index < psps.size(); index++) {
+ mpix.add((psps.get(index)).width * (psps.get(index)).height);
+ picSizesValues.add(index);
+ }
+ // sort list for max resolution in begining of list
+ for (int i = 0; i < mpix.size(); i++) {
+ for (int j = 0; j < mpix.size() - i - 1; j++) {
+ if (mpix.get(j) < mpix.get(j + 1)) {
+ // change elements
+ int tmp = mpix.get(j + 1);
+ mpix.set(j + 1, mpix.get(j));
+ mpix.set(j, tmp);
+
+ tmp = picSizesValues.get(j + 1);
+ picSizesValues.set(j + 1, picSizesValues.get(j));
+ picSizesValues.set(j, tmp);
+ }
+ }
+ }
+ // set default photo size to max resolution (set index of element with max resolution in List, returned by getSupportedPictureSizes() )
+ cameraPictureSizeDefault = picSizesValues.get(0);
+ log.debug("onCreate() set cameraPictureSizeDefault=" + cameraPictureSizeDefault);
+
+ List itemsPicSizes = new ArrayList();
+ String prefix;
+ for (int index = 0; index < psps.size(); index++) {
+ float px = (float) ((psps.get(picSizesValues.get(index))).width * (psps.get(picSizesValues.get(index))).height);
+ if (px > 102400) { // 100 K
+ px = px / 1048576;
+ prefix = "Mpx";
+ } else {
+ px = px / 1024;
+ prefix = "Kpx";
+ }
+
+ itemsPicSizes.add((psps.get(picSizesValues.get(index))).width
+ + "x" + (psps.get(picSizesValues.get(index))).height
+ + " ( " + String.format("%.2f", px) + " " + prefix + " )");
+ }
+ log.debug("onCreate() set default size: width=" + psps.get(cameraPictureSizeDefault).width + " height="
+ + psps.get(cameraPictureSizeDefault).height + " index in ps=" + cameraPictureSizeDefault);
+
+ String[] entries = itemsPicSizes.toArray(new String[0]);
+ Integer[] entryValues = picSizesValues.toArray(new Integer[0]);
+
+ ListPreferenceEx cameraPictureSize = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_PICTURE_SIZE.getId());
+ if (entries.length > 0) {
+ cameraPictureSize.setEntries(entries);
+ cameraPictureSize.setEntryValues(entryValues);
+ cameraPictureSize.setDescription(R.string.av_camera_pic_size_descr);
+ cameraPictureSize.setIcon(getActiveIcon(R.drawable.ic_action_picture_size));
+ } else {
+ cameraPictureSize.setVisible(false);
+ }
+ }
+
+ private void setupCameraFocusTypePref(Camera cam, AudioVideoNotesPlugin plugin) {
+ Camera.Parameters parameters = cam.getParameters();
+
+ // focus mode settings
+ // show in menu only suppoted modes
+ List sfm = parameters.getSupportedFocusModes();
+ List items = new ArrayList();
+ List itemsValues = new ArrayList();
+ // filtering known types for translate and set index
+ for (int index = 0; index < sfm.size(); index++) {
+ if (sfm.get(index).equals("auto")) {
+ items.add(getString(R.string.av_camera_focus_auto));
+ itemsValues.add(AV_CAMERA_FOCUS_AUTO);
+ } else if (sfm.get(index).equals("fixed")) {
+ items.add(getString(R.string.av_camera_focus_hiperfocal));
+ itemsValues.add(AV_CAMERA_FOCUS_HIPERFOCAL);
+ } else if (sfm.get(index).equals("edof")) {
+ items.add(getString(R.string.av_camera_focus_edof));
+ itemsValues.add(AV_CAMERA_FOCUS_EDOF);
+ } else if (sfm.get(index).equals("infinity")) {
+ items.add(getString(R.string.av_camera_focus_infinity));
+ itemsValues.add(AV_CAMERA_FOCUS_INFINITY);
+ } else if (sfm.get(index).equals("macro")) {
+ items.add(getString(R.string.av_camera_focus_macro));
+ itemsValues.add(AV_CAMERA_FOCUS_MACRO);
+ } else if (sfm.get(index).equals("continuous-picture")) {
+ items.add(getString(R.string.av_camera_focus_continuous));
+ itemsValues.add(AV_CAMERA_FOCUS_CONTINUOUS);
+ }
+ }
+
+ String[] entries = items.toArray(new String[0]);
+ Integer[] entryValues = itemsValues.toArray(new Integer[0]);
+
+ ListPreferenceEx cameraFocusType = (ListPreferenceEx) findPreference(plugin.AV_CAMERA_FOCUS_TYPE.getId());
+ if (entries.length > 0) {
+ cameraFocusType.setEntries(entries);
+ cameraFocusType.setEntryValues(entryValues);
+ cameraFocusType.setDescription(R.string.av_camera_focus_descr);
+ cameraFocusType.setIcon(getActiveIcon(R.drawable.ic_action_camera_focus));
+ } else {
+ cameraFocusType.setVisible(false);
+ }
+ }
+
+ private void setupPhotoPlaySoundPref(AudioVideoNotesPlugin plugin) {
+ SwitchPreferenceEx photoPlaySound = (SwitchPreferenceEx) findPreference(plugin.AV_PHOTO_PLAY_SOUND.getId());
+ photoPlaySound.setDescription(getString(R.string.av_photo_play_sound_descr));
+ photoPlaySound.setIcon(getContentIcon(R.drawable.ic_action_music_off));
+ }
+
+ private void setupAudioFormatPref(AudioVideoNotesPlugin plugin) {
+ Integer[] entryValues = new Integer[] {MediaRecorder.AudioEncoder.DEFAULT, MediaRecorder.AudioEncoder.AAC};
+ String[] entries = new String[] {"Default", "AAC"};
+
+ ListPreferenceEx audioFormat = (ListPreferenceEx) findPreference(plugin.AV_AUDIO_FORMAT.getId());
+ audioFormat.setEntries(entries);
+ audioFormat.setEntryValues(entryValues);
+ audioFormat.setDescription(R.string.av_audio_format_descr);
+ }
+
+ private void setupAudioBitratePref(AudioVideoNotesPlugin plugin) {
+ Integer[] entryValues = new Integer[] {AUDIO_BITRATE_DEFAULT, 16 * 1024, 32 * 1024, 48 * 1024, 64 * 1024, 96 * 1024, 128 * 1024};
+ String[] entries = new String[] {"Default", "16 kbps", "32 kbps", "48 kbps", "64 kbps", "96 kbps", "128 kbps"};
+
+ ListPreferenceEx audioBitrate = (ListPreferenceEx) findPreference(plugin.AV_AUDIO_BITRATE.getId());
+ audioBitrate.setEntries(entries);
+ audioBitrate.setEntryValues(entryValues);
+ audioBitrate.setDescription(R.string.av_audio_bitrate_descr);
+ }
+
+ private void setupExternalRecorderPref(AudioVideoNotesPlugin plugin) {
+ SwitchPreferenceEx externalRecorder = (SwitchPreferenceEx) findPreference(plugin.AV_EXTERNAL_RECORDER.getId());
+ externalRecorder.setDescription(getString(R.string.av_use_external_recorder_descr));
+ externalRecorder.setIcon(getContentIcon(R.drawable.ic_action_video_dark));
+ }
+
+ private void setupVideoQualityPref(AudioVideoNotesPlugin plugin) {
+ List qNames = new ArrayList<>();
+ List qValues = new ArrayList<>();
+ if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_LOW)) {
+ qNames.add(getString(R.string.av_video_quality_low));
+ qValues.add(CamcorderProfile.QUALITY_LOW);
+ }
+ if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_480P)) {
+ qNames.add("720 x 480 (480p)");
+ qValues.add(CamcorderProfile.QUALITY_480P);
+ }
+ if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_720P)) {
+ qNames.add("1280 x 720 (720p)");
+ qValues.add(CamcorderProfile.QUALITY_720P);
+ }
+ if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_1080P)) {
+ qNames.add("1920 x 1080 (1080p)");
+ qValues.add(CamcorderProfile.QUALITY_1080P);
+ }
+ if (Build.VERSION.SDK_INT >= 21 && CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_2160P)) {
+ qNames.add("3840x2160 (2160p)");
+ qValues.add(CamcorderProfile.QUALITY_2160P);
+ }
+ if (CamcorderProfile.hasProfile(CamcorderProfile.QUALITY_HIGH)) {
+ qNames.add(getString(R.string.av_video_quality_high));
+ qValues.add(CamcorderProfile.QUALITY_HIGH);
+ }
+
+ String[] entries = qNames.toArray(new String[0]);
+ Integer[] entryValues = qValues.toArray(new Integer[0]);
+
+ ListPreferenceEx videoQuality = (ListPreferenceEx) findPreference(plugin.AV_VIDEO_QUALITY.getId());
+ videoQuality.setEntries(entries);
+ videoQuality.setEntryValues(entryValues);
+ videoQuality.setDescription(R.string.av_video_quality_descr);
+ videoQuality.setIcon(getContentIcon(R.drawable.ic_action_picture_size));
+ }
+
+ private void setupRecorderSplitPref(AudioVideoNotesPlugin plugin) {
+ SwitchPreferenceEx recorderSplit = (SwitchPreferenceEx) findPreference(plugin.AV_RECORDER_SPLIT.getId());
+ recorderSplit.setDescription(getString(R.string.rec_split_desc));
+ }
+
+ private void setupClipLengthPref(AudioVideoNotesPlugin plugin) {
+ Integer[] entryValues = new Integer[] {1, 2, 3, 4, 5, 7, 10, 15, 20, 25, 30};
+ String[] entries = new String[entryValues.length];
+ int i = 0;
+ String minStr = getString(R.string.int_min);
+ for (int v : entryValues) {
+ entries[i++] = v + " " + minStr;
+ }
+
+ ListPreferenceEx clipLength = (ListPreferenceEx) findPreference(plugin.AV_RS_CLIP_LENGTH.getId());
+ clipLength.setEntries(entries);
+ clipLength.setEntryValues(entryValues);
+ clipLength.setDescription(R.string.rec_split_clip_length_desc);
+ }
+
+ private void setupStorageSizePref(AudioVideoNotesPlugin plugin) {
+ ListPreferenceEx storageSize = (ListPreferenceEx) findPreference(plugin.AV_RS_STORAGE_SIZE.getId());
+
+ File dir = app.getAppPath("").getParentFile();
+ long size = 0;
+ if (dir.canRead()) {
+ StatFs fs = new StatFs(dir.getAbsolutePath());
+ size = ((long) fs.getBlockSize() * (long) fs.getBlockCount()) / (1 << 30);
+ }
+ if (size > 0) {
+ int value = 1;
+ ArrayList gbList = new ArrayList<>();
+ while (value < size) {
+ gbList.add(value);
+ if (value < 5) {
+ value++;
+ } else {
+ value += 5;
+ }
+ }
+ if (value != size) {
+ gbList.add((int) size);
+ }
+ MessageFormat formatGb = new MessageFormat("{0, number,#.##} GB", Locale.US);
+ String[] entries = new String[gbList.size()];
+ Integer[] entryValues = new Integer[gbList.size()];
+ int i = 0;
+ for (int v : gbList) {
+ entryValues[i] = v;
+ entries[i] = formatGb.format(new Object[] {(float) v});
+ i++;
+ }
+
+ storageSize.setEntries(entries);
+ storageSize.setEntryValues(entryValues);
+ storageSize.setDescription(R.string.rec_split_storage_size_desc);
+ } else {
+ storageSize.setVisible(false);
+ }
+ }
+
+ private void setupOpenNotesDescrPref() {
+ Preference nameAndPasswordPref = findPreference("open_notes_description");
+ nameAndPasswordPref.setTitle(getText(R.string.multimedia_notes_view_descr));
+ }
+
+ private void setupOpenNotesPref() {
+ Preference openNotes = findPreference(OPEN_NOTES);
+ openNotes.setIcon(getActiveIcon(R.drawable.ic_action_folder));
+ }
+
+ private void setupCopyProfileSettingsPref() {
+ Preference copyProfilePrefs = findPreference(COPY_PLUGIN_SETTINGS);
+ copyProfilePrefs.setIcon(getActiveIcon(R.drawable.ic_action_copy));
+ }
+
+ private void setupResetToDefaultPref() {
+ Preference resetToDefault = findPreference(RESET_TO_DEFAULT);
+ resetToDefault.setIcon(getActiveIcon(R.drawable.ic_action_reset_to_default_dark));
+ }
+
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ if (OPEN_NOTES.equals(preference.getKey())) {
+ OsmAndAppCustomization appCustomization = app.getAppCustomization();
+ Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
+ favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+ app.getSettings().FAVORITES_TAB.set(NOTES_TAB);
+ startActivity(favorites);
+ return true;
+ }
+ return super.onPreferenceClick(preference);
+ }
+
+ private Camera openCamera() {
+ try {
+ return Camera.open();
+ } catch (Exception e) {
+ log.error("Error open camera", e);
+ return null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java b/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java
deleted file mode 100644
index bb372f91f9..0000000000
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashRateUsFragment.java
+++ /dev/null
@@ -1,165 +0,0 @@
-package net.osmand.plus.dashboard;
-
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.TextView;
-
-import net.osmand.plus.OsmandSettings;
-import net.osmand.plus.R;
-import net.osmand.plus.Version;
-import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.dashboard.tools.DashFragmentData;
-import net.osmand.plus.dialogs.RateUsBottomSheetDialog;
-
-public class DashRateUsFragment extends DashBaseFragment {
- public static final String TAG = "DASH_RATE_US_FRAGMENT";
-
- public static final DashFragmentData.ShouldShowFunction SHOULD_SHOW_FUNCTION =
- new DashboardOnMap.DefaultShouldShow() {
- @Override
- public boolean shouldShow(OsmandSettings settings, MapActivity activity, String tag) {
- return RateUsBottomSheetDialog.shouldShow(activity.getMyApplication())
- && super.shouldShow(settings, activity, tag);
- }
- };
-
- private RateUsBottomSheetDialog.FragmentState state = RateUsBottomSheetDialog.FragmentState.INITIAL_STATE;
- private RateUsDismissListener mRateUsDismissListener;
-
- @Override
- public void onOpenDash() {
-
- }
-
- @Override
- public View initView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- View view = getActivity().getLayoutInflater().inflate(R.layout.dash_rate_us_fragment, container, false);
- TextView header = (TextView) view.findViewById(R.id.header);
- TextView subheader = (TextView) view.findViewById(R.id.subheader);
- Button positiveButton = (Button) view.findViewById(R.id.positive_button);
- Button negativeButton = (Button) view.findViewById(R.id.negative_button);
- positiveButton.setOnClickListener(
- new PositiveButtonListener(header, subheader, positiveButton, negativeButton));
- negativeButton.setOnClickListener(
- new NegativeButtonListener(header, subheader, positiveButton, negativeButton));
- OsmandSettings settings = getMyApplication().getSettings();
- mRateUsDismissListener = new RateUsDismissListener(dashboard, settings);
- return view;
- }
-
- @Override
- public DismissListener getDismissCallback() {
- return mRateUsDismissListener;
- }
-
- public class PositiveButtonListener implements View.OnClickListener {
- private TextView header;
- private TextView subheader;
- private Button positiveButton;
- private Button negativeButton;
-
- public PositiveButtonListener(TextView header, TextView subheader, Button positiveButton,
- Button negativeButton) {
- this.header = header;
- this.subheader = subheader;
- this.positiveButton = positiveButton;
- this.negativeButton = negativeButton;
- }
-
- @Override
- public void onClick(View v) {
- final OsmandSettings settings = getMyApplication().getSettings();
- switch (state) {
- case INITIAL_STATE:
- state = RateUsBottomSheetDialog.FragmentState.USER_LIKES_APP;
-
- header.setText(getResources().getString(R.string.rate_this_app));
- subheader.setText(getResources().getString(R.string.rate_this_app_long));
- positiveButton.setText(getResources().getString(R.string.shared_string_ok));
- negativeButton.setText(getResources().getString(R.string.shared_string_no_thanks));
- return;
- case USER_LIKES_APP:
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
- Uri uri = Uri.parse(Version.getUrlWithUtmRef(getMyApplication(), getActivity().getPackageName()));
- Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(goToMarket);
- break;
- case USER_DISLIKES_APP:
- String email = getString(R.string.support_email);
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITH_MESSAGE);
- settings.NUMBER_OF_APPLICATION_STARTS.set(0);
- settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
- Intent sendEmail = new Intent(Intent.ACTION_SENDTO);
- sendEmail.setType("text/plain");
- sendEmail.setData(Uri.parse("mailto:" + email));
- sendEmail.putExtra(Intent.EXTRA_EMAIL, email);
- startActivity(sendEmail);
- break;
- }
- dashboard.refreshDashboardFragments();
- }
- }
-
- public class NegativeButtonListener implements View.OnClickListener {
- private TextView header;
- private TextView subheader;
- private Button positiveButton;
- private Button negativeButton;
-
- public NegativeButtonListener(TextView header, TextView subheader, Button positiveButton,
- Button negativeButton) {
- this.header = header;
- this.subheader = subheader;
- this.positiveButton = positiveButton;
- this.negativeButton = negativeButton;
- }
-
- @Override
- public void onClick(View v) {
- final OsmandSettings settings = getMyApplication().getSettings();
- switch (state) {
- case INITIAL_STATE:
- state = RateUsBottomSheetDialog.FragmentState.USER_DISLIKES_APP;
-
- header.setText(getResources().getString(R.string.user_hates_app_get_feedback));
- subheader.setText(getResources().getString(R.string.user_hates_app_get_feedback_long));
- positiveButton.setText(getResources().getString(R.string.shared_string_ok));
- negativeButton.setText(getResources().getString(R.string.shared_string_no_thanks));
- return;
- case USER_LIKES_APP:
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.IGNORED);
- break;
- case USER_DISLIKES_APP:
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITHOUT_MESSAGE);
- break;
- }
- settings.NUMBER_OF_APPLICATION_STARTS.set(0);
- settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
- dashboard.refreshDashboardFragments();
- }
- }
-
- private static class RateUsDismissListener implements DismissListener {
- private DashboardOnMap dashboardOnMap;
- private OsmandSettings settings;
-
- public RateUsDismissListener(DashboardOnMap dashboardOnMap, OsmandSettings settings) {
- this.dashboardOnMap = dashboardOnMap;
- this.settings = settings;
- }
-
- @Override
- public void onDismiss() {
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.IGNORED);
- settings.NUMBER_OF_APPLICATION_STARTS.set(0);
- settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
- dashboardOnMap.refreshDashboardFragments();
- }
- }
-}
diff --git a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java
index d7999b53fb..eb4ecde9ba 100644
--- a/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java
+++ b/OsmAnd/src/net/osmand/plus/dashboard/DashboardOnMap.java
@@ -103,8 +103,6 @@ public class DashboardOnMap implements ObservableScrollViewCallbacks, IRouteInfo
private final DashFragmentData[] fragmentsData = new DashFragmentData[]{
- new DashFragmentData(DashRateUsFragment.TAG, DashRateUsFragment.class,
- DashRateUsFragment.SHOULD_SHOW_FUNCTION, 0, null),
new DashFragmentData(DashDashboardOrDrawerFragment.TAG, DashDashboardOrDrawerFragment.class,
DashDashboardOrDrawerFragment.SHOULD_SHOW_FUNCTION, 5, null),
new DashFragmentData(DashErrorFragment.TAG, DashErrorFragment.class,
diff --git a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
index 527fb03d9e..1e3d2a983d 100644
--- a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java
@@ -13,6 +13,7 @@ import net.osmand.plus.Version;
import net.osmand.plus.activities.ContributionVersionActivity;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dashboard.tools.DashFragmentData;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.plus.views.OsmandMapTileView;
@@ -29,7 +30,6 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
//ApplicationMode.regWidgetVisibility("fps", new ApplicationMode[0]);
}
-
@Override
public String getId() {
return ID;
@@ -139,4 +139,4 @@ public class OsmandDevelopmentPlugin extends OsmandPlugin {
public DashFragmentData getCardFragment() {
return DashSimulateFragment.FRAGMENT_DATA;
}
-}
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/dialogs/DislikeOsmAndBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/DislikeOsmAndBottomSheetDialogFragment.java
index 4e39a67038..443b348f6f 100644
--- a/OsmAnd/src/net/osmand/plus/dialogs/DislikeOsmAndBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dialogs/DislikeOsmAndBottomSheetDialogFragment.java
@@ -45,7 +45,9 @@ public class DislikeOsmAndBottomSheetDialogFragment extends MenuBottomSheetDialo
protected void onDismissButtonClickAction() {
OsmandApplication app = getMyApplication();
if (app != null) {
- app.getSettings().RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITHOUT_MESSAGE);
+ app.getSettings().RATE_US_STATE.set(RateUsBottomSheetDialogFragment.RateUsState.DISLIKED_WITHOUT_MESSAGE);
+ app.getSettings().NUMBER_OF_APP_STARTS_ON_DISLIKE_MOMENT.set(app.getAppInitializer().getNumberOfStarts());
+ app.getSettings().LAST_DISPLAY_TIME.set(System.currentTimeMillis());
}
}
@@ -60,14 +62,13 @@ public class DislikeOsmAndBottomSheetDialogFragment extends MenuBottomSheetDialo
if (app != null) {
OsmandSettings settings = app.getSettings();
String email = getString(R.string.support_email);
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITH_MESSAGE);
- settings.NUMBER_OF_APPLICATION_STARTS.set(0);
+ settings.RATE_US_STATE.set(RateUsBottomSheetDialogFragment.RateUsState.DISLIKED_WITH_MESSAGE);
+ settings.NUMBER_OF_APP_STARTS_ON_DISLIKE_MOMENT.set(app.getAppInitializer().getNumberOfStarts());
settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
Intent sendEmail = new Intent(Intent.ACTION_SENDTO);
- sendEmail.setType("text/plain");
sendEmail.setData(Uri.parse("mailto:" + email));
sendEmail.putExtra(Intent.EXTRA_EMAIL, email);
- startActivity(sendEmail);
+ startActivity(Intent.createChooser(sendEmail, "Send Email"));
dismiss();
}
}
diff --git a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java b/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java
deleted file mode 100644
index bd70893c37..0000000000
--- a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialog.java
+++ /dev/null
@@ -1,191 +0,0 @@
-package net.osmand.plus.dialogs;
-
-import android.content.Intent;
-import android.net.Uri;
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-import android.widget.Button;
-import android.widget.TextView;
-
-import net.osmand.plus.OsmandApplication;
-import net.osmand.plus.OsmandSettings;
-import net.osmand.plus.R;
-import net.osmand.plus.Version;
-import net.osmand.plus.base.BottomSheetDialogFragment;
-
-import java.util.Calendar;
-
-public class RateUsBottomSheetDialog extends BottomSheetDialogFragment {
- private RateUsBottomSheetDialog.FragmentState state = RateUsBottomSheetDialog.FragmentState.INITIAL_STATE;
- @Nullable
- @Override
- public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
- View view = getActivity().getLayoutInflater().inflate(R.layout.dash_rate_us_fragment, container, false);
- TextView header = (TextView) view.findViewById(R.id.header);
- TextView subheader = (TextView) view.findViewById(R.id.subheader);
- Button positiveButton = (Button) view.findViewById(R.id.positive_button);
- Button negativeButton = (Button) view.findViewById(R.id.negative_button);
- positiveButton.setOnClickListener(
- new PositiveButtonListener(header, subheader, positiveButton, negativeButton));
- negativeButton.setOnClickListener(
- new NegativeButtonListener(header, subheader, positiveButton, negativeButton));
- return view;
- }
-
- public static boolean shouldShow(OsmandApplication application) {
- if (Version.isMarketEnabled(application)) {
- return false;
- }
- OsmandSettings settings = application.getSettings();
- if(!settings.LAST_DISPLAY_TIME.isSet()) {
- settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
- }
- long lastDisplayTimeInMillis = settings.LAST_DISPLAY_TIME.get();
- int numberOfApplicationRuns = settings.NUMBER_OF_APPLICATION_STARTS.get();
- RateUsState state = settings.RATE_US_STATE.get();
-
- Calendar modifiedTime = Calendar.getInstance();
- Calendar lastDisplayTime = Calendar.getInstance();
- lastDisplayTime.setTimeInMillis(lastDisplayTimeInMillis);
-
- int bannerFreeRuns = 0;
-
- switch (state) {
- case LIKED:
- return false;
- case INITIAL_STATE:
- break;
- case IGNORED:
- modifiedTime.add(Calendar.WEEK_OF_YEAR, -1);
- bannerFreeRuns = 5;
- break;
- case DISLIKED_WITH_MESSAGE:
- modifiedTime.add(Calendar.MONTH, -3);
- bannerFreeRuns = 3;
- break;
- case DISLIKED_WITHOUT_MESSAGE:
- modifiedTime.add(Calendar.MONTH, -2);
- break;
- default:
- throw new IllegalStateException("Unexpected state:" + state);
- }
-
- if (state != RateUsState.INITIAL_STATE) {
- if (modifiedTime.after(lastDisplayTime) && numberOfApplicationRuns >= bannerFreeRuns) {
- settings.RATE_US_STATE.set(RateUsState.INITIAL_STATE);
- modifiedTime = Calendar.getInstance();
- } else {
- return false;
- }
- }
- // Initial state now
- modifiedTime.add(Calendar.MONTH, -1);
- bannerFreeRuns = 3;
- return modifiedTime.after(lastDisplayTime) && numberOfApplicationRuns >= bannerFreeRuns;
- }
-
- public class PositiveButtonListener implements View.OnClickListener {
- private TextView header;
- private TextView subheader;
- private Button positiveButton;
- private Button negativeButton;
-
- public PositiveButtonListener(TextView header, TextView subheader, Button positiveButton,
- Button negativeButton) {
- this.header = header;
- this.subheader = subheader;
- this.positiveButton = positiveButton;
- this.negativeButton = negativeButton;
- }
-
- @Override
- public void onClick(View v) {
- final OsmandSettings settings = getMyApplication().getSettings();
- switch (state) {
- case INITIAL_STATE:
- state = RateUsBottomSheetDialog.FragmentState.USER_LIKES_APP;
-
- header.setText(getResources().getString(R.string.rate_this_app));
- subheader.setText(getResources().getString(R.string.rate_this_app_long));
- positiveButton.setText(getResources().getString(R.string.shared_string_ok));
- negativeButton.setText(getResources().getString(R.string.shared_string_no_thanks));
- return;
- case USER_LIKES_APP:
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
- Uri uri = Uri.parse(Version.getUrlWithUtmRef(getMyApplication(), getActivity().getPackageName()));
- Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
- startActivity(goToMarket);
- break;
- case USER_DISLIKES_APP:
- String email = getString(R.string.support_email);
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITH_MESSAGE);
- settings.NUMBER_OF_APPLICATION_STARTS.set(0);
- settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
- Intent sendEmail = new Intent(Intent.ACTION_SENDTO);
- sendEmail.setType("text/plain");
- sendEmail.setData(Uri.parse("mailto:" + email));
- sendEmail.putExtra(Intent.EXTRA_EMAIL, email);
- startActivity(sendEmail);
- break;
- }
- dismiss();
- }
- }
-
- public class NegativeButtonListener implements View.OnClickListener {
- private TextView header;
- private TextView subheader;
- private Button positiveButton;
- private Button negativeButton;
-
- public NegativeButtonListener(TextView header, TextView subheader, Button positiveButton,
- Button negativeButton) {
- this.header = header;
- this.subheader = subheader;
- this.positiveButton = positiveButton;
- this.negativeButton = negativeButton;
- }
-
- @Override
- public void onClick(View v) {
- final OsmandSettings settings = getMyApplication().getSettings();
- switch (state) {
- case INITIAL_STATE:
- state = RateUsBottomSheetDialog.FragmentState.USER_DISLIKES_APP;
-
- header.setText(getResources().getString(R.string.user_hates_app_get_feedback));
- subheader.setText(getResources().getString(R.string.user_hates_app_get_feedback_long));
- positiveButton.setText(getResources().getString(R.string.shared_string_ok));
- negativeButton.setText(getResources().getString(R.string.shared_string_no_thanks));
- return;
- case USER_LIKES_APP:
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.IGNORED);
- break;
- case USER_DISLIKES_APP:
- settings.RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.DISLIKED_WITHOUT_MESSAGE);
- break;
- }
- settings.NUMBER_OF_APPLICATION_STARTS.set(0);
- settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
- dismiss();
- }
- }
-
- public enum FragmentState {
- INITIAL_STATE,
- USER_LIKES_APP,
- USER_DISLIKES_APP
- }
-
- public enum RateUsState {
- INITIAL_STATE,
- IGNORED,
- LIKED,
- DISLIKED_WITH_MESSAGE,
- DISLIKED_WITHOUT_MESSAGE
- }
-}
diff --git a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialogFragment.java
index 51b46fc143..20bd10f612 100644
--- a/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/dialogs/RateUsBottomSheetDialogFragment.java
@@ -25,6 +25,7 @@ import java.util.Calendar;
public class RateUsBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
public static final String TAG = "RateUsBottomSheetDialogFragment";
private static final Log LOG = PlatformUtil.getLog(SendAnalyticsBottomSheetDialogFragment.class);
+ private static final long SIXTY_DAYS = 60 * 24 * 60 * 60 * 1000L;
@Override
public void createMenuItems(Bundle savedInstanceState) {
@@ -62,7 +63,7 @@ public class RateUsBottomSheetDialogFragment extends MenuBottomSheetDialogFragme
protected void onRightBottomButtonClick() {
OsmandApplication app = getMyApplication();
if (app != null) {
- app.getSettings().RATE_US_STATE.set(RateUsBottomSheetDialog.RateUsState.LIKED);
+ app.getSettings().RATE_US_STATE.set(RateUsState.LIKED);
Uri uri = Uri.parse(Version.getUrlWithUtmRef(app, app.getPackageName()));
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
startActivity(goToMarket);
@@ -70,10 +71,6 @@ public class RateUsBottomSheetDialogFragment extends MenuBottomSheetDialogFragme
}
}
- public static boolean shouldShow(OsmandApplication app) {
- return RateUsBottomSheetDialog.shouldShow(app);
- }
-
public static void showInstance(@NonNull FragmentManager fm) {
try {
if (fm.findFragmentByTag(RateUsBottomSheetDialogFragment.TAG) == null) {
@@ -84,4 +81,41 @@ public class RateUsBottomSheetDialogFragment extends MenuBottomSheetDialogFragme
LOG.error("showInstance", e);
}
}
+
+ public static boolean shouldShow(OsmandApplication application) {
+ long firstInstalledDays = application.getAppInitializer().getFirstInstalledDays();
+ if (!Version.isGooglePlayEnabled(application) || firstInstalledDays > 350) {
+ return false;
+ }
+ OsmandSettings settings = application.getSettings();
+ if (!settings.LAST_DISPLAY_TIME.isSet()) {
+ settings.LAST_DISPLAY_TIME.set(System.currentTimeMillis());
+ }
+ int numberOfStarts = application.getAppInitializer().getNumberOfStarts();
+
+ RateUsState state = settings.RATE_US_STATE.get();
+ switch (state) {
+ case LIKED:
+ return false;
+ case INITIAL_STATE:
+ return firstInstalledDays > 15 && numberOfStarts > 100;
+ case IGNORED:
+ case DISLIKED_WITH_MESSAGE:
+ case DISLIKED_WITHOUT_MESSAGE:
+ int startsOnDislikeMoment = settings.NUMBER_OF_APP_STARTS_ON_DISLIKE_MOMENT.get();
+ long lastDisplayTimeInMillis = settings.LAST_DISPLAY_TIME.get();
+ long currentTime = System.currentTimeMillis();
+ return currentTime - lastDisplayTimeInMillis > SIXTY_DAYS
+ && numberOfStarts - startsOnDislikeMoment > 50;
+ }
+ return false;
+ }
+
+ public enum RateUsState {
+ INITIAL_STATE,
+ IGNORED,
+ LIKED,
+ DISLIKED_WITH_MESSAGE,
+ DISLIKED_WITHOUT_MESSAGE
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java
index 31c231a211..8997c4069a 100644
--- a/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java
+++ b/OsmAnd/src/net/osmand/plus/helpers/ImportHelper.java
@@ -22,6 +22,7 @@ import android.view.View;
import android.widget.Toast;
import net.osmand.AndroidUtils;
+import net.osmand.CallbackWithObject;
import net.osmand.GPXUtilities;
import net.osmand.GPXUtilities.GPXFile;
import net.osmand.GPXUtilities.WptPt;
@@ -39,6 +40,7 @@ import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
import net.osmand.plus.SettingsHelper;
import net.osmand.plus.SettingsHelper.SettingsImportListener;
+import net.osmand.plus.activities.ActivityResultListener;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.TrackActivity;
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
@@ -49,9 +51,11 @@ import net.osmand.plus.base.bottomsheetmenu.simpleitems.ShortDescriptionItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.rastermaps.OsmandRasterMapsPlugin;
import net.osmand.plus.views.OsmandMapTileView;
+import net.osmand.router.RoutingConfiguration;
import net.osmand.util.Algorithms;
import org.apache.commons.logging.Log;
+import org.xmlpull.v1.XmlPullParserException;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -69,6 +73,10 @@ import java.util.List;
import java.util.Locale;
import java.util.zip.ZipInputStream;
+import static android.app.Activity.RESULT_OK;
+import static net.osmand.IndexConstants.OSMAND_SETTINGS_FILE_EXT;
+import static net.osmand.IndexConstants.ROUTING_FILE_EXT;
+import static net.osmand.plus.AppInitializer.loadRoutingFiles;
import static net.osmand.plus.myplaces.FavoritesActivity.FAV_TAB;
import static net.osmand.plus.myplaces.FavoritesActivity.GPX_TAB;
import static net.osmand.plus.myplaces.FavoritesActivity.TAB_ID;
@@ -86,6 +94,23 @@ public class ImportHelper {
private final OsmandMapTileView mapView;
private OnGpxImportCompleteListener gpxImportCompleteListener;
+ public final static int IMPORT_FILE_REQUEST = 1006;
+
+ public enum ImportType {
+ SETTINGS(IndexConstants.OSMAND_SETTINGS_FILE_EXT),
+ ROUTING(ROUTING_FILE_EXT);
+
+ ImportType(String extension) {
+ this.extension = extension;
+ }
+
+ private String extension;
+
+ public String getExtension() {
+ return extension;
+ }
+ }
+
public interface OnGpxImportCompleteListener {
void onComplete(boolean success);
}
@@ -156,14 +181,10 @@ public class ImportHelper {
handleObfImport(intentUri, fileName);
} else if (fileName != null && fileName.endsWith(IndexConstants.SQLITE_EXT)) {
handleSqliteTileImport(intentUri, fileName);
- } else if (fileName != null && fileName.endsWith(IndexConstants.OSMAND_SETTINGS_FILE_EXT)) {
- if (extras != null && extras.containsKey(SettingsHelper.SETTINGS_VERSION_KEY) && extras.containsKey(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY)) {
- int version = extras.getInt(SettingsHelper.SETTINGS_VERSION_KEY, -1);
- String latestChanges = extras.getString(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY);
- handleOsmAndSettingsImport(intentUri, fileName, latestChanges, version);
- } else {
- handleOsmAndSettingsImport(intentUri, fileName, null, -1);
- }
+ } else if (fileName != null && fileName.endsWith(OSMAND_SETTINGS_FILE_EXT)) {
+ handleOsmAndSettingsImport(intentUri, fileName, extras, null);
+ } else if (fileName != null && fileName.endsWith(ROUTING_FILE_EXT)) {
+ handleRoutingFileImport(intentUri, fileName, null);
} else {
handleFavouritesImport(intentUri, fileName, saveFile, useImportDir, false);
}
@@ -585,8 +606,147 @@ public class ImportHelper {
}.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
}
+ public void chooseFileToImport(final ImportType importType, final CallbackWithObject callback) {
+ final MapActivity mapActivity = getMapActivity();
+ if (mapActivity == null) {
+ return;
+ }
+ final OsmandApplication app = mapActivity.getMyApplication();
+ Intent intent = new Intent();
+ String action;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
+ action = Intent.ACTION_OPEN_DOCUMENT;
+ } else {
+ action = Intent.ACTION_GET_CONTENT;
+ }
+ intent.setAction(action);
+ intent.setType("*/*");
+
+ ActivityResultListener listener = new ActivityResultListener(IMPORT_FILE_REQUEST, new ActivityResultListener.OnActivityResultListener() {
+ @Override
+ public void onResult(int resultCode, Intent resultData) {
+ MapActivity mapActivity = getMapActivity();
+ if (resultCode == RESULT_OK) {
+ Uri data = resultData.getData();
+ if (mapActivity == null || data == null) {
+ return;
+ }
+ String scheme = data.getScheme();
+ String fileName = "";
+ if ("file".equals(scheme)) {
+ final String path = data.getPath();
+ if (path != null) {
+ fileName = new File(path).getName();
+ }
+ } else if ("content".equals(scheme)) {
+ fileName = getNameFromContentUri(app, data);
+ }
+
+ if (fileName.endsWith(importType.getExtension())) {
+ if (importType.equals(ImportType.SETTINGS)) {
+ handleOsmAndSettingsImport(data, fileName, resultData.getExtras(), callback);
+ } else if (importType.equals(ImportType.ROUTING)){
+ handleRoutingFileImport(data, fileName, callback);
+ }
+ } else {
+ app.showToastMessage(app.getString(R.string.not_support_file_type_with_ext,
+ importType.getExtension().replaceAll("\\.", "").toUpperCase()));
+ }
+ }
+ }
+ });
+
+ mapActivity.registerActivityResultListener(listener);
+ mapActivity.startActivityForResult(intent, IMPORT_FILE_REQUEST);
+ }
+
@SuppressLint("StaticFieldLeak")
- private void handleOsmAndSettingsImport(final Uri uri, final String name, final String latestChanges, final int version) {
+ private void handleRoutingFileImport(final Uri uri, final String fileName, final CallbackWithObject callback) {
+ final AsyncTask routingImportTask = new AsyncTask() {
+
+ String mFileName;
+ ProgressDialog progress;
+
+ @Override
+ protected void onPreExecute() {
+ progress = ProgressDialog.show(activity, app.getString(R.string.loading_smth, ""), app.getString(R.string.loading_data));
+ mFileName = fileName;
+ }
+
+ @Override
+ protected String doInBackground(Void... voids) {
+ File routingDir = app.getAppPath(IndexConstants.ROUTING_PROFILES_DIR);
+ if (!routingDir.exists()) {
+ routingDir.mkdirs();
+ }
+ File dest = new File(routingDir, mFileName);
+ while (dest.exists()) {
+ mFileName = AndroidUtils.createNewFileName(mFileName);
+ dest = new File(routingDir, mFileName);
+ }
+ return copyFile(app, dest, uri, true);
+ }
+
+ @Override
+ protected void onPostExecute(String error) {
+ File routingDir = app.getAppPath(IndexConstants.ROUTING_PROFILES_DIR);
+ final File file = new File(routingDir, mFileName);
+ if (error == null && file.exists()) {
+ loadRoutingFiles(app, new AppInitializer.LoadRoutingFilesCallback() {
+ @Override
+ public void onRoutingFilesLoaded() {
+ if (isActivityNotDestroyed(activity)) {
+ progress.dismiss();
+ }
+ String profileKey = app.getRoutingConfig().getRoutingProfileKeyByFileName(mFileName);
+ if (profileKey != null) {
+ app.showShortToastMessage(app.getString(R.string.file_imported_successfully, mFileName));
+ if (callback != null) {
+ callback.processResult(profileKey);
+ }
+ } else {
+ app.showToastMessage(app.getString(R.string.file_does_not_contain_routing_rules, mFileName));
+ }
+ }
+ });
+ } else {
+ if (isActivityNotDestroyed(activity)) {
+ progress.dismiss();
+ }
+ app.showShortToastMessage(app.getString(R.string.file_import_error, mFileName, error));
+ }
+ }
+ };
+ if (app.isApplicationInitializing()) {
+ app.getAppInitializer().addListener(new AppInitializer.AppInitializeListener() {
+ @Override
+ public void onProgress(AppInitializer init, AppInitializer.InitEvents event) {
+ }
+
+ @Override
+ public void onFinish(AppInitializer init) {
+ routingImportTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+ }
+ });
+ } else {
+ routingImportTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+ }
+ }
+
+ private void handleOsmAndSettingsImport(Uri intentUri, String fileName, Bundle extras,
+ CallbackWithObject> callback) {
+ if (extras != null && extras.containsKey(SettingsHelper.SETTINGS_VERSION_KEY) && extras.containsKey(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY)) {
+ int version = extras.getInt(SettingsHelper.SETTINGS_VERSION_KEY, -1);
+ String latestChanges = extras.getString(SettingsHelper.SETTINGS_LATEST_CHANGES_KEY);
+ handleOsmAndSettingsImport(intentUri, fileName, latestChanges, version, callback);
+ } else {
+ handleOsmAndSettingsImport(intentUri, fileName, null, -1, callback);
+ }
+ }
+
+ @SuppressLint("StaticFieldLeak")
+ private void handleOsmAndSettingsImport(final Uri uri, final String name, final String latestChanges, final int version,
+ final CallbackWithObject> callback) {
final AsyncTask settingsImportTask = new AsyncTask() {
ProgressDialog progress;
@@ -613,12 +773,15 @@ public class ImportHelper {
if (error == null && file.exists()) {
app.getSettingsHelper().importSettings(file, latestChanges, version, new SettingsImportListener() {
@Override
- public void onSettingsImportFinished(boolean succeed, boolean empty) {
+ public void onSettingsImportFinished(boolean succeed, boolean empty, @NonNull List items) {
if (isActivityNotDestroyed(activity)) {
progress.dismiss();
}
if (succeed) {
app.showShortToastMessage(app.getString(R.string.file_imported_successfully, name));
+ if (callback != null) {
+ callback.processResult(items);
+ }
} else if (!empty) {
app.showShortToastMessage(app.getString(R.string.file_import_error, name, app.getString(R.string.shared_string_unexpected_error)));
}
diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java
index d8d8572218..e3ef951edc 100644
--- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryPlugin.java
@@ -28,6 +28,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.MapActivityLayers;
import net.osmand.plus.base.BottomSheetDialogFragment;
import net.osmand.plus.dashboard.DashboardOnMap;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.MapTileLayer;
import net.osmand.plus.views.OsmandMapTileView;
@@ -139,11 +140,6 @@ public class MapillaryPlugin extends OsmandPlugin {
}
}
- @Override
- public Class extends Activity> getSettingsActivity() {
- return null;
- }
-
@Override
public void registerLayerContextMenuActions(final OsmandMapTileView mapView, ContextMenuAdapter adapter, final MapActivity mapActivity) {
ContextMenuAdapter.ItemClickListener listener = new ContextMenuAdapter.OnRowItemClick() {
diff --git a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java
index 8d59b2355e..3288b43b82 100644
--- a/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java
+++ b/OsmAnd/src/net/osmand/plus/mapillary/MapillaryVectorLayer.java
@@ -127,8 +127,8 @@ class MapillaryVectorLayer extends MapTileLayer implements MapillaryLayer, ICont
int dzoom = nzoom - TILE_ZOOM;
int div = (int) Math.pow(2.0, dzoom);
- boolean useInternet = (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null || OsmandPlugin.getEnabledPlugin(MapillaryPlugin.class) != null) &&
- settings.USE_INTERNET_TO_DOWNLOAD_TILES.get() && settings.isInternetConnectionAvailable() && map.couldBeDownloadedFromInternet();
+ boolean useInternet = (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null || OsmandPlugin.getEnabledPlugin(MapillaryPlugin.class) != null)
+ && settings.isInternetConnectionAvailable() && map.couldBeDownloadedFromInternet();
Map tiles = new HashMap<>();
Map visiblePoints = new HashMap<>();
diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java
index 4ebcdbafca..19f48003c9 100644
--- a/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java
+++ b/OsmAnd/src/net/osmand/plus/mapmarkers/adapters/MapMarkersListAdapter.java
@@ -154,7 +154,7 @@ public class MapMarkersListAdapter extends RecyclerView.Adapter before.points.size())
+ if (position < 0 || position >= before.points.size()) {
return new WptPt();
+ }
WptPt pt = before.points.remove(position);
if (updateSnapToRoad) {
updateCacheForSnapIfNeeded(false);
diff --git a/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java
new file mode 100644
index 0000000000..3d29e9bb13
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/monitoring/MonitoringSettingsFragment.java
@@ -0,0 +1,202 @@
+package net.osmand.plus.monitoring;
+
+import android.content.Intent;
+import android.support.v4.app.FragmentManager;
+import android.support.v7.preference.Preference;
+
+import net.osmand.plus.OsmAndAppCustomization;
+import net.osmand.plus.OsmandSettings;
+import net.osmand.plus.R;
+import net.osmand.plus.myplaces.FavoritesActivity;
+import net.osmand.plus.settings.BaseSettingsFragment;
+import net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet;
+import net.osmand.plus.settings.preferences.ListPreferenceEx;
+import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
+
+import java.io.Serializable;
+
+import static net.osmand.plus.OsmandSettings.DAILY_DIRECTORY;
+import static net.osmand.plus.OsmandSettings.MONTHLY_DIRECTORY;
+import static net.osmand.plus.OsmandSettings.REC_DIRECTORY;
+import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES;
+import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS;
+
+public class MonitoringSettingsFragment extends BaseSettingsFragment {
+
+ private static final String COPY_PLUGIN_SETTINGS = "copy_plugin_settings";
+ private static final String RESET_TO_DEFAULT = "reset_to_default";
+ private static final String OPEN_TRACKS = "open_tracks";
+
+ @Override
+ protected void setupPreferences() {
+ setupSaveTrackToGpxPref();
+ setupSaveTrackIntervalPref();
+
+ setupSaveTrackMinDistancePref();
+ setupSaveTrackPrecisionPref();
+ setupSaveTrackMinSpeedPref();
+ setupAutoSplitRecordingPref();
+ setupDisableRecordingOnceAppKilledPref();
+
+ setupTrackStorageDirectoryPref();
+ setupLiveMonitoringPref();
+
+ setupOpenNotesDescrPref();
+ setupOpenNotesPref();
+
+ setupCopyProfileSettingsPref();
+ setupResetToDefaultPref();
+ }
+
+ private void setupSaveTrackToGpxPref() {
+ SwitchPreferenceEx saveTrackToGpx = (SwitchPreferenceEx) findPreference(settings.SAVE_TRACK_TO_GPX.getId());
+ saveTrackToGpx.setDescription(getString(R.string.save_track_to_gpx_descrp));
+ saveTrackToGpx.setIcon(getContentIcon(R.drawable.ic_action_gdirections_dark));
+ }
+
+ private void setupSaveTrackIntervalPref() {
+ Integer[] entryValues = new Integer[SECONDS.length + MINUTES.length];
+ String[] entries = new String[entryValues.length];
+ int k = 0;
+ for (int second : SECONDS) {
+ entryValues[k] = second * 1000;
+ entries[k] = second + " " + getString(R.string.int_seconds);
+ k++;
+ }
+ for (int minute : MINUTES) {
+ entryValues[k] = (minute * 60) * 1000;
+ entries[k] = minute + " " + getString(R.string.int_min);
+ k++;
+ }
+
+ ListPreferenceEx saveTrackInterval = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_INTERVAL.getId());
+ saveTrackInterval.setEntries(entries);
+ saveTrackInterval.setEntryValues(entryValues);
+ saveTrackInterval.setIcon(getActiveIcon(R.drawable.ic_action_time_span));
+ saveTrackInterval.setDescription(R.string.save_track_interval_descr);
+ }
+
+ private void setupSaveTrackMinDistancePref() {
+ Float[] entryValues = new Float[] {0.f, 2.0f, 5.0f, 10.0f, 20.0f, 30.0f, 50.0f};
+ String[] entries = new String[entryValues.length];
+ entries[0] = getString(R.string.shared_string_not_selected);
+ for (int i = 1; i < entryValues.length; i++) {
+ entries[i] = entryValues[i].intValue() + " " + getString(R.string.m);
+ }
+
+ ListPreferenceEx saveTrackMinDistance = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_DISTANCE.getId());
+ saveTrackMinDistance.setEntries(entries);
+ saveTrackMinDistance.setEntryValues(entryValues);
+ saveTrackMinDistance.setDescription(R.string.save_track_min_distance_descr);
+ }
+
+ private void setupSaveTrackPrecisionPref() {
+ Float[] entryValues = new Float[] {0.f, 1.0f, 2.0f, 5.0f, 10.0f, 15.0f, 20.0f, 50.0f, 100.0f};
+ String[] entries = new String[entryValues.length];
+ entries[0] = getString(R.string.shared_string_not_selected);
+ for (int i = 1; i < entryValues.length; i++) {
+ entries[i] = entryValues[i].intValue() + " " + getString(R.string.m) + " (" + Math.round(entryValues[i] / 0.3048f) + " " + getString(R.string.foot) + ")";
+ }
+
+ ListPreferenceEx saveTrackPrecision = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_PRECISION.getId());
+ saveTrackPrecision.setEntries(entries);
+ saveTrackPrecision.setEntryValues(entryValues);
+ saveTrackPrecision.setDescription(R.string.save_track_precision_descr);
+ }
+
+ private void setupSaveTrackMinSpeedPref() {
+ Float[] entryValues = new Float[] {0.f, 0.000001f, 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0f};
+ String[] entries = new String[entryValues.length];
+ entries[0] = getString(R.string.shared_string_not_selected);
+ entries[1] = "> 0"; // This option for the GPS chipset motion detection
+ for (int i = 2; i < entryValues.length; i++) {
+ entries[i] = entryValues[i].intValue() + " " + getString(R.string.km_h);
+ entryValues[i] = entryValues[i] / 3.6f;
+ }
+
+ ListPreferenceEx saveTrackMinSpeed = (ListPreferenceEx) findPreference(settings.SAVE_TRACK_MIN_SPEED.getId());
+ saveTrackMinSpeed.setEntries(entries);
+ saveTrackMinSpeed.setEntryValues(entryValues);
+ saveTrackMinSpeed.setDescription(R.string.save_track_min_speed_descr);
+ }
+
+ private void setupAutoSplitRecordingPref() {
+ SwitchPreferenceEx autoSplitRecording = (SwitchPreferenceEx) findPreference(settings.AUTO_SPLIT_RECORDING.getId());
+ autoSplitRecording.setDescription(getString(R.string.auto_split_recording_descr));
+ }
+
+ private void setupDisableRecordingOnceAppKilledPref() {
+ SwitchPreferenceEx disableRecordingOnceAppKilled = (SwitchPreferenceEx) findPreference(settings.DISABLE_RECORDING_ONCE_APP_KILLED.getId());
+ disableRecordingOnceAppKilled.setDescription(getString(R.string.disable_recording_once_app_killed_descrp));
+ }
+
+ private void setupTrackStorageDirectoryPref() {
+ Integer[] entryValues = new Integer[] {REC_DIRECTORY, MONTHLY_DIRECTORY, DAILY_DIRECTORY};
+ String[] entries = new String[entryValues.length];
+ entries[0] = getString(R.string.store_tracks_in_rec_directory);
+ entries[1] = getString(R.string.store_tracks_in_monthly_directories);
+ entries[2] = getString(R.string.store_tracks_in_daily_directories);
+
+ ListPreferenceEx trackStorageDirectory = (ListPreferenceEx) findPreference(settings.TRACK_STORAGE_DIRECTORY.getId());
+ trackStorageDirectory.setEntries(entries);
+ trackStorageDirectory.setEntryValues(entryValues);
+ trackStorageDirectory.setDescription(R.string.track_storage_directory_descrp);
+ trackStorageDirectory.setIcon(getActiveIcon(R.drawable.ic_action_folder));
+ }
+
+ private void setupLiveMonitoringPref() {
+ SwitchPreferenceEx liveMonitoring = (SwitchPreferenceEx) findPreference(settings.LIVE_MONITORING.getId());
+ liveMonitoring.setDescription(getString(R.string.live_monitoring_m_descr));
+ liveMonitoring.setIcon(getContentIcon(R.drawable.ic_world_globe_dark));
+ }
+
+ private void setupOpenNotesDescrPref() {
+ Preference nameAndPasswordPref = findPreference("open_tracks_description");
+ nameAndPasswordPref.setTitle(getText(R.string.tracks_view_descr));
+ }
+
+ private void setupOpenNotesPref() {
+ Preference openNotes = findPreference(OPEN_TRACKS);
+ openNotes.setIcon(getActiveIcon(R.drawable.ic_action_folder));
+ }
+
+ private void setupCopyProfileSettingsPref() {
+ Preference copyProfilePrefs = findPreference(COPY_PLUGIN_SETTINGS);
+ copyProfilePrefs.setIcon(getActiveIcon(R.drawable.ic_action_copy));
+ }
+
+ private void setupResetToDefaultPref() {
+ Preference resetToDefault = findPreference(RESET_TO_DEFAULT);
+ resetToDefault.setIcon(getActiveIcon(R.drawable.ic_action_reset_to_default_dark));
+ }
+
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ if (OPEN_TRACKS.equals(preference.getKey())) {
+ OsmAndAppCustomization appCustomization = app.getAppCustomization();
+ Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
+ favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+ app.getSettings().FAVORITES_TAB.set(FavoritesActivity.GPX_TAB);
+ startActivity(favorites);
+ return true;
+ }
+ return super.onPreferenceClick(preference);
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ String prefId = preference.getKey();
+
+ OsmandSettings.OsmandPreference pref = settings.getPreference(prefId);
+ if (pref instanceof OsmandSettings.CommonPreference && !((OsmandSettings.CommonPreference) pref).hasDefaultValueForMode(getSelectedAppMode())) {
+ FragmentManager fragmentManager = getFragmentManager();
+ if (fragmentManager != null && newValue instanceof Serializable) {
+ ChangeGeneralProfilesPrefBottomSheet.showInstance(fragmentManager, prefId,
+ (Serializable) newValue, this, false, getSelectedAppMode());
+ }
+ return false;
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
index 580151f590..7a4aacb035 100644
--- a/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/monitoring/OsmandMonitoringPlugin.java
@@ -34,6 +34,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.SavingTrackHelper;
import net.osmand.plus.activities.SavingTrackHelper.SaveGpxResult;
import net.osmand.plus.dashboard.tools.DashFragmentData;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
import net.osmand.plus.views.OsmandMapTileView;
@@ -146,7 +147,15 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
return SettingsMonitoringActivity.class;
}
-
+ @Override
+ public Class extends BaseSettingsFragment> getSettingsFragment() {
+ return MonitoringSettingsFragment.class;
+ }
+
+ @Override
+ public String getPrefsDescription() {
+ return app.getString(R.string.monitoring_prefs_descr);
+ }
/**
* creates (if it wasn't created previously) the control to be added on a MapInfoLayer that shows a monitoring state (recorded/stopped)
diff --git a/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java b/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java
index 98efb29dba..1f0f86fea6 100644
--- a/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java
+++ b/OsmAnd/src/net/osmand/plus/myplaces/TrackBitmapDrawer.java
@@ -6,6 +6,7 @@ import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.LayerDrawable;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@@ -51,7 +52,7 @@ public class TrackBitmapDrawer {
private int trackColor;
private int currentTrackColor;
private Paint paint;
- private Bitmap selectedPoint;
+ private LayerDrawable selectedPoint;
private int defPointColor;
private Paint paintIcon;
private Bitmap pointSmall;
@@ -85,7 +86,7 @@ public class TrackBitmapDrawer {
defPointColor = ContextCompat.getColor(app, R.color.gpx_color_point);
paintIcon = new Paint();
pointSmall = BitmapFactory.decodeResource(app.getResources(), R.drawable.map_white_shield_small);
- selectedPoint = BitmapFactory.decodeResource(app.getResources(), R.drawable.map_default_location);
+ selectedPoint = (LayerDrawable) app.getResources().getDrawable(R.drawable.map_location_default);
}
public void addListener(TrackBitmapDrawerListener l) {
@@ -283,7 +284,11 @@ public class TrackBitmapDrawer {
paintIcon.setColorFilter(null);
Bitmap bmp = mapTrackBitmap.copy(mapTrackBitmap.getConfig(), true);
Canvas canvas = new Canvas(bmp);
- canvas.drawBitmap(selectedPoint, x - selectedPoint.getWidth() / 2, y - selectedPoint.getHeight() / 2, paintIcon);
+ selectedPoint.setBounds((int) x - selectedPoint.getIntrinsicWidth() / 2,
+ (int) y - selectedPoint.getIntrinsicHeight() / 2,
+ (int) x + selectedPoint.getIntrinsicWidth() / 2,
+ (int) y + selectedPoint.getIntrinsicHeight() / 2);
+ selectedPoint.draw(canvas);
return bmp;
} else {
return null;
diff --git a/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java b/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
index 04f7225e0b..60133000a0 100644
--- a/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/openseamapsplugin/NauticalMapsPlugin.java
@@ -17,6 +17,7 @@ import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.download.DownloadActivity;
import net.osmand.plus.download.DownloadResources;
+import net.osmand.plus.settings.BaseSettingsFragment;
import java.util.Collections;
import java.util.List;
@@ -120,9 +121,4 @@ public class NauticalMapsPlugin extends OsmandPlugin {
public String getId() {
return ID;
}
-
- @Override
- public Class extends Activity> getSettingsActivity() {
- return null;
- }
-}
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java
new file mode 100644
index 0000000000..f2240fa74f
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingFragment.java
@@ -0,0 +1,90 @@
+package net.osmand.plus.osmedit;
+
+import android.content.Intent;
+import android.support.v4.app.FragmentManager;
+import android.support.v7.preference.Preference;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.TextView;
+
+import net.osmand.plus.OsmAndAppCustomization;
+import net.osmand.plus.R;
+import net.osmand.plus.helpers.AndroidUiHelper;
+import net.osmand.plus.settings.BaseSettingsFragment;
+import net.osmand.plus.settings.OnPreferenceChanged;
+import net.osmand.plus.settings.bottomsheets.OsmLoginDataBottomSheet;
+import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
+
+public class OsmEditingFragment extends BaseSettingsFragment implements OnPreferenceChanged {
+
+ private static final String OPEN_OSM_EDITS = "open_osm_edits";
+ private static final String OSM_LOGIN_DATA = "osm_login_data";
+
+ @Override
+ protected void setupPreferences() {
+ Preference vehicleParametersInfo = findPreference("osm_editing_info");
+ vehicleParametersInfo.setIcon(getContentIcon(R.drawable.ic_action_info_dark));
+
+ setupNameAndPasswordPref();
+ setupOfflineEditingPref();
+ setupOsmEditsDescrPref();
+ setupOsmEditsPref();
+ }
+
+ @Override
+ protected void createToolbar(LayoutInflater inflater, View view) {
+ super.createToolbar(inflater, view);
+
+ TextView toolbarSubtitle = view.findViewById(R.id.toolbar_subtitle);
+ toolbarSubtitle.setText(getPreferenceScreen().getSummary());
+ AndroidUiHelper.updateVisibility(toolbarSubtitle, true);
+ }
+
+ private void setupNameAndPasswordPref() {
+ Preference nameAndPasswordPref = findPreference(OSM_LOGIN_DATA);
+ nameAndPasswordPref.setSummary(settings.USER_NAME.get());
+ nameAndPasswordPref.setIcon(getContentIcon(R.drawable.ic_action_openstreetmap_logo));
+ }
+
+ private void setupOfflineEditingPref() {
+ SwitchPreferenceEx offlineEditingPref = (SwitchPreferenceEx) findPreference(settings.OFFLINE_EDITION.getId());
+ offlineEditingPref.setDescription(getString(R.string.offline_edition_descr));
+ }
+
+ private void setupOsmEditsDescrPref() {
+ Preference nameAndPasswordPref = findPreference("osm_edits_description");
+ nameAndPasswordPref.setTitle(getText(R.string.osm_edits_view_descr));
+ }
+
+ private void setupOsmEditsPref() {
+ Preference createProfile = findPreference(OPEN_OSM_EDITS);
+ createProfile.setIcon(getActiveIcon(R.drawable.ic_action_folder));
+ }
+
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ if (OPEN_OSM_EDITS.equals(preference.getKey())) {
+ OsmAndAppCustomization appCustomization = app.getAppCustomization();
+ Intent favorites = new Intent(preference.getContext(), appCustomization.getFavoritesActivity());
+ favorites.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
+ app.getSettings().FAVORITES_TAB.set(R.string.osm_edits);
+ startActivity(favorites);
+ return true;
+ } else if (OSM_LOGIN_DATA.equals(preference.getKey())) {
+ FragmentManager fragmentManager = getFragmentManager();
+ if (fragmentManager != null) {
+ OsmLoginDataBottomSheet.showInstance(fragmentManager, OSM_LOGIN_DATA, this, false, getSelectedAppMode());
+ return true;
+ }
+ }
+ return super.onPreferenceClick(preference);
+ }
+
+ @Override
+ public void onPreferenceChanged(String prefId) {
+ if (OSM_LOGIN_DATA.equals(prefId)) {
+ Preference nameAndPasswordPref = findPreference(OSM_LOGIN_DATA);
+ nameAndPasswordPref.setSummary(settings.USER_NAME.get());
+ }
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java
index e6bbe9ea4a..0d3118a98d 100644
--- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java
@@ -40,6 +40,7 @@ import net.osmand.plus.myplaces.AvailableGPXFragment;
import net.osmand.plus.myplaces.AvailableGPXFragment.GpxInfo;
import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.plus.osmedit.OsmPoint.Action;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.util.Algorithms;
@@ -190,6 +191,16 @@ public class OsmEditingPlugin extends OsmandPlugin {
return SettingsOsmEditingActivity.class;
}
+ @Override
+ public Class extends BaseSettingsFragment> getSettingsFragment() {
+ return OsmEditingFragment.class;
+ }
+
+ @Override
+ public String getPrefsDescription() {
+ return app.getString(R.string.osm_editing_prefs_descr);
+ }
+
@Override
public void registerMapContextMenuActions(final MapActivity mapActivity,
final double latitude,
diff --git a/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java b/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java
index d5c7fabe4a..b313bd124d 100644
--- a/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java
+++ b/OsmAnd/src/net/osmand/plus/osmedit/SettingsOsmEditingActivity.java
@@ -95,7 +95,7 @@ public class SettingsOsmEditingActivity extends SettingsBaseActivity {
}
}
- private static class ValidateOsmLoginDetailsTask extends AsyncTask {
+ public static class ValidateOsmLoginDetailsTask extends AsyncTask {
private final Context context;
public ValidateOsmLoginDetailsTask(Context context) {
diff --git a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java
index 20a0171e96..2e068d9cb8 100644
--- a/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/parkingpoint/ParkingPositionPlugin.java
@@ -31,6 +31,7 @@ import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.dashboard.tools.DashFragmentData;
import net.osmand.plus.mapcontextmenu.MapContextMenu;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.AnimateDraggingMapThread;
import net.osmand.plus.views.MapInfoLayer;
import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
@@ -517,12 +518,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
parkingPlaceControl.setIcons(R.drawable.widget_parking_day, R.drawable.widget_parking_night);
return parkingPlaceControl;
}
-
- @Override
- public Class extends Activity> getSettingsActivity() {
- return null;
- }
-
+
@Override
public int getAssetResourceName() {
return R.drawable.parking_position;
diff --git a/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java b/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java
index 91f7074696..bf72dc83e6 100644
--- a/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java
+++ b/OsmAnd/src/net/osmand/plus/profiles/EditProfileFragment.java
@@ -68,9 +68,9 @@ import studio.carbonylgroup.textfieldboxes.ExtendedEditText;
import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SETTINGS_ID;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.DIALOG_TYPE;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.PROFILE_KEY_ARG;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.SELECTED_KEY;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_BASE_APP_PROFILE;
-import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_ICON;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_NAV_PROFILE;
import static net.osmand.plus.profiles.SettingsProfileFragment.IS_NEW_PROFILE;
import static net.osmand.plus.profiles.SettingsProfileFragment.IS_USER_PROFILE;
@@ -312,7 +312,7 @@ public class EditProfileFragment extends BaseOsmAndFragment {
public void onClick(View v) {
final SelectProfileBottomSheetDialogFragment iconSelectDialog = new SelectProfileBottomSheetDialogFragment();
Bundle bundle = new Bundle();
- bundle.putString(DIALOG_TYPE, TYPE_ICON);
+// bundle.putString(DIALOG_TYPE, TYPE_ICON);
bundle.putString(SELECTED_ICON, profile.iconStringName);
iconSelectDialog.setArguments(bundle);
hideKeyboard();
@@ -470,10 +470,11 @@ public class EditProfileFragment extends BaseOsmAndFragment {
if (iconIdListener == null) {
iconIdListener = new SelectProfileListener() {
@Override
- public void onSelectedType(int pos, String stringRes) {
+ public void onSelectedType(Bundle bundle) {
+ int pos = -1;
dataChanged = true;
profile.iconId = pos;
- profile.iconStringName = stringRes;
+ profile.iconStringName = null;
profileIcon.setImageDrawable(app.getUIUtilities().getIcon(pos,
profile.iconColor.getColor(nightMode)));
@@ -487,11 +488,10 @@ public class EditProfileFragment extends BaseOsmAndFragment {
if (baseTypeListener == null) {
baseTypeListener = new SelectProfileListener() {
@Override
- public void onSelectedType(int pos, String stringRes) {
- String key = SettingsProfileFragment.getBaseProfiles(getMyApplication())
- .get(pos).getStringKey();
- setupBaseProfileView(key);
- profile.parent = ApplicationMode.valueOfStringKey(key, ApplicationMode.DEFAULT);
+ public void onSelectedType(Bundle args) {
+ String profileKey = args.getString(PROFILE_KEY_ARG);
+ setupBaseProfileView(profileKey);
+ profile.parent = ApplicationMode.valueOfStringKey(profileKey, ApplicationMode.DEFAULT);
dataChanged = true;
}
};
@@ -503,7 +503,8 @@ public class EditProfileFragment extends BaseOsmAndFragment {
if (navTypeListener == null) {
navTypeListener = new SelectProfileListener() {
@Override
- public void onSelectedType(int pos, String stringRes) {
+ public void onSelectedType(Bundle args) {
+ int pos = -1;
updateRoutingProfile(pos);
}
};
@@ -775,7 +776,7 @@ public class EditProfileFragment extends BaseOsmAndFragment {
}
}
- public static List getRoutingProfiles(OsmandApplication context) {
+ private static List getRoutingProfiles(OsmandApplication context) {
List profilesObjects = new ArrayList<>();
profilesObjects.add(new RoutingProfileDataObject(
RoutingProfilesResources.STRAIGHT_LINE_MODE.name(),
@@ -812,7 +813,7 @@ public class EditProfileFragment extends BaseOsmAndFragment {
return profilesObjects;
}
- public enum RoutingProfilesResources {
+ private enum RoutingProfilesResources {
STRAIGHT_LINE_MODE(R.string.routing_profile_straightline, R.drawable.ic_action_split_interval),
BROUTER_MODE(R.string.routing_profile_broutrer, R.drawable.ic_action_split_interval),
CAR(R.string.rendering_value_car_name, R.drawable.ic_action_car_dark),
diff --git a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java
index 3df92e0ce3..b812022ec1 100644
--- a/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java
+++ b/OsmAnd/src/net/osmand/plus/profiles/RoutingProfileDataObject.java
@@ -1,7 +1,9 @@
package net.osmand.plus.profiles;
-import android.os.Parcel;
-import net.osmand.plus.ApplicationMode.ProfileIconColors;
+import net.osmand.plus.R;
+
+import java.util.ArrayList;
+import java.util.List;
public class RoutingProfileDataObject extends ProfileDataObject {
@@ -17,4 +19,43 @@ public class RoutingProfileDataObject extends ProfileDataObject {
return fileName;
}
+ public enum RoutingProfilesResources {
+ STRAIGHT_LINE_MODE(R.string.routing_profile_straightline, R.drawable.ic_action_split_interval),
+ BROUTER_MODE(R.string.routing_profile_broutrer, R.drawable.ic_action_split_interval),
+ CAR(R.string.rendering_value_car_name, R.drawable.ic_action_car_dark),
+ PEDESTRIAN(R.string.rendering_value_pedestrian_name, R.drawable.ic_action_pedestrian_dark),
+ BICYCLE(R.string.rendering_value_bicycle_name, R.drawable.ic_action_bicycle_dark),
+ SKI(R.string.routing_profile_ski, R.drawable.ic_action_skiing),
+ PUBLIC_TRANSPORT(R.string.app_mode_public_transport, R.drawable.ic_action_bus_dark),
+ BOAT(R.string.app_mode_boat, R.drawable.ic_action_sail_boat_dark),
+ GEOCODING(R.string.routing_profile_geocoding, R.drawable.ic_action_world_globe);
+
+ int stringRes;
+ int iconRes;
+
+ RoutingProfilesResources(int stringRes, int iconRes) {
+ this.stringRes = stringRes;
+ this.iconRes = iconRes;
+ }
+
+ public int getStringRes() {
+ return stringRes;
+ }
+
+ public int getIconRes() {
+ return iconRes;
+ }
+
+ private static final List rpValues = new ArrayList<>();
+
+ static {
+ for (RoutingProfilesResources rpr : RoutingProfilesResources.values()) {
+ rpValues.add(rpr.name());
+ }
+ }
+
+ public static boolean isRpValue(String value) {
+ return rpValues.contains(value);
+ }
+ }
}
diff --git a/OsmAnd/src/net/osmand/plus/profiles/SelectProfileBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/profiles/SelectProfileBottomSheetDialogFragment.java
index 596765675c..4c81a64473 100644
--- a/OsmAnd/src/net/osmand/plus/profiles/SelectProfileBottomSheetDialogFragment.java
+++ b/OsmAnd/src/net/osmand/plus/profiles/SelectProfileBottomSheetDialogFragment.java
@@ -1,5 +1,6 @@
package net.osmand.plus.profiles;
+import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
@@ -9,13 +10,20 @@ import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.view.View;
import android.view.View.OnClickListener;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import net.osmand.CallbackWithObject;
import net.osmand.PlatformUtil;
-import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
+import net.osmand.plus.SettingsHelper.*;
+import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.base.MenuBottomSheetDialogFragment;
+import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
import net.osmand.plus.base.bottomsheetmenu.BottomSheetItemWithCompoundButton;
+import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
+import net.osmand.plus.base.bottomsheetmenu.simpleitems.DividerItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.LongDescriptionItem;
import net.osmand.plus.base.bottomsheetmenu.simpleitems.TitleItem;
import net.osmand.plus.settings.MainSettingsFragment;
@@ -27,7 +35,8 @@ import org.apache.commons.logging.Log;
import java.util.ArrayList;
import java.util.List;
-import static net.osmand.plus.profiles.EditProfileFragment.SELECTED_ICON;
+import static net.osmand.plus.helpers.ImportHelper.ImportType.ROUTING;
+import static net.osmand.plus.helpers.ImportHelper.ImportType.SETTINGS;
public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialogFragment {
@@ -38,18 +47,18 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
public final static String DIALOG_TYPE = "dialog_type";
public final static String TYPE_BASE_APP_PROFILE = "base_profiles";
public final static String TYPE_NAV_PROFILE = "routing_profiles";
- public final static String TYPE_ICON = "icon_type";
public final static String SELECTED_KEY = "selected_base";
+ public final static String PROFILE_KEY_ARG = "profile_key_arg";
+ public final static String IS_PROFILE_IMPORTED_ARG = "is_profile_imported_arg";
+
String type;
- int bottomButtonText = R.string.shared_string_cancel;
private SelectProfileListener listener;
private final List profiles = new ArrayList<>();
private String selectedItemKey;
- private String selectedIconRes;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -60,11 +69,9 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
type = args.getString(DIALOG_TYPE);
selectedItemKey = args.getString(SELECTED_KEY, null);
if (type.equals(TYPE_NAV_PROFILE)) {
- profiles.addAll(EditProfileFragment.getRoutingProfiles(app));
+ profiles.addAll(NavigationFragment.getRoutingProfiles(app).values());
} else if (type.equals(TYPE_BASE_APP_PROFILE)) {
profiles.addAll(SettingsProfileFragment.getBaseProfiles(app));
- } else if (type.equals(TYPE_ICON)) {
- selectedIconRes = args.getString(SELECTED_ICON, "");
} else {
LOG.error("Check intent data!");
dismiss();
@@ -84,8 +91,11 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
});
if (type.equals(TYPE_NAV_PROFILE) || type.equals(TYPE_BASE_APP_PROFILE)) {
- if (items.get(items.size()-1).getView() != null) {
- items.get(items.size()-1).getView().findViewById(R.id.divider_bottom).setVisibility(View.INVISIBLE);
+ for (BaseBottomSheetItem item : items) {
+ View bottomDivider = item.getView().findViewById(R.id.divider_bottom);
+ if (bottomDivider != null) {
+ bottomDivider.setVisibility(View.INVISIBLE);
+ }
}
}
}
@@ -93,6 +103,13 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
@Override
public void createMenuItems(Bundle savedInstanceState) {
int activeColorRes = nightMode ? R.color.active_color_primary_dark : R.color.active_color_primary_light;
+ int iconDefaultColorResId = nightMode ? R.color.icon_color_default_dark : R.color.icon_color_default_light;
+ OsmandApplication app = getMyApplication();
+
+ View bottomSpaceView = new View(app);
+ int space = (int) getResources().getDimension(R.dimen.empty_state_text_button_padding_top);
+ bottomSpaceView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, space));
+
if (type.equals(TYPE_BASE_APP_PROFILE)) {
items.add(new TitleItem(getString(R.string.select_base_profile_dialog_title)));
items.add(new LongDescriptionItem(getString(R.string.select_base_profile_dialog_message)));
@@ -125,18 +142,56 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
if (listener == null) {
getListener();
}
- listener.onSelectedType(pos, "");
+ Bundle args = new Bundle();
+ args.putString(PROFILE_KEY_ARG, profile.getStringKey());
+ listener.onSelectedType(args);
dismiss();
}
})
.create());
}
+ items.add(new DividerItem(app));
+ items.add(new SimpleBottomSheetItem.Builder()
+ .setTitle(app.getString(R.string.import_from_file))
+ .setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_folder, iconDefaultColorResId))
+ .setLayoutId(R.layout.bottom_sheet_item_simple)
+ .setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ MapActivity mapActivity = getMapActivity();
+ if (mapActivity == null) {
+ return;
+ }
+ mapActivity.getImportHelper().chooseFileToImport(SETTINGS, new CallbackWithObject>() {
+ @Override
+ public boolean processResult(List result) {
+ for (SettingsItem item : result) {
+ if (SettingsItemType.PROFILE.equals(item.getType())) {
+ if (listener == null) {
+ getListener();
+ }
+ Bundle args = new Bundle();
+ args.putString(PROFILE_KEY_ARG, item.getName());
+ args.putBoolean(IS_PROFILE_IMPORTED_ARG, true);
+ listener.onSelectedType(args);
+ dismiss();
+ break;
+ }
+ }
+ return false;
+ }
+ });
+ }
+ })
+ .create());
+ items.add(new BaseBottomSheetItem.Builder()
+ .setCustomView(bottomSpaceView)
+ .create());
} else if (type.equals(TYPE_NAV_PROFILE)){
items.add(new TitleItem(getString(R.string.select_nav_profile_dialog_title)));
items.add(new LongDescriptionItem(getString(R.string.select_nav_profile_dialog_message)));
for (int i = 0; i < profiles.size(); i++) {
- final int pos = i;
final ProfileDataObject profile = profiles.get(i);
final boolean isSelected = profile.getStringKey().equals(selectedItemKey);
final Drawable drawableIcon;
@@ -164,50 +219,47 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
if (listener == null) {
getListener();
}
- listener.onSelectedType(pos, "");
+ Bundle args = new Bundle();
+ args.putString(PROFILE_KEY_ARG, profile.getStringKey());
+ listener.onSelectedType(args);
dismiss();
}
})
.create());
}
- } else if (type.equals(TYPE_ICON)) {
- items.add(new TitleItem(getString(R.string.select_icon_profile_dialog_title)));
- for (final ApplicationMode.ProfileIcons icon : ApplicationMode.ProfileIcons.values()) {
- Drawable drawableIcon;
- boolean isSelected = icon.getResStringId().equals(selectedIconRes);
- int iconRes = icon.getResId();
- if (isSelected) {
- drawableIcon = getMyApplication().getUIUtilities()
- .getIcon(iconRes, nightMode
- ? R.color.active_color_primary_dark
- : R.color.active_color_primary_light);
- } else {
- drawableIcon = getMyApplication().getUIUtilities()
- .getIcon(iconRes, R.color.icon_color_default_light);
- }
-
- items.add(new BottomSheetItemWithCompoundButton.Builder()
- .setCompoundButtonColorId(activeColorRes)
- .setChecked(icon.getResStringId().equals(selectedIconRes))
- .setButtonTintList(isSelected
- ? ColorStateList.valueOf(getResolvedColor(getActiveColorId()))
- : null)
- .setTitle(getMyApplication().getString(icon.getTitleId()))
- .setIcon(drawableIcon)
- .setLayoutId(R.layout.bottom_sheet_item_with_radio_btn)
+ items.add(new DividerItem(app));
+ items.add(new LongDescriptionItem(app.getString(R.string.osmand_routing_promo)));
+ items.add(new SimpleBottomSheetItem.Builder()
+ .setTitle(app.getString(R.string.import_routing_file))
+ .setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_folder, iconDefaultColorResId))
+ .setLayoutId(R.layout.bottom_sheet_item_simple)
.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- if(listener == null) {
- getListener();
+ MapActivity mapActivity = getMapActivity();
+ if (mapActivity == null) {
+ return;
}
- listener.onSelectedType(icon.getResId(), icon.getResStringId());
- dismiss();
+ mapActivity.getImportHelper().chooseFileToImport(ROUTING, new CallbackWithObject() {
+ @Override
+ public boolean processResult(String profileKey) {
+ if (listener == null) {
+ getListener();
+ }
+ Bundle args = new Bundle();
+ args.putString(PROFILE_KEY_ARG, profileKey);
+ args.putBoolean(IS_PROFILE_IMPORTED_ARG, true);
+ listener.onSelectedType(args);
+ dismiss();
+ return false;
+ }
+ });
}
})
- .create()
- );
- }
+ .create());
+ items.add(new BaseBottomSheetItem.Builder()
+ .setCustomView(bottomSpaceView)
+ .create());
}
}
@@ -215,26 +267,12 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
FragmentActivity activity = getActivity();
if (activity != null) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
- EditProfileFragment editProfileFragment = (EditProfileFragment) fragmentManager.findFragmentByTag(EditProfileFragment.TAG);
SettingsProfileFragment settingsProfileFragment = (SettingsProfileFragment) fragmentManager.findFragmentByTag(SettingsProfileFragment.class.getName());
NavigationFragment navigationFragment = (NavigationFragment) fragmentManager.findFragmentByTag(NavigationFragment.class.getName());
ProfileAppearanceFragment profileAppearanceFragment = (ProfileAppearanceFragment) fragmentManager.findFragmentByTag(ProfileAppearanceFragment.TAG);
MainSettingsFragment mainSettingsFragment = (MainSettingsFragment) fragmentManager.findFragmentByTag(MainSettingsFragment.TAG);
- if (editProfileFragment != null) {
- switch (type) {
- case TYPE_BASE_APP_PROFILE:
- listener = editProfileFragment.getBaseProfileListener();
- break;
- case TYPE_NAV_PROFILE:
- listener = editProfileFragment.getNavProfileListener();
-
- break;
- case TYPE_ICON:
- listener = editProfileFragment.getIconListener();
- break;
- }
- } else if (settingsProfileFragment != null) {
+ if (settingsProfileFragment != null) {
listener = settingsProfileFragment.getBaseProfileListener();
} else if (navigationFragment != null) {
listener = navigationFragment.getNavProfileListener();
@@ -247,6 +285,15 @@ public class SelectProfileBottomSheetDialogFragment extends MenuBottomSheetDialo
}
public interface SelectProfileListener {
- void onSelectedType(int pos, String stringRes);
+ void onSelectedType(Bundle args);
+ }
+
+ @Nullable
+ private MapActivity getMapActivity() {
+ Activity activity = getActivity();
+ if (activity instanceof MapActivity) {
+ return (MapActivity) activity;
+ }
+ return null;
}
}
diff --git a/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java b/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java
index 2ebe4582f6..19b9529246 100644
--- a/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java
+++ b/OsmAnd/src/net/osmand/plus/profiles/SettingsProfileFragment.java
@@ -3,6 +3,7 @@ package net.osmand.plus.profiles;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.DIALOG_TYPE;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.PROFILE_KEY_ARG;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_BASE_APP_PROFILE;
import android.content.Context;
@@ -147,19 +148,19 @@ public class SettingsProfileFragment extends BaseOsmAndFragment
if (typeListener == null) {
typeListener = new SelectProfileListener() {
@Override
- public void onSelectedType(int pos, String stringRes) {
+ public void onSelectedType(Bundle args) {
FragmentActivity activity = getActivity();
+ String profileKey = args.getString(PROFILE_KEY_ARG);
if (activity != null) {
if (activity instanceof SettingsProfileActivity) {
Intent intent = new Intent(getActivity(), EditProfileActivity.class);
intent.putExtra(IS_NEW_PROFILE, true);
intent.putExtra(IS_USER_PROFILE, true);
- intent.putExtra(PROFILE_STRING_KEY, baseProfiles.get(pos).getStringKey());
+ intent.putExtra(PROFILE_STRING_KEY, profileKey);
activity.startActivity(intent);
} else {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
if (fragmentManager != null) {
- String profileKey = baseProfiles.get(pos).getStringKey();
EditProfileFragment.showInstance(fragmentManager, true, true, profileKey);
}
}
diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
index 56084c50ea..728cd6b652 100644
--- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java
@@ -42,6 +42,7 @@ import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.MapActivityLayers;
import net.osmand.plus.dashboard.DashboardOnMap.DashboardType;
import net.osmand.plus.dialogs.RasterMapMenu;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.MapTileLayer;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.util.Algorithms;
@@ -406,12 +407,6 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
}
}
- @Override
- public Class extends Activity> getSettingsActivity() {
- return SettingsRasterMapsActivity.class;
- }
-
-
public static void installMapLayers(final Activity activity, final ResultMatcher result) {
final OsmandApplication app = (OsmandApplication) activity.getApplication();
final OsmandSettings settings = app.getSettings();
diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/SettingsRasterMapsActivity.java b/OsmAnd/src/net/osmand/plus/rastermaps/SettingsRasterMapsActivity.java
index 27a2dce0d5..617e370910 100644
--- a/OsmAnd/src/net/osmand/plus/rastermaps/SettingsRasterMapsActivity.java
+++ b/OsmAnd/src/net/osmand/plus/rastermaps/SettingsRasterMapsActivity.java
@@ -42,9 +42,7 @@ public class SettingsRasterMapsActivity extends SettingsBaseActivity {
// present on configure map
// addTileSourcePrefs(listener, cat);
- cat.addPreference(createCheckBoxPreference(settings.USE_INTERNET_TO_DOWNLOAD_TILES,
- R.string.use_internet, R.string.use_internet_to_download_tile));
-
+
// int startZoom = 1;
// int endZoom = 18;
// String[] entries = new String[endZoom - startZoom + 1];
diff --git a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
index 7c740513ed..83fa92524f 100644
--- a/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/BaseSettingsFragment.java
@@ -40,6 +40,7 @@ import android.widget.TextView;
import net.osmand.AndroidUtils;
import net.osmand.PlatformUtil;
+import net.osmand.access.AccessibilitySettingsFragment;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
@@ -48,6 +49,9 @@ import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.activities.OsmandActionBarActivity;
import net.osmand.plus.activities.OsmandInAppPurchaseActivity;
+import net.osmand.plus.audionotes.MultimediaNotesFragment;
+import net.osmand.plus.monitoring.MonitoringSettingsFragment;
+import net.osmand.plus.osmedit.OsmEditingFragment;
import net.osmand.plus.profiles.SelectAppModesBottomSheetDialogFragment;
import net.osmand.plus.profiles.SelectAppModesBottomSheetDialogFragment.AppModeChangedListener;
import net.osmand.plus.settings.bottomsheets.BooleanPreferenceBottomSheet;
@@ -86,14 +90,19 @@ public abstract class BaseSettingsFragment extends PreferenceFragmentCompat impl
MAIN_SETTINGS(MainSettingsFragment.TAG, false, R.xml.settings_main_screen, R.layout.global_preference_toolbar),
GLOBAL_SETTINGS(GlobalSettingsFragment.class.getName(), false, R.xml.global_settings, R.layout.global_preference_toolbar),
+ OPEN_STREET_MAP_EDITING(OsmEditingFragment.class.getName(), false, R.xml.osm_editing, R.layout.global_preference_toolbar),
CONFIGURE_PROFILE(ConfigureProfileFragment.class.getName(), true, R.xml.configure_profile, R.layout.profile_preference_toolbar_with_switch),
PROXY_SETTINGS(ProxySettingsFragment.class.getName(), false, R.xml.proxy_preferences, R.layout.global_preferences_toolbar_with_switch),
+ LIVE_MONITORING(LiveMonitoringFragment.class.getName(), false, R.xml.live_monitoring, R.layout.global_preferences_toolbar_with_switch),
GENERAL_PROFILE(GeneralProfileSettingsFragment.class.getName(), true, R.xml.general_profile_settings, R.layout.profile_preference_toolbar_big),
NAVIGATION(NavigationFragment.class.getName(), true, R.xml.navigation_settings_new, R.layout.profile_preference_toolbar),
COORDINATES_FORMAT(CoordinatesFormatFragment.class.getName(), true, R.xml.coordinates_format, R.layout.profile_preference_toolbar),
ROUTE_PARAMETERS(RouteParametersFragment.class.getName(), true, R.xml.route_parameters, R.layout.profile_preference_toolbar),
SCREEN_ALERTS(ScreenAlertsFragment.class.getName(), true, R.xml.screen_alerts, R.layout.profile_preference_toolbar_with_switch),
VOICE_ANNOUNCES(VoiceAnnouncesFragment.class.getName(), true, R.xml.voice_announces, R.layout.profile_preference_toolbar_with_switch),
+ ACCESSIBILITY_SETTINGS(AccessibilitySettingsFragment.class.getName(), true, R.xml.accessibility_settings, R.layout.profile_preference_toolbar_big),
+ MULTIMEDIA_NOTES(MultimediaNotesFragment.class.getName(), true, R.xml.multimedia_notes, R.layout.profile_preference_toolbar_big),
+ MONITORING_SETTINGS(MonitoringSettingsFragment.class.getName(), true, R.xml.monitoring_settings, R.layout.profile_preference_toolbar_big),
VEHICLE_PARAMETERS(VehicleParametersFragment.class.getName(), true, R.xml.vehicle_parameters, R.layout.profile_preference_toolbar),
MAP_DURING_NAVIGATION(MapDuringNavigationFragment.class.getName(), true, R.xml.map_during_navigation, R.layout.profile_preference_toolbar),
TURN_SCREEN_ON(TurnScreenOnFragment.class.getName(), true, R.xml.turn_screen_on, R.layout.profile_preference_toolbar_with_switch),
diff --git a/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java b/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java
index e882cc1c0f..ea40709d09 100644
--- a/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/ConfigureProfileFragment.java
@@ -1,6 +1,5 @@
package net.osmand.plus.settings;
-import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -20,7 +19,6 @@ import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceCategory;
import android.support.v7.preference.PreferenceGroup;
import android.support.v7.preference.PreferenceGroupAdapter;
-import android.support.v7.preference.SwitchPreferenceCompat;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SwitchCompat;
import android.view.LayoutInflater;
@@ -32,8 +30,6 @@ import android.widget.Toast;
import net.osmand.AndroidUtils;
import net.osmand.IndexConstants;
import net.osmand.PlatformUtil;
-import net.osmand.aidl.ConnectedApp;
-import net.osmand.aidl.OsmandAidlApi;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
@@ -42,12 +38,10 @@ import net.osmand.plus.SettingsHelper;
import net.osmand.plus.SettingsHelper.ProfileSettingsItem;
import net.osmand.plus.UiUtilities;
import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.activities.PluginActivity;
import net.osmand.plus.helpers.FontCache;
import net.osmand.plus.openseamapsplugin.NauticalMapsPlugin;
import net.osmand.plus.profiles.SelectCopyAppModeBottomSheet;
import net.osmand.plus.settings.bottomsheets.ResetProfilePrefsBottomSheet;
-import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
import net.osmand.plus.skimapsplugin.SkiMapsPlugin;
import org.apache.commons.logging.Log;
@@ -60,7 +54,6 @@ import static net.osmand.plus.profiles.EditProfileFragment.MAP_CONFIG;
import static net.osmand.plus.profiles.EditProfileFragment.OPEN_CONFIG_ON_MAP;
import static net.osmand.plus.profiles.EditProfileFragment.SCREEN_CONFIG;
import static net.osmand.plus.profiles.EditProfileFragment.SELECTED_ITEM;
-import static net.osmand.plus.profiles.SettingsProfileFragment.PROFILE_STRING_KEY;
public class ConfigureProfileFragment extends BaseSettingsFragment {
@@ -212,9 +205,6 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
setupProfileAppearancePref();
PreferenceCategory pluginSettings = (PreferenceCategory) findPreference(PLUGIN_SETTINGS);
- pluginSettings.setIconSpaceReserved(false);
-
- setupConnectedAppsPref(pluginSettings);
setupOsmandPluginsPref(pluginSettings);
PreferenceCategory settingsActions = (PreferenceCategory) findPreference(SETTINGS_ACTIONS);
@@ -265,14 +255,9 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
if (ctx == null) {
return;
}
-
Preference configureMap = findPreference(PROFILE_APPEARANCE);
- if (!getSelectedAppMode().equals(ApplicationMode.DEFAULT)) {
- configureMap.setIcon(getContentIcon(getSelectedAppMode().getIconRes()));
- configureMap.setFragment(ProfileAppearanceFragment.TAG);
- } else {
- configureMap.setVisible(false);
- }
+ configureMap.setIcon(getContentIcon(getSelectedAppMode().getIconRes()));
+ configureMap.setFragment(ProfileAppearanceFragment.TAG);
}
private void setupCopyProfileSettingsPref() {
@@ -319,25 +304,6 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
}
}
- private void setupConnectedAppsPref(PreferenceCategory preferenceCategory) {
- OsmandApplication app = getMyApplication();
- if (app == null) {
- return;
- }
- List connectedApps = app.getAidlApi().getConnectedApps();
- for (ConnectedApp connectedApp : connectedApps) {
- SwitchPreferenceCompat preference = new SwitchPreferenceCompat(app);
- preference.setPersistent(false);
- preference.setKey(connectedApp.getPack());
- preference.setIcon(connectedApp.getIcon());
- preference.setTitle(connectedApp.getName());
- preference.setChecked(connectedApp.isEnabled());
- preference.setLayoutResource(R.layout.preference_switch);
-
- preferenceCategory.addPreference(preference);
- }
- }
-
private void setupOsmandPluginsPref(PreferenceCategory preferenceCategory) {
Context ctx = getContext();
if (ctx == null) {
@@ -345,40 +311,22 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
}
List plugins = OsmandPlugin.getVisiblePlugins();
for (OsmandPlugin plugin : plugins) {
- if (plugin instanceof SkiMapsPlugin || plugin instanceof NauticalMapsPlugin) {
+ if (plugin instanceof SkiMapsPlugin || plugin instanceof NauticalMapsPlugin || plugin.getSettingsFragment() == null) {
continue;
}
- SwitchPreferenceEx preference = new SwitchPreferenceEx(ctx);
+ Preference preference = new Preference(ctx);
preference.setPersistent(false);
preference.setKey(plugin.getId());
preference.setTitle(plugin.getName());
- preference.setChecked(plugin.isActive());
- preference.setIcon(getPluginIcon(plugin));
- preference.setIntent(getPluginIntent(plugin));
- preference.setLayoutResource(R.layout.preference_dialog_and_switch);
+ preference.setSummary(plugin.getPrefsDescription());
+ preference.setIcon(getContentIcon(plugin.getLogoResourceId()));
+ preference.setLayoutResource(R.layout.preference_with_descr);
+ preference.setFragment(plugin.getSettingsFragment().getName());
preferenceCategory.addPreference(preference);
}
}
- private Drawable getPluginIcon(OsmandPlugin plugin) {
- int iconResId = plugin.getLogoResourceId();
- return plugin.isActive() ? getActiveIcon(iconResId) : getIcon(iconResId, isNightMode() ? R.color.icon_color_secondary_dark : R.color.icon_color_secondary_light);
- }
-
- private Intent getPluginIntent(OsmandPlugin plugin) {
- Intent intent;
- final Class extends Activity> settingsActivity = plugin.getSettingsActivity();
- if (settingsActivity != null && !plugin.needsInstallation()) {
- intent = new Intent(getContext(), settingsActivity);
- intent.putExtra(PROFILE_STRING_KEY, getSelectedAppMode().getStringKey());
- } else {
- intent = new Intent(getContext(), PluginActivity.class);
- intent.putExtra(PluginActivity.EXTRA_PLUGIN_ID, plugin.getId());
- }
- return intent;
- }
-
@Override
public boolean onPreferenceClick(Preference preference) {
String prefId = preference.getKey();
@@ -437,7 +385,7 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
return super.onPreferenceClick(preference);
}
- void onDeleteProfileClick() {
+ private void onDeleteProfileClick() {
final ApplicationMode profile = getSelectedAppMode();
if (getActivity() != null) {
if (profile.getParent() != null) {
@@ -470,32 +418,4 @@ public class ConfigureProfileFragment extends BaseSettingsFragment {
}
}
}
-
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- String key = preference.getKey();
-
- OsmandPlugin plugin = OsmandPlugin.getPlugin(key);
- if (plugin != null) {
- if (newValue instanceof Boolean) {
- if ((plugin.isActive() || !plugin.needsInstallation())) {
- if (OsmandPlugin.enablePlugin(getActivity(), app, plugin, (Boolean) newValue)) {
- preference.setIcon(getPluginIcon(plugin));
- return true;
- }
- } else if (plugin.needsInstallation() && preference.getIntent() != null) {
- startActivity(preference.getIntent());
- }
- }
- return false;
- }
-
- OsmandAidlApi aidlApi = app.getAidlApi();
- ConnectedApp connectedApp = aidlApi.getConnectedApp(key);
- if (connectedApp != null) {
- return aidlApi.switchEnabled(connectedApp);
- }
-
- return super.onPreferenceChange(preference, newValue);
- }
}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/settings/LiveMonitoringFragment.java b/OsmAnd/src/net/osmand/plus/settings/LiveMonitoringFragment.java
new file mode 100644
index 0000000000..14a266dab4
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/settings/LiveMonitoringFragment.java
@@ -0,0 +1,150 @@
+package net.osmand.plus.settings;
+
+import android.graphics.drawable.ColorDrawable;
+import android.graphics.drawable.Drawable;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.preference.Preference;
+import android.support.v7.widget.SwitchCompat;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.TextView;
+
+import net.osmand.AndroidUtils;
+import net.osmand.plus.ApplicationMode;
+import net.osmand.plus.OsmandSettings;
+import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities;
+import net.osmand.plus.settings.bottomsheets.ChangeGeneralProfilesPrefBottomSheet;
+import net.osmand.plus.settings.preferences.EditTextPreferenceEx;
+import net.osmand.plus.settings.preferences.ListPreferenceEx;
+
+import java.io.Serializable;
+
+import static net.osmand.plus.UiUtilities.CompoundButtonType.TOOLBAR;
+import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MAX_INTERVAL_TO_SEND_MINUTES;
+import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.MINUTES;
+import static net.osmand.plus.monitoring.OsmandMonitoringPlugin.SECONDS;
+
+public class LiveMonitoringFragment extends BaseSettingsFragment {
+
+ @Override
+ protected void setupPreferences() {
+ setupLiveMonitoringUrlPref();
+ setupLiveMonitoringIntervalPref();
+ setupLiveMonitoringBufferPref();
+ enableDisablePreferences(settings.LIVE_MONITORING.getModeValue(getSelectedAppMode()));
+ }
+
+ @Override
+ protected void createToolbar(LayoutInflater inflater, View view) {
+ super.createToolbar(inflater, view);
+
+ view.findViewById(R.id.toolbar_switch_container).setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ ApplicationMode appMode = getSelectedAppMode();
+ boolean checked = !settings.LIVE_MONITORING.getModeValue(appMode);
+ settings.LIVE_MONITORING.setModeValue(appMode, checked);
+ updateToolbarSwitch();
+ enableDisablePreferences(checked);
+ }
+ });
+ TextView title = (TextView) view.findViewById(R.id.switchButtonText);
+ title.setTextColor(ContextCompat.getColor(app, isNightMode() ? R.color.active_color_primary_dark : R.color.active_color_primary_light));
+ }
+
+ @Override
+ protected void updateToolbar() {
+ super.updateToolbar();
+ updateToolbarSwitch();
+ }
+
+ private void updateToolbarSwitch() {
+ View view = getView();
+ if (view == null) {
+ return;
+ }
+ boolean checked = settings.LIVE_MONITORING.getModeValue(getSelectedAppMode());
+ int color = checked ? getActiveProfileColor() : ContextCompat.getColor(app, R.color.preference_top_switch_off);
+
+ View selectableView = view.findViewById(R.id.selectable_item);
+ View switchContainer = view.findViewById(R.id.toolbar_switch_container);
+
+ AndroidUtils.setBackground(switchContainer, new ColorDrawable(color));
+
+ SwitchCompat switchView = (SwitchCompat) selectableView.findViewById(R.id.switchWidget);
+ switchView.setChecked(checked);
+ UiUtilities.setupCompoundButton(switchView, isNightMode(), TOOLBAR);
+
+ TextView title = (TextView) selectableView.findViewById(R.id.switchButtonText);
+ title.setText(checked ? R.string.shared_string_enabled : R.string.shared_string_disabled);
+ title.setTextColor(ContextCompat.getColor(app, isNightMode() ? R.color.text_color_tab_active_dark : R.color.text_color_tab_active_light));
+
+ Drawable drawable = UiUtilities.getColoredSelectableDrawable(app, getActiveProfileColor(), 0.3f);
+ AndroidUtils.setBackground(selectableView, drawable);
+ }
+
+ private void setupLiveMonitoringUrlPref() {
+ EditTextPreferenceEx liveMonitoringUrl = (EditTextPreferenceEx) findPreference(settings.LIVE_MONITORING_URL.getId());
+ liveMonitoringUrl.setSummary(settings.LIVE_MONITORING_URL.getModeValue(getSelectedAppMode()));
+ liveMonitoringUrl.setDescription(R.string.live_monitoring_m_descr);
+ liveMonitoringUrl.setIcon(getContentIcon(R.drawable.ic_world_globe_dark));
+ }
+
+ private void setupLiveMonitoringIntervalPref() {
+ Integer[] entryValues = new Integer[SECONDS.length + MINUTES.length];
+ String[] entries = new String[entryValues.length];
+ int k = 0;
+ for (int second : SECONDS) {
+ entryValues[k] = second * 1000;
+ entries[k] = second + " " + getString(R.string.int_seconds);
+ k++;
+ }
+ for (int minute : MINUTES) {
+ entryValues[k] = (minute * 60) * 1000;
+ entries[k] = minute + " " + getString(R.string.int_min);
+ k++;
+ }
+
+ ListPreferenceEx liveMonitoringInterval = (ListPreferenceEx) findPreference(settings.LIVE_MONITORING_INTERVAL.getId());
+ liveMonitoringInterval.setEntries(entries);
+ liveMonitoringInterval.setEntryValues(entryValues);
+ liveMonitoringInterval.setIcon(getContentIcon(R.drawable.ic_action_time_span));
+ liveMonitoringInterval.setDescription(R.string.live_monitoring_interval_descr);
+ }
+
+ private void setupLiveMonitoringBufferPref() {
+ Integer[] entryValues = new Integer[MAX_INTERVAL_TO_SEND_MINUTES.length];
+ String[] entries = new String[entryValues.length];
+
+ for (int i = 0; i < MAX_INTERVAL_TO_SEND_MINUTES.length; i++) {
+ int minute = MAX_INTERVAL_TO_SEND_MINUTES[i];
+ entryValues[i] = (minute * 60) * 1000;
+ entries[i] = minute + " " + getString(R.string.int_min);
+ }
+
+ ListPreferenceEx liveMonitoringBuffer = (ListPreferenceEx) findPreference(settings.LIVE_MONITORING_MAX_INTERVAL_TO_SEND.getId());
+ liveMonitoringBuffer.setEntries(entries);
+ liveMonitoringBuffer.setEntryValues(entryValues);
+ liveMonitoringBuffer.setIcon(getContentIcon(R.drawable.ic_action_time_span));
+ liveMonitoringBuffer.setDescription(R.string.live_monitoring_max_interval_to_send_desrc);
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ String prefId = preference.getKey();
+
+ OsmandSettings.OsmandPreference pref = settings.getPreference(prefId);
+ if (pref instanceof OsmandSettings.CommonPreference && !((OsmandSettings.CommonPreference) pref).hasDefaultValueForMode(getSelectedAppMode())) {
+ FragmentManager fragmentManager = getFragmentManager();
+ if (fragmentManager != null && newValue instanceof Serializable) {
+ ChangeGeneralProfilesPrefBottomSheet.showInstance(fragmentManager, prefId,
+ (Serializable) newValue, this, false, getSelectedAppMode());
+ }
+ return false;
+ }
+
+ return true;
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java b/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java
index 3f1e028cab..d081e9a196 100644
--- a/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/MainSettingsFragment.java
@@ -12,11 +12,13 @@ import android.support.v7.preference.PreferenceViewHolder;
import android.view.View;
import net.osmand.AndroidUtils;
+import net.osmand.CallbackWithObject;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
+import net.osmand.plus.SettingsHelper.*;
import net.osmand.plus.UiUtilities;
-import net.osmand.plus.profiles.ProfileDataObject;
+import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment;
import net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.SelectProfileListener;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
@@ -26,9 +28,11 @@ import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
+import static net.osmand.plus.helpers.ImportHelper.ImportType.SETTINGS;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.DIALOG_TYPE;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.IS_PROFILE_IMPORTED_ARG;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.PROFILE_KEY_ARG;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_BASE_APP_PROFILE;
-import static net.osmand.plus.profiles.SettingsProfileFragment.getBaseProfiles;
public class MainSettingsFragment extends BaseSettingsFragment {
@@ -38,7 +42,7 @@ public class MainSettingsFragment extends BaseSettingsFragment {
private static final String APP_PROFILES = "app_profiles";
private static final String SELECTED_PROFILE = "selected_profile";
private static final String CREATE_PROFILE = "create_profile";
- // private static final String IMPORT_PROFILE = "import_profile";
+ private static final String IMPORT_PROFILE = "import_profile";
private static final String REORDER_PROFILES = "reorder_profiles";
private List allAppModes;
@@ -59,9 +63,7 @@ public class MainSettingsFragment extends BaseSettingsFragment {
@Override
protected void setupPreferences() {
allAppModes = new ArrayList<>(ApplicationMode.allPossibleValues());
- allAppModes.remove(ApplicationMode.DEFAULT);
availableAppModes = new LinkedHashSet<>(ApplicationMode.values(getMyApplication()));
- availableAppModes.remove(ApplicationMode.DEFAULT);
Preference globalSettings = findPreference("global_settings");
globalSettings.setIcon(getContentIcon(R.drawable.ic_action_settings));
PreferenceCategory selectedProfile = (PreferenceCategory) findPreference(SELECTED_PROFILE);
@@ -117,6 +119,25 @@ public class MainSettingsFragment extends BaseSettingsFragment {
getActivity().getSupportFragmentManager().beginTransaction()
.add(dialog, "select_base_profile").commitAllowingStateLoss();
}
+ } else if (IMPORT_PROFILE.equals(prefId)) {
+ final MapActivity mapActivity = getMapActivity();
+ if (mapActivity != null) {
+ mapActivity.getImportHelper().chooseFileToImport(SETTINGS, new CallbackWithObject>() {
+
+ @Override
+ public boolean processResult(List result) {
+ for (SettingsItem item : result) {
+ if (SettingsItemType.PROFILE.equals(item.getType())) {
+ ConfigureProfileFragment.showInstance(mapActivity, SettingsScreenType.CONFIGURE_PROFILE,
+ ApplicationMode.valueOfStringKey(item.getName(), null));
+ break;
+ }
+ }
+ return false;
+ }
+
+ });
+ }
}
return super.onPreferenceClick(preference);
}
@@ -133,15 +154,17 @@ public class MainSettingsFragment extends BaseSettingsFragment {
}
private void profileManagementPref() {
+ int activeColorPrimaryResId = isNightMode() ? R.color.active_color_primary_dark
+ : R.color.active_color_primary_light;
+
Preference createProfile = findPreference(CREATE_PROFILE);
- createProfile.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_plus,
- isNightMode() ? R.color.active_color_primary_dark : R.color.active_color_primary_light));
-// Preference importProfile = findPreference(IMPORT_PROFILE);
-// importProfile.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_import,
-// isNightMode() ? R.color.active_color_primary_dark : R.color.active_color_primary_light));
+ createProfile.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_plus, activeColorPrimaryResId));
+
+ Preference importProfile = findPreference(IMPORT_PROFILE);
+ importProfile.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_import, activeColorPrimaryResId));
+
Preference reorderProfiles = findPreference(REORDER_PROFILES);
- reorderProfiles.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_edit_dark,
- isNightMode() ? R.color.active_color_primary_dark : R.color.active_color_primary_light));
+ reorderProfiles.setIcon(app.getUIUtilities().getIcon(R.drawable.ic_action_edit_dark, activeColorPrimaryResId));
}
private void setupAppProfiles(PreferenceCategory preferenceCategory) {
@@ -183,14 +206,15 @@ public class MainSettingsFragment extends BaseSettingsFragment {
if (selectProfileListener == null) {
selectProfileListener = new SelectProfileListener() {
@Override
- public void onSelectedType(int pos, String stringRes) {
+ public void onSelectedType(Bundle args) {
FragmentActivity activity = getActivity();
if (activity != null) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
if (fragmentManager != null) {
- ProfileDataObject profileDataObject = getBaseProfiles(app).get(pos);
+ String profileKey = args.getString(PROFILE_KEY_ARG);
+ boolean imported = args.getBoolean(IS_PROFILE_IMPORTED_ARG);
ProfileAppearanceFragment.showInstance(activity, SettingsScreenType.PROFILE_APPEARANCE,
- profileDataObject.getStringKey());
+ profileKey, imported);
}
}
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java
index de19501412..9453385d99 100644
--- a/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/NavigationFragment.java
@@ -7,19 +7,23 @@ import android.view.LayoutInflater;
import android.view.View;
import net.osmand.plus.ApplicationMode;
+import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import net.osmand.plus.activities.MapActivity;
-import net.osmand.plus.profiles.EditProfileFragment;
-import net.osmand.plus.profiles.EditProfileFragment.RoutingProfilesResources;
import net.osmand.plus.profiles.RoutingProfileDataObject;
+import net.osmand.plus.profiles.RoutingProfileDataObject.RoutingProfilesResources;
import net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment;
import net.osmand.plus.routing.RouteProvider;
import net.osmand.plus.settings.preferences.SwitchPreferenceEx;
import net.osmand.router.GeneralRouter;
+import net.osmand.util.Algorithms;
-import java.util.List;
+import java.util.HashMap;
+import java.util.Map;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.DIALOG_TYPE;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.IS_PROFILE_IMPORTED_ARG;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.PROFILE_KEY_ARG;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.SELECTED_KEY;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_NAV_PROFILE;
@@ -29,13 +33,13 @@ public class NavigationFragment extends BaseSettingsFragment {
public static final String NAVIGATION_TYPE = "navigation_type";
private SelectProfileBottomSheetDialogFragment.SelectProfileListener navTypeListener;
- private List routingProfileDataObjects;
+ private Map routingProfileDataObjects;
private Preference navigationType;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- routingProfileDataObjects = EditProfileFragment.getRoutingProfiles(app);
+ routingProfileDataObjects = getRoutingProfiles(app);
}
@Override
@@ -55,9 +59,14 @@ public class NavigationFragment extends BaseSettingsFragment {
if (getSelectedAppMode().getRoutingProfile() != null) {
GeneralRouter routingProfile = app.getRoutingConfig().getRouter(getSelectedAppMode().getRoutingProfile());
if (routingProfile != null) {
- RoutingProfilesResources routingProfilesResources = RoutingProfilesResources.valueOf(routingProfile.getProfileName().toUpperCase());
- navigationType.setSummary(routingProfilesResources.getStringRes());
- navigationType.setIcon(getContentIcon(routingProfilesResources.getIconRes()));
+ String profileNameUC = routingProfile.getProfileName().toUpperCase();
+ if (RoutingProfilesResources.isRpValue(profileNameUC)) {
+ RoutingProfilesResources routingProfilesResources = RoutingProfilesResources.valueOf(profileNameUC);
+ navigationType.setSummary(routingProfilesResources.getStringRes());
+ navigationType.setIcon(getContentIcon(routingProfilesResources.getIconRes()));
+ } else {
+ navigationType.setIcon(getContentIcon(R.drawable.ic_action_gdirections_dark));
+ }
}
}
routeParameters.setIcon(getContentIcon(R.drawable.ic_action_route_distance));
@@ -103,34 +112,35 @@ public class NavigationFragment extends BaseSettingsFragment {
if (navTypeListener == null) {
navTypeListener = new SelectProfileBottomSheetDialogFragment.SelectProfileListener() {
@Override
- public void onSelectedType(int pos, String stringRes) {
- updateRoutingProfile(pos);
+ public void onSelectedType(Bundle args) {
+ if (args.getBoolean(IS_PROFILE_IMPORTED_ARG)) {
+ routingProfileDataObjects = getRoutingProfiles(app);
+ }
+ updateRoutingProfile(args.getString(PROFILE_KEY_ARG));
}
};
}
return navTypeListener;
}
- void updateRoutingProfile(int pos) {
- for (int i = 0; i < routingProfileDataObjects.size(); i++) {
- if (i == pos) {
- routingProfileDataObjects.get(i).setSelected(true);
- } else {
- routingProfileDataObjects.get(i).setSelected(false);
- }
+ void updateRoutingProfile(String profileKey) {
+ RoutingProfileDataObject selectedRoutingProfileDataObject = routingProfileDataObjects.get(profileKey);
+ if (profileKey == null || selectedRoutingProfileDataObject == null) {
+ return;
+ }
+ for (Map.Entry rp : routingProfileDataObjects.entrySet()) {
+ boolean selected = profileKey.equals(rp.getKey());
+ rp.getValue().setSelected(selected);
}
- RoutingProfileDataObject selectedRoutingProfileDataObject = routingProfileDataObjects.get(pos);
navigationType.setSummary(selectedRoutingProfileDataObject.getName());
navigationType.setIcon(getContentIcon(selectedRoutingProfileDataObject.getIconRes()));
ApplicationMode.ApplicationModeBuilder builder = ApplicationMode.changeBaseMode(getSelectedAppMode());
- if (selectedRoutingProfileDataObject.getStringKey().equals(
- RoutingProfilesResources.STRAIGHT_LINE_MODE.name())) {
+ if (profileKey.equals(RoutingProfilesResources.STRAIGHT_LINE_MODE.name())) {
builder.setRouteService(RouteProvider.RouteService.STRAIGHT);
- } else if (selectedRoutingProfileDataObject.getStringKey().equals(
- RoutingProfilesResources.BROUTER_MODE.name())) {
+ } else if (profileKey.equals(RoutingProfilesResources.BROUTER_MODE.name())) {
builder.setRouteService(RouteProvider.RouteService.BROUTER);
} else {
- builder.setRoutingProfile(selectedRoutingProfileDataObject.getStringKey());
+ builder.setRoutingProfile(profileKey);
}
ApplicationMode mode = ApplicationMode.saveProfile(builder, app);
@@ -139,6 +149,43 @@ public class NavigationFragment extends BaseSettingsFragment {
}
}
+ public static Map getRoutingProfiles(OsmandApplication context) {
+ Map profilesObjects = new HashMap<>();
+ profilesObjects.put(RoutingProfilesResources.STRAIGHT_LINE_MODE.name(), new RoutingProfileDataObject(
+ RoutingProfilesResources.STRAIGHT_LINE_MODE.name(),
+ context.getString(RoutingProfilesResources.STRAIGHT_LINE_MODE.getStringRes()),
+ context.getString(R.string.special_routing_type),
+ RoutingProfilesResources.STRAIGHT_LINE_MODE.getIconRes(),
+ false, null));
+ if (context.getBRouterService() != null) {
+ profilesObjects.put(RoutingProfilesResources.BROUTER_MODE.name(), new RoutingProfileDataObject(
+ RoutingProfilesResources.BROUTER_MODE.name(),
+ context.getString(RoutingProfilesResources.BROUTER_MODE.getStringRes()),
+ context.getString(R.string.third_party_routing_type),
+ RoutingProfilesResources.BROUTER_MODE.getIconRes(),
+ false, null));
+ }
+
+ Map inputProfiles = context.getRoutingConfig().getAllRouters();
+ for (Map.Entry e : inputProfiles.entrySet()) {
+ if (!e.getKey().equals("geocoding")) {
+ int iconRes = R.drawable.ic_action_gdirections_dark;
+ String name = e.getValue().getProfileName();
+ String description = context.getString(R.string.osmand_default_routing);
+ if (!Algorithms.isEmpty(e.getValue().getFilename())) {
+ description = e.getValue().getFilename();
+ } else if (RoutingProfilesResources.isRpValue(name.toUpperCase())){
+ iconRes = RoutingProfilesResources.valueOf(name.toUpperCase()).getIconRes();
+ name = context
+ .getString(RoutingProfilesResources.valueOf(name.toUpperCase()).getStringRes());
+ }
+ profilesObjects.put(e.getKey(), new RoutingProfileDataObject(e.getKey(), name, description,
+ iconRes, false, e.getValue().getFilename()));
+ }
+ }
+ return profilesObjects;
+ }
+
private void setupVehicleParametersPref() {
Preference vehicleParameters = findPreference("vehicle_parameters");
int iconRes = getSelectedAppMode().getIconRes();
diff --git a/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java b/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java
index d90ae9a914..7dcb2d24b2 100644
--- a/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java
+++ b/OsmAnd/src/net/osmand/plus/settings/ProfileAppearanceFragment.java
@@ -4,13 +4,17 @@ import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
+import android.graphics.Matrix;
import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
import android.graphics.drawable.GradientDrawable;
+import android.graphics.drawable.LayerDrawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.content.ContextCompat;
+import android.support.v4.graphics.drawable.DrawableCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceViewHolder;
@@ -21,7 +25,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
-import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
@@ -34,7 +37,6 @@ import net.osmand.plus.UiUtilities;
import net.osmand.plus.UiUtilities.DialogButtonType;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment;
-import net.osmand.plus.profiles.SettingsProfileFragment;
import net.osmand.plus.routing.RouteProvider;
import net.osmand.plus.widgets.FlowLayout;
import net.osmand.plus.widgets.OsmandTextFieldBoxes;
@@ -46,6 +48,8 @@ import java.util.ArrayList;
import static net.osmand.aidlapi.OsmAndCustomizationConstants.DRAWER_SETTINGS_ID;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.DIALOG_TYPE;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.IS_PROFILE_IMPORTED_ARG;
+import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.PROFILE_KEY_ARG;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.SELECTED_KEY;
import static net.osmand.plus.profiles.SelectProfileBottomSheetDialogFragment.TYPE_BASE_APP_PROFILE;
@@ -60,15 +64,20 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
private static final String SELECT_ICON = "select_icon";
private static final String COLOR_ITEMS = "color_items";
private static final String ICON_ITEMS = "icon_items";
-// private static final String SELECT_MAP_ICON = "select_map_icon";
-// private static final String SELECT_NAV_ICON = "select_nav_icon";
+ private static final String SELECT_LOCATION_ICON = "select_location_icon";
+ private static final String LOCATION_ICON_ITEMS = "location_icon_items";
+ private static final String SELECT_NAV_ICON = "select_nav_icon";
+ private static final String NAV_ICON_ITEMS = "nav_icon_items";
public static final String PROFILE_NAME_KEY = "profile_name_key";
public static final String PROFILE_STRINGKEY_KEY = "profile_stringkey_key";
public static final String PROFILE_ICON_RES_KEY = "profile_icon_res_key";
public static final String PROFILE_COLOR_KEY = "profile_color_key";
public static final String PROFILE_PARENT_KEY = "profile_parent_key";
+ public static final String PROFILE_LOCATION_ICON_KEY = "profile_location_icon_key";
+ public static final String PROFILE_NAVIGATION_ICON_KEY = "profile_navigation_icon_key";
public static final String BASE_PROFILE_FOR_NEW = "base_profile_for_new";
+ public static final String IS_BASE_PROFILE_IMPORTED = "is_base_profile_imported";
private SelectProfileBottomSheetDialogFragment.SelectProfileListener parentProfileListener;
private EditText baseProfileName;
private ApplicationProfileObject profile;
@@ -76,8 +85,12 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
private EditText profileName;
private FlowLayout colorItems;
private FlowLayout iconItems;
+ private FlowLayout locationIconItems;
+ private FlowLayout navIconItems;
private OsmandTextFieldBoxes profileNameOtfb;
private View saveButton;
+
+ private boolean isBaseProfileImported;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -87,12 +100,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (getArguments() != null) {
Bundle arguments = getArguments();
String keyBaseProfileForNew = arguments.getString(BASE_PROFILE_FOR_NEW, null);
- for (ApplicationMode mode : ApplicationMode.getDefaultValues()) {
- if (mode.getStringKey().equals(keyBaseProfileForNew)) {
- baseModeForNewProfile = mode;
- break;
- }
- }
+ baseModeForNewProfile = ApplicationMode.valueOfStringKey(keyBaseProfileForNew, null);
+ isBaseProfileImported = arguments.getBoolean(IS_BASE_PROFILE_IMPORTED);
}
if (baseModeForNewProfile != null) {
profile.stringKey = baseModeForNewProfile.getStringKey() + "_" + System.currentTimeMillis();
@@ -102,6 +111,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
profile.iconRes = baseModeForNewProfile.getIconRes();
profile.routingProfile = baseModeForNewProfile.getRoutingProfile();
profile.routeService = baseModeForNewProfile.getRouteService();
+ profile.locationIcon = baseModeForNewProfile.getLocationIcon();
+ profile.navigationIcon = baseModeForNewProfile.getNavigationIcon();
} else {
profile.stringKey = getSelectedAppMode().getStringKey();
profile.parent = getSelectedAppMode().getParent();
@@ -110,6 +121,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
profile.iconRes = getSelectedAppMode().getIconRes();
profile.routingProfile = getSelectedAppMode().getRoutingProfile();
profile.routeService = getSelectedAppMode().getRouteService();
+ profile.locationIcon = getSelectedAppMode().getLocationIcon();
+ profile.navigationIcon = getSelectedAppMode().getNavigationIcon();
}
changedProfile = new ApplicationProfileObject();
if (savedInstanceState != null) {
@@ -126,6 +139,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
changedProfile.iconRes = profile.iconRes;
changedProfile.routingProfile = profile.routingProfile;
changedProfile.routeService = profile.routeService;
+ changedProfile.locationIcon = profile.locationIcon;
+ changedProfile.navigationIcon = profile.navigationIcon;
}
}
@@ -166,8 +181,12 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
protected void setupPreferences() {
findPreference(SELECT_COLOR).setIconSpaceReserved(false);
findPreference(SELECT_ICON).setIconSpaceReserved(false);
-// findPreference(SELECT_MAP_ICON).setIconSpaceReserved(false);
-// findPreference(SELECT_NAV_ICON).setIconSpaceReserved(false);
+ findPreference(SELECT_LOCATION_ICON).setIconSpaceReserved(false);
+ findPreference(SELECT_NAV_ICON).setIconSpaceReserved(false);
+ if (getSelectedAppMode().equals(ApplicationMode.DEFAULT)) {
+ findPreference(SELECT_ICON).setVisible(false);
+ findPreference(ICON_ITEMS).setVisible(false);
+ }
}
@SuppressLint("InlinedApi")
@@ -194,9 +213,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- if (getActivity() != null) {
- getActivity().onBackPressed();
- }
+ goBackWithoutSaving();
}
});
saveButton.setOnClickListener(new View.OnClickListener() {
@@ -249,6 +266,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (changedProfile.parent != null) {
outState.putString(PROFILE_PARENT_KEY, changedProfile.parent.getStringKey());
}
+ outState.putBoolean(IS_BASE_PROFILE_IMPORTED, isBaseProfileImported);
+ outState.putSerializable(PROFILE_LOCATION_ICON_KEY, changedProfile.locationIcon);
+ outState.putSerializable(PROFILE_NAVIGATION_ICON_KEY, changedProfile.navigationIcon);
}
private void restoreState(Bundle savedInstanceState) {
@@ -258,6 +278,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
changedProfile.color = (ApplicationMode.ProfileIconColors) savedInstanceState.getSerializable(PROFILE_COLOR_KEY);
String parentStringKey = savedInstanceState.getString(PROFILE_PARENT_KEY);
changedProfile.parent = ApplicationMode.valueOfStringKey(parentStringKey, null);
+ isBaseProfileImported = savedInstanceState.getBoolean(IS_BASE_PROFILE_IMPORTED);
+ changedProfile.locationIcon = (ApplicationMode.LocationIcon) savedInstanceState.getSerializable(PROFILE_LOCATION_ICON_KEY);
+ changedProfile.navigationIcon = (ApplicationMode.NavigationIcon) savedInstanceState.getSerializable(PROFILE_NAVIGATION_ICON_KEY);
}
@Override
@@ -278,11 +301,6 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
}
}
- @Override
- protected void updatePreference(Preference preference) {
- super.updatePreference(preference);
- }
-
@Override
protected void onBindPreferenceViewHolder(Preference preference, PreferenceViewHolder holder) {
super.onBindPreferenceViewHolder(preference, holder);
@@ -291,7 +309,6 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
profileName.setImeOptions(EditorInfo.IME_ACTION_DONE);
profileName.setRawInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
profileName.setText(changedProfile.name);
- profileName.requestFocus();
profileName.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
@@ -312,6 +329,12 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
}
}
});
+ if (getSelectedAppMode().equals(ApplicationMode.DEFAULT)) {
+ profileName.setFocusableInTouchMode(false);
+ profileName.setFocusable(false);
+ } else {
+ profileName.requestFocus();
+ }
profileNameOtfb = (OsmandTextFieldBoxes) holder.findViewById(R.id.profile_name_otfb);
} else if (MASTER_PROFILE.equals(preference.getKey())) {
baseProfileName = (EditText) holder.findViewById(R.id.master_profile_et);
@@ -347,16 +370,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
for (ApplicationMode.ProfileIconColors color : ApplicationMode.ProfileIconColors.values()) {
View colorItem = createColorItemView(color, colorItems);
colorItems.addView(colorItem, new FlowLayout.LayoutParams(0, 0));
- ImageView outlineCircle = colorItem.findViewById(R.id.outlineCircle);
- ImageView checkMark = colorItem.findViewById(R.id.checkMark);
- GradientDrawable gradientDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.circle_contour_bg_light);
- if (gradientDrawable != null) {
- gradientDrawable.setStroke(AndroidUtils.dpToPx(app, 2),
- UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, color.getColor(isNightMode())), 0.3f));
- outlineCircle.setImageDrawable(gradientDrawable);
- }
- checkMark.setVisibility(View.GONE);
- outlineCircle.setVisibility(View.GONE);
+
}
updateColorSelector(changedProfile.color);
} else if (ICON_ITEMS.equals(preference.getKey())) {
@@ -366,10 +380,24 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
for (int iconRes : icons) {
View iconItem = createIconItemView(iconRes, iconItems);
iconItems.addView(iconItem, new FlowLayout.LayoutParams(0, 0));
- ImageView outlineCircle = iconItem.findViewById(R.id.outlineCircle);
- outlineCircle.setVisibility(View.GONE);
}
setIconNewColor(changedProfile.iconRes);
+ } else if (LOCATION_ICON_ITEMS.equals(preference.getKey())) {
+ locationIconItems = (FlowLayout) holder.findViewById(R.id.color_items);
+ locationIconItems.removeAllViews();
+ for (ApplicationMode.LocationIcon locationIcon : ApplicationMode.LocationIcon.values()) {
+ View iconItemView = createLocationIconView(locationIcon, locationIconItems);
+ locationIconItems.addView(iconItemView, new FlowLayout.LayoutParams(0, 0));
+ }
+ updateLocationIconSelector(changedProfile.locationIcon);
+ } else if (NAV_ICON_ITEMS.equals(preference.getKey())) {
+ navIconItems = (FlowLayout) holder.findViewById(R.id.color_items);
+ navIconItems.removeAllViews();
+ for (ApplicationMode.NavigationIcon navigationIcon : ApplicationMode.NavigationIcon.values()) {
+ View iconItemView = createNavigationIconView(navigationIcon, navIconItems);
+ navIconItems.addView(iconItemView, new FlowLayout.LayoutParams(0, 0));
+ }
+ updateNavigationIconSelector(changedProfile.navigationIcon);
}
}
@@ -385,9 +413,23 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
public void onClick(View v) {
if (colorRes != changedProfile.color) {
updateColorSelector(colorRes);
+ updatePreference(findPreference(MASTER_PROFILE));
+ updatePreference(findPreference(LOCATION_ICON_ITEMS));
+ updatePreference(findPreference(NAV_ICON_ITEMS));
}
}
});
+
+ ImageView outlineCircle = colorItemView.findViewById(R.id.outlineCircle);
+ ImageView checkMark = colorItemView.findViewById(R.id.checkMark);
+ GradientDrawable gradientDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.circle_contour_bg_light);
+ if (gradientDrawable != null) {
+ gradientDrawable.setStroke(AndroidUtils.dpToPx(app, 2),
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, colorRes.getColor(isNightMode())), 0.3f));
+ outlineCircle.setImageDrawable(gradientDrawable);
+ }
+ checkMark.setVisibility(View.GONE);
+ outlineCircle.setVisibility(View.GONE);
colorItemView.setTag(colorRes);
return colorItemView;
}
@@ -403,13 +445,18 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (iconItems != null) {
setIconNewColor(changedProfile.iconRes);
}
- int selectedColor = ContextCompat.getColor(app,
- changedProfile.color.getColor(isNightMode()));
- profileNameOtfb.setPrimaryColor(selectedColor);
- profileName.getBackground().mutate().setColorFilter(selectedColor, PorterDuff.Mode.SRC_ATOP);
+ updateProfileNameAppearance();
updateProfileButton();
}
+ private void updateProfileNameAppearance() {
+ if (profileName.isFocusable() && profileName.isFocusableInTouchMode()) {
+ int selectedColor = ContextCompat.getColor(app, changedProfile.color.getColor(isNightMode()));
+ profileNameOtfb.setPrimaryColor(selectedColor);
+ profileName.getBackground().mutate().setColorFilter(selectedColor, PorterDuff.Mode.SRC_ATOP);
+ }
+ }
+
private View createIconItemView(final int iconRes, ViewGroup rootView) {
FrameLayout iconItemView = (FrameLayout) UiUtilities.getInflater(getContext(), isNightMode())
.inflate(R.layout.preference_circle_item, rootView, false);
@@ -427,6 +474,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
}
}
});
+ iconItemView.findViewById(R.id.outlineCircle).setVisibility(View.GONE);
iconItemView.setTag(iconRes);
return iconItemView;
}
@@ -439,11 +487,99 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
checkMark.setImageDrawable(app.getUIUtilities().getIcon(changedProfile.iconRes, R.color.icon_color_default_light));
AndroidUtils.setBackground(iconItem.findViewById(R.id.backgroundCircle),
UiUtilities.tintDrawable(ContextCompat.getDrawable(app, R.drawable.circle_background_light),
- UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
changedProfile.iconRes = iconRes;
updateProfileButton();
}
+ private View createLocationIconView(final ApplicationMode.LocationIcon locationIcon, ViewGroup rootView) {
+ FrameLayout locationIconView = (FrameLayout) UiUtilities.getInflater(getContext(), isNightMode())
+ .inflate(R.layout.preference_select_icon_button, rootView, false);
+ int changedProfileColor = ContextCompat.getColor(app, changedProfile.color.getColor(
+ app.getDaynightHelper().isNightModeForMapControls()));
+ LayerDrawable locationIconDrawable = (LayerDrawable) app.getResources().getDrawable(locationIcon.getIconId());
+ DrawableCompat.setTint(DrawableCompat.wrap(locationIconDrawable.getDrawable(1)), changedProfileColor);
+ locationIconView.findViewById(R.id.icon).setImageDrawable(locationIconDrawable);
+ ImageView headingIcon = locationIconView.findViewById(R.id.headingIcon);
+ headingIcon.setImageDrawable(ContextCompat.getDrawable(app, locationIcon.getHeadingIconId()));
+ headingIcon.setColorFilter(new PorterDuffColorFilter(changedProfileColor, PorterDuff.Mode.SRC_IN));
+ ImageView coloredRect = locationIconView.findViewById(R.id.backgroundRect);
+ AndroidUtils.setBackground(coloredRect,
+ UiUtilities.tintDrawable(ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button),
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
+ coloredRect.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (locationIcon != changedProfile.locationIcon) {
+ updateLocationIconSelector(locationIcon);
+ }
+ }
+ });
+ ImageView outlineRect = locationIconView.findViewById(R.id.outlineRect);
+ GradientDrawable rectContourDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button_outline);
+ if (rectContourDrawable != null) {
+ rectContourDrawable.setStroke(AndroidUtils.dpToPx(app, 2), changedProfileColor);
+ }
+ outlineRect.setImageDrawable(rectContourDrawable);
+ outlineRect.setVisibility(View.GONE);
+ locationIconView.setTag(locationIcon);
+ return locationIconView;
+ }
+
+ private void updateLocationIconSelector(ApplicationMode.LocationIcon locationIcon) {
+ View viewWithTag = locationIconItems.findViewWithTag(changedProfile.locationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.GONE);
+ viewWithTag = locationIconItems.findViewWithTag(locationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.VISIBLE);
+ changedProfile.locationIcon = locationIcon;
+ }
+
+ private View createNavigationIconView(final ApplicationMode.NavigationIcon navigationIcon, ViewGroup rootView) {
+ FrameLayout navigationIconView = (FrameLayout) UiUtilities.getInflater(getContext(), isNightMode())
+ .inflate(R.layout.preference_select_icon_button, rootView, false);
+ LayerDrawable navigationIconDrawable = (LayerDrawable) app.getResources().getDrawable(navigationIcon.getIconId());
+ DrawableCompat.setTint(DrawableCompat.wrap(navigationIconDrawable.getDrawable(1)),
+ ContextCompat.getColor(app, changedProfile.color.getColor(app.getDaynightHelper().isNightModeForMapControls())));
+ ImageView imageView = navigationIconView.findViewById(R.id.icon);
+ imageView.setImageDrawable(navigationIconDrawable);
+ Matrix matrix = new Matrix();
+ imageView.setScaleType(ImageView.ScaleType.MATRIX);
+ matrix.postRotate((float) -90, imageView.getDrawable().getIntrinsicWidth() / 2,
+ imageView.getDrawable().getIntrinsicHeight() / 2);
+ imageView.setImageMatrix(matrix);
+ ImageView coloredRect = navigationIconView.findViewById(R.id.backgroundRect);
+ AndroidUtils.setBackground(coloredRect,
+ UiUtilities.tintDrawable(ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button),
+ UiUtilities.getColorWithAlpha(ContextCompat.getColor(app, R.color.icon_color_default_light), 0.1f)));
+ coloredRect.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (navigationIcon != changedProfile.navigationIcon) {
+ updateNavigationIconSelector(navigationIcon);
+ }
+ }
+ });
+ ImageView outlineRect = navigationIconView.findViewById(R.id.outlineRect);
+ GradientDrawable rectContourDrawable = (GradientDrawable) ContextCompat.getDrawable(app, R.drawable.bg_select_icon_button_outline);
+ int changedProfileColor = ContextCompat.getColor(app, changedProfile.color.getColor(
+ app.getDaynightHelper().isNightModeForMapControls()));
+ if (rectContourDrawable != null) {
+ rectContourDrawable.setStroke(AndroidUtils.dpToPx(app, 2), changedProfileColor);
+ }
+ outlineRect.setImageDrawable(rectContourDrawable);
+ outlineRect.setVisibility(View.GONE);
+ navigationIconView.setTag(navigationIcon);
+ return navigationIconView;
+ }
+
+ private void updateNavigationIconSelector(ApplicationMode.NavigationIcon navigationIcon) {
+ View viewWithTag = navIconItems.findViewWithTag(changedProfile.navigationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.GONE);
+ viewWithTag = navIconItems.findViewWithTag(navigationIcon);
+ viewWithTag.findViewById(R.id.outlineRect).setVisibility(View.VISIBLE);
+ changedProfile.navigationIcon = navigationIcon;
+ }
+
private void setIconNewColor(int iconRes) {
int changedProfileColor = ContextCompat.getColor(app, changedProfile.color.getColor(
app.getDaynightHelper().isNightModeForMapControls()));
@@ -468,12 +604,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
Activity activity = getActivity();
if (activity != null) {
View cf = activity.getCurrentFocus();
- if (cf != null) {
- InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
- if (imm != null) {
- imm.hideSoftInputFromWindow(cf.getWindowToken(), 0);
- }
- }
+ AndroidUtils.hideSoftKeyboard(activity, cf);
}
}
@@ -481,18 +612,21 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (parentProfileListener == null) {
parentProfileListener = new SelectProfileBottomSheetDialogFragment.SelectProfileListener() {
@Override
- public void onSelectedType(int pos, String stringRes) {
- updateParentProfile(pos);
+ public void onSelectedType(Bundle args) {
+ String profileKey = args.getString(PROFILE_KEY_ARG);
+ boolean imported = args.getBoolean(IS_PROFILE_IMPORTED_ARG);
+ updateParentProfile(profileKey, imported);
}
};
}
return parentProfileListener;
}
- void updateParentProfile(int pos) {
- String key = SettingsProfileFragment.getBaseProfiles(getMyApplication()).get(pos).getStringKey();
- setupBaseProfileView(key);
- changedProfile.parent = ApplicationMode.valueOfStringKey(key, ApplicationMode.DEFAULT);
+ void updateParentProfile(String profileKey, boolean isBaseProfileImported) {
+ deleteImportedProfile();
+ setupBaseProfileView(profileKey);
+ changedProfile.parent = ApplicationMode.valueOfStringKey(profileKey, ApplicationMode.DEFAULT);
+ this.isBaseProfileImported = isBaseProfileImported;
}
private void setupBaseProfileView(String stringKey) {
@@ -517,7 +651,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
.icon(app, ApplicationMode.ProfileIcons.getResStringByResId(changedProfile.iconRes))
.setRouteService(changedProfile.routeService)
.setRoutingProfile(changedProfile.routingProfile)
- .setColor(changedProfile.color);
+ .setColor(changedProfile.color)
+ .locationIcon(changedProfile.locationIcon)
+ .navigationIcon(changedProfile.navigationIcon);
ApplicationMode mode = ApplicationMode.saveProfile(builder, getMyApplication());
if (!ApplicationMode.values(app).contains(mode)) {
@@ -548,7 +684,7 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
@Override
public void onClick(DialogInterface dialog, int which) {
changedProfile = profile;
- mapActivity.onBackPressed();
+ goBackWithoutSaving();
}
});
dismissDialog.show();
@@ -567,12 +703,27 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
return warningDialog;
}
- public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType, @Nullable String appMode) {
+ private void goBackWithoutSaving() {
+ deleteImportedProfile();
+ if (getActivity() != null) {
+ getActivity().onBackPressed();
+ }
+ }
+
+ private void deleteImportedProfile() {
+ if (isBaseProfileImported) {
+ ApplicationMode.deleteCustomMode(ApplicationMode.valueOfStringKey(
+ changedProfile.parent.getStringKey(), ApplicationMode.DEFAULT), app);
+ }
+ }
+
+ public static boolean showInstance(FragmentActivity activity, SettingsScreenType screenType, @Nullable String appMode, boolean imported) {
try {
Fragment fragment = Fragment.instantiate(activity, screenType.fragmentName);
Bundle args = new Bundle();
if (appMode != null) {
args.putString(BASE_PROFILE_FOR_NEW, appMode);
+ args.putBoolean(IS_BASE_PROFILE_IMPORTED, imported);
}
fragment.setArguments(args);
activity.getSupportFragmentManager().beginTransaction()
@@ -594,6 +745,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
int iconRes;
String routingProfile;
RouteProvider.RouteService routeService;
+ ApplicationMode.NavigationIcon navigationIcon;
+ ApplicationMode.LocationIcon locationIcon;
@Override
public boolean equals(Object o) {
@@ -610,7 +763,9 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
if (color != that.color) return false;
if (routingProfile != null ? !routingProfile.equals(that.routingProfile) : that.routingProfile != null)
return false;
- return routeService == that.routeService;
+ if (routeService != that.routeService) return false;
+ if (navigationIcon != that.navigationIcon) return false;
+ return locationIcon == that.locationIcon;
}
@Override
@@ -622,6 +777,8 @@ public class ProfileAppearanceFragment extends BaseSettingsFragment {
result = 31 * result + iconRes;
result = 31 * result + (routingProfile != null ? routingProfile.hashCode() : 0);
result = 31 * result + (routeService != null ? routeService.hashCode() : 0);
+ result = 31 * result + (navigationIcon != null ? navigationIcon.hashCode() : 0);
+ result = 31 * result + (locationIcon != null ? locationIcon.hashCode() : 0);
return result;
}
}
diff --git a/OsmAnd/src/net/osmand/plus/settings/bottomsheets/OsmLoginDataBottomSheet.java b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/OsmLoginDataBottomSheet.java
new file mode 100644
index 0000000000..8865458e85
--- /dev/null
+++ b/OsmAnd/src/net/osmand/plus/settings/bottomsheets/OsmLoginDataBottomSheet.java
@@ -0,0 +1,114 @@
+package net.osmand.plus.settings.bottomsheets;
+
+import android.content.Context;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v7.preference.Preference;
+import android.view.View;
+import android.widget.EditText;
+
+import net.osmand.plus.ApplicationMode;
+import net.osmand.plus.OsmandApplication;
+import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities;
+import net.osmand.plus.base.bottomsheetmenu.BaseBottomSheetItem;
+import net.osmand.plus.base.bottomsheetmenu.SimpleBottomSheetItem;
+import net.osmand.plus.osmedit.SettingsOsmEditingActivity;
+import net.osmand.plus.settings.OnPreferenceChanged;
+
+public class OsmLoginDataBottomSheet extends BasePreferenceBottomSheet {
+
+ public static final String TAG = EditTextPreferenceBottomSheet.class.getSimpleName();
+
+ private static final String USER_NAME_KEY = "user_name_key";
+ private static final String PASSWORD_KEY = "password_key";
+
+ private EditText userNameEditText;
+ private EditText passwordEditText;
+
+ @Override
+ public void createMenuItems(Bundle savedInstanceState) {
+ Context context = getContext();
+ if (context == null) {
+ return;
+ }
+ OsmandApplication app = requiredMyApplication();
+
+ View view = UiUtilities.getInflater(context, nightMode).inflate(R.layout.osm_login_data, null);
+
+ userNameEditText = view.findViewById(R.id.name_edit_text);
+ passwordEditText = view.findViewById(R.id.password_edit_text);
+
+ String name = app.getSettings().USER_NAME.get();
+ String password = app.getSettings().USER_PASSWORD.get();
+
+ if (savedInstanceState != null) {
+ name = savedInstanceState.getString(USER_NAME_KEY, null);
+ password = savedInstanceState.getString(PASSWORD_KEY, null);
+ }
+
+ userNameEditText.setText(name);
+ passwordEditText.setText(password);
+
+ BaseBottomSheetItem titleItem = new SimpleBottomSheetItem.Builder()
+ .setCustomView(view)
+ .create();
+ items.add(titleItem);
+ }
+
+ @Override
+ public void onSaveInstanceState(@NonNull Bundle outState) {
+ super.onSaveInstanceState(outState);
+ outState.putString(USER_NAME_KEY, userNameEditText.getText().toString());
+ outState.putString(PASSWORD_KEY, passwordEditText.getText().toString());
+ }
+
+ @Override
+ protected int getDismissButtonTextId() {
+ return R.string.shared_string_cancel;
+ }
+
+ @Override
+ protected int getRightBottomButtonTextId() {
+ return R.string.shared_string_apply;
+ }
+
+ @Override
+ protected void onRightBottomButtonClick() {
+ OsmandApplication app = requiredMyApplication();
+
+ app.getSettings().USER_NAME.set(userNameEditText.getText().toString());
+ app.getSettings().USER_PASSWORD.set(passwordEditText.getText().toString());
+ new SettingsOsmEditingActivity.ValidateOsmLoginDetailsTask(app).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
+
+ Fragment target = getTargetFragment();
+ Preference preference = getPreference();
+ if (target instanceof OnPreferenceChanged && preference != null) {
+ ((OnPreferenceChanged) target).onPreferenceChanged(preference.getKey());
+ }
+
+ dismiss();
+ }
+
+ public static boolean showInstance(@NonNull FragmentManager fragmentManager, String key, Fragment target,
+ boolean usedOnMap, @Nullable ApplicationMode appMode) {
+ try {
+ Bundle args = new Bundle();
+ args.putString(PREFERENCE_ID, key);
+
+ OsmLoginDataBottomSheet fragment = new OsmLoginDataBottomSheet();
+ fragment.setArguments(args);
+ fragment.setUsedOnMap(usedOnMap);
+ fragment.setAppMode(appMode);
+ fragment.setTargetFragment(target, 0);
+ fragment.show(fragmentManager, TAG);
+ return true;
+ } catch (RuntimeException e) {
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java b/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java
index 7bee696943..b188b3b33d 100644
--- a/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/skimapsplugin/SkiMapsPlugin.java
@@ -8,6 +8,7 @@ import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandPlugin;
import net.osmand.plus.R;
+import net.osmand.plus.settings.BaseSettingsFragment;
import java.util.Collections;
import java.util.List;
@@ -88,9 +89,4 @@ public class SkiMapsPlugin extends OsmandPlugin {
public String getId() {
return ID;
}
-
- @Override
- public Class extends Activity> getSettingsActivity() {
- return null;
- }
-}
+}
\ No newline at end of file
diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java
index 5998417267..19eccbbf44 100644
--- a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java
+++ b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java
@@ -29,6 +29,7 @@ import net.osmand.plus.download.DownloadIndexesThread;
import net.osmand.plus.download.DownloadResources;
import net.osmand.plus.download.IndexItem;
import net.osmand.plus.inapp.InAppPurchaseHelper;
+import net.osmand.plus.settings.BaseSettingsFragment;
import net.osmand.plus.views.OsmandMapTileView;
import net.osmand.render.RenderingRuleProperty;
import net.osmand.util.Algorithms;
@@ -419,11 +420,6 @@ public class SRTMPlugin extends OsmandPlugin {
@Override
public void disable(OsmandApplication app) {
}
-
- @Override
- public Class extends Activity> getSettingsActivity() {
- return null;
- }
public static void refreshMapComplete(final MapActivity activity) {
activity.getMyApplication().getResourceManager().getRenderer().clearCache();
diff --git a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java
index 461a1a1410..43c3fcb164 100644
--- a/OsmAnd/src/net/osmand/plus/views/GPXLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/GPXLayer.java
@@ -14,6 +14,7 @@ import android.graphics.PorterDuff.Mode;
import android.graphics.PorterDuffColorFilter;
import android.graphics.Rect;
import android.graphics.RectF;
+import android.graphics.drawable.LayerDrawable;
import android.os.AsyncTask;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
@@ -77,7 +78,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
private Bitmap pointSmall;
private int currentTrackColor;
- private Bitmap selectedPoint;
+ private LayerDrawable selectedPoint;
private TrackChartPoints trackChartPoints;
private static final int startZoom = 7;
@@ -176,7 +177,7 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
paintIcon = new Paint();
pointSmall = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_white_shield_small);
- selectedPoint = BitmapFactory.decodeResource(view.getResources(), R.drawable.map_default_location);
+ selectedPoint = (LayerDrawable) view.getResources().getDrawable(R.drawable.map_location_default);
contextMenuLayer = view.getLayerByClass(ContextMenuLayer.class);
@@ -422,7 +423,11 @@ public class GPXLayer extends OsmandMapLayer implements ContextMenuLayer.IContex
float x = tileBox.getPixXFromLatLon(highlightedPoint.getLatitude(), highlightedPoint.getLongitude());
float y = tileBox.getPixYFromLatLon(highlightedPoint.getLatitude(), highlightedPoint.getLongitude());
paintIcon.setColorFilter(null);
- canvas.drawBitmap(selectedPoint, x - selectedPoint.getWidth() / 2, y - selectedPoint.getHeight() / 2, paintIcon);
+ selectedPoint.setBounds((int) x - selectedPoint.getIntrinsicWidth() / 2,
+ (int) y - selectedPoint.getIntrinsicHeight() / 2,
+ (int) x + selectedPoint.getIntrinsicWidth() / 2,
+ (int) y + selectedPoint.getIntrinsicHeight() / 2);
+ selectedPoint.draw(canvas);
}
}
}
diff --git a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java
index 5154fe57e3..bd80c95f23 100644
--- a/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/MapTileLayer.java
@@ -154,8 +154,8 @@ public class MapTileLayer extends BaseMapLayer {
int width = (int) Math.ceil(tilesRect.right - left);
int height = (int) Math.ceil(tilesRect.bottom + ellipticTileCorrection - top);
- boolean useInternet = (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null || OsmandPlugin.getEnabledPlugin(MapillaryPlugin.class) != null) &&
- settings.USE_INTERNET_TO_DOWNLOAD_TILES.get() && settings.isInternetConnectionAvailable() && map.couldBeDownloadedFromInternet();
+ boolean useInternet = (OsmandPlugin.getEnabledPlugin(OsmandRasterMapsPlugin.class) != null || OsmandPlugin.getEnabledPlugin(MapillaryPlugin.class) != null)
+ && settings.isInternetConnectionAvailable() && map.couldBeDownloadedFromInternet();
int maxLevel = map.getMaximumZoomSupported();
int tileSize = map.getTileSize();
boolean oneTileShown = false;
diff --git a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
index 01f73e39a3..f505e51639 100644
--- a/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
+++ b/OsmAnd/src/net/osmand/plus/views/PointLocationLayer.java
@@ -1,13 +1,17 @@
package net.osmand.plus.views;
-
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Paint.Style;
import android.graphics.PointF;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
import android.graphics.RectF;
+import android.graphics.drawable.LayerDrawable;
+import android.support.v4.content.ContextCompat;
+import android.support.v4.graphics.drawable.DrawableCompat;
import net.osmand.Location;
import net.osmand.PlatformUtil;
@@ -17,28 +21,32 @@ import net.osmand.data.RotatedTileBox;
import net.osmand.plus.ApplicationMode;
import net.osmand.plus.OsmAndLocationProvider;
import net.osmand.plus.R;
+import net.osmand.plus.UiUtilities;
import net.osmand.plus.base.MapViewTrackingUtilities;
import org.apache.commons.logging.Log;
import java.util.List;
+import static android.graphics.Paint.ANTI_ALIAS_FLAG;
+import static android.graphics.Paint.FILTER_BITMAP_FLAG;
+
public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider {
private static final Log LOG = PlatformUtil.getLog(PointLocationLayer.class);
-
protected final static int RADIUS = 7;
- private Paint locationPaint;
+ private Paint headingPaint;
private Paint area;
private Paint aroundArea;
private OsmandMapTileView view;
private ApplicationMode appMode;
- private Bitmap bearingIcon;
+ private int colorId;
+ private LayerDrawable navigationIcon;
+ private LayerDrawable locationIcon;
private Bitmap headingIcon;
- private Bitmap locationIcon;
private OsmAndLocationProvider locationProvider;
private MapViewTrackingUtilities mapViewTrackingUtilities;
private boolean nm;
@@ -49,19 +57,12 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
}
private void initUI() {
- locationPaint = new Paint();
- locationPaint.setAntiAlias(true);
- locationPaint.setFilterBitmap(true);
-
+ headingPaint = new Paint(ANTI_ALIAS_FLAG | FILTER_BITMAP_FLAG);
area = new Paint();
- area.setColor(view.getResources().getColor(R.color.pos_area));
-
aroundArea = new Paint();
- aroundArea.setColor(view.getResources().getColor(R.color.pos_around));
aroundArea.setStyle(Style.STROKE);
aroundArea.setStrokeWidth(1);
aroundArea.setAntiAlias(true);
-
locationProvider = view.getApplication().getLocationProvider();
updateIcons(view.getSettings().getApplicationMode(), false, locationProvider.getLastKnownLocation() == null);
}
@@ -115,73 +116,66 @@ public class PointLocationLayer extends OsmandMapLayer implements ContextMenuLay
Float heading = locationProvider.getHeading();
if (!locationOutdated && heading != null && mapViewTrackingUtilities.isShowViewAngle()) {
-
canvas.save();
canvas.rotate(heading - 180, locationX, locationY);
canvas.drawBitmap(headingIcon, locationX - headingIcon.getWidth() / 2,
- locationY - headingIcon.getHeight() / 2, locationPaint);
+ locationY - headingIcon.getHeight() / 2, headingPaint);
canvas.restore();
-
}
// Issue 5538: Some devices return positives for hasBearing() at rest, hence add 0.0 check:
boolean isBearing = lastKnownLocation.hasBearing() && (lastKnownLocation.getBearing() != 0.0);
if (!locationOutdated && isBearing) {
float bearing = lastKnownLocation.getBearing();
canvas.rotate(bearing - 90, locationX, locationY);
- canvas.drawBitmap(bearingIcon, locationX - bearingIcon.getWidth() / 2,
- locationY - bearingIcon.getHeight() / 2, locationPaint);
+ navigationIcon.setBounds(locationX - navigationIcon.getIntrinsicWidth() / 2,
+ locationY - navigationIcon.getIntrinsicHeight() / 2,
+ locationX + navigationIcon.getIntrinsicWidth() / 2,
+ locationY + navigationIcon.getIntrinsicHeight() / 2);
+ navigationIcon.draw(canvas);
} else {
- canvas.drawBitmap(locationIcon, locationX - locationIcon.getWidth() / 2,
- locationY - locationIcon.getHeight() / 2, locationPaint);
+ locationIcon.setBounds(locationX - locationIcon.getIntrinsicWidth() / 2,
+ locationY - locationIcon.getIntrinsicHeight() / 2,
+ locationX + locationIcon.getIntrinsicWidth() / 2,
+ locationY + locationIcon.getIntrinsicHeight() / 2);
+ locationIcon.draw(canvas);
}
-
}
}
- public boolean isLocationVisible(RotatedTileBox tb, Location l) {
+ private boolean isLocationVisible(RotatedTileBox tb, Location l) {
return l != null && tb.containsLatLon(l.getLatitude(), l.getLongitude());
}
-
@Override
public void destroyLayer() {
-
}
- public void updateIcons(ApplicationMode appMode, boolean nighMode, boolean locationOutdated) {
- if (appMode != this.appMode || this.nm != nighMode || this.locationOutdated != locationOutdated) {
+
+ private void updateIcons(ApplicationMode appMode, boolean nighMode, boolean locationOutdated) {
+ if (appMode != this.appMode || this.nm != nighMode || this.locationOutdated != locationOutdated
+ || colorId != appMode.getIconColorInfo().getColor(nighMode)
+ || locationIcon != view.getResources().getDrawable(appMode.getLocationIcon().getIconId())
+ || navigationIcon != view.getResources().getDrawable(appMode.getNavigationIcon().getIconId())) {
this.appMode = appMode;
+ this.colorId = appMode.getIconColorInfo().getColor(nighMode);
this.nm = nighMode;
this.locationOutdated = locationOutdated;
- final int resourceBearingDay = appMode.getResourceBearingDay();
- final int resourceBearingNight = appMode.getResourceBearingNight();
- final int resourceBearing = nighMode ? resourceBearingNight : resourceBearingDay;
- bearingIcon = BitmapFactory.decodeResource(view.getResources(), resourceBearing);
-
- final int resourceHeadingDay = appMode.getResourceHeadingDay();
- final int resourceHeadingNight = appMode.getResourceHeadingNight();
- final int resourceHeading = nighMode ? resourceHeadingNight : resourceHeadingDay;
- headingIcon = BitmapFactory.decodeResource(view.getResources(), resourceHeading);
-
- final int resourceLocationDay;
- final int resourceLocationNight;
- if (locationOutdated) {
- resourceLocationDay = appMode.getResourceLocationDayLost();
- resourceLocationNight = appMode.getResourceLocationNightLost();
- } else {
- resourceLocationDay = appMode.getResourceLocationDay();
- resourceLocationNight = appMode.getResourceLocationNight();
- }
- final int resourceLocation = nighMode ? resourceLocationNight : resourceLocationDay;
- locationIcon = BitmapFactory.decodeResource(view.getResources(), resourceLocation);
- area.setColor(view.getResources().getColor(!nm ? R.color.pos_area : R.color.pos_area_night));
+ int color = ContextCompat.getColor(view.getContext(), colorId);
+ navigationIcon = (LayerDrawable) view.getResources().getDrawable(appMode.getNavigationIcon().getIconId());
+ DrawableCompat.setTint(navigationIcon.getDrawable(1), color);
+ headingIcon = BitmapFactory.decodeResource(view.getResources(), appMode.getLocationIcon().getHeadingIconId());
+ headingPaint.setColorFilter(new PorterDuffColorFilter(color, PorterDuff.Mode.SRC_IN));
+ locationIcon = (LayerDrawable) view.getResources().getDrawable(appMode.getLocationIcon().getIconId());
+ DrawableCompat.setTint(DrawableCompat.wrap(locationIcon.getDrawable(1)), color);
+ area.setColor(UiUtilities.getColorWithAlpha(color, 0.16f));
+ aroundArea.setColor(color);
}
}
+
@Override
public boolean drawInScreenPixels() {
return false;
}
-
@Override
public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List