Dialogs replaced with AppCompatDialogs
This commit is contained in:
parent
4f97ccc711
commit
b3266d86af
69 changed files with 1368 additions and 1130 deletions
|
@ -1,64 +1,118 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:installLocation="auto"
|
package="net.osmand.plus"
|
||||||
android:versionName="@string/app_version"
|
android:installLocation="auto"
|
||||||
android:versionCode="231"
|
android:versionCode="231"
|
||||||
package="net.osmand.plus">
|
android:versionName="@string/app_version" >
|
||||||
|
|
||||||
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="21" />
|
<uses-sdk
|
||||||
|
android:minSdkVersion="14"
|
||||||
|
android:targetSdkVersion="21" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
|
<uses-permission android:name="com.android.vending.BILLING" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-feature
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
android:name="android.hardware.camera"
|
||||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
android:name="android.hardware.camera.autofocus"
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
android:required="false" />
|
||||||
<uses-permission android:name="android.permission.STORAGE" />
|
<uses-feature
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
android:name="android.hardware.microphone"
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
android:required="false" />
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<uses-feature
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
android:name="android.hardware.wifi"
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
android:required="false" />
|
||||||
<uses-permission android:name="com.android.vending.BILLING" />
|
<uses-feature
|
||||||
|
android:name="android.hardware.location"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.location.network"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.location.gps"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.sensor.light"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.sensor.compass"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.sensor.accelerometer"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.sensor.gyroscope"
|
||||||
|
android:required="false" />
|
||||||
|
<uses-feature
|
||||||
|
android:name="android.hardware.touchscreen"
|
||||||
|
android:required="false" />
|
||||||
|
|
||||||
|
<supports-screens
|
||||||
|
android:anyDensity="true"
|
||||||
|
android:largeScreens="true"
|
||||||
|
android:normalScreens="true"
|
||||||
|
android:resizeable="true"
|
||||||
|
android:smallScreens="true"
|
||||||
|
android:xlargeScreens="true" />
|
||||||
|
|
||||||
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
<android:uses-permission android:name="android.permission.READ_PHONE_STATE" />
|
||||||
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
<android:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- android:theme="@style/OsmandLightDarkActionBarTheme" -->
|
||||||
<uses-feature android:name="android.hardware.microphone" android:required="false" />
|
<application
|
||||||
<uses-feature android:name="android.hardware.wifi" android:required="false" />
|
android:name=".OsmandApplication"
|
||||||
<uses-feature android:name="android.hardware.location" android:required="false" />
|
android:allowBackup="true"
|
||||||
<uses-feature android:name="android.hardware.location.network" android:required="false" />
|
android:backupAgent=".OsmandBackupAgent"
|
||||||
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
|
android:configChanges="locale"
|
||||||
<uses-feature android:name="android.hardware.sensor.light" android:required="false" />
|
android:icon="@drawable/icon"
|
||||||
<uses-feature android:name="android.hardware.sensor.compass" android:required="false" />
|
android:label="@string/app_name"
|
||||||
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
|
android:largeHeap="true"
|
||||||
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" />
|
android:restoreAnyVersion="true"
|
||||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
android:theme="@style/OsmandDarkTheme" >
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.backup.api_key"
|
||||||
|
android:value="AEdPqrEAAAAIqF3tNGT66etVBn_vgzpfAY1wmIzKV1Ss6Ku-2A" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.support.multiwindow"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W"
|
||||||
|
android:resource="@dimen/app_defaultsize_w"
|
||||||
|
android:value="" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H"
|
||||||
|
android:resource="@dimen/app_defaultsize_h"
|
||||||
|
android:value="" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W"
|
||||||
|
android:resource="@dimen/app_minimumsize_w"
|
||||||
|
android:value="" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H"
|
||||||
|
android:resource="@dimen/app_minimumsize_h"
|
||||||
|
android:value="" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.minimode.icon.portrait.normal"
|
||||||
|
android:resource="@drawable/icon"
|
||||||
|
android:value="" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.minimode.icon.landscape.normal"
|
||||||
|
android:resource="@drawable/icon"
|
||||||
|
android:value="" />
|
||||||
|
|
||||||
|
<activity android:name=".activities.HelpActivity" />
|
||||||
|
<activity android:name=".activities.ExitActivity" />
|
||||||
|
|
||||||
<supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"
|
|
||||||
android:xlargeScreens="true" android:anyDensity="true" />
|
|
||||||
|
|
||||||
|
|
||||||
<!-- android:theme="@style/OsmandLightDarkActionBarTheme" -->
|
|
||||||
<application android:allowBackup="true" android:backupAgent="net.osmand.plus.OsmandBackupAgent"
|
|
||||||
android:icon="@drawable/icon" android:label="@string/app_name"
|
|
||||||
android:name="net.osmand.plus.OsmandApplication" android:configChanges="locale"
|
|
||||||
android:theme="@style/OsmandDarkTheme" android:restoreAnyVersion="true" android:largeHeap="true">
|
|
||||||
|
|
||||||
<meta-data android:name="com.google.android.backup.api_key" android:value="AEdPqrEAAAAIqF3tNGT66etVBn_vgzpfAY1wmIzKV1Ss6Ku-2A" />
|
|
||||||
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true" />
|
|
||||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:resource="@dimen/app_defaultsize_w" android:value="" />
|
|
||||||
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:resource="@dimen/app_defaultsize_h" android:value="" />
|
|
||||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:resource="@dimen/app_minimumsize_w" android:value="" />
|
|
||||||
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:resource="@dimen/app_minimumsize_h" android:value="" />
|
|
||||||
<meta-data android:name="com.sec.minimode.icon.portrait.normal" android:resource="@drawable/icon" android:value="" />
|
|
||||||
<meta-data android:name="com.sec.minimode.icon.landscape.normal" android:resource="@drawable/icon" android:value="" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.HelpActivity" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.ExitActivity" />
|
|
||||||
|
|
||||||
<provider
|
<provider
|
||||||
android:name="android.support.v4.content.FileProvider"
|
android:name="android.support.v4.content.FileProvider"
|
||||||
android:authorities="net.osmand.fileprovider"
|
android:authorities="net.osmand.fileprovider"
|
||||||
|
@ -69,224 +123,355 @@
|
||||||
android:resource="@xml/paths" />
|
android:resource="@xml/paths" />
|
||||||
</provider>
|
</provider>
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.activities.MapActivity" android:label="@string/app_name"
|
<activity
|
||||||
android:screenOrientation="unspecified" android:launchMode="singleTop">
|
android:name=".activities.MapActivity"
|
||||||
<intent-filter>
|
android:label="@string/app_name"
|
||||||
<action android:name="android.intent.action.VIEW" />
|
android:launchMode="singleTop"
|
||||||
<action android:name="android.intent.action.SEND" />
|
android:screenOrientation="unspecified" >
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<intent-filter>
|
||||||
<data android:scheme="content" android:host="*" android:mimeType="binary/octet-stream" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<data android:scheme="content" android:host="*" android:mimeType="application/octet-stream" />
|
<action android:name="android.intent.action.SEND" />
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter>
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<action android:name="android.intent.action.MAIN" />
|
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
|
||||||
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter>
|
<data
|
||||||
<data android:scheme="http" />
|
android:host="*"
|
||||||
<data android:host="osmand.net" />
|
android:mimeType="binary/octet-stream"
|
||||||
<data android:pathPrefix="/go" />
|
android:scheme="content" />
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<data
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
android:host="*"
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
android:mimeType="application/octet-stream"
|
||||||
<category android:name="android.intent.category.APP_MAPS" />
|
android:scheme="content" />
|
||||||
<category android:name="android.intent.category.CAR_MODE" />
|
</intent-filter>
|
||||||
<category android:name="android.intent.category.CAR_DOCK" />
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.DESK_DOCK" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<data android:scheme="https" />
|
|
||||||
<data android:host="osmand.net" />
|
|
||||||
<data android:pathPrefix="/go" />
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
<category android:name="android.intent.category.APP_MAPS" />
|
|
||||||
<category android:name="android.intent.category.CAR_MODE" />
|
|
||||||
<category android:name="android.intent.category.CAR_DOCK" />
|
|
||||||
<category android:name="android.intent.category.DESK_DOCK" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- android matches non-greedy : http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i-->
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
<!-- mimeType&host are both needed or you will either have unwanted matching or no match when needed -->
|
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
|
||||||
<intent-filter>
|
</intent-filter>
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<data android:scheme="http" />
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.gpx" />
|
<data android:host="osmand.net" />
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\.gpx" />
|
<data android:pathPrefix="/go" />
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\.gpx" />
|
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\.gpx" />
|
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpx" />
|
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\.kml" />
|
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\.kml" />
|
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\.kml" />
|
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\.kml" />
|
|
||||||
<data android:scheme="file" android:host="*" android:mimeType="*/*" android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kml" />
|
|
||||||
</intent-filter>
|
|
||||||
|
|
||||||
<!-- google navigation intent -->
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<data android:scheme="google.navigation" />
|
|
||||||
<data android:scheme="osmand.navigation" />
|
|
||||||
</intent-filter>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<receiver android:name="net.osmand.plus.audionotes.MediaRemoteControlReceiver">
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<intent-filter>
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<action android:name="android.intent.action.CAMERA_BUTTON" />
|
<category android:name="android.intent.category.APP_MAPS" />
|
||||||
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
<category android:name="android.intent.category.CAR_MODE" />
|
||||||
</intent-filter>
|
<category android:name="android.intent.category.CAR_DOCK" />
|
||||||
</receiver>
|
<category android:name="android.intent.category.DESK_DOCK" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<data android:scheme="https" />
|
||||||
|
<data android:host="osmand.net" />
|
||||||
|
<data android:pathPrefix="/go" />
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.activities.SettingsActivity" android:label="@string/shared_string_settings" android:configChanges="keyboardHidden|orientation" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<activity android:name="net.osmand.plus.activities.SettingsGeneralActivity" android:configChanges="keyboardHidden|orientation" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.SettingsNavigationActivity" android:configChanges="keyboardHidden|orientation" />
|
|
||||||
<activity android:name="net.osmand.plus.monitoring.SettingsMonitoringActivity" android:configChanges="keyboardHidden|orientation" />
|
|
||||||
<activity android:name="net.osmand.plus.rastermaps.SettingsRasterMapsActivity" android:configChanges="keyboardHidden|orientation" />
|
|
||||||
<activity android:name="net.osmand.plus.routepointsnavigation.RoutePointsActivity" />
|
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.osmedit.SettingsOsmEditingActivity" android:configChanges="keyboardHidden|orientation" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<activity android:name="net.osmand.plus.development.SettingsDevelopmentActivity" android:configChanges="keyboardHidden|orientation" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<activity android:name="net.osmand.plus.audionotes.SettingsAudioVideoActivity" android:configChanges="keyboardHidden|orientation" />
|
<category android:name="android.intent.category.APP_MAPS" />
|
||||||
<activity android:name="net.osmand.access.SettingsAccessibilityActivity" android:configChanges="keyboardHidden|orientation" />
|
<category android:name="android.intent.category.CAR_MODE" />
|
||||||
|
<category android:name="android.intent.category.CAR_DOCK" />
|
||||||
|
<category android:name="android.intent.category.DESK_DOCK" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchActivity" android:label="@string/search_activity" />
|
<!-- android matches non-greedy : http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i -->
|
||||||
<activity android:name="net.osmand.plus.activities.ShowRouteInfoActivity" android:label="@string/show_route" />
|
<!-- mimeType&host are both needed or you will either have unwanted matching or no match when needed -->
|
||||||
<activity android:name="net.osmand.plus.activities.FavoritesListActivity" android:label="@string/favourites_list_activity" />
|
<intent-filter>
|
||||||
<activity android:name=".myplaces.FavoritesActivity" android:windowSoftInputMode="adjustPan" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<activity android:name="net.osmand.plus.activities.TrackActivity"/>
|
|
||||||
<activity android:name="net.osmand.plus.activities.PluginsActivity" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.PluginActivity" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.ContributionVersionActivity" android:configChanges="keyboardHidden|orientation" android:label="@string/contribution_activity" />
|
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.osmo.SettingsOsMoActivity" android:configChanges="keyboardHidden|orientation" />
|
<data
|
||||||
<activity android:name="net.osmand.plus.osmo.OsMoGroupsActivity">
|
android:host="*"
|
||||||
<intent-filter>
|
android:mimeType="*/*"
|
||||||
<data android:scheme="http" android:host="z.osmo.mobi" />
|
android:pathPattern=".*\\.gpx"
|
||||||
<action android:name="android.intent.action.VIEW" />
|
android:scheme="file" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<data
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
android:host="*"
|
||||||
</intent-filter>
|
android:mimeType="*/*"
|
||||||
</activity>
|
android:pathPattern=".*\\..*\\.gpx"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\..*\\..*\\.gpx"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\..*\\..*\\..*\\.gpx"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\..*\\..*\\..*\\..*\\.gpx"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\.kml"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\..*\\.kml"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\..*\\..*\\.kml"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\..*\\..*\\..*\\.kml"
|
||||||
|
android:scheme="file" />
|
||||||
|
<data
|
||||||
|
android:host="*"
|
||||||
|
android:mimeType="*/*"
|
||||||
|
android:pathPattern=".*\\..*\\..*\\..*\\..*\\.kml"
|
||||||
|
android:scheme="file" />
|
||||||
|
</intent-filter>
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchPOIActivity" android:label="@string/searchpoi_activity" />
|
<!-- google navigation intent -->
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchAddressActivity" android:label="@string/select_address_activity" />
|
<intent-filter>
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchCityByNameActivity" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchRegionByNameActivity" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchStreetByNameActivity" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchStreet2ByNameActivity" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.search.SearchBuildingByNameActivity" />
|
|
||||||
<activity android:name="net.osmand.plus.sherpafy.TourViewActivity" android:exported="true"
|
|
||||||
android:launchMode= "singleInstance" android:label="Sherpafy" />
|
|
||||||
<activity android:name="net.osmand.plus.activities.EditPOIFilterActivity" />
|
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.activities.search.GeoIntentActivity" android:label="@string/app_name">
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<intent-filter>
|
|
||||||
<data android:scheme="osmand.geo" />
|
<data android:scheme="google.navigation" />
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<data android:scheme="osmand.navigation" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
</intent-filter>
|
||||||
</intent-filter>
|
</activity>
|
||||||
<intent-filter>
|
|
||||||
<data android:scheme="geo" />
|
<receiver android:name=".audionotes.MediaRemoteControlReceiver" >
|
||||||
<action android:name="android.intent.action.VIEW"/>
|
<intent-filter>
|
||||||
<category android:name="android.intent.category.DEFAULT"/>
|
<action android:name="android.intent.action.CAMERA_BUTTON" />
|
||||||
<category android:name="android.intent.category.BROWSABLE"/>
|
<action android:name="android.intent.action.MEDIA_BUTTON" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<intent-filter>
|
</receiver>
|
||||||
<data android:scheme="http" />
|
|
||||||
<data android:scheme="https" />
|
<activity
|
||||||
<data android:host="maps.google.com" />
|
android:name=".activities.SettingsActivity"
|
||||||
<data android:host="maps.yandex.ru" />
|
android:configChanges="keyboardHidden|orientation"
|
||||||
<data android:host="maps.yandex.com" />
|
android:label="@string/shared_string_settings" />
|
||||||
<data android:host="www.openstreetmap.org" />
|
<activity
|
||||||
<data android:host="openstreetmap.org" />
|
android:name=".activities.SettingsGeneralActivity"
|
||||||
<data android:host="osm.org" />
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
<data android:host="map.baidu.cn" />
|
<activity
|
||||||
<data android:host="map.baidu.com" />
|
android:name=".activities.SettingsNavigationActivity"
|
||||||
<data android:host="wb.amap.com" />
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
<data android:host="www.amap.com" />
|
<activity
|
||||||
<data android:host="here.com" />
|
android:name=".monitoring.SettingsMonitoringActivity"
|
||||||
<data android:host="www.here.com" />
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
<data android:host="share.here.com" />
|
<activity
|
||||||
<data android:host="map.wap.qq.com" />
|
android:name=".rastermaps.SettingsRasterMapsActivity"
|
||||||
<data android:host="map.qq.com" />
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
<data android:host="maps.apple.com" />
|
<activity android:name=".routepointsnavigation.RoutePointsActivity" />
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<activity
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
android:name=".osmedit.SettingsOsmEditingActivity"
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
</intent-filter>
|
<activity
|
||||||
<intent-filter>
|
android:name=".development.SettingsDevelopmentActivity"
|
||||||
<data android:scheme="http" android:host="www.google.com" android:pathPrefix="/maps" />
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
<data android:scheme="https" android:host="www.google.com" android:pathPrefix="/maps" />
|
<activity
|
||||||
<action android:name="android.intent.action.VIEW" />
|
android:name=".audionotes.SettingsAudioVideoActivity"
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<activity
|
||||||
</intent-filter>
|
android:name="net.osmand.access.SettingsAccessibilityActivity"
|
||||||
<intent-filter>
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
<data android:scheme="http" android:host="openstreetmap.de" android:pathPrefix="/karte" />
|
<activity
|
||||||
<data android:scheme="https" android:host="openstreetmap.de" android:pathPrefix="/karte" />
|
android:name=".activities.search.SearchActivity"
|
||||||
<action android:name="android.intent.action.VIEW" />
|
android:label="@string/search_activity" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<activity
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
android:name=".activities.ShowRouteInfoActivity"
|
||||||
</intent-filter>
|
android:label="@string/show_route" />
|
||||||
<intent-filter>
|
<activity
|
||||||
<data android:scheme="http" android:host="download.osmand.net" android:pathPrefix="/go" />
|
android:name=".activities.FavoritesListActivity"
|
||||||
<data android:scheme="http" android:host="download.osmand.net" android:pathPrefix="go" />
|
android:label="@string/favourites_list_activity" />
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<activity
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
android:name=".myplaces.FavoritesActivity"
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
android:windowSoftInputMode="adjustPan" />
|
||||||
<category android:name="android.intent.category.APP_MAPS" />
|
<activity android:name=".activities.TrackActivity" />
|
||||||
<category android:name="android.intent.category.CAR_MODE" />
|
<activity android:name=".activities.PluginsActivity" />
|
||||||
<category android:name="android.intent.category.CAR_DOCK" />
|
<activity android:name=".activities.PluginActivity" />
|
||||||
<category android:name="android.intent.category.DESK_DOCK" />
|
<activity
|
||||||
</intent-filter>
|
android:name=".activities.ContributionVersionActivity"
|
||||||
<!-- requires read permission -->
|
android:configChanges="keyboardHidden|orientation"
|
||||||
<!--
|
android:label="@string/contribution_activity" />
|
||||||
|
<activity
|
||||||
|
android:name=".osmo.SettingsOsMoActivity"
|
||||||
|
android:configChanges="keyboardHidden|orientation" />
|
||||||
|
<activity android:name=".osmo.OsMoGroupsActivity" >
|
||||||
|
<intent-filter>
|
||||||
|
<data
|
||||||
|
android:host="z.osmo.mobi"
|
||||||
|
android:scheme="http" />
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".activities.search.SearchPOIActivity"
|
||||||
|
android:label="@string/searchpoi_activity" />
|
||||||
|
<activity
|
||||||
|
android:name=".activities.search.SearchAddressActivity"
|
||||||
|
android:label="@string/select_address_activity" />
|
||||||
|
<activity android:name=".activities.search.SearchCityByNameActivity" />
|
||||||
|
<activity android:name=".activities.search.SearchRegionByNameActivity" />
|
||||||
|
<activity android:name=".activities.search.SearchStreetByNameActivity" />
|
||||||
|
<activity android:name=".activities.search.SearchStreet2ByNameActivity" />
|
||||||
|
<activity android:name=".activities.search.SearchBuildingByNameActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".sherpafy.TourViewActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:label="Sherpafy"
|
||||||
|
android:launchMode="singleInstance" />
|
||||||
|
<activity android:name=".activities.EditPOIFilterActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".activities.search.GeoIntentActivity"
|
||||||
|
android:label="@string/app_name" >
|
||||||
|
<intent-filter>
|
||||||
|
<data android:scheme="osmand.geo" />
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<data android:scheme="geo" />
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<data android:scheme="http" />
|
||||||
|
<data android:scheme="https" />
|
||||||
|
<data android:host="maps.google.com" />
|
||||||
|
<data android:host="maps.yandex.ru" />
|
||||||
|
<data android:host="maps.yandex.com" />
|
||||||
|
<data android:host="www.openstreetmap.org" />
|
||||||
|
<data android:host="openstreetmap.org" />
|
||||||
|
<data android:host="osm.org" />
|
||||||
|
<data android:host="map.baidu.cn" />
|
||||||
|
<data android:host="map.baidu.com" />
|
||||||
|
<data android:host="wb.amap.com" />
|
||||||
|
<data android:host="www.amap.com" />
|
||||||
|
<data android:host="here.com" />
|
||||||
|
<data android:host="www.here.com" />
|
||||||
|
<data android:host="share.here.com" />
|
||||||
|
<data android:host="map.wap.qq.com" />
|
||||||
|
<data android:host="map.qq.com" />
|
||||||
|
<data android:host="maps.apple.com" />
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<data
|
||||||
|
android:host="www.google.com"
|
||||||
|
android:pathPrefix="/maps"
|
||||||
|
android:scheme="http" />
|
||||||
|
<data
|
||||||
|
android:host="www.google.com"
|
||||||
|
android:pathPrefix="/maps"
|
||||||
|
android:scheme="https" />
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<data
|
||||||
|
android:host="openstreetmap.de"
|
||||||
|
android:pathPrefix="/karte"
|
||||||
|
android:scheme="http" />
|
||||||
|
<data
|
||||||
|
android:host="openstreetmap.de"
|
||||||
|
android:pathPrefix="/karte"
|
||||||
|
android:scheme="https" />
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<data
|
||||||
|
android:host="download.osmand.net"
|
||||||
|
android:pathPrefix="/go"
|
||||||
|
android:scheme="http" />
|
||||||
|
<data
|
||||||
|
android:host="download.osmand.net"
|
||||||
|
android:pathPrefix="go"
|
||||||
|
android:scheme="http" />
|
||||||
|
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
|
<category android:name="android.intent.category.APP_MAPS" />
|
||||||
|
<category android:name="android.intent.category.CAR_MODE" />
|
||||||
|
<category android:name="android.intent.category.CAR_DOCK" />
|
||||||
|
<category android:name="android.intent.category.DESK_DOCK" />
|
||||||
|
</intent-filter>
|
||||||
|
<!-- requires read permission -->
|
||||||
|
<!--
|
||||||
<intent-filter android:label="OsmAnd">
|
<intent-filter android:label="OsmAnd">
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
<data android:mimeType="vnd.android.cursor.item/postal-address_v2" />
|
<data android:mimeType="vnd.android.cursor.item/postal-address_v2" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
-->
|
-->
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity android:name=".development.TestVoiceActivity" />
|
||||||
|
<activity
|
||||||
|
android:name=".download.DownloadActivity"
|
||||||
|
android:label="" />
|
||||||
|
|
||||||
<activity android:name="net.osmand.plus.development.TestVoiceActivity" />
|
<!-- keep android:process on a separate line !! -->
|
||||||
<activity android:name="net.osmand.plus.download.DownloadActivity" android:label="" />
|
<service
|
||||||
|
android:name=".NavigationService"
|
||||||
|
android:label="@string/process_navigation_service"
|
||||||
|
android:process="net.osmand.plus"
|
||||||
|
android:stopWithTask="false" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="net.osmand.plus.NavigationService" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
|
||||||
<!-- keep android:process on a separate line !! -->
|
<receiver android:name=".OnNavigationServiceAlarmReceiver" />
|
||||||
<service
|
|
||||||
android:process="net.osmand.plus"
|
|
||||||
android:label="@string/process_navigation_service"
|
|
||||||
android:name="net.osmand.plus.NavigationService"
|
|
||||||
android:stopWithTask="false">
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="net.osmand.plus.NavigationService" />
|
|
||||||
</intent-filter>
|
|
||||||
</service>
|
|
||||||
|
|
||||||
<receiver android:name="net.osmand.plus.OnNavigationServiceAlarmReceiver" />
|
<activity android:name=".activities.PrintDialogActivity" />
|
||||||
<activity android:name="net.osmand.plus.activities.PrintDialogActivity" />
|
|
||||||
|
|
||||||
<receiver
|
|
||||||
android:name="net.osmand.plus.DeviceAdminRecv"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:permission="android.permission.BIND_DEVICE_ADMIN" >
|
|
||||||
<meta-data
|
|
||||||
android:name="android.app.device_admin"
|
|
||||||
android:resource="@xml/device_admin" />
|
|
||||||
|
|
||||||
<intent-filter>
|
<receiver
|
||||||
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
|
android:name=".DeviceAdminRecv"
|
||||||
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
|
android:label="@string/app_name"
|
||||||
</intent-filter>
|
android:permission="android.permission.BIND_DEVICE_ADMIN" >
|
||||||
</receiver>
|
<meta-data
|
||||||
</application>
|
android:name="android.app.device_admin"
|
||||||
</manifest>
|
android:resource="@xml/device_admin" />
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
|
||||||
|
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<activity android:name=".activities.AppCompatPreferenceActivity" >
|
||||||
|
</activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
package net.osmand.access;
|
package net.osmand.access;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
// Since usual message in an AlertDialog that is set by
|
// Since usual message in an AlertDialog that is set by
|
||||||
// AlertDialog.Builder.setMessage() is spoken only once
|
// AlertDialog.Builder.setMessage() is spoken only once
|
||||||
|
@ -17,7 +18,7 @@ import android.content.Context;
|
||||||
// or system accessibility service is turned off this class
|
// or system accessibility service is turned off this class
|
||||||
// acts just identical to it's direct parent.
|
// acts just identical to it's direct parent.
|
||||||
//
|
//
|
||||||
public class AccessibleAlertBuilder extends Builder {
|
public class AccessibleAlertBuilder extends AlertDialog.Builder {
|
||||||
|
|
||||||
// The method getContext() is only available
|
// The method getContext() is only available
|
||||||
// starting from API level 11, so store it here.
|
// starting from API level 11, so store it here.
|
||||||
|
@ -33,14 +34,14 @@ public class AccessibleAlertBuilder extends Builder {
|
||||||
// Provided setMessage() alternatives.
|
// Provided setMessage() alternatives.
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder setMessage(CharSequence msg) {
|
public AlertDialog.Builder setMessage(CharSequence msg) {
|
||||||
if (((OsmandApplication) context.getApplicationContext()).accessibilityExtensions())
|
if (((OsmandApplication) context.getApplicationContext()).accessibilityExtensions())
|
||||||
return setView(TextMessage.makeView(context, msg, R.layout.alert));
|
return setView(TextMessage.makeView(context, msg, R.layout.alert));
|
||||||
return super.setMessage(msg);
|
return super.setMessage(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Builder setMessage(int msgid) {
|
public AlertDialog.Builder setMessage(int msgid) {
|
||||||
if (((OsmandApplication) context.getApplicationContext()).accessibilityExtensions())
|
if (((OsmandApplication) context.getApplicationContext()).accessibilityExtensions())
|
||||||
return setView(TextMessage.makeView(context, msgid, R.layout.alert));
|
return setView(TextMessage.makeView(context, msgid, R.layout.alert));
|
||||||
return super.setMessage(msgid);
|
return super.setMessage(msgid);
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
package net.osmand.access;
|
package net.osmand.access;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import android.content.Context;
|
||||||
import java.util.List;
|
import android.content.DialogInterface;
|
||||||
|
import android.os.SystemClock;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
@ -12,10 +14,9 @@ import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||||
import net.osmand.plus.access.RelativeDirectionStyle;
|
import net.osmand.plus.access.RelativeDirectionStyle;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Context;
|
import java.util.ArrayList;
|
||||||
import android.content.DialogInterface;
|
import java.util.List;
|
||||||
import android.os.SystemClock;
|
|
||||||
|
|
||||||
public class NavigationInfo {
|
public class NavigationInfo {
|
||||||
|
|
||||||
|
@ -26,14 +27,14 @@ public class NavigationInfo {
|
||||||
|
|
||||||
private static final int UNKNOWN = -1;
|
private static final int UNKNOWN = -1;
|
||||||
|
|
||||||
private final int[] direction = { R.string.front,
|
private final int[] direction = {R.string.front,
|
||||||
R.string.front_right,
|
R.string.front_right,
|
||||||
R.string.right,
|
R.string.right,
|
||||||
R.string.back_right,
|
R.string.back_right,
|
||||||
R.string.back,
|
R.string.back,
|
||||||
R.string.back_left,
|
R.string.back_left,
|
||||||
R.string.left,
|
R.string.left,
|
||||||
R.string.front_left };
|
R.string.front_left};
|
||||||
|
|
||||||
private RelativeDirectionStyle style;
|
private RelativeDirectionStyle style;
|
||||||
private int value;
|
private int value;
|
||||||
|
@ -107,22 +108,22 @@ public class NavigationInfo {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private final int[] cardinal = { R.string.north,
|
private final int[] cardinal = {R.string.north,
|
||||||
R.string.north_north_east,
|
R.string.north_north_east,
|
||||||
R.string.north_east,
|
R.string.north_east,
|
||||||
R.string.east_north_east,
|
R.string.east_north_east,
|
||||||
R.string.east,
|
R.string.east,
|
||||||
R.string.east_south_east,
|
R.string.east_south_east,
|
||||||
R.string.south_east,
|
R.string.south_east,
|
||||||
R.string.south_south_east,
|
R.string.south_south_east,
|
||||||
R.string.south,
|
R.string.south,
|
||||||
R.string.south_south_west,
|
R.string.south_south_west,
|
||||||
R.string.south_west,
|
R.string.south_west,
|
||||||
R.string.west_south_west,
|
R.string.west_south_west,
|
||||||
R.string.west,
|
R.string.west,
|
||||||
R.string.west_north_west,
|
R.string.west_north_west,
|
||||||
R.string.north_west,
|
R.string.north_west,
|
||||||
R.string.north_north_west };
|
R.string.north_north_west};
|
||||||
|
|
||||||
private final OsmandApplication context;
|
private final OsmandApplication context;
|
||||||
private final OsmandSettings settings;
|
private final OsmandSettings settings;
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package net.osmand.plus;
|
package net.osmand.plus;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.IProgress;
|
import net.osmand.IProgress;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
|
|
|
@ -1,5 +1,18 @@
|
||||||
package net.osmand.plus;
|
package net.osmand.plus;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.data.FavouritePoint;
|
||||||
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
|
import net.osmand.plus.GPXUtilities.WptPt;
|
||||||
|
import net.osmand.plus.api.SQLiteAPI.SQLiteConnection;
|
||||||
|
import net.osmand.plus.api.SQLiteAPI.SQLiteCursor;
|
||||||
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
|
import org.apache.tools.bzip2.CBZip2OutputStream;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
@ -12,19 +25,6 @@ import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
|
||||||
import net.osmand.data.FavouritePoint;
|
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
|
||||||
import net.osmand.plus.GPXUtilities.WptPt;
|
|
||||||
import net.osmand.plus.api.SQLiteAPI.SQLiteConnection;
|
|
||||||
import net.osmand.plus.api.SQLiteAPI.SQLiteCursor;
|
|
||||||
import net.osmand.util.Algorithms;
|
|
||||||
|
|
||||||
import org.apache.tools.bzip2.CBZip2OutputStream;
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
public class FavouritesDbHelper {
|
public class FavouritesDbHelper {
|
||||||
|
|
||||||
public interface FavoritesUpdatedListener {
|
public interface FavoritesUpdatedListener {
|
||||||
|
|
|
@ -1,24 +1,5 @@
|
||||||
package net.osmand.plus;
|
package net.osmand.plus;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.osmand.GeoidAltitudeCorrection;
|
|
||||||
import net.osmand.PlatformUtil;
|
|
||||||
import net.osmand.ResultMatcher;
|
|
||||||
import net.osmand.access.NavigationInfo;
|
|
||||||
import net.osmand.binary.RouteDataObject;
|
|
||||||
import net.osmand.data.LatLon;
|
|
||||||
import net.osmand.data.QuadPoint;
|
|
||||||
import net.osmand.plus.OsmandSettings.OsmandPreference;
|
|
||||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
|
||||||
import net.osmand.plus.routing.RoutingHelper;
|
|
||||||
import net.osmand.router.RouteSegmentResult;
|
|
||||||
import net.osmand.util.MapUtils;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -36,8 +17,28 @@ import android.location.LocationManager;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
import net.osmand.GeoidAltitudeCorrection;
|
||||||
|
import net.osmand.PlatformUtil;
|
||||||
|
import net.osmand.ResultMatcher;
|
||||||
|
import net.osmand.access.NavigationInfo;
|
||||||
|
import net.osmand.binary.RouteDataObject;
|
||||||
|
import net.osmand.data.LatLon;
|
||||||
|
import net.osmand.data.QuadPoint;
|
||||||
|
import net.osmand.plus.OsmandSettings.OsmandPreference;
|
||||||
|
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||||
|
import net.osmand.plus.routing.RoutingHelper;
|
||||||
|
import net.osmand.router.RouteSegmentResult;
|
||||||
|
import net.osmand.util.MapUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class OsmAndLocationProvider implements SensorEventListener {
|
public class OsmAndLocationProvider implements SensorEventListener {
|
||||||
|
|
||||||
private static final String SIMULATED_PROVIDER = "OsmAnd";
|
private static final String SIMULATED_PROVIDER = "OsmAnd";
|
||||||
|
|
|
@ -1,18 +1,9 @@
|
||||||
package net.osmand.plus;
|
package net.osmand.plus;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.osmand.CallbackWithObject;
|
|
||||||
import net.osmand.Location;
|
|
||||||
import net.osmand.access.AccessibleToast;
|
|
||||||
import net.osmand.plus.helpers.GpxUiHelper;
|
|
||||||
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.CompoundButton.OnCheckedChangeListener;
|
import android.widget.CompoundButton.OnCheckedChangeListener;
|
||||||
|
@ -22,6 +13,15 @@ import android.widget.SeekBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.CallbackWithObject;
|
||||||
|
import net.osmand.Location;
|
||||||
|
import net.osmand.access.AccessibleToast;
|
||||||
|
import net.osmand.plus.helpers.GpxUiHelper;
|
||||||
|
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class OsmAndLocationSimulation {
|
public class OsmAndLocationSimulation {
|
||||||
|
|
||||||
private Thread routeAnimation;
|
private Thread routeAnimation;
|
||||||
|
@ -53,7 +53,7 @@ public class OsmAndLocationSimulation {
|
||||||
|
|
||||||
public void startStopRouteAnimation(final Activity ma, final Runnable runnable) {
|
public void startStopRouteAnimation(final Activity ma, final Runnable runnable) {
|
||||||
if (!isRouteAnimating()) {
|
if (!isRouteAnimating()) {
|
||||||
Builder builder = new AlertDialog.Builder(ma);
|
AlertDialog.Builder builder = new AlertDialog.Builder(ma);
|
||||||
builder.setTitle(R.string.animate_route);
|
builder.setTitle(R.string.animate_route);
|
||||||
|
|
||||||
final View view = ma.getLayoutInflater().inflate(R.layout.animate_route, null);
|
final View view = ma.getLayoutInflater().inflate(R.layout.animate_route, null);
|
||||||
|
|
|
@ -2,8 +2,6 @@ package net.osmand.plus;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlarmManager;
|
import android.app.AlarmManager;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Application;
|
import android.app.Application;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -16,6 +14,7 @@ import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -342,7 +341,7 @@ public class OsmandApplication extends Application {
|
||||||
String voiceProvider = osmandSettings.VOICE_PROVIDER.get();
|
String voiceProvider = osmandSettings.VOICE_PROVIDER.get();
|
||||||
if (voiceProvider == null || OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(voiceProvider)) {
|
if (voiceProvider == null || OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(voiceProvider)) {
|
||||||
if (warningNoneProvider && voiceProvider == null) {
|
if (warningNoneProvider && voiceProvider == null) {
|
||||||
Builder builder = new AccessibleAlertBuilder(uiContext);
|
AlertDialog.Builder builder = new AccessibleAlertBuilder(uiContext);
|
||||||
LinearLayout ll = new LinearLayout(uiContext);
|
LinearLayout ll = new LinearLayout(uiContext);
|
||||||
ll.setOrientation(LinearLayout.VERTICAL);
|
ll.setOrientation(LinearLayout.VERTICAL);
|
||||||
final TextView tv = new TextView(uiContext);
|
final TextView tv = new TextView(uiContext);
|
||||||
|
@ -408,7 +407,7 @@ public class OsmandApplication extends Application {
|
||||||
|
|
||||||
public synchronized void closeApplication(final Activity activity) {
|
public synchronized void closeApplication(final Activity activity) {
|
||||||
if (getNavigationService() != null) {
|
if (getNavigationService() != null) {
|
||||||
Builder bld = new AlertDialog.Builder(activity);
|
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
|
||||||
bld.setMessage(R.string.background_service_is_enabled_question);
|
bld.setMessage(R.string.background_service_is_enabled_question);
|
||||||
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.OsmandSettings;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.os.Build.VERSION;
|
import android.os.Build.VERSION;
|
||||||
import android.os.Build.VERSION_CODES;
|
import android.os.Build.VERSION_CODES;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceActivity;
|
|
||||||
import android.support.v4.view.ViewCompat;
|
import android.support.v4.view.ViewCompat;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
|
@ -15,7 +11,11 @@ import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Spinner;
|
import android.widget.Spinner;
|
||||||
|
|
||||||
public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.OsmandSettings;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
|
||||||
|
public abstract class ActionBarPreferenceActivity extends AppCompatPreferenceActivity {
|
||||||
private Toolbar tb;
|
private Toolbar tb;
|
||||||
private View shadowView;
|
private View shadowView;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(final Bundle savedInstanceState) {
|
protected void onCreate(final Bundle savedInstanceState) {
|
||||||
//settings needed it's own theme because of check boxes not styled properly
|
//settings needed it's own theme because of check boxes not styled properly
|
||||||
OsmandSettings settings = ((OsmandApplication)getApplication()).getSettings();
|
OsmandSettings settings = ((OsmandApplication) getApplication()).getSettings();
|
||||||
int t = R.style.OsmandLightTheme;
|
int t = R.style.OsmandLightTheme;
|
||||||
if (settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_DARK_THEME) {
|
if (settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_DARK_THEME) {
|
||||||
t = R.style.OsmandDarkTheme;
|
t = R.style.OsmandDarkTheme;
|
||||||
|
@ -44,7 +44,7 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
|
||||||
shadowView = null;
|
shadowView = null;
|
||||||
}
|
}
|
||||||
tb.setClickable(true);
|
tb.setClickable(true);
|
||||||
tb.setNavigationIcon(((OsmandApplication)getApplication()).getIconsCache().getIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha));
|
tb.setNavigationIcon(((OsmandApplication) getApplication()).getIconsCache().getIcon(R.drawable.abc_ic_ab_back_mtrl_am_alpha));
|
||||||
tb.setBackgroundColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTabBackground)));
|
tb.setBackgroundColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTabBackground)));
|
||||||
tb.setTitleTextColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTextColor)));
|
tb.setTitleTextColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTextColor)));
|
||||||
tb.setNavigationOnClickListener(new View.OnClickListener() {
|
tb.setNavigationOnClickListener(new View.OnClickListener() {
|
||||||
|
|
|
@ -0,0 +1,108 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2014 The Android Open Source Project
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
package net.osmand.plus.activities;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.PreferenceActivity;
|
||||||
|
import android.support.annotation.LayoutRes;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
|
import android.support.v7.app.AppCompatDelegate;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
/**
|
||||||
|
* A {@link android.preference.PreferenceActivity} which implements and proxies the necessary calls
|
||||||
|
* to be used with AppCompat.
|
||||||
|
*
|
||||||
|
* This technique can be used with an {@link android.app.Activity} class, not just
|
||||||
|
* {@link android.preference.PreferenceActivity}.
|
||||||
|
*/
|
||||||
|
public abstract class AppCompatPreferenceActivity extends PreferenceActivity {
|
||||||
|
private AppCompatDelegate mDelegate;
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
getDelegate().installViewFactory();
|
||||||
|
getDelegate().onCreate(savedInstanceState);
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onPostCreate(Bundle savedInstanceState) {
|
||||||
|
super.onPostCreate(savedInstanceState);
|
||||||
|
getDelegate().onPostCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
public ActionBar getSupportActionBar() {
|
||||||
|
return getDelegate().getSupportActionBar();
|
||||||
|
}
|
||||||
|
public void setSupportActionBar(@Nullable Toolbar toolbar) {
|
||||||
|
getDelegate().setSupportActionBar(toolbar);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public MenuInflater getMenuInflater() {
|
||||||
|
return getDelegate().getMenuInflater();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setContentView(@LayoutRes int layoutResID) {
|
||||||
|
getDelegate().setContentView(layoutResID);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setContentView(View view) {
|
||||||
|
getDelegate().setContentView(view);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void setContentView(View view, ViewGroup.LayoutParams params) {
|
||||||
|
getDelegate().setContentView(view, params);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void addContentView(View view, ViewGroup.LayoutParams params) {
|
||||||
|
getDelegate().addContentView(view, params);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onPostResume() {
|
||||||
|
super.onPostResume();
|
||||||
|
getDelegate().onPostResume();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onTitleChanged(CharSequence title, int color) {
|
||||||
|
super.onTitleChanged(title, color);
|
||||||
|
getDelegate().setTitle(title);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onConfigurationChanged(Configuration newConfig) {
|
||||||
|
super.onConfigurationChanged(newConfig);
|
||||||
|
getDelegate().onConfigurationChanged(newConfig);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
getDelegate().onStop();
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
getDelegate().onDestroy();
|
||||||
|
}
|
||||||
|
public void invalidateOptionsMenu() {
|
||||||
|
getDelegate().invalidateOptionsMenu();
|
||||||
|
}
|
||||||
|
private AppCompatDelegate getDelegate() {
|
||||||
|
if (mDelegate == null) {
|
||||||
|
mDelegate = AppCompatDelegate.create(this, null);
|
||||||
|
}
|
||||||
|
return mDelegate;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,16 +1,19 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import java.io.File;
|
import android.app.ProgressDialog;
|
||||||
import java.io.FileOutputStream;
|
import android.content.DialogInterface;
|
||||||
import java.io.InputStream;
|
import android.content.Intent;
|
||||||
import java.net.URL;
|
import android.net.Uri;
|
||||||
import java.net.URLConnection;
|
import android.os.Bundle;
|
||||||
import java.text.MessageFormat;
|
import android.support.v7.app.AlertDialog;
|
||||||
import java.text.ParseException;
|
import android.view.LayoutInflater;
|
||||||
import java.text.SimpleDateFormat;
|
import android.view.View;
|
||||||
import java.util.ArrayList;
|
import android.view.ViewGroup;
|
||||||
import java.util.Date;
|
import android.widget.AdapterView;
|
||||||
import java.util.List;
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Filterable;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.AndroidUtils;
|
import net.osmand.AndroidUtils;
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
|
@ -20,21 +23,16 @@ import net.osmand.plus.R;
|
||||||
import org.xmlpull.v1.XmlPullParser;
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
import org.xmlpull.v1.XmlPullParserFactory;
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import java.io.File;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.io.FileOutputStream;
|
||||||
import android.app.ProgressDialog;
|
import java.io.InputStream;
|
||||||
import android.content.DialogInterface;
|
import java.net.URLConnection;
|
||||||
import android.content.Intent;
|
import java.text.MessageFormat;
|
||||||
import android.net.Uri;
|
import java.text.ParseException;
|
||||||
import android.os.Bundle;
|
import java.text.SimpleDateFormat;
|
||||||
import android.view.LayoutInflater;
|
import java.util.ArrayList;
|
||||||
import android.view.View;
|
import java.util.Date;
|
||||||
import android.view.ViewGroup;
|
import java.util.List;
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Filterable;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
public class ContributionVersionActivity extends OsmandListActivity {
|
public class ContributionVersionActivity extends OsmandListActivity {
|
||||||
|
|
||||||
|
@ -210,7 +208,7 @@ public class ContributionVersionActivity extends OsmandListActivity {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
final OsmAndBuild item = (OsmAndBuild) getListAdapter().getItem(position);
|
final OsmAndBuild item = (OsmAndBuild) getListAdapter().getItem(position);
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setMessage(MessageFormat.format(getString(R.string.install_selected_build), item.tag,
|
builder.setMessage(MessageFormat.format(getString(R.string.install_selected_build), item.tag,
|
||||||
AndroidUtils.formatDateTime(getMyApplication(), item.date.getTime()), item.size));
|
AndroidUtils.formatDateTime(getMyApplication(), item.date.getTime()), item.size));
|
||||||
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
|
|
@ -1,8 +1,14 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import java.text.MessageFormat;
|
import android.app.ProgressDialog;
|
||||||
import java.util.ArrayList;
|
import android.content.Context;
|
||||||
import java.util.List;
|
import android.content.DialogInterface;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.SeekBar;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
|
@ -23,18 +29,8 @@ import net.osmand.util.MapUtils;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import java.text.MessageFormat;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.util.List;
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.graphics.Rect;
|
|
||||||
import android.graphics.RectF;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.widget.SeekBar;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
public class DownloadTilesDialog {
|
public class DownloadTilesDialog {
|
||||||
|
|
||||||
|
@ -67,7 +63,7 @@ public class DownloadTilesDialog {
|
||||||
final int zoom = rb.getZoom();
|
final int zoom = rb.getZoom();
|
||||||
|
|
||||||
// calculate pixel rectangle
|
// calculate pixel rectangle
|
||||||
Builder builder = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
|
||||||
LayoutInflater inflater = (LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
View view = inflater.inflate(R.layout.download_tiles, null);
|
View view = inflater.inflate(R.layout.download_tiles, null);
|
||||||
|
|
||||||
|
|
|
@ -4,27 +4,10 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
|
|
||||||
import java.text.Collator;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.LinkedHashSet;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import net.osmand.osm.PoiCategory;
|
|
||||||
import net.osmand.osm.PoiType;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.poi.PoiFiltersHelper;
|
|
||||||
import net.osmand.plus.poi.PoiUIFilter;
|
|
||||||
import net.osmand.util.Algorithms;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -35,9 +18,25 @@ import android.widget.AdapterView;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.ScrollView;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import net.osmand.osm.PoiCategory;
|
||||||
|
import net.osmand.osm.PoiType;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.poi.PoiFiltersHelper;
|
||||||
|
import net.osmand.plus.poi.PoiUIFilter;
|
||||||
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
|
import java.text.Collator;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -112,7 +111,7 @@ public class EditPOIFilterActivity extends OsmandListActivity {
|
||||||
final int index = lv.getFirstVisiblePosition();
|
final int index = lv.getFirstVisiblePosition();
|
||||||
View v = lv.getChildAt(0);
|
View v = lv.getChildAt(0);
|
||||||
final int top = (v == null) ? 0 : v.getTop();
|
final int top = (v == null) ? 0 : v.getTop();
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
final LinkedHashMap<String, String> subCategories = new LinkedHashMap<String, String>();
|
final LinkedHashMap<String, String> subCategories = new LinkedHashMap<String, String>();
|
||||||
Set<String> acceptedCategories = filter.getAcceptedSubtypes(poiCategory);
|
Set<String> acceptedCategories = filter.getAcceptedSubtypes(poiCategory);
|
||||||
if (acceptedCategories != null) {
|
if (acceptedCategories != null) {
|
||||||
|
|
|
@ -1,16 +1,39 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import gnu.trove.list.array.TIntArrayList;
|
import android.app.Activity;
|
||||||
|
import android.content.Context;
|
||||||
import java.io.File;
|
import android.content.DialogInterface;
|
||||||
import java.text.MessageFormat;
|
import android.content.Intent;
|
||||||
import java.util.ArrayList;
|
import android.content.res.Resources;
|
||||||
import java.util.HashSet;
|
import android.graphics.PorterDuff;
|
||||||
import java.util.LinkedHashMap;
|
import android.graphics.Typeface;
|
||||||
import java.util.LinkedHashSet;
|
import android.graphics.drawable.Drawable;
|
||||||
import java.util.List;
|
import android.net.Uri;
|
||||||
import java.util.Map;
|
import android.os.AsyncTask;
|
||||||
import java.util.Set;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.support.v4.view.MenuItemCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.view.ActionMode;
|
||||||
|
import android.support.v7.widget.SearchView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.AutoCompleteTextView;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ExpandableListView;
|
||||||
|
import android.widget.Filter;
|
||||||
|
import android.widget.Filterable;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.Spinner;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.data.FavouritePoint;
|
import net.osmand.data.FavouritePoint;
|
||||||
|
@ -32,41 +55,18 @@ import net.osmand.plus.helpers.ColorDialogs;
|
||||||
import net.osmand.plus.myplaces.FavoritesActivity;
|
import net.osmand.plus.myplaces.FavoritesActivity;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
import java.io.File;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.text.MessageFormat;
|
||||||
import android.content.Context;
|
import java.util.ArrayList;
|
||||||
import android.content.DialogInterface;
|
import java.util.HashSet;
|
||||||
import android.content.Intent;
|
import java.util.LinkedHashMap;
|
||||||
import android.content.res.Resources;
|
import java.util.LinkedHashSet;
|
||||||
import android.graphics.PorterDuff;
|
import java.util.List;
|
||||||
import android.graphics.Typeface;
|
import java.util.Map;
|
||||||
import android.graphics.drawable.Drawable;
|
import java.util.Set;
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.AsyncTask;
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.support.v4.app.FragmentActivity;
|
|
||||||
import android.support.v4.view.MenuItemCompat;
|
|
||||||
import android.support.v7.view.ActionMode;
|
|
||||||
import android.support.v7.widget.SearchView;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.AutoCompleteTextView;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ExpandableListView;
|
|
||||||
import android.widget.Filter;
|
|
||||||
import android.widget.Filterable;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.Spinner;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
|
|
||||||
public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
@ -188,7 +188,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
public static boolean editPoint(final Context ctx, final FavouritePoint point, final Runnable callback) {
|
public static boolean editPoint(final Context ctx, final FavouritePoint point, final Runnable callback) {
|
||||||
OsmandApplication app = (OsmandApplication) ctx.getApplicationContext();
|
OsmandApplication app = (OsmandApplication) ctx.getApplicationContext();
|
||||||
final Builder builder = new AlertDialog.Builder(ctx);
|
final AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
|
||||||
builder.setTitle(R.string.favourites_context_menu_edit);
|
builder.setTitle(R.string.favourites_context_menu_edit);
|
||||||
final View v = LayoutInflater.from(ctx).inflate(R.layout.favorite_edit_dialog,
|
final View v = LayoutInflater.from(ctx).inflate(R.layout.favorite_edit_dialog,
|
||||||
null, false);
|
null, false);
|
||||||
|
@ -247,7 +247,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
|
|
||||||
private boolean deletePoint(final FavouritePoint point) {
|
private boolean deletePoint(final FavouritePoint point) {
|
||||||
final Resources resources = this.getResources();
|
final Resources resources = this.getResources();
|
||||||
Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
builder.setMessage(getString(R.string.favourites_remove_dialog_msg, point.getName()));
|
builder.setMessage(getString(R.string.favourites_remove_dialog_msg, point.getName()));
|
||||||
builder.setNegativeButton(R.string.shared_string_no, null);
|
builder.setNegativeButton(R.string.shared_string_no, null);
|
||||||
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
@ -295,7 +295,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
|
||||||
if (targetPointsHelper.getIntermediatePoints().size() > 0) {
|
if (targetPointsHelper.getIntermediatePoints().size() > 0) {
|
||||||
final FragmentActivity act = getActivity();
|
final FragmentActivity act = getActivity();
|
||||||
Builder builder = new AlertDialog.Builder(act);
|
AlertDialog.Builder builder = new AlertDialog.Builder(act);
|
||||||
builder.setTitle(R.string.new_directions_point_dialog);
|
builder.setTitle(R.string.new_directions_point_dialog);
|
||||||
builder.setItems(
|
builder.setItems(
|
||||||
new String[] { act.getString(R.string.keep_intermediate_points),
|
new String[] { act.getString(R.string.keep_intermediate_points),
|
||||||
|
@ -491,7 +491,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void openChangeGroupDialog(final FavoriteGroup group) {
|
protected void openChangeGroupDialog(final FavoriteGroup group) {
|
||||||
Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
View view = getActivity().getLayoutInflater().inflate(R.layout.fav_group_edit, null);
|
View view = getActivity().getLayoutInflater().inflate(R.layout.fav_group_edit, null);
|
||||||
|
|
||||||
final EditText nameEditText = (EditText) view.findViewById(R.id.nameEditText);
|
final EditText nameEditText = (EditText) view.findViewById(R.id.nameEditText);
|
||||||
|
@ -532,7 +532,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
private void deleteFavoritesAction() {
|
private void deleteFavoritesAction() {
|
||||||
if (groupsToDelete.size() + favoritesSelected.size() > 0) {
|
if (groupsToDelete.size() + favoritesSelected.size() > 0) {
|
||||||
|
|
||||||
Builder b = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
|
||||||
b.setMessage(getString(R.string.favorite_delete_multiple, favoritesSelected.size(), groupsToDelete.size()));
|
b.setMessage(getString(R.string.favorite_delete_multiple, favoritesSelected.size(), groupsToDelete.size()));
|
||||||
b.setPositiveButton(R.string.shared_string_delete, new DialogInterface.OnClickListener() {
|
b.setPositiveButton(R.string.shared_string_delete, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -615,7 +615,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (tosave.exists()) {
|
if (tosave.exists()) {
|
||||||
Builder bld = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder bld = new AlertDialog.Builder(getActivity());
|
||||||
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
|
@ -1,29 +1,12 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import gnu.trove.list.array.TIntArrayList;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.osmand.Location;
|
|
||||||
import net.osmand.TspAnt;
|
|
||||||
import net.osmand.access.AccessibleAlertBuilder;
|
|
||||||
import net.osmand.data.LatLon;
|
|
||||||
import net.osmand.plus.OsmAndFormatter;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.TargetPointsHelper;
|
|
||||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
|
||||||
import net.osmand.util.MapUtils;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnShowListener;
|
import android.content.DialogInterface.OnShowListener;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
@ -38,6 +21,23 @@ import android.widget.ListView;
|
||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import net.osmand.Location;
|
||||||
|
import net.osmand.TspAnt;
|
||||||
|
import net.osmand.access.AccessibleAlertBuilder;
|
||||||
|
import net.osmand.data.LatLon;
|
||||||
|
import net.osmand.plus.OsmAndFormatter;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.TargetPointsHelper;
|
||||||
|
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||||
|
import net.osmand.util.MapUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
|
|
||||||
public class IntermediatePointsDialog {
|
public class IntermediatePointsDialog {
|
||||||
|
|
||||||
public static void openIntermediatePointsDialog(final Activity activity,
|
public static void openIntermediatePointsDialog(final Activity activity,
|
||||||
|
@ -86,7 +86,7 @@ public class IntermediatePointsDialog {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Builder builder = new AccessibleAlertBuilder(activity);
|
AlertDialog.Builder builder = new AccessibleAlertBuilder(activity);
|
||||||
builder.setView(contentView);
|
builder.setView(contentView);
|
||||||
builder.setInverseBackgroundForced(true);
|
builder.setInverseBackgroundForced(true);
|
||||||
lv.setBackgroundColor(Color.WHITE);
|
lv.setBackgroundColor(Color.WHITE);
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -20,6 +19,7 @@ import android.widget.EditText;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.londatiga.android.ActionItem;
|
import net.londatiga.android.ActionItem;
|
||||||
import net.londatiga.android.QuickAction;
|
import net.londatiga.android.QuickAction;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
|
@ -69,23 +69,23 @@ public class MapActivityActions implements DialogProvider {
|
||||||
public static final String KEY_LONGITUDE = "longitude";
|
public static final String KEY_LONGITUDE = "longitude";
|
||||||
public static final String KEY_LATITUDE = "latitude";
|
public static final String KEY_LATITUDE = "latitude";
|
||||||
public static final String KEY_NAME = "name";
|
public static final String KEY_NAME = "name";
|
||||||
|
|
||||||
public static final String KEY_ZOOM = "zoom";
|
public static final String KEY_ZOOM = "zoom";
|
||||||
|
|
||||||
private static final int DIALOG_ADD_FAVORITE = 100;
|
private static final int DIALOG_ADD_FAVORITE = 100;
|
||||||
private static final int DIALOG_REPLACE_FAVORITE = 101;
|
private static final int DIALOG_REPLACE_FAVORITE = 101;
|
||||||
private static final int DIALOG_ADD_WAYPOINT = 102;
|
private static final int DIALOG_ADD_WAYPOINT = 102;
|
||||||
private static final int DIALOG_RELOAD_TITLE = 103;
|
private static final int DIALOG_RELOAD_TITLE = 103;
|
||||||
|
|
||||||
private static final int DIALOG_SAVE_DIRECTIONS = 106;
|
private static final int DIALOG_SAVE_DIRECTIONS = 106;
|
||||||
// make static
|
// make static
|
||||||
private static Bundle dialogBundle = new Bundle();
|
private static Bundle dialogBundle = new Bundle();
|
||||||
|
|
||||||
private final MapActivity mapActivity;
|
private final MapActivity mapActivity;
|
||||||
private OsmandSettings settings;
|
private OsmandSettings settings;
|
||||||
private RoutingHelper routingHelper;
|
private RoutingHelper routingHelper;
|
||||||
|
|
||||||
public MapActivityActions(MapActivity mapActivity){
|
public MapActivityActions(MapActivity mapActivity) {
|
||||||
this.mapActivity = mapActivity;
|
this.mapActivity = mapActivity;
|
||||||
settings = mapActivity.getMyApplication().getSettings();
|
settings = mapActivity.getMyApplication().getSettings();
|
||||||
routingHelper = mapActivity.getMyApplication().getRoutingHelper();
|
routingHelper = mapActivity.getMyApplication().getRoutingHelper();
|
||||||
|
@ -94,14 +94,14 @@ public class MapActivityActions implements DialogProvider {
|
||||||
public void showNavigationContextMenuPoint(final double latitude, final double longitude) {
|
public void showNavigationContextMenuPoint(final double latitude, final double longitude) {
|
||||||
final ContextMenuAdapter adapter = new ContextMenuAdapter(mapActivity);
|
final ContextMenuAdapter adapter = new ContextMenuAdapter(mapActivity);
|
||||||
|
|
||||||
if(!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) {
|
if (!mapActivity.getRoutingHelper().isFollowingMode() && !mapActivity.getRoutingHelper().isRoutePlanningMode()) {
|
||||||
adapter.item(R.string.context_menu_item_directions_to).iconColor(
|
adapter.item(R.string.context_menu_item_directions_to).iconColor(
|
||||||
R.drawable.ic_action_gdirections_dark).reg();
|
R.drawable.ic_action_gdirections_dark).reg();
|
||||||
adapter.item(R.string.context_menu_item_directions_from).iconColor(
|
adapter.item(R.string.context_menu_item_directions_from).iconColor(
|
||||||
R.drawable.ic_action_gdirections_dark).reg();
|
R.drawable.ic_action_gdirections_dark).reg();
|
||||||
}
|
}
|
||||||
final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
|
final TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
|
||||||
if(targets.getPointToNavigate() != null) {
|
if (targets.getPointToNavigate() != null) {
|
||||||
adapter.item(R.string.context_menu_item_destination_point).iconColor(R.drawable.ic_action_flag_dark).reg();
|
adapter.item(R.string.context_menu_item_destination_point).iconColor(R.drawable.ic_action_flag_dark).reg();
|
||||||
adapter.item(R.string.context_menu_item_intermediate_point).iconColor(R.drawable.ic_action_flage_dark).reg();
|
adapter.item(R.string.context_menu_item_intermediate_point).iconColor(R.drawable.ic_action_flage_dark).reg();
|
||||||
// For button-less search UI
|
// For button-less search UI
|
||||||
|
@ -111,9 +111,9 @@ public class MapActivityActions implements DialogProvider {
|
||||||
|
|
||||||
getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter);
|
getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter);
|
||||||
|
|
||||||
final Builder builder = new AlertDialog.Builder(mapActivity);
|
final AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
|
||||||
builder.setTitle(R.string.get_directions);
|
builder.setTitle(R.string.get_directions);
|
||||||
final ArrayAdapter<?> listAdapter =
|
final ArrayAdapter<?> listAdapter =
|
||||||
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
|
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
|
||||||
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() {
|
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
|
|
||||||
public void addAsWaypoint(double latitude, double longitude) {
|
public void addAsWaypoint(double latitude, double longitude) {
|
||||||
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
|
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
|
||||||
boolean destination = (targets.getPointToNavigate() == null);
|
boolean destination = (targets.getPointToNavigate() == null);
|
||||||
|
|
||||||
targets.navigateToPoint(new LatLon(latitude, longitude), true,
|
targets.navigateToPoint(new LatLon(latitude, longitude), true,
|
||||||
destination ? -1 : targets.getIntermediatePoints().size(),
|
destination ? -1 : targets.getIntermediatePoints().size(),
|
||||||
|
@ -171,7 +171,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
aBundle.putString(KEY_NAME, name);
|
aBundle.putString(KEY_NAME, name);
|
||||||
return aBundle;
|
return aBundle;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Bundle enhance(Bundle bundle, double latitude, double longitude, final int zoom) {
|
private Bundle enhance(Bundle bundle, double latitude, double longitude, final int zoom) {
|
||||||
bundle.putDouble(KEY_LATITUDE, latitude);
|
bundle.putDouble(KEY_LATITUDE, latitude);
|
||||||
bundle.putDouble(KEY_LONGITUDE, longitude);
|
bundle.putDouble(KEY_LONGITUDE, longitude);
|
||||||
|
@ -180,7 +180,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addWaypoint(final double latitude, final double longitude) {
|
public void addWaypoint(final double latitude, final double longitude) {
|
||||||
String name;
|
String name;
|
||||||
PointDescription pointDescription = mapActivity.getContextMenu().getPointDescription();
|
PointDescription pointDescription = mapActivity.getContextMenu().getPointDescription();
|
||||||
if (!pointDescription.isWpt() && !mapActivity.getContextMenu().isAddressUnknown()) {
|
if (!pointDescription.isWpt() && !mapActivity.getContextMenu().isAddressUnknown()) {
|
||||||
|
@ -188,12 +188,12 @@ public class MapActivityActions implements DialogProvider {
|
||||||
} else {
|
} else {
|
||||||
name = "";
|
name = "";
|
||||||
}
|
}
|
||||||
enhance(dialogBundle,latitude,longitude, name);
|
enhance(dialogBundle, latitude, longitude, name);
|
||||||
mapActivity.showDialog(DIALOG_ADD_WAYPOINT);
|
mapActivity.showDialog(DIALOG_ADD_WAYPOINT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createAddWaypointDialog(final Bundle args) {
|
private Dialog createAddWaypointDialog(final Bundle args) {
|
||||||
Builder builder = new AlertDialog.Builder(mapActivity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
|
||||||
builder.setTitle(R.string.add_waypoint_dialog_title);
|
builder.setTitle(R.string.add_waypoint_dialog_title);
|
||||||
View view = mapActivity.getLayoutInflater().inflate(R.layout.add_gpx_point_dialog, null);
|
View view = mapActivity.getLayoutInflater().inflate(R.layout.add_gpx_point_dialog, null);
|
||||||
final EditText editText = (EditText) view.findViewById(android.R.id.edit);
|
final EditText editText = (EditText) view.findViewById(android.R.id.edit);
|
||||||
|
@ -222,60 +222,60 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return alertDialog;
|
return alertDialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reloadTile(final int zoom, final double latitude, final double longitude){
|
|
||||||
enhance(dialogBundle,latitude,longitude,zoom);
|
|
||||||
mapActivity.showDialog(DIALOG_RELOAD_TITLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected String getString(int res){
|
public void reloadTile(final int zoom, final double latitude, final double longitude) {
|
||||||
return mapActivity.getString(res);
|
enhance(dialogBundle, latitude, longitude, zoom);
|
||||||
}
|
mapActivity.showDialog(DIALOG_RELOAD_TITLE);
|
||||||
|
}
|
||||||
protected void showToast(final String msg){
|
|
||||||
mapActivity.runOnUiThread(new Runnable() {
|
protected String getString(int res) {
|
||||||
|
return mapActivity.getString(res);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void showToast(final String msg) {
|
||||||
|
mapActivity.runOnUiThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
AccessibleToast.makeText(mapActivity, msg, Toast.LENGTH_LONG).show();
|
AccessibleToast.makeText(mapActivity, msg, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void aboutRoute() {
|
public void aboutRoute() {
|
||||||
Intent intent = new Intent(mapActivity, ShowRouteInfoActivity.class);
|
Intent intent = new Intent(mapActivity, ShowRouteInfoActivity.class);
|
||||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
mapActivity.startActivity(intent);
|
mapActivity.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Location getLastKnownLocation() {
|
protected Location getLastKnownLocation() {
|
||||||
return getMyApplication().getLocationProvider().getLastKnownLocation();
|
return getMyApplication().getLocationProvider().getLastKnownLocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected OsmandApplication getMyApplication() {
|
protected OsmandApplication getMyApplication() {
|
||||||
return mapActivity.getMyApplication();
|
return mapActivity.getMyApplication();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void saveDirections() {
|
public void saveDirections() {
|
||||||
mapActivity.showDialog(DIALOG_SAVE_DIRECTIONS);
|
mapActivity.showDialog(DIALOG_SAVE_DIRECTIONS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dialog createSaveDirections(Activity activity, RoutingHelper routingHelper) {
|
public static Dialog createSaveDirections(Activity activity, RoutingHelper routingHelper) {
|
||||||
final OsmandApplication app = ((OsmandApplication) activity.getApplication());
|
final OsmandApplication app = ((OsmandApplication) activity.getApplication());
|
||||||
final File fileDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
|
final File fileDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
|
||||||
final Dialog dlg = new Dialog(activity);
|
final Dialog dlg = new Dialog(activity);
|
||||||
dlg.setTitle(R.string.shared_string_save_as_gpx);
|
dlg.setTitle(R.string.shared_string_save_as_gpx);
|
||||||
dlg.setContentView(R.layout.save_directions_dialog);
|
dlg.setContentView(R.layout.save_directions_dialog);
|
||||||
final EditText edit = (EditText) dlg.findViewById(R.id.FileNameEdit);
|
final EditText edit = (EditText) dlg.findViewById(R.id.FileNameEdit);
|
||||||
|
|
||||||
final GPXRouteParamsBuilder rp = routingHelper.getCurrentGPXRoute();
|
final GPXRouteParamsBuilder rp = routingHelper.getCurrentGPXRoute();
|
||||||
final String editText;
|
final String editText;
|
||||||
if (rp == null || rp.getFile() == null || rp.getFile().path == null) {
|
if (rp == null || rp.getFile() == null || rp.getFile().path == null) {
|
||||||
editText = "_" + MessageFormat.format("{0,date,yyyy-MM-dd}", new Date()) + "_";
|
editText = "_" + MessageFormat.format("{0,date,yyyy-MM-dd}", new Date()) + "_";
|
||||||
} else {
|
} else {
|
||||||
editText = new File(rp.getFile().path).getName();
|
editText = new File(rp.getFile().path).getName();
|
||||||
}
|
}
|
||||||
edit.setText(editText);
|
edit.setText(editText);
|
||||||
|
|
||||||
((Button) dlg.findViewById(R.id.Save)).setOnClickListener(new View.OnClickListener() {
|
((Button) dlg.findViewById(R.id.Save)).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@ -298,20 +298,20 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
((Button) dlg.findViewById(R.id.Cancel)).setOnClickListener(new View.OnClickListener() {
|
((Button) dlg.findViewById(R.id.Cancel)).setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
dlg.dismiss();
|
dlg.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return dlg;
|
return dlg;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class SaveDirectionsAsyncTask extends AsyncTask<File, Void, String> {
|
private static class SaveDirectionsAsyncTask extends AsyncTask<File, Void, String> {
|
||||||
|
|
||||||
private final OsmandApplication app;
|
private final OsmandApplication app;
|
||||||
|
|
||||||
public SaveDirectionsAsyncTask(OsmandApplication app) {
|
public SaveDirectionsAsyncTask(OsmandApplication app) {
|
||||||
|
@ -328,14 +328,14 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPostExecute(String result) {
|
protected void onPostExecute(String result) {
|
||||||
if(result != null){
|
if (result != null) {
|
||||||
AccessibleToast.makeText(app, result, Toast.LENGTH_LONG).show();
|
AccessibleToast.makeText(app, result, Toast.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void contextMenuPoint(final double latitude, final double longitude, final ContextMenuAdapter iadapter, Object selectedObj) {
|
public void contextMenuPoint(final double latitude, final double longitude, final ContextMenuAdapter iadapter, Object selectedObj) {
|
||||||
|
@ -343,9 +343,9 @@ public class MapActivityActions implements DialogProvider {
|
||||||
adapter.item(R.string.context_menu_item_search).iconColor(R.drawable.ic_action_search_dark).reg();
|
adapter.item(R.string.context_menu_item_search).iconColor(R.drawable.ic_action_search_dark).reg();
|
||||||
OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj);
|
OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj);
|
||||||
getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter);
|
getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter);
|
||||||
|
|
||||||
final Builder builder = new AlertDialog.Builder(mapActivity);
|
final AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
|
||||||
final ArrayAdapter<?> listAdapter =
|
final ArrayAdapter<?> listAdapter =
|
||||||
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
|
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
|
||||||
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() {
|
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
@ -368,9 +368,9 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGPXRouteParams(GPXFile result) {
|
public void setGPXRouteParams(GPXFile result) {
|
||||||
if(result == null) {
|
if (result == null) {
|
||||||
mapActivity.getRoutingHelper().setGpxParams(null);
|
mapActivity.getRoutingHelper().setGpxParams(null);
|
||||||
settings.FOLLOW_THE_GPX_ROUTE.set(null);
|
settings.FOLLOW_THE_GPX_ROUTE.set(null);
|
||||||
} else {
|
} else {
|
||||||
GPXRouteParamsBuilder params = new GPXRouteParamsBuilder(result, mapActivity.getMyApplication()
|
GPXRouteParamsBuilder params = new GPXRouteParamsBuilder(result, mapActivity.getMyApplication()
|
||||||
.getSettings());
|
.getSettings());
|
||||||
|
@ -396,7 +396,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void enterRoutePlanningMode(final LatLon from, final PointDescription fromName, boolean useCurrentGPX) {
|
public void enterRoutePlanningMode(final LatLon from, final PointDescription fromName, boolean useCurrentGPX) {
|
||||||
List<SelectedGpxFile> selectedGPXFiles = mapActivity.getMyApplication().getSelectedGpxHelper()
|
List<SelectedGpxFile> selectedGPXFiles = mapActivity.getMyApplication().getSelectedGpxHelper()
|
||||||
.getSelectedGPXFiles();
|
.getSelectedGPXFiles();
|
||||||
|
@ -410,8 +410,8 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gpxFiles.size() > 0 && !useCurrentGPX) {
|
if (gpxFiles.size() > 0 && !useCurrentGPX) {
|
||||||
Builder bld = new AlertDialog.Builder(mapActivity);
|
AlertDialog.Builder bld = new AlertDialog.Builder(mapActivity);
|
||||||
if (gpxFiles.size() == 1){
|
if (gpxFiles.size() == 1) {
|
||||||
bld.setMessage(R.string.use_displayed_track_for_navigation);
|
bld.setMessage(R.string.use_displayed_track_for_navigation);
|
||||||
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -421,15 +421,15 @@ public class MapActivityActions implements DialogProvider {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
bld.setTitle(R.string.navigation_over_track);
|
bld.setTitle(R.string.navigation_over_track);
|
||||||
ArrayAdapter<GPXFile> adapter =new ArrayAdapter<GPXFile>(mapActivity, R.layout.drawer_list_item, gpxFiles){
|
ArrayAdapter<GPXFile> adapter = new ArrayAdapter<GPXFile>(mapActivity, R.layout.drawer_list_item, gpxFiles) {
|
||||||
@Override
|
@Override
|
||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
if (convertView == null){
|
if (convertView == null) {
|
||||||
convertView = mapActivity.getLayoutInflater().inflate(R.layout.drawer_list_item, null);
|
convertView = mapActivity.getLayoutInflater().inflate(R.layout.drawer_list_item, null);
|
||||||
}
|
}
|
||||||
String path = getItem(position).path;
|
String path = getItem(position).path;
|
||||||
String name = path.substring(path.lastIndexOf("/") + 1,path.length());
|
String name = path.substring(path.lastIndexOf("/") + 1, path.length());
|
||||||
((TextView)convertView.findViewById(R.id.title)).setText(name);
|
((TextView) convertView.findViewById(R.id.title)).setText(name);
|
||||||
convertView.findViewById(R.id.icon).setVisibility(View.GONE);
|
convertView.findViewById(R.id.icon).setVisibility(View.GONE);
|
||||||
convertView.findViewById(R.id.check_item).setVisibility(View.GONE);
|
convertView.findViewById(R.id.check_item).setVisibility(View.GONE);
|
||||||
return convertView;
|
return convertView;
|
||||||
|
@ -454,7 +454,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
enterRoutePlanningModeImpl(useCurrentGPX ? gpxFiles.get(0) : null, from, fromName);
|
enterRoutePlanningModeImpl(useCurrentGPX ? gpxFiles.get(0) : null, from, fromName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enterRoutePlanningModeImpl(GPXFile gpxFile, LatLon from, PointDescription fromName) {
|
private void enterRoutePlanningModeImpl(GPXFile gpxFile, LatLon from, PointDescription fromName) {
|
||||||
|
|
||||||
OsmandApplication app = mapActivity.getMyApplication();
|
OsmandApplication app = mapActivity.getMyApplication();
|
||||||
|
@ -474,11 +474,11 @@ public class MapActivityActions implements DialogProvider {
|
||||||
setGPXRouteParams(gpxFile);
|
setGPXRouteParams(gpxFile);
|
||||||
// then update start and destination point
|
// then update start and destination point
|
||||||
targets.updateRouteAndReferesh(true);
|
targets.updateRouteAndReferesh(true);
|
||||||
|
|
||||||
mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode();
|
mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode();
|
||||||
mapActivity.getMapView().refreshMap(true);
|
mapActivity.getMapView().refreshMap(true);
|
||||||
mapActivity.getMapLayers().getMapControlsLayer().showDialog();
|
mapActivity.getMapLayers().getMapControlsLayer().showDialog();
|
||||||
if(targets.hasTooLongDistanceToNavigate()) {
|
if (targets.hasTooLongDistanceToNavigate()) {
|
||||||
app.showToastMessage(R.string.route_is_too_long);
|
app.showToastMessage(R.string.route_is_too_long);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -494,39 +494,39 @@ public class MapActivityActions implements DialogProvider {
|
||||||
from = new LatLon(ll.getLatitude(), ll.getLongitude());
|
from = new LatLon(ll.getLatitude(), ll.getLongitude());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( selected != ApplicationMode.DEFAULT) {
|
if (selected != ApplicationMode.DEFAULT) {
|
||||||
mode = selected;
|
mode = selected;
|
||||||
} else if (mode == ApplicationMode.DEFAULT) {
|
} else if (mode == ApplicationMode.DEFAULT) {
|
||||||
mode = ApplicationMode.CAR;
|
mode = ApplicationMode.CAR;
|
||||||
if(settings.LAST_ROUTING_APPLICATION_MODE != null &&
|
if (settings.LAST_ROUTING_APPLICATION_MODE != null &&
|
||||||
settings.LAST_ROUTING_APPLICATION_MODE != ApplicationMode.DEFAULT) {
|
settings.LAST_ROUTING_APPLICATION_MODE != ApplicationMode.DEFAULT) {
|
||||||
mode = settings.LAST_ROUTING_APPLICATION_MODE;
|
mode = settings.LAST_ROUTING_APPLICATION_MODE;
|
||||||
}
|
}
|
||||||
if(from != null && targets.getPointToNavigate() != null) {
|
if (from != null && targets.getPointToNavigate() != null) {
|
||||||
double dist = MapUtils.getDistance(from, targets.getPointToNavigate().getLatitude(),
|
double dist = MapUtils.getDistance(from, targets.getPointToNavigate().getLatitude(),
|
||||||
targets.getPointToNavigate().getLongitude());
|
targets.getPointToNavigate().getLongitude());
|
||||||
if(dist >= 50000 && mode.isDerivedRoutingFrom(ApplicationMode.PEDESTRIAN)) {
|
if (dist >= 50000 && mode.isDerivedRoutingFrom(ApplicationMode.PEDESTRIAN)) {
|
||||||
mode = ApplicationMode.CAR ;
|
mode = ApplicationMode.CAR;
|
||||||
} else if(dist >= 300000 && mode.isDerivedRoutingFrom(ApplicationMode.BICYCLE)) {
|
} else if (dist >= 300000 && mode.isDerivedRoutingFrom(ApplicationMode.BICYCLE)) {
|
||||||
mode = ApplicationMode.CAR ;
|
mode = ApplicationMode.CAR;
|
||||||
} else if(dist < 2000 && mode.isDerivedRoutingFrom(ApplicationMode.CAR)) {
|
} else if (dist < 2000 && mode.isDerivedRoutingFrom(ApplicationMode.CAR)) {
|
||||||
mode = ApplicationMode.PEDESTRIAN ;
|
mode = ApplicationMode.PEDESTRIAN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return mode;
|
return mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void contextMenuPoint(final double latitude, final double longitude){
|
public void contextMenuPoint(final double latitude, final double longitude) {
|
||||||
contextMenuPoint(latitude, longitude, null, null);
|
contextMenuPoint(latitude, longitude, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createReloadTitleDialog(final Bundle args) {
|
private Dialog createReloadTitleDialog(final Bundle args) {
|
||||||
Builder builder = new AccessibleAlertBuilder(mapActivity);
|
AlertDialog.Builder builder = new AccessibleAlertBuilder(mapActivity);
|
||||||
builder.setMessage(R.string.context_menu_item_update_map_confirm);
|
builder.setMessage(R.string.context_menu_item_update_map_confirm);
|
||||||
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
||||||
final OsmandMapTileView mapView = mapActivity.getMapView();
|
final OsmandMapTileView mapView = mapActivity.getMapView();
|
||||||
builder.setPositiveButton(R.string.context_menu_item_update_map, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.context_menu_item_update_map, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
int zoom = args.getInt(KEY_ZOOM);
|
int zoom = args.getInt(KEY_ZOOM);
|
||||||
|
@ -558,9 +558,8 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return builder.create();
|
return builder.create();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(int id) {
|
public Dialog onCreateDialog(int id) {
|
||||||
|
@ -584,21 +583,21 @@ public class MapActivityActions implements DialogProvider {
|
||||||
public void onPrepareDialog(int id, Dialog dialog) {
|
public void onPrepareDialog(int id, Dialog dialog) {
|
||||||
Bundle args = dialogBundle;
|
Bundle args = dialogBundle;
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case DIALOG_ADD_FAVORITE:
|
case DIALOG_ADD_FAVORITE:
|
||||||
FavoriteDialogs.prepareAddFavouriteDialog(mapActivity, dialog, args,
|
FavoriteDialogs.prepareAddFavouriteDialog(mapActivity, dialog, args,
|
||||||
args.getDouble(KEY_LATITUDE), args.getDouble(KEY_LONGITUDE),
|
args.getDouble(KEY_LATITUDE), args.getDouble(KEY_LONGITUDE),
|
||||||
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, args.getString(KEY_NAME)));
|
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, args.getString(KEY_NAME)));
|
||||||
break;
|
break;
|
||||||
case DIALOG_ADD_WAYPOINT:
|
case DIALOG_ADD_WAYPOINT:
|
||||||
EditText v = (EditText) dialog.getWindow().findViewById(android.R.id.edit);
|
EditText v = (EditText) dialog.getWindow().findViewById(android.R.id.edit);
|
||||||
v.setPadding(5, 0, 5, 0);
|
v.setPadding(5, 0, 5, 0);
|
||||||
if(args.getString(KEY_NAME) != null) {
|
if (args.getString(KEY_NAME) != null) {
|
||||||
v.setText(args.getString(KEY_NAME));
|
v.setText(args.getString(KEY_NAME));
|
||||||
v.selectAll();
|
v.selectAll();
|
||||||
} else {
|
} else {
|
||||||
v.setText("");
|
v.setText("");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +649,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
LatLon loc = mapActivity.getMapLocation();
|
LatLon loc = mapActivity.getMapLocation();
|
||||||
newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
|
newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
|
||||||
newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
|
newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
|
||||||
if(mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation()) {
|
if (mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation()) {
|
||||||
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
|
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
|
||||||
}
|
}
|
||||||
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
@ -670,7 +669,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}).reg();
|
}).reg();
|
||||||
|
|
||||||
|
|
||||||
optionsMenuHelper.item(R.string.show_point_options).iconColor(R.drawable.ic_action_marker_dark)
|
optionsMenuHelper.item(R.string.show_point_options).iconColor(R.drawable.ic_action_marker_dark)
|
||||||
.listen(new OnContextMenuClick() {
|
.listen(new OnContextMenuClick() {
|
||||||
|
@ -699,10 +698,10 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
}).reg();
|
}).reg();
|
||||||
String d = getString(R.string.index_settings);
|
String d = getString(R.string.index_settings);
|
||||||
if(app.getDownloadThread().getIndexes().isDownloadedFromInternet) {
|
if (app.getDownloadThread().getIndexes().isDownloadedFromInternet) {
|
||||||
List<IndexItem> updt = app.getDownloadThread().getIndexes().getItemsToUpdate();
|
List<IndexItem> updt = app.getDownloadThread().getIndexes().getItemsToUpdate();
|
||||||
if(updt != null && updt.size() > 0) {
|
if (updt != null && updt.size() > 0) {
|
||||||
d += " ("+updt.size()+")";
|
d += " (" + updt.size() + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
optionsMenuHelper.item(R.string.index_settings).name(d).iconColor(R.drawable.ic_type_archive)
|
optionsMenuHelper.item(R.string.index_settings).name(d).iconColor(R.drawable.ic_type_archive)
|
||||||
|
@ -716,7 +715,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}).reg();
|
}).reg();
|
||||||
|
|
||||||
|
|
||||||
optionsMenuHelper.item(R.string.prefs_plugins).iconColor(R.drawable.ic_extension_dark)
|
optionsMenuHelper.item(R.string.prefs_plugins).iconColor(R.drawable.ic_extension_dark)
|
||||||
.listen(new OnContextMenuClick() {
|
.listen(new OnContextMenuClick() {
|
||||||
|
@ -729,7 +728,7 @@ public class MapActivityActions implements DialogProvider {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}).reg();
|
}).reg();
|
||||||
|
|
||||||
|
|
||||||
optionsMenuHelper.item(R.string.shared_string_settings).iconColor(R.drawable.ic_action_settings)
|
optionsMenuHelper.item(R.string.shared_string_settings).iconColor(R.drawable.ic_action_settings)
|
||||||
.listen(new OnContextMenuClick() {
|
.listen(new OnContextMenuClick() {
|
||||||
|
@ -742,17 +741,17 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
}).reg();
|
}).reg();
|
||||||
optionsMenuHelper.item(R.string.shared_string_help).iconColor(R.drawable.ic_action_help)
|
optionsMenuHelper.item(R.string.shared_string_help).iconColor(R.drawable.ic_action_help)
|
||||||
.listen(new OnContextMenuClick() {
|
.listen(new OnContextMenuClick() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
|
||||||
mapActivity.startActivity(new Intent(mapActivity, HelpActivity.class));
|
mapActivity.startActivity(new Intent(mapActivity, HelpActivity.class));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}).reg();
|
}).reg();
|
||||||
|
|
||||||
//////////// Others
|
//////////// Others
|
||||||
OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper);
|
OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper);
|
||||||
|
|
||||||
// optionsMenuHelper.item(R.string.shared_string_exit).iconColor(R.drawable.ic_action_quit_dark )
|
// optionsMenuHelper.item(R.string.shared_string_exit).iconColor(R.drawable.ic_action_quit_dark )
|
||||||
// .listen(new OnContextMenuClick() {
|
// .listen(new OnContextMenuClick() {
|
||||||
// @Override
|
// @Override
|
||||||
|
@ -773,21 +772,21 @@ public class MapActivityActions implements DialogProvider {
|
||||||
return optionsMenuHelper;
|
return optionsMenuHelper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void openIntermediatePointsDialog(){
|
public void openIntermediatePointsDialog() {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void openIntermediateEditPointsDialog(){
|
public void openIntermediateEditPointsDialog() {
|
||||||
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
|
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TargetPointsHelper getTargets() {
|
private TargetPointsHelper getTargets() {
|
||||||
return mapActivity.getMyApplication().getTargetPointsHelper();
|
return mapActivity.getMyApplication().getTargetPointsHelper();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopNavigationWithoutConfirm() {
|
public void stopNavigationWithoutConfirm() {
|
||||||
if(getMyApplication().getLocationProvider().getLocationSimulation().isRouteAnimating()) {
|
if (getMyApplication().getLocationProvider().getLocationSimulation().isRouteAnimating()) {
|
||||||
getMyApplication().getLocationProvider().getLocationSimulation().startStopRouteAnimation(mapActivity);
|
getMyApplication().getLocationProvider().getLocationSimulation().startStopRouteAnimation(mapActivity);
|
||||||
}
|
}
|
||||||
routingHelper.getVoiceRouter().interruptRouteCommands();
|
routingHelper.getVoiceRouter().interruptRouteCommands();
|
||||||
|
@ -797,9 +796,9 @@ public class MapActivityActions implements DialogProvider {
|
||||||
settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get());
|
settings.APPLICATION_MODE.set(settings.DEFAULT_APPLICATION_MODE.get());
|
||||||
mapActivity.updateApplicationModeSettings();
|
mapActivity.updateApplicationModeSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public AlertDialog stopNavigationActionConfirm() {
|
public AlertDialog stopNavigationActionConfirm() {
|
||||||
Builder builder = new AlertDialog.Builder(mapActivity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
|
||||||
// Stop the navigation
|
// Stop the navigation
|
||||||
builder.setTitle(getString(R.string.cancel_route));
|
builder.setTitle(getString(R.string.cancel_route));
|
||||||
builder.setMessage(getString(R.string.stop_routing_confirm));
|
builder.setMessage(getString(R.string.stop_routing_confirm));
|
||||||
|
@ -812,9 +811,8 @@ public class MapActivityActions implements DialogProvider {
|
||||||
builder.setNegativeButton(R.string.shared_string_no, null);
|
builder.setNegativeButton(R.string.shared_string_no, null);
|
||||||
return builder.show();
|
return builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void whereAmIDialog() {
|
public void whereAmIDialog() {
|
||||||
final List<String> items = new ArrayList<String>();
|
final List<String> items = new ArrayList<String>();
|
||||||
items.add(getString(R.string.show_location));
|
items.add(getString(R.string.show_location));
|
||||||
|
@ -825,30 +823,27 @@ public class MapActivityActions implements DialogProvider {
|
||||||
public void onClick(DialogInterface dialog, int item) {
|
public void onClick(DialogInterface dialog, int item) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
switch (item) {
|
switch (item) {
|
||||||
case 0:
|
case 0:
|
||||||
mapActivity.getMapViewTrackingUtilities().backToLocationImpl();
|
mapActivity.getMapViewTrackingUtilities().backToLocationImpl();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
OsmAndLocationProvider locationProvider = getMyApplication().getLocationProvider();
|
OsmAndLocationProvider locationProvider = getMyApplication().getLocationProvider();
|
||||||
locationProvider.showNavigationInfo(mapActivity.getPointToNavigate(), mapActivity);
|
locationProvider.showNavigationInfo(mapActivity.getPointToNavigate(), mapActivity);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
menu.show();
|
menu.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void showObjectContextMenu(final ContextMenuAdapter qa, final Activity activity,
|
public static void showObjectContextMenu(final ContextMenuAdapter qa, final Activity activity,
|
||||||
final OnClickListener onShow) {
|
final OnClickListener onShow) {
|
||||||
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
OsmandApplication app = (OsmandApplication) activity.getApplication();
|
||||||
if(app.accessibilityEnabled()) {
|
if (app.accessibilityEnabled()) {
|
||||||
Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
String[] values = qa.getItemNames();
|
String[] values = qa.getItemNames();
|
||||||
builder.setItems(values, new DialogInterface.OnClickListener() {
|
builder.setItems(values, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -910,5 +905,5 @@ public class MapActivityActions implements DialogProvider {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,10 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.util.OpeningHoursParser.BasicOpeningHourRule;
|
|
||||||
import net.osmand.util.OpeningHoursParser.OpeningHoursRule;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -26,6 +16,16 @@ import android.widget.TextView;
|
||||||
import android.widget.TimePicker;
|
import android.widget.TimePicker;
|
||||||
import android.widget.TimePicker.OnTimeChangedListener;
|
import android.widget.TimePicker.OnTimeChangedListener;
|
||||||
|
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.util.OpeningHoursParser.BasicOpeningHourRule;
|
||||||
|
import net.osmand.util.OpeningHoursParser.OpeningHoursRule;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class OpeningHoursView {
|
public class OpeningHoursView {
|
||||||
|
|
||||||
private final Context ctx;
|
private final Context ctx;
|
||||||
|
@ -160,7 +160,7 @@ public class OpeningHoursView {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showDaysDialog(final BasicOpeningHourRule item, final int positionToAdd) {
|
public void showDaysDialog(final BasicOpeningHourRule item, final int positionToAdd) {
|
||||||
Builder b = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder b = new AlertDialog.Builder(ctx);
|
||||||
|
|
||||||
boolean add = positionToAdd > -1;
|
boolean add = positionToAdd > -1;
|
||||||
Calendar inst = Calendar.getInstance();
|
Calendar inst = Calendar.getInstance();
|
||||||
|
|
|
@ -1,13 +1,25 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import android.content.Context;
|
||||||
import java.util.ArrayList;
|
import android.content.DialogInterface;
|
||||||
import java.util.LinkedHashMap;
|
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
||||||
import java.util.LinkedHashSet;
|
import android.os.Bundle;
|
||||||
import java.util.List;
|
import android.preference.CheckBoxPreference;
|
||||||
import java.util.Map;
|
import android.preference.EditTextPreference;
|
||||||
import java.util.Map.Entry;
|
import android.preference.ListPreference;
|
||||||
import java.util.Set;
|
import android.preference.Preference;
|
||||||
|
import android.preference.Preference.OnPreferenceChangeListener;
|
||||||
|
import android.preference.Preference.OnPreferenceClickListener;
|
||||||
|
import android.preference.PreferenceGroup;
|
||||||
|
import android.preference.PreferenceScreen;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.plus.ApplicationMode;
|
import net.osmand.plus.ApplicationMode;
|
||||||
|
@ -18,28 +30,15 @@ import net.osmand.plus.OsmandSettings.OsmandPreference;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.activities.actions.AppModeDialog;
|
import net.osmand.plus.activities.actions.AppModeDialog;
|
||||||
import net.osmand.plus.views.SeekBarPreference;
|
import net.osmand.plus.views.SeekBarPreference;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
import java.lang.reflect.Field;
|
||||||
import android.content.Context;
|
import java.util.ArrayList;
|
||||||
import android.content.DialogInterface;
|
import java.util.LinkedHashMap;
|
||||||
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
import java.util.LinkedHashSet;
|
||||||
import android.graphics.Color;
|
import java.util.List;
|
||||||
import android.os.Bundle;
|
import java.util.Map;
|
||||||
import android.preference.CheckBoxPreference;
|
import java.util.Map.Entry;
|
||||||
import android.preference.EditTextPreference;
|
import java.util.Set;
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.preference.Preference;
|
|
||||||
import android.preference.Preference.OnPreferenceChangeListener;
|
|
||||||
import android.preference.Preference.OnPreferenceClickListener;
|
|
||||||
import android.preference.PreferenceGroup;
|
|
||||||
import android.preference.PreferenceScreen;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
|
|
||||||
public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
|
public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
|
||||||
|
@ -399,7 +398,7 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void profileDialog() {
|
protected void profileDialog() {
|
||||||
Builder b = new AlertDialog.Builder(this);
|
AlertDialog.Builder b = new AlertDialog.Builder(this);
|
||||||
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>();
|
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>();
|
||||||
View v = AppModeDialog.prepareAppModeView(this, selected, false, null, true,
|
View v = AppModeDialog.prepareAppModeView(this, selected, false, null, true,
|
||||||
new View.OnClickListener() {
|
new View.OnClickListener() {
|
||||||
|
@ -538,7 +537,7 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
|
||||||
|
|
||||||
|
|
||||||
public void showBooleanSettings(String[] vals, final OsmandPreference<Boolean>[] prefs) {
|
public void showBooleanSettings(String[] vals, final OsmandPreference<Boolean>[] prefs) {
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
boolean[] checkedItems = new boolean[prefs.length];
|
boolean[] checkedItems = new boolean[prefs.length];
|
||||||
for (int i = 0; i < prefs.length; i++) {
|
for (int i = 0; i < prefs.length; i++) {
|
||||||
checkedItems[i] = prefs[i].get();
|
checkedItems[i] = prefs[i].get();
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
|
@ -21,9 +19,11 @@ import android.preference.Preference.OnPreferenceChangeListener;
|
||||||
import android.preference.Preference.OnPreferenceClickListener;
|
import android.preference.Preference.OnPreferenceClickListener;
|
||||||
import android.preference.PreferenceGroup;
|
import android.preference.PreferenceGroup;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.IProgress;
|
import net.osmand.IProgress;
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
|
@ -62,7 +62,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
((OsmandApplication) getApplication()).applyTheme(this);
|
((OsmandApplication) getApplication()).applyTheme(this);
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
getToolbar().setTitle(R.string.global_app_settings);
|
getToolbar().setTitle(R.string.global_app_settings);
|
||||||
|
@ -73,10 +73,9 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
settings = getMyApplication().getSettings();
|
settings = getMyApplication().getSettings();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ApplicationMode[] appModes = ApplicationMode.values(settings).toArray(new ApplicationMode[0]);
|
ApplicationMode[] appModes = ApplicationMode.values(settings).toArray(new ApplicationMode[0]);
|
||||||
entries = new String[appModes.length];
|
entries = new String[appModes.length];
|
||||||
for(int i=0; i<entries.length; i++){
|
for (int i = 0; i < entries.length; i++) {
|
||||||
entries[i] = appModes[i].toHumanString(getMyApplication());
|
entries[i] = appModes[i].toHumanString(getMyApplication());
|
||||||
}
|
}
|
||||||
registerListPreference(settings.APPLICATION_MODE, screen, entries, appModes);
|
registerListPreference(settings.APPLICATION_MODE, screen, entries, appModes);
|
||||||
|
@ -87,8 +86,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
new Integer[]{OsmandSettings.ROTATE_MAP_NONE, OsmandSettings.ROTATE_MAP_BEARING, OsmandSettings.ROTATE_MAP_COMPASS});
|
new Integer[]{OsmandSettings.ROTATE_MAP_NONE, OsmandSettings.ROTATE_MAP_BEARING, OsmandSettings.ROTATE_MAP_COMPASS});
|
||||||
|
|
||||||
registerListPreference(settings.MAP_SCREEN_ORIENTATION, screen,
|
registerListPreference(settings.MAP_SCREEN_ORIENTATION, screen,
|
||||||
new String[] {getString(R.string.map_orientation_portrait), getString(R.string.map_orientation_landscape), getString(R.string.map_orientation_default)},
|
new String[]{getString(R.string.map_orientation_portrait), getString(R.string.map_orientation_landscape), getString(R.string.map_orientation_default)},
|
||||||
new Integer[] {ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED});
|
new Integer[]{ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED});
|
||||||
|
|
||||||
addLocalPrefs((PreferenceGroup) screen.findPreference("localization"));
|
addLocalPrefs((PreferenceGroup) screen.findPreference("localization"));
|
||||||
addVoicePrefs((PreferenceGroup) screen.findPreference("voice"));
|
addVoicePrefs((PreferenceGroup) screen.findPreference("voice"));
|
||||||
|
@ -99,17 +98,16 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
applicationModePreference = (ListPreference) screen.findPreference(settings.APPLICATION_MODE.getId());
|
applicationModePreference = (ListPreference) screen.findPreference(settings.APPLICATION_MODE.getId());
|
||||||
applicationModePreference.setOnPreferenceChangeListener(this);
|
applicationModePreference.setOnPreferenceChangeListener(this);
|
||||||
drivingRegionPreference = (ListPreference) screen.findPreference(settings.DRIVING_REGION.getId());
|
drivingRegionPreference = (ListPreference) screen.findPreference(settings.DRIVING_REGION.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void addVoicePrefs(PreferenceGroup cat) {
|
private void addVoicePrefs(PreferenceGroup cat) {
|
||||||
if (!Version.isBlackberry((OsmandApplication) getApplication())) {
|
if (!Version.isBlackberry((OsmandApplication) getApplication())) {
|
||||||
ListPreference lp = createListPreference(
|
ListPreference lp = createListPreference(
|
||||||
settings.AUDIO_STREAM_GUIDANCE,
|
settings.AUDIO_STREAM_GUIDANCE,
|
||||||
new String[] { getString(R.string.voice_stream_music), getString(R.string.voice_stream_notification),
|
new String[]{getString(R.string.voice_stream_music), getString(R.string.voice_stream_notification),
|
||||||
getString(R.string.voice_stream_voice_call) }, new Integer[] { AudioManager.STREAM_MUSIC,
|
getString(R.string.voice_stream_voice_call)}, new Integer[]{AudioManager.STREAM_MUSIC,
|
||||||
AudioManager.STREAM_NOTIFICATION, AudioManager.STREAM_VOICE_CALL }, R.string.choose_audio_stream,
|
AudioManager.STREAM_NOTIFICATION, AudioManager.STREAM_VOICE_CALL}, R.string.choose_audio_stream,
|
||||||
R.string.choose_audio_stream_descr);
|
R.string.choose_audio_stream_descr);
|
||||||
final OnPreferenceChangeListener prev = lp.getOnPreferenceChangeListener();
|
final OnPreferenceChangeListener prev = lp.getOnPreferenceChangeListener();
|
||||||
lp.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
lp.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
|
||||||
|
@ -131,21 +129,20 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void addLocalPrefs(PreferenceGroup screen) {
|
private void addLocalPrefs(PreferenceGroup screen) {
|
||||||
String[] entries;
|
String[] entries;
|
||||||
String[] entrieValues;
|
String[] entrieValues;
|
||||||
|
|
||||||
DrivingRegion[] drs = DrivingRegion.values();
|
DrivingRegion[] drs = DrivingRegion.values();
|
||||||
entries = new String[drs.length];
|
entries = new String[drs.length];
|
||||||
for (int i = 0; i < entries.length; i++) {
|
for (int i = 0; i < entries.length; i++) {
|
||||||
entries[i] = getString(drs[i].name); // + " (" + drs[i].defMetrics.toHumanString(this) +")" ;
|
entries[i] = getString(drs[i].name); // + " (" + drs[i].defMetrics.toHumanString(this) +")" ;
|
||||||
}
|
}
|
||||||
registerListPreference(settings.DRIVING_REGION, screen, entries, drs);
|
registerListPreference(settings.DRIVING_REGION, screen, entries, drs);
|
||||||
|
|
||||||
MetricsConstants[] mvls = MetricsConstants.values();
|
MetricsConstants[] mvls = MetricsConstants.values();
|
||||||
entries = new String[mvls.length];
|
entries = new String[mvls.length];
|
||||||
for(int i=0; i<entries.length; i++){
|
for (int i = 0; i < entries.length; i++) {
|
||||||
entries[i] = mvls[i].toHumanString(getMyApplication());
|
entries[i] = mvls[i].toHumanString(getMyApplication());
|
||||||
}
|
}
|
||||||
registerListPreference(settings.METRIC_SYSTEM, screen, entries, mvls);
|
registerListPreference(settings.METRIC_SYSTEM, screen, entries, mvls);
|
||||||
|
@ -156,7 +153,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
String latinSystemDefaultSuffix = " (" + getString(R.string.system_locale_no_translate) + ")";
|
String latinSystemDefaultSuffix = " (" + getString(R.string.system_locale_no_translate) + ")";
|
||||||
|
|
||||||
//getResources().getAssets().getLocales();
|
//getResources().getAssets().getLocales();
|
||||||
entrieValues = new String[] { "",
|
entrieValues = new String[]{"",
|
||||||
"en",
|
"en",
|
||||||
"af",
|
"af",
|
||||||
"al",
|
"al",
|
||||||
|
@ -204,7 +201,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
"uk",
|
"uk",
|
||||||
"vi",
|
"vi",
|
||||||
"cy"};
|
"cy"};
|
||||||
entries = new String[] { getString(R.string.system_locale) + latinSystemDefaultSuffix,
|
entries = new String[]{getString(R.string.system_locale) + latinSystemDefaultSuffix,
|
||||||
getString(R.string.lang_en),
|
getString(R.string.lang_en),
|
||||||
getString(R.string.lang_af) + incompleteSuffix,
|
getString(R.string.lang_af) + incompleteSuffix,
|
||||||
getString(R.string.lang_al) + incompleteSuffix,
|
getString(R.string.lang_al) + incompleteSuffix,
|
||||||
|
@ -257,7 +254,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
if (!getResources().getString(R.string.preferred_locale).equals(getResources().getString(R.string.preferred_locale_no_translate))) {
|
if (!getResources().getString(R.string.preferred_locale).equals(getResources().getString(R.string.preferred_locale_no_translate))) {
|
||||||
((ListPreference) screen.findPreference(settings.PREFERRED_LOCALE.getId())).setTitle(getString(R.string.preferred_locale) + " (" + getString(R.string.preferred_locale_no_translate) + ")");
|
((ListPreference) screen.findPreference(settings.PREFERRED_LOCALE.getId())).setTitle(getString(R.string.preferred_locale) + " (" + getString(R.string.preferred_locale_no_translate) + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
registerListPreference(settings.MAP_PREFERRED_LOCALE, screen, ConfigureMapMenu.getMapNamesValues(this), ConfigureMapMenu.mapNamesIds);
|
registerListPreference(settings.MAP_PREFERRED_LOCALE, screen, ConfigureMapMenu.getMapNamesValues(this), ConfigureMapMenu.mapNamesIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,18 +306,18 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void showAppDirDialog(){
|
public void showAppDirDialog() {
|
||||||
if(Build.VERSION.SDK_INT >= 19) {
|
if (Build.VERSION.SDK_INT >= 19) {
|
||||||
showAppDirDialogV19();
|
showAppDirDialogV19();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AlertDialog.Builder editalert = new AlertDialog.Builder(SettingsGeneralActivity.this);
|
AlertDialog.Builder editalert = new AlertDialog.Builder(SettingsGeneralActivity.this);
|
||||||
editalert.setTitle(R.string.application_dir);
|
editalert.setTitle(R.string.application_dir);
|
||||||
final EditText input = new EditText(SettingsGeneralActivity.this);
|
final EditText input = new EditText(SettingsGeneralActivity.this);
|
||||||
input.setText(settings.getExternalStorageDirectory().getAbsolutePath());
|
input.setText(settings.getExternalStorageDirectory().getAbsolutePath());
|
||||||
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
|
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT);
|
LinearLayout.LayoutParams.MATCH_PARENT);
|
||||||
lp.leftMargin = lp.rightMargin = 5;
|
lp.leftMargin = lp.rightMargin = 5;
|
||||||
lp.bottomMargin = lp.topMargin = 5;
|
lp.bottomMargin = lp.topMargin = 5;
|
||||||
input.setLayoutParams(lp);
|
input.setLayoutParams(lp);
|
||||||
|
@ -328,16 +325,16 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
editalert.setView(input);
|
editalert.setView(input);
|
||||||
editalert.setNegativeButton(R.string.shared_string_cancel, null);
|
editalert.setNegativeButton(R.string.shared_string_cancel, null);
|
||||||
editalert.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
editalert.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int whichButton) {
|
public void onClick(DialogInterface dialog, int whichButton) {
|
||||||
warnAboutChangingStorage(input.getText().toString());
|
warnAboutChangingStorage(input.getText().toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
editalert.show();
|
editalert.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showAppDirDialogV19() {
|
private void showAppDirDialogV19() {
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
ChooseAppDirFragment frg = new DashChooseAppDirFragment.ChooseAppDirFragment(this, (Dialog) null);
|
ChooseAppDirFragment frg = new DashChooseAppDirFragment.ChooseAppDirFragment(this, (Dialog) null);
|
||||||
bld.setView(frg.initView(getLayoutInflater(), null, null));
|
bld.setView(frg.initView(getLayoutInflater(), null, null));
|
||||||
AlertDialog dlg = bld.show();
|
AlertDialog dlg = bld.show();
|
||||||
|
@ -345,7 +342,6 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void addMiscPreferences(PreferenceGroup misc) {
|
private void addMiscPreferences(PreferenceGroup misc) {
|
||||||
if (!Version.isBlackberry(getMyApplication())) {
|
if (!Version.isBlackberry(getMyApplication())) {
|
||||||
applicationDir = new Preference(this);
|
applicationDir = new Preference(this);
|
||||||
|
@ -380,7 +376,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
|
|
||||||
registerListPreference(
|
registerListPreference(
|
||||||
settings.OSMAND_THEME, misc,
|
settings.OSMAND_THEME, misc,
|
||||||
new String[] { getString(R.string.dark_theme), getString(R.string.light_theme) }, new Integer[] { OsmandSettings.OSMAND_DARK_THEME,
|
new String[]{getString(R.string.dark_theme), getString(R.string.light_theme)}, new Integer[]{OsmandSettings.OSMAND_DARK_THEME,
|
||||||
OsmandSettings.OSMAND_LIGHT_THEME});
|
OsmandSettings.OSMAND_LIGHT_THEME});
|
||||||
|
|
||||||
misc.addPreference(createCheckBoxPreference(settings.USE_KALMAN_FILTER_FOR_COMPASS, R.string.use_kalman_filter_compass, R.string.use_kalman_filter_compass_descr));
|
misc.addPreference(createCheckBoxPreference(settings.USE_KALMAN_FILTER_FOR_COMPASS, R.string.use_kalman_filter_compass, R.string.use_kalman_filter_compass_descr));
|
||||||
|
@ -388,9 +384,8 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void updateApplicationDirTextAndSummary() {
|
private void updateApplicationDirTextAndSummary() {
|
||||||
if(applicationDir != null) {
|
if (applicationDir != null) {
|
||||||
String storageDir = settings.getExternalStorageDirectory().getAbsolutePath();
|
String storageDir = settings.getExternalStorageDirectory().getAbsolutePath();
|
||||||
applicationDir.setSummary(storageDir);
|
applicationDir.setSummary(storageDir);
|
||||||
}
|
}
|
||||||
|
@ -445,15 +440,14 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void restartApp() {
|
private void restartApp() {
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
bld.setMessage(R.string.restart_is_required);
|
bld.setMessage(R.string.restart_is_required);
|
||||||
bld.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
android.os.Process.killProcess(android.os.Process.myPid());
|
android.os.Process.killProcess(android.os.Process.myPid());
|
||||||
// Intent intent = getIntent();
|
// Intent intent = getIntent();
|
||||||
// finish();
|
// finish();
|
||||||
// startActivity(intent);
|
// startActivity(intent);
|
||||||
|
@ -463,12 +457,11 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private void warnAboutChangingStorage(final String newValue) {
|
private void warnAboutChangingStorage(final String newValue) {
|
||||||
String newDir = newValue != null ? newValue.trim() : newValue;
|
String newDir = newValue != null ? newValue.trim() : newValue;
|
||||||
if(!newDir.replace('/', ' ').trim().
|
if (!newDir.replace('/', ' ').trim().
|
||||||
toLowerCase().endsWith(IndexConstants.APP_DIR.replace('/', ' ').trim())) {
|
toLowerCase().endsWith(IndexConstants.APP_DIR.replace('/', ' ').trim())) {
|
||||||
newDir += "/" +IndexConstants.APP_DIR;
|
newDir += "/" + IndexConstants.APP_DIR;
|
||||||
}
|
}
|
||||||
final File path = new File(newDir);
|
final File path = new File(newDir);
|
||||||
path.mkdirs();
|
path.mkdirs();
|
||||||
|
@ -476,14 +469,14 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
AccessibleToast.makeText(this, R.string.specified_dir_doesnt_exist, Toast.LENGTH_LONG).show();
|
AccessibleToast.makeText(this, R.string.specified_dir_doesnt_exist, Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setMessage(getString(R.string.application_dir_change_warning3));
|
builder.setMessage(getString(R.string.application_dir_change_warning3));
|
||||||
builder.setPositiveButton(R.string.shared_string_yes, new OnClickListener() {
|
builder.setPositiveButton(R.string.shared_string_yes, new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
MoveFilesToDifferentDirectory task =
|
MoveFilesToDifferentDirectory task =
|
||||||
new MoveFilesToDifferentDirectory(SettingsGeneralActivity.this,
|
new MoveFilesToDifferentDirectory(SettingsGeneralActivity.this,
|
||||||
settings.getExternalStorageDirectory(), path);
|
settings.getExternalStorageDirectory(), path);
|
||||||
task.setRunOnSuccess(new Runnable() {
|
task.setRunOnSuccess(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -515,7 +508,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
public void reloadIndexes() {
|
public void reloadIndexes() {
|
||||||
setProgressVisibility(true);
|
setProgressVisibility(true);
|
||||||
final CharSequence oldTitle = getToolbar().getTitle();
|
final CharSequence oldTitle = getToolbar().getTitle();
|
||||||
getToolbar(). setTitle(getString(R.string.loading_data));
|
getToolbar().setTitle(getString(R.string.loading_data));
|
||||||
getToolbar().setSubtitle(getString(R.string.reading_indexes));
|
getToolbar().setSubtitle(getString(R.string.reading_indexes));
|
||||||
new AsyncTask<Void, Void, List<String>>() {
|
new AsyncTask<Void, Void, List<String>>() {
|
||||||
|
|
||||||
|
@ -597,7 +590,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
entrieValues[k] = OsmandSettings.VOICE_PROVIDER_NOT_USE;
|
entrieValues[k] = OsmandSettings.VOICE_PROVIDER_NOT_USE;
|
||||||
entries[k++] = getString(R.string.shared_string_do_not_use);
|
entries[k++] = getString(R.string.shared_string_do_not_use);
|
||||||
for (String s : voiceFiles) {
|
for (String s : voiceFiles) {
|
||||||
entries[k] = (s.contains("tts") ? getString(R.string.ttsvoice) +" ":"") +
|
entries[k] = (s.contains("tts") ? getString(R.string.ttsvoice) + " " : "") +
|
||||||
FileNameTranslationHelper.getVoiceName(this, s);
|
FileNameTranslationHelper.getVoiceName(this, s);
|
||||||
entrieValues[k] = s;
|
entrieValues[k] = s;
|
||||||
k++;
|
k++;
|
||||||
|
@ -621,6 +614,6 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
return setFiles;
|
return setFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,18 @@
|
||||||
package net.osmand.plus.activities;
|
package net.osmand.plus.activities;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import android.app.admin.DevicePolicyManager;
|
||||||
import java.util.List;
|
import android.content.ComponentName;
|
||||||
import java.util.Map;
|
import android.content.DialogInterface;
|
||||||
|
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.preference.CheckBoxPreference;
|
||||||
|
import android.preference.ListPreference;
|
||||||
|
import android.preference.Preference;
|
||||||
|
import android.preference.PreferenceCategory;
|
||||||
|
import android.preference.PreferenceScreen;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.plus.ApplicationMode;
|
import net.osmand.plus.ApplicationMode;
|
||||||
import net.osmand.plus.DeviceAdminRecv;
|
import net.osmand.plus.DeviceAdminRecv;
|
||||||
|
@ -18,19 +27,10 @@ import net.osmand.plus.routing.RouteProvider.RouteService;
|
||||||
import net.osmand.router.GeneralRouter;
|
import net.osmand.router.GeneralRouter;
|
||||||
import net.osmand.router.GeneralRouter.RoutingParameter;
|
import net.osmand.router.GeneralRouter.RoutingParameter;
|
||||||
import net.osmand.router.GeneralRouter.RoutingParameterType;
|
import net.osmand.router.GeneralRouter.RoutingParameterType;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
import java.util.ArrayList;
|
||||||
import android.app.admin.DevicePolicyManager;
|
import java.util.List;
|
||||||
import android.content.ComponentName;
|
import java.util.Map;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.DialogInterface.OnMultiChoiceClickListener;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.CheckBoxPreference;
|
|
||||||
import android.preference.ListPreference;
|
|
||||||
import android.preference.Preference;
|
|
||||||
import android.preference.PreferenceCategory;
|
|
||||||
import android.preference.PreferenceScreen;
|
|
||||||
|
|
||||||
public class SettingsNavigationActivity extends SettingsBaseActivity {
|
public class SettingsNavigationActivity extends SettingsBaseActivity {
|
||||||
|
|
||||||
|
@ -391,7 +391,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void confirmSpeedCamerasDlg() {
|
private void confirmSpeedCamerasDlg() {
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
bld.setMessage(R.string.confirm_usage_speed_cameras);
|
bld.setMessage(R.string.confirm_usage_speed_cameras);
|
||||||
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
@ -405,7 +405,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public AlertDialog showBooleanSettings(String[] vals, final OsmandPreference<Boolean>[] prefs, final CharSequence title) {
|
public AlertDialog showBooleanSettings(String[] vals, final OsmandPreference<Boolean>[] prefs, final CharSequence title) {
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
boolean[] checkedItems = new boolean[prefs.length];
|
boolean[] checkedItems = new boolean[prefs.length];
|
||||||
for (int i = 0; i < prefs.length; i++) {
|
for (int i = 0; i < prefs.length; i++) {
|
||||||
checkedItems[i] = prefs[i].get();
|
checkedItems[i] = prefs[i].get();
|
||||||
|
|
|
@ -1,15 +1,6 @@
|
||||||
package net.osmand.plus.activities.actions;
|
package net.osmand.plus.activities.actions;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import net.osmand.access.AccessibleAlertBuilder;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.Version;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -18,10 +9,19 @@ import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.ClipboardManager;
|
import android.text.ClipboardManager;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.access.AccessibleAlertBuilder;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.Version;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class ShareDialog {
|
public class ShareDialog {
|
||||||
|
|
||||||
private Activity a;
|
private Activity a;
|
||||||
|
@ -113,7 +113,7 @@ public class ShareDialog {
|
||||||
if(type == ACTION) {
|
if(type == ACTION) {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
} else if(type == VIEW) {
|
} else if(type == VIEW) {
|
||||||
Builder bld = new AlertDialog.Builder(a);
|
AlertDialog.Builder bld = new AlertDialog.Builder(a);
|
||||||
bld.setTitle(title);
|
bld.setTitle(title);
|
||||||
bld.setMessage(content);
|
bld.setMessage(content);
|
||||||
bld.show();
|
bld.show();
|
||||||
|
@ -131,7 +131,7 @@ public class ShareDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showDialog() {
|
public void showDialog() {
|
||||||
AlertDialog.Builder builder = new Builder(a);
|
AlertDialog.Builder builder = new AlertDialog.Builder(a);
|
||||||
builder.setTitle(title);
|
builder.setTitle(title);
|
||||||
String[] shareStrings = new String[share.size()];
|
String[] shareStrings = new String[share.size()];
|
||||||
for(int i = 0; i < shareStrings.length; i++) {
|
for(int i = 0; i < shareStrings.length; i++) {
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
package net.osmand.plus.activities.actions;
|
package net.osmand.plus.activities.actions;
|
||||||
|
|
||||||
import net.osmand.access.AccessibleAlertBuilder;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.Version;
|
|
||||||
import net.osmand.plus.activities.MapActivity;
|
|
||||||
import net.osmand.plus.views.OsmandMapTileView;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -16,6 +10,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
|
@ -28,6 +23,12 @@ import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.access.AccessibleAlertBuilder;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.Version;
|
||||||
|
import net.osmand.plus.activities.MapActivity;
|
||||||
|
import net.osmand.plus.views.OsmandMapTileView;
|
||||||
|
|
||||||
public class StartGPSStatus extends OsmAndAction {
|
public class StartGPSStatus extends OsmAndAction {
|
||||||
|
|
||||||
public enum GpsStatusApps {
|
public enum GpsStatusApps {
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
package net.osmand.plus.activities.search;
|
package net.osmand.plus.activities.search;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.widget.PopupMenu;
|
import android.support.v7.widget.PopupMenu;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -36,7 +35,6 @@ import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.activities.OsmAndListFragment;
|
import net.osmand.plus.activities.OsmAndListFragment;
|
||||||
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
|
import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild;
|
||||||
import net.osmand.plus.dashboard.DashLocationFragment;
|
import net.osmand.plus.dashboard.DashLocationFragment;
|
||||||
import net.osmand.plus.dialogs.DirectionsDialogs;
|
|
||||||
import net.osmand.plus.helpers.SearchHistoryHelper;
|
import net.osmand.plus.helpers.SearchHistoryHelper;
|
||||||
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
|
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
|
@ -80,7 +78,7 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearWithConfirmation() {
|
private void clearWithConfirmation() {
|
||||||
Builder bld = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder bld = new AlertDialog.Builder(getActivity());
|
||||||
bld.setMessage(R.string.confirmation_to_clear_history);
|
bld.setMessage(R.string.confirmation_to_clear_history);
|
||||||
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
|
|
@ -3,16 +3,37 @@
|
||||||
*/
|
*/
|
||||||
package net.osmand.plus.activities.search;
|
package net.osmand.plus.activities.search;
|
||||||
|
|
||||||
import gnu.trove.set.hash.TLongHashSet;
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import java.text.MessageFormat;
|
import android.content.Intent;
|
||||||
import java.util.ArrayList;
|
import android.graphics.drawable.Drawable;
|
||||||
import java.util.Calendar;
|
import android.os.AsyncTask;
|
||||||
import java.util.Collection;
|
import android.os.AsyncTask.Status;
|
||||||
import java.util.Collections;
|
import android.os.Bundle;
|
||||||
import java.util.List;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
import java.util.Map;
|
import android.support.v7.app.AlertDialog;
|
||||||
import java.util.TreeMap;
|
import android.support.v7.widget.PopupMenu;
|
||||||
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.MenuItem.OnMenuItemClickListener;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Filter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.LinearLayout.LayoutParams;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.ResultMatcher;
|
import net.osmand.ResultMatcher;
|
||||||
|
@ -43,38 +64,17 @@ import net.osmand.util.Algorithms;
|
||||||
import net.osmand.util.MapUtils;
|
import net.osmand.util.MapUtils;
|
||||||
import net.osmand.util.OpeningHoursParser;
|
import net.osmand.util.OpeningHoursParser;
|
||||||
import net.osmand.util.OpeningHoursParser.OpeningHours;
|
import net.osmand.util.OpeningHoursParser.OpeningHours;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
import java.text.MessageFormat;
|
||||||
import android.content.Context;
|
import java.util.ArrayList;
|
||||||
import android.content.DialogInterface;
|
import java.util.Calendar;
|
||||||
import android.content.Intent;
|
import java.util.Collection;
|
||||||
import android.graphics.drawable.Drawable;
|
import java.util.Collections;
|
||||||
import android.os.AsyncTask;
|
import java.util.List;
|
||||||
import android.os.AsyncTask.Status;
|
import java.util.Map;
|
||||||
import android.os.Bundle;
|
import java.util.TreeMap;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
|
||||||
import android.support.v7.widget.PopupMenu;
|
import gnu.trove.set.hash.TLongHashSet;
|
||||||
import android.support.v7.widget.Toolbar;
|
|
||||||
import android.text.Editable;
|
|
||||||
import android.text.TextWatcher;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.MenuItem.OnMenuItemClickListener;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.view.inputmethod.InputMethodManager;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.Filter;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.LinearLayout.LayoutParams;
|
|
||||||
import android.widget.ListView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search poi activity
|
* Search poi activity
|
||||||
|
@ -860,7 +860,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
|
|
||||||
|
|
||||||
private void removePoiFilter() {
|
private void removePoiFilter() {
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setMessage(R.string.edit_filter_delete_dialog_title);
|
builder.setMessage(R.string.edit_filter_delete_dialog_title);
|
||||||
builder.setNegativeButton(R.string.shared_string_no, null);
|
builder.setNegativeButton(R.string.shared_string_no, null);
|
||||||
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
@ -881,7 +881,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
|
||||||
}
|
}
|
||||||
|
|
||||||
public void savePoiFilter() {
|
public void savePoiFilter() {
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle(R.string.edit_filter_save_as_menu_item);
|
builder.setTitle(R.string.edit_filter_save_as_menu_item);
|
||||||
final EditText editText = new EditText(this);
|
final EditText editText = new EditText(this);
|
||||||
if(filter.isStandardFilter()) {
|
if(filter.isStandardFilter()) {
|
||||||
|
|
|
@ -1,32 +1,31 @@
|
||||||
package net.osmand.plus.base;
|
package net.osmand.plus.base;
|
||||||
|
|
||||||
import java.io.File;
|
import android.content.DialogInterface;
|
||||||
import java.util.ArrayList;
|
import android.content.DialogInterface.OnCancelListener;
|
||||||
|
import android.content.DialogInterface.OnDismissListener;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
import net.osmand.access.AccessibleAlertBuilder;
|
import net.osmand.access.AccessibleAlertBuilder;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.plus.GPXUtilities;
|
import net.osmand.plus.GPXUtilities;
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.OsmandSettings;
|
import net.osmand.plus.OsmandSettings;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.TargetPointsHelper;
|
import net.osmand.plus.TargetPointsHelper;
|
||||||
|
import net.osmand.plus.TargetPointsHelper.TargetPoint;
|
||||||
import net.osmand.plus.activities.MapActivity;
|
import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.routing.RoutingHelper;
|
|
||||||
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
|
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
|
||||||
|
import net.osmand.plus.routing.RoutingHelper;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import java.io.File;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.util.ArrayList;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.DialogInterface.OnCancelListener;
|
|
||||||
import android.content.DialogInterface.OnDismissListener;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
public class FailSafeFuntions {
|
public class FailSafeFuntions {
|
||||||
private static boolean quitRouteRestoreDialog = false;
|
private static boolean quitRouteRestoreDialog = false;
|
||||||
|
@ -49,7 +48,7 @@ public class FailSafeFuntions {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Builder builder = new AccessibleAlertBuilder(ma);
|
AlertDialog.Builder builder = new AccessibleAlertBuilder(ma);
|
||||||
final TextView tv = new TextView(ma);
|
final TextView tv = new TextView(ma);
|
||||||
tv.setText(ma.getString(R.string.continue_follow_previous_route_auto, delay + ""));
|
tv.setText(ma.getString(R.string.continue_follow_previous_route_auto, delay + ""));
|
||||||
tv.setPadding(7, 5, 7, 5);
|
tv.setPadding(7, 5, 7, 5);
|
||||||
|
|
|
@ -1,6 +1,37 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
import gnu.trove.list.array.TIntArrayList;
|
import android.annotation.TargetApi;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.app.ProgressDialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.StatFs;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.View.OnClickListener;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.IndexConstants;
|
||||||
|
import net.osmand.ValueHolder;
|
||||||
|
import net.osmand.access.AccessibleToast;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.OsmandSettings;
|
||||||
|
import net.osmand.plus.ProgressImplementation;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
|
@ -13,37 +44,7 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import net.osmand.IndexConstants;
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
import net.osmand.ValueHolder;
|
|
||||||
import net.osmand.access.AccessibleToast;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.OsmandSettings;
|
|
||||||
import net.osmand.plus.ProgressImplementation;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.util.Algorithms;
|
|
||||||
import android.annotation.TargetApi;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.app.ProgressDialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.StatFs;
|
|
||||||
import android.support.annotation.Nullable;
|
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.app.FragmentActivity;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.View.OnClickListener;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
public class DashChooseAppDirFragment {
|
public class DashChooseAppDirFragment {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
package net.osmand.plus.dashboard;
|
package net.osmand.plus.dashboard;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.widget.PopupMenu;
|
import android.support.v7.widget.PopupMenu;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -195,7 +194,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
|
||||||
|
|
||||||
protected void deletePointConfirm(final TargetPoint point, View view) {
|
protected void deletePointConfirm(final TargetPoint point, View view) {
|
||||||
final boolean target = point == getMyApplication().getTargetPointsHelper().getPointToNavigate();
|
final boolean target = point == getMyApplication().getTargetPointsHelper().getPointToNavigate();
|
||||||
Builder builder = new AlertDialog.Builder(view.getContext());
|
AlertDialog.Builder builder = new AlertDialog.Builder(view.getContext());
|
||||||
// Stop the navigation
|
// Stop the navigation
|
||||||
builder.setTitle(getString(R.string.delete_target_point));
|
builder.setTitle(getString(R.string.delete_target_point));
|
||||||
builder.setMessage(PointDescription.getSimpleName(point, getActivity()));
|
builder.setMessage(PointDescription.getSimpleName(point, getActivity()));
|
||||||
|
|
|
@ -2,8 +2,6 @@ package net.osmand.plus.development;
|
||||||
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Debug;
|
import android.os.Debug;
|
||||||
|
@ -13,6 +11,7 @@ import android.preference.Preference;
|
||||||
import android.preference.Preference.OnPreferenceClickListener;
|
import android.preference.Preference.OnPreferenceClickListener;
|
||||||
import android.preference.PreferenceCategory;
|
import android.preference.PreferenceCategory;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import net.osmand.plus.ApplicationMode;
|
import net.osmand.plus.ApplicationMode;
|
||||||
|
@ -207,7 +206,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void availableProfileDialog() {
|
protected void availableProfileDialog() {
|
||||||
Builder b = new AlertDialog.Builder(this);
|
AlertDialog.Builder b = new AlertDialog.Builder(this);
|
||||||
final List<ApplicationMode> modes = ApplicationMode.allPossibleValues();
|
final List<ApplicationMode> modes = ApplicationMode.allPossibleValues();
|
||||||
modes.remove(ApplicationMode.DEFAULT);
|
modes.remove(ApplicationMode.DEFAULT);
|
||||||
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>(ApplicationMode.values(settings));
|
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>(ApplicationMode.values(settings));
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
package net.osmand.plus.development;
|
package net.osmand.plus.development;
|
||||||
|
|
||||||
import android.app.ActionBar;
|
import android.app.ActionBar;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -106,7 +105,7 @@ public class TestVoiceActivity extends OsmandActionBarActivity {
|
||||||
}
|
}
|
||||||
k++;
|
k++;
|
||||||
}
|
}
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
bld.setSingleChoiceItems(entrieValues, selected, new DialogInterface.OnClickListener() {
|
bld.setSingleChoiceItems(entrieValues, selected, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package net.osmand.plus.dialogs;
|
package net.osmand.plus.dialogs;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.widget.PopupMenu;
|
import android.support.v7.widget.PopupMenu;
|
||||||
|
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
@ -23,7 +22,7 @@ public class DirectionsDialogs {
|
||||||
final OsmandApplication ctx = (OsmandApplication) act.getApplication();
|
final OsmandApplication ctx = (OsmandApplication) act.getApplication();
|
||||||
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
|
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
|
||||||
if (targetPointsHelper.getIntermediatePoints().size() > 0) {
|
if (targetPointsHelper.getIntermediatePoints().size() > 0) {
|
||||||
Builder builder = new AlertDialog.Builder(act);
|
AlertDialog.Builder builder = new AlertDialog.Builder(act);
|
||||||
builder.setTitle(R.string.new_directions_point_dialog);
|
builder.setTitle(R.string.new_directions_point_dialog);
|
||||||
builder.setItems(
|
builder.setItems(
|
||||||
new String[] { act.getString(R.string.keep_intermediate_points),
|
new String[] { act.getString(R.string.keep_intermediate_points),
|
||||||
|
@ -51,7 +50,7 @@ public class DirectionsDialogs {
|
||||||
final OsmandApplication ctx = (OsmandApplication) act.getApplication();
|
final OsmandApplication ctx = (OsmandApplication) act.getApplication();
|
||||||
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
|
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
|
||||||
if (targetPointsHelper.getPointToNavigate() != null) {
|
if (targetPointsHelper.getPointToNavigate() != null) {
|
||||||
Builder builder = new AlertDialog.Builder(act);
|
AlertDialog.Builder builder = new AlertDialog.Builder(act);
|
||||||
builder.setTitle(R.string.new_destination_point_dialog);
|
builder.setTitle(R.string.new_destination_point_dialog);
|
||||||
builder.setItems(
|
builder.setItems(
|
||||||
new String[] { act.getString(R.string.replace_destination_point),
|
new String[] { act.getString(R.string.replace_destination_point),
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.osmand.plus.dialogs;
|
package net.osmand.plus.dialogs;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -10,6 +8,7 @@ import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.DialogInterface.OnDismissListener;
|
import android.content.DialogInterface.OnDismissListener;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.AdapterView.OnItemClickListener;
|
import android.widget.AdapterView.OnItemClickListener;
|
||||||
|
@ -98,7 +97,7 @@ public class FavoriteDialogs {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dialog createAddFavouriteDialog(final Activity activity, final Bundle args) {
|
public static Dialog createAddFavouriteDialog(final Activity activity, final Bundle args) {
|
||||||
Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
builder.setTitle(R.string.favourites_context_menu_edit);
|
builder.setTitle(R.string.favourites_context_menu_edit);
|
||||||
final View v = activity.getLayoutInflater().inflate(R.layout.favorite_edit_dialog, null, false);
|
final View v = activity.getLayoutInflater().inflate(R.layout.favorite_edit_dialog, null, false);
|
||||||
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
|
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
|
||||||
|
@ -138,7 +137,7 @@ public class FavoriteDialogs {
|
||||||
point.setName(editText.getText().toString().trim());
|
point.setName(editText.getText().toString().trim());
|
||||||
point.setDescription(description.getText().toString().trim());
|
point.setDescription(description.getText().toString().trim());
|
||||||
point.setCategory(categoryStr);
|
point.setCategory(categoryStr);
|
||||||
Builder bld = FavouritesDbHelper.checkDuplicates(point, helper, activity);
|
AlertDialog.Builder bld = FavouritesDbHelper.checkDuplicates(point, helper, activity);
|
||||||
if(bld != null) {
|
if(bld != null) {
|
||||||
bld.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -172,7 +171,7 @@ public class FavoriteDialogs {
|
||||||
final FavouritesAdapter favouritesAdapter, final OnItemClickListener click,
|
final FavouritesAdapter favouritesAdapter, final OnItemClickListener click,
|
||||||
final OnDismissListener dismissListener, final Dialog[] dialogHolder, final boolean sortByDist) {
|
final OnDismissListener dismissListener, final Dialog[] dialogHolder, final boolean sortByDist) {
|
||||||
ListView listView = new ListView(uiContext);
|
ListView listView = new ListView(uiContext);
|
||||||
Builder bld = new AlertDialog.Builder(uiContext);
|
AlertDialog.Builder bld = new AlertDialog.Builder(uiContext);
|
||||||
final Collator inst = Collator.getInstance();
|
final Collator inst = Collator.getInstance();
|
||||||
favouritesAdapter.sort(new Comparator<FavouritePoint>() {
|
favouritesAdapter.sort(new Comparator<FavouritePoint>() {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.osmand.plus.distancecalculator;
|
package net.osmand.plus.distancecalculator;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
|
@ -17,6 +15,7 @@ import android.graphics.Paint.Style;
|
||||||
import android.graphics.Path;
|
import android.graphics.Path;
|
||||||
import android.graphics.PointF;
|
import android.graphics.PointF;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
import android.text.TextWatcher;
|
import android.text.TextWatcher;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -170,7 +169,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private void showDialog(final MapActivity activity) {
|
private void showDialog(final MapActivity activity) {
|
||||||
Builder bld = new AlertDialog.Builder(activity);
|
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
|
||||||
final TIntArrayList list = new TIntArrayList();
|
final TIntArrayList list = new TIntArrayList();
|
||||||
if(distanceMeasurementMode == 0) {
|
if(distanceMeasurementMode == 0) {
|
||||||
list.add(R.string.distance_measurement_start_editing);
|
list.add(R.string.distance_measurement_start_editing);
|
||||||
|
@ -257,7 +256,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void saveGpx(final MapActivity activity) {
|
protected void saveGpx(final MapActivity activity) {
|
||||||
Builder b = new AlertDialog.Builder(activity);
|
AlertDialog.Builder b = new AlertDialog.Builder(activity);
|
||||||
final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
|
final File dir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
|
||||||
LinearLayout ll = new LinearLayout(activity);
|
LinearLayout ll = new LinearLayout(activity);
|
||||||
ll.setOrientation(LinearLayout.VERTICAL);
|
ll.setOrientation(LinearLayout.VERTICAL);
|
||||||
|
@ -393,7 +392,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
|
||||||
final CommonPreference<Boolean> pref = app.getSettings().registerBooleanPreference("show_measurement_help_first_time", true);
|
final CommonPreference<Boolean> pref = app.getSettings().registerBooleanPreference("show_measurement_help_first_time", true);
|
||||||
pref.makeGlobal();
|
pref.makeGlobal();
|
||||||
if(pref.get()) {
|
if(pref.get()) {
|
||||||
Builder builder = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
|
||||||
builder.setMessage(R.string.use_distance_measurement_help);
|
builder.setMessage(R.string.use_distance_measurement_help);
|
||||||
builder.setNegativeButton(R.string.shared_string_do_not_show_again, new OnClickListener() {
|
builder.setNegativeButton(R.string.shared_string_do_not_show_again, new OnClickListener() {
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ package net.osmand.plus.download;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Notification;
|
import android.app.Notification;
|
||||||
import android.app.NotificationManager;
|
import android.app.NotificationManager;
|
||||||
import android.app.PendingIntent;
|
import android.app.PendingIntent;
|
||||||
|
@ -16,6 +15,7 @@ import android.os.AsyncTask.Status;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.StatFs;
|
import android.os.StatFs;
|
||||||
import android.support.annotation.UiThread;
|
import android.support.annotation.UiThread;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.app.NotificationCompat;
|
import android.support.v7.app.NotificationCompat;
|
||||||
import android.support.v7.app.NotificationCompat.Builder;
|
import android.support.v7.app.NotificationCompat.Builder;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
|
@ -1,19 +1,5 @@
|
||||||
package net.osmand.plus.download;
|
package net.osmand.plus.download;
|
||||||
|
|
||||||
import java.lang.ref.WeakReference;
|
|
||||||
import java.text.MessageFormat;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import net.osmand.access.AccessibleToast;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.OsmandSettings;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.Version;
|
|
||||||
import net.osmand.plus.activities.ActionBarProgressActivity;
|
|
||||||
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
@ -22,12 +8,20 @@ import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.annotation.UiThread;
|
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.app.Fragment;
|
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.access.AccessibleToast;
|
||||||
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
import net.osmand.plus.OsmandSettings;
|
||||||
|
import net.osmand.plus.R;
|
||||||
|
import net.osmand.plus.Version;
|
||||||
|
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
|
||||||
public class DownloadValidationManager {
|
public class DownloadValidationManager {
|
||||||
public static final int MAXIMUM_AVAILABLE_FREE_DOWNLOADS = 5;
|
public static final int MAXIMUM_AVAILABLE_FREE_DOWNLOADS = 5;
|
||||||
protected OsmandSettings settings;
|
protected OsmandSettings settings;
|
||||||
|
@ -40,11 +34,11 @@ public class DownloadValidationManager {
|
||||||
downloadThread = app.getDownloadThread();
|
downloadThread = app.getDownloadThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public DownloadIndexesThread getDownloadThread() {
|
public DownloadIndexesThread getDownloadThread() {
|
||||||
return downloadThread;
|
return downloadThread;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startDownload(FragmentActivity activity, IndexItem... items) {
|
public void startDownload(FragmentActivity activity, IndexItem... items) {
|
||||||
downloadFilesWithAllChecks(activity, items);
|
downloadFilesWithAllChecks(activity, items);
|
||||||
}
|
}
|
||||||
|
@ -82,16 +76,15 @@ public class DownloadValidationManager {
|
||||||
downloadFileCheck_Final_Run(activity, items);
|
downloadFileCheck_Final_Run(activity, items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void downloadFileCheck_Final_Run(FragmentActivity activity, IndexItem[] items) {
|
private void downloadFileCheck_Final_Run(FragmentActivity activity, IndexItem[] items) {
|
||||||
downloadThread.runDownloadFiles(items);
|
downloadThread.runDownloadFiles(items);
|
||||||
if(activity instanceof DownloadEvents) {
|
if (activity instanceof DownloadEvents) {
|
||||||
((DownloadEvents) activity).downloadInProgress();
|
((DownloadEvents) activity).downloadInProgress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void downloadFilesWithAllChecks(FragmentActivity activity, IndexItem[] items) {
|
protected void downloadFilesWithAllChecks(FragmentActivity activity, IndexItem[] items) {
|
||||||
downloadFilesCheck_1_FreeVersion(activity, items);
|
downloadFilesCheck_1_FreeVersion(activity, items);
|
||||||
}
|
}
|
||||||
|
@ -131,7 +124,6 @@ public class DownloadValidationManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void makeSureUserCancelDownload(Context ctx, final IndexItem item) {
|
public void makeSureUserCancelDownload(Context ctx, final IndexItem item) {
|
||||||
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
|
||||||
|
@ -147,9 +139,10 @@ public class DownloadValidationManager {
|
||||||
bld.setNegativeButton(R.string.shared_string_no, null);
|
bld.setNegativeButton(R.string.shared_string_no, null);
|
||||||
bld.show();
|
bld.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class InstallPaidVersionDialogFragment extends DialogFragment {
|
public static class InstallPaidVersionDialogFragment extends DialogFragment {
|
||||||
public static final String TAG = "InstallPaidVersionDialogFragment";
|
public static final String TAG = "InstallPaidVersionDialogFragment";
|
||||||
|
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||||
|
|
|
@ -1,21 +1,22 @@
|
||||||
package net.osmand.plus.download.ui;
|
package net.osmand.plus.download.ui;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import android.app.Dialog;
|
||||||
import java.util.List;
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.download.DownloadActivity;
|
import net.osmand.plus.download.DownloadActivity;
|
||||||
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
|
||||||
import net.osmand.plus.download.IndexItem;
|
import net.osmand.plus.download.IndexItem;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import java.util.ArrayList;
|
||||||
import android.os.Bundle;
|
import java.util.List;
|
||||||
import android.support.annotation.NonNull;
|
|
||||||
import android.support.v4.app.DialogFragment;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
|
|
||||||
public class ActiveDownloadsDialogFragment extends DialogFragment implements DownloadEvents {
|
public class ActiveDownloadsDialogFragment extends DialogFragment implements DownloadEvents {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.osmand.plus.download.ui;
|
package net.osmand.plus.download.ui;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
@ -369,7 +368,7 @@ public class ItemViewHolder {
|
||||||
: LocalIndexType.VOICE_DATA;
|
: LocalIndexType.VOICE_DATA;
|
||||||
}
|
}
|
||||||
final LocalIndexInfo info = new LocalIndexInfo(tp, fl, false);
|
final LocalIndexInfo info = new LocalIndexInfo(tp, fl, false);
|
||||||
Builder confirm = new Builder(context);
|
AlertDialog.Builder confirm = new AlertDialog.Builder(context);
|
||||||
confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
|
@ -1,20 +1,40 @@
|
||||||
package net.osmand.plus.download.ui;
|
package net.osmand.plus.download.ui;
|
||||||
|
|
||||||
import java.io.File;
|
import android.app.Activity;
|
||||||
import java.text.Collator;
|
import android.content.DialogInterface;
|
||||||
import java.util.ArrayList;
|
import android.content.res.Resources;
|
||||||
import java.util.Collections;
|
import android.content.res.TypedArray;
|
||||||
import java.util.Comparator;
|
import android.graphics.PorterDuff;
|
||||||
import java.util.EnumSet;
|
import android.graphics.Typeface;
|
||||||
import java.util.HashMap;
|
import android.graphics.drawable.Drawable;
|
||||||
import java.util.LinkedHashMap;
|
import android.os.AsyncTask;
|
||||||
import java.util.LinkedHashSet;
|
import android.os.Bundle;
|
||||||
import java.util.List;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
import java.util.Map;
|
import android.support.v7.app.ActionBar;
|
||||||
import java.util.Set;
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.support.v7.view.ActionMode;
|
||||||
|
import android.support.v7.widget.PopupMenu;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.ContextMenu;
|
||||||
|
import android.view.ContextMenu.ContextMenuInfo;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.SubMenu;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.CheckBox;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.ExpandableListView;
|
||||||
|
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.PlatformUtil;
|
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
import net.osmand.plus.ContextMenuAdapter;
|
||||||
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
||||||
|
@ -38,42 +58,18 @@ import net.osmand.plus.resources.IncrementalChangesManager.IncrementalUpdate;
|
||||||
import net.osmand.plus.resources.IncrementalChangesManager.IncrementalUpdateList;
|
import net.osmand.plus.resources.IncrementalChangesManager.IncrementalUpdateList;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import java.io.File;
|
||||||
|
import java.text.Collator;
|
||||||
import android.app.Activity;
|
import java.util.ArrayList;
|
||||||
import android.app.AlertDialog;
|
import java.util.Collections;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.util.Comparator;
|
||||||
import android.content.DialogInterface;
|
import java.util.EnumSet;
|
||||||
import android.content.res.Resources;
|
import java.util.HashMap;
|
||||||
import android.content.res.TypedArray;
|
import java.util.LinkedHashMap;
|
||||||
import android.graphics.PorterDuff;
|
import java.util.LinkedHashSet;
|
||||||
import android.graphics.Typeface;
|
import java.util.List;
|
||||||
import android.graphics.drawable.Drawable;
|
import java.util.Map;
|
||||||
import android.os.AsyncTask;
|
import java.util.Set;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v4.view.MenuItemCompat;
|
|
||||||
import android.support.v7.app.ActionBar;
|
|
||||||
import android.support.v7.view.ActionMode;
|
|
||||||
import android.support.v7.widget.PopupMenu;
|
|
||||||
import android.util.TypedValue;
|
|
||||||
import android.view.ContextMenu;
|
|
||||||
import android.view.ContextMenu.ContextMenuInfo;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.SubMenu;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.CheckBox;
|
|
||||||
import android.widget.EditText;
|
|
||||||
import android.widget.ExpandableListView;
|
|
||||||
import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
|
|
||||||
import android.widget.ImageButton;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
|
|
||||||
public class LocalIndexesFragment extends OsmandExpandableListFragment implements DownloadEvents {
|
public class LocalIndexesFragment extends OsmandExpandableListFragment implements DownloadEvents {
|
||||||
|
@ -170,7 +166,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showContextMenu(final LocalIndexInfo info) {
|
private void showContextMenu(final LocalIndexInfo info) {
|
||||||
Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
final ContextMenuAdapter adapter = new ContextMenuAdapter(getActivity());
|
final ContextMenuAdapter adapter = new ContextMenuAdapter(getActivity());
|
||||||
basicFileOperation(info, adapter);
|
basicFileOperation(info, adapter);
|
||||||
OsmandPlugin.onContextMenuActivity(getActivity(), null, info, adapter);
|
OsmandPlugin.onContextMenuActivity(getActivity(), null, info, adapter);
|
||||||
|
@ -224,7 +220,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
} else if (resId == R.string.local_index_mi_restore) {
|
} else if (resId == R.string.local_index_mi_restore) {
|
||||||
new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.RESTORE_OPERATION).execute(info);
|
new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.RESTORE_OPERATION).execute(info);
|
||||||
} else if (resId == R.string.shared_string_delete) {
|
} else if (resId == R.string.shared_string_delete) {
|
||||||
Builder confirm = new Builder(getActivity());
|
AlertDialog.Builder confirm = new AlertDialog.Builder(getActivity());
|
||||||
confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
confirm.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
@ -244,7 +240,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void renameFile(final Activity a, final File f, final Runnable callback) {
|
public static void renameFile(final Activity a, final File f, final Runnable callback) {
|
||||||
Builder b = new AlertDialog.Builder(a);
|
AlertDialog.Builder b = new AlertDialog.Builder(a);
|
||||||
if (f.exists()) {
|
if (f.exists()) {
|
||||||
int xt = f.getName().lastIndexOf('.');
|
int xt = f.getName().lastIndexOf('.');
|
||||||
final String ext = xt == -1 ? "" : f.getName().substring(xt);
|
final String ext = xt == -1 ? "" : f.getName().substring(xt);
|
||||||
|
@ -679,7 +675,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Builder builder = new AlertDialog.Builder(getDownloadActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getDownloadActivity());
|
||||||
builder.setMessage(getString(R.string.local_index_action_do, actionButton.toLowerCase(), selectedItems.size()));
|
builder.setMessage(getString(R.string.local_index_action_do, actionButton.toLowerCase(), selectedItems.size()));
|
||||||
builder.setPositiveButton(actionButton, listener);
|
builder.setPositiveButton(actionButton, listener);
|
||||||
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package net.osmand.plus.helpers;
|
package net.osmand.plus.helpers;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
@ -103,7 +102,7 @@ public class AvoidSpecificRoads {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showDialog(final MapActivity mapActivity) {
|
public void showDialog(final MapActivity mapActivity) {
|
||||||
Builder bld = new AlertDialog.Builder(mapActivity);
|
AlertDialog.Builder bld = new AlertDialog.Builder(mapActivity);
|
||||||
bld.setTitle(R.string.impassable_road);
|
bld.setTitle(R.string.impassable_road);
|
||||||
if (getMissingRoads().size() == 0){
|
if (getMissingRoads().size() == 0){
|
||||||
bld.setMessage(R.string.avoid_roads_msg);
|
bld.setMessage(R.string.avoid_roads_msg);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.osmand.plus.helpers;
|
package net.osmand.plus.helpers;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -9,7 +8,9 @@ import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.ParcelFileDescriptor;
|
import android.os.ParcelFileDescriptor;
|
||||||
import android.provider.OpenableColumns;
|
import android.provider.OpenableColumns;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.data.FavouritePoint;
|
import net.osmand.data.FavouritePoint;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package net.osmand.plus.mapcontextmenu.controllers;
|
package net.osmand.plus.mapcontextmenu.controllers;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.binary.BinaryMapDataObject;
|
import net.osmand.binary.BinaryMapDataObject;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.osmand.plus.mapcontextmenu.editors;
|
package net.osmand.plus.mapcontextmenu.editors;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.osmand.plus.mapcontextmenu.editors;
|
package net.osmand.plus.mapcontextmenu.editors;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.osmand.plus.mapcontextmenu.editors;
|
package net.osmand.plus.mapcontextmenu.editors;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
|
@ -9,6 +8,7 @@ import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package net.osmand.plus.monitoring;
|
package net.osmand.plus.monitoring;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.WindowManager;
|
import android.view.WindowManager;
|
||||||
|
@ -247,7 +246,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
||||||
private void controlDialog(final Activity map) {
|
private void controlDialog(final Activity map) {
|
||||||
final boolean wasTrackMonitored = settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
|
final boolean wasTrackMonitored = settings.SAVE_GLOBAL_TRACK_TO_GPX.get();
|
||||||
|
|
||||||
Builder bld = new AlertDialog.Builder(map);
|
AlertDialog.Builder bld = new AlertDialog.Builder(map);
|
||||||
final TIntArrayList items = new TIntArrayList();
|
final TIntArrayList items = new TIntArrayList();
|
||||||
if(wasTrackMonitored) {
|
if(wasTrackMonitored) {
|
||||||
items.add(R.string.gpx_monitoring_stop);
|
items.add(R.string.gpx_monitoring_stop);
|
||||||
|
@ -381,7 +380,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
|
||||||
|
|
||||||
public static void showIntervalChooseDialog(final Context uiCtx, final String patternMsg,
|
public static void showIntervalChooseDialog(final Context uiCtx, final String patternMsg,
|
||||||
String title, final int[] seconds, final int[] minutes, final ValueHolder<Boolean> choice, final ValueHolder<Integer> v, OnClickListener onclick){
|
String title, final int[] seconds, final int[] minutes, final ValueHolder<Boolean> choice, final ValueHolder<Integer> v, OnClickListener onclick){
|
||||||
Builder dlg = new AlertDialog.Builder(uiCtx);
|
AlertDialog.Builder dlg = new AlertDialog.Builder(uiCtx);
|
||||||
dlg.setTitle(title);
|
dlg.setTitle(title);
|
||||||
WindowManager mgr = (WindowManager) uiCtx.getSystemService(Context.WINDOW_SERVICE);
|
WindowManager mgr = (WindowManager) uiCtx.getSystemService(Context.WINDOW_SERVICE);
|
||||||
DisplayMetrics dm = new DisplayMetrics();
|
DisplayMetrics dm = new DisplayMetrics();
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.osmand.plus.myplaces;
|
package net.osmand.plus.myplaces;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -13,6 +11,7 @@ import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.view.ActionMode;
|
import android.support.v7.view.ActionMode;
|
||||||
import android.support.v7.widget.PopupMenu;
|
import android.support.v7.widget.PopupMenu;
|
||||||
import android.support.v7.widget.SearchView;
|
import android.support.v7.widget.SearchView;
|
||||||
|
@ -32,6 +31,7 @@ import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.access.AccessibleToast;
|
import net.osmand.access.AccessibleToast;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
import net.osmand.plus.ContextMenuAdapter;
|
||||||
|
@ -526,7 +526,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Builder builder = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
|
||||||
builder.setMessage(getString(R.string.local_index_action_do, actionButton.toLowerCase(),
|
builder.setMessage(getString(R.string.local_index_action_do, actionButton.toLowerCase(),
|
||||||
selectedItems.size()));
|
selectedItems.size()));
|
||||||
builder.setPositiveButton(actionButton, listener);
|
builder.setPositiveButton(actionButton, listener);
|
||||||
|
|
|
@ -2,8 +2,6 @@ package net.osmand.plus.myplaces;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
@ -11,7 +9,7 @@ import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
import android.support.v7.widget.PopupMenu;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
|
@ -30,7 +28,6 @@ import android.widget.TextView;
|
||||||
import net.osmand.data.FavouritePoint;
|
import net.osmand.data.FavouritePoint;
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.data.PointDescription;
|
import net.osmand.data.PointDescription;
|
||||||
import net.osmand.plus.ContextMenuAdapter;
|
|
||||||
import net.osmand.plus.FavouritesDbHelper;
|
import net.osmand.plus.FavouritesDbHelper;
|
||||||
import net.osmand.plus.GPXUtilities.GPXFile;
|
import net.osmand.plus.GPXUtilities.GPXFile;
|
||||||
import net.osmand.plus.GPXUtilities.WptPt;
|
import net.osmand.plus.GPXUtilities.WptPt;
|
||||||
|
@ -47,7 +44,6 @@ import net.osmand.plus.activities.MapActivity;
|
||||||
import net.osmand.plus.activities.OsmAndListFragment;
|
import net.osmand.plus.activities.OsmAndListFragment;
|
||||||
import net.osmand.plus.activities.TrackActivity;
|
import net.osmand.plus.activities.TrackActivity;
|
||||||
import net.osmand.plus.base.FavoriteImageDrawable;
|
import net.osmand.plus.base.FavoriteImageDrawable;
|
||||||
import net.osmand.plus.dialogs.DirectionsDialogs;
|
|
||||||
import net.osmand.plus.helpers.ColorDialogs;
|
import net.osmand.plus.helpers.ColorDialogs;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
|
@ -206,7 +202,7 @@ public class SelectedGPXFragment extends OsmAndListFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void saveAsFavorites(final GpxDisplayItemType gpxDisplayItemType) {
|
protected void saveAsFavorites(final GpxDisplayItemType gpxDisplayItemType) {
|
||||||
Builder b = new AlertDialog.Builder(getMyActivity());
|
AlertDialog.Builder b = new AlertDialog.Builder(getMyActivity());
|
||||||
final EditText editText = new EditText(getMyActivity());
|
final EditText editText = new EditText(getMyActivity());
|
||||||
final List<GpxDisplayGroup> gs = filterGroups(gpxDisplayItemType);
|
final List<GpxDisplayGroup> gs = filterGroups(gpxDisplayItemType);
|
||||||
if (gs.size() == 0) {
|
if (gs.size() == 0) {
|
||||||
|
@ -280,7 +276,7 @@ public class SelectedGPXFragment extends OsmAndListFragment {
|
||||||
ColorDialogs.setupColorSpinner(getActivity(), getGpx().getColor(0), colorSpinner, list);
|
ColorDialogs.setupColorSpinner(getActivity(), getGpx().getColor(0), colorSpinner, list);
|
||||||
|
|
||||||
final Spinner sp = (Spinner) view.findViewById(R.id.Spinner);
|
final Spinner sp = (Spinner) view.findViewById(R.id.Spinner);
|
||||||
Builder bld = new AlertDialog.Builder(getMyActivity());
|
AlertDialog.Builder bld = new AlertDialog.Builder(getMyActivity());
|
||||||
final List<Double> distanceSplit = new ArrayList<Double>();
|
final List<Double> distanceSplit = new ArrayList<Double>();
|
||||||
final TIntArrayList timeSplit = new TIntArrayList();
|
final TIntArrayList timeSplit = new TIntArrayList();
|
||||||
if(groups.size() == 0) {
|
if(groups.size() == 0) {
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package net.osmand.plus.openseamapsplugin;
|
package net.osmand.plus.openseamapsplugin;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.IndexConstants;
|
import net.osmand.IndexConstants;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
@ -59,7 +58,7 @@ public class NauticalMapsPlugin extends OsmandPlugin {
|
||||||
app.getSettings().RENDERER.set(RendererRegistry.NAUTICAL_RENDER);
|
app.getSettings().RENDERER.set(RendererRegistry.NAUTICAL_RENDER);
|
||||||
if(!app.getResourceManager().getIndexFileNames().containsKey("World_seamarks"+
|
if(!app.getResourceManager().getIndexFileNames().containsKey("World_seamarks"+
|
||||||
IndexConstants.BINARY_MAP_INDEX_EXT)){
|
IndexConstants.BINARY_MAP_INDEX_EXT)){
|
||||||
Builder dlg = new AlertDialog.Builder(activity);
|
AlertDialog.Builder dlg = new AlertDialog.Builder(activity);
|
||||||
dlg.setMessage(net.osmand.plus.R.string.nautical_maps_missing);
|
dlg.setMessage(net.osmand.plus.R.string.nautical_maps_missing);
|
||||||
dlg.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
|
dlg.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package net.osmand.plus.osmedit;
|
package net.osmand.plus.osmedit;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.osmand.plus.osmedit;
|
package net.osmand.plus.osmedit;
|
||||||
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
|
@ -10,6 +8,7 @@ import android.graphics.Paint;
|
||||||
import android.graphics.PointF;
|
import android.graphics.PointF;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
@ -320,7 +319,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
||||||
|
|
||||||
private Dialog createOpenBugDialog(final Bundle args) {
|
private Dialog createOpenBugDialog(final Bundle args) {
|
||||||
final View openBug = activity.getLayoutInflater().inflate(R.layout.open_bug, null);
|
final View openBug = activity.getLayoutInflater().inflate(R.layout.open_bug, null);
|
||||||
Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
builder.setTitle(R.string.osb_add_dialog_title);
|
builder.setTitle(R.string.osb_add_dialog_title);
|
||||||
builder.setView(openBug);
|
builder.setView(openBug);
|
||||||
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
||||||
|
@ -406,7 +405,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createCommentBugDialog(final Bundle args) {
|
private Dialog createCommentBugDialog(final Bundle args) {
|
||||||
Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
builder.setTitle(R.string.osb_comment_dialog_title);
|
builder.setTitle(R.string.osb_comment_dialog_title);
|
||||||
final View view = activity.getLayoutInflater().inflate(R.layout.open_bug, null);
|
final View view = activity.getLayoutInflater().inflate(R.layout.open_bug, null);
|
||||||
builder.setView(view);
|
builder.setView(view);
|
||||||
|
@ -453,7 +452,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dialog createCloseBugDialog(final Bundle args) {
|
private Dialog createCloseBugDialog(final Bundle args) {
|
||||||
Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
builder.setTitle(R.string.osb_close_dialog_title);
|
builder.setTitle(R.string.osb_close_dialog_title);
|
||||||
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
builder.setNegativeButton(R.string.shared_string_cancel, null);
|
||||||
builder.setPositiveButton(R.string.osb_close_dialog_close_button, new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(R.string.osb_close_dialog_close_button, new DialogInterface.OnClickListener() {
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
package net.osmand.plus.osmedit;
|
package net.osmand.plus.osmedit;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ArrayAdapter;
|
import android.widget.ArrayAdapter;
|
||||||
|
@ -285,7 +284,7 @@ public class OsmEditingPlugin extends OsmandPlugin {
|
||||||
AccessibleToast.makeText(la, R.string.validate_gpx_upload_name_pwd, Toast.LENGTH_LONG).show();
|
AccessibleToast.makeText(la, R.string.validate_gpx_upload_name_pwd, Toast.LENGTH_LONG).show();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Builder bldr = new AlertDialog.Builder(la);
|
AlertDialog.Builder bldr = new AlertDialog.Builder(la);
|
||||||
LayoutInflater inflater = (LayoutInflater) la.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) la.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
final View view = inflater.inflate(R.layout.send_gpx_osm, null);
|
final View view = inflater.inflate(R.layout.send_gpx_osm, null);
|
||||||
final EditText descr = (EditText) view.findViewById(R.id.memory_size);
|
final EditText descr = (EditText) view.findViewById(R.id.memory_size);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.osmand.plus.osmedit;
|
package net.osmand.plus.osmedit;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.app.ProgressDialog;
|
import android.app.ProgressDialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -11,6 +10,7 @@ import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.view.ActionMode;
|
import android.support.v7.view.ActionMode;
|
||||||
import android.support.v7.widget.PopupMenu;
|
import android.support.v7.widget.PopupMenu;
|
||||||
import android.util.Xml;
|
import android.util.Xml;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.osmand.plus.osmedit.dialogs;
|
package net.osmand.plus.osmedit.dialogs;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.data.Amenity;
|
import net.osmand.data.Amenity;
|
||||||
import net.osmand.osm.MapPoiTypes;
|
import net.osmand.osm.MapPoiTypes;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.osmand.plus.osmedit.dialogs;
|
package net.osmand.plus.osmedit.dialogs;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import net.osmand.data.Amenity;
|
import net.osmand.data.Amenity;
|
||||||
import net.osmand.osm.MapPoiTypes;
|
import net.osmand.osm.MapPoiTypes;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package net.osmand.plus.osmedit.dialogs;
|
package net.osmand.plus.osmedit.dialogs;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.NonNull;
|
import android.support.annotation.NonNull;
|
||||||
import android.support.v4.app.DialogFragment;
|
import android.support.v4.app.DialogFragment;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.CheckBox;
|
import android.widget.CheckBox;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
|
|
@ -3,48 +3,8 @@
|
||||||
*/
|
*/
|
||||||
package net.osmand.plus.osmo;
|
package net.osmand.plus.osmo;
|
||||||
|
|
||||||
import gnu.trove.list.array.TIntArrayList;
|
|
||||||
|
|
||||||
import java.text.Collator;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import net.osmand.AndroidUtils;
|
|
||||||
import net.osmand.Location;
|
|
||||||
import net.osmand.StateChangedListener;
|
|
||||||
import net.osmand.access.AccessibleToast;
|
|
||||||
import net.osmand.data.LatLon;
|
|
||||||
import net.osmand.data.PointDescription;
|
|
||||||
import net.osmand.plus.NavigationService;
|
|
||||||
import net.osmand.plus.OsmAndConstants;
|
|
||||||
import net.osmand.plus.OsmAndFormatter;
|
|
||||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
|
|
||||||
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
|
|
||||||
import net.osmand.plus.OsmandApplication;
|
|
||||||
import net.osmand.plus.OsmandPlugin;
|
|
||||||
import net.osmand.plus.R;
|
|
||||||
import net.osmand.plus.TargetPointsHelper;
|
|
||||||
import net.osmand.plus.activities.MapActivity;
|
|
||||||
import net.osmand.plus.activities.OsmandBaseExpandableListAdapter;
|
|
||||||
import net.osmand.plus.activities.OsmandExpandableListActivity;
|
|
||||||
import net.osmand.plus.activities.actions.ShareDialog;
|
|
||||||
import net.osmand.plus.base.MapViewTrackingUtilities;
|
|
||||||
import net.osmand.plus.helpers.AndroidUiHelper;
|
|
||||||
import net.osmand.plus.helpers.ColorDialogs;
|
|
||||||
import net.osmand.plus.osmo.OsMoGroups.OsMoGroupsUIListener;
|
|
||||||
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
|
|
||||||
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoGroup;
|
|
||||||
import net.osmand.plus.osmo.OsMoService.SessionInfo;
|
|
||||||
import net.osmand.util.MapUtils;
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -67,6 +27,7 @@ import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
import android.support.v4.view.MenuItemCompat;
|
import android.support.v4.view.MenuItemCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.support.v7.view.ActionMode;
|
import android.support.v7.view.ActionMode;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.text.Editable;
|
import android.text.Editable;
|
||||||
|
@ -100,6 +61,44 @@ import android.widget.Spinner;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import net.osmand.AndroidUtils;
|
||||||
|
import net.osmand.Location;
|
||||||
|
import net.osmand.StateChangedListener;
|
||||||
|
import net.osmand.access.AccessibleToast;
|
||||||
|
import net.osmand.data.LatLon;
|
||||||
|
import net.osmand.data.PointDescription;
|
||||||
|
import net.osmand.plus.NavigationService;
|
||||||
|
import net.osmand.plus.OsmAndConstants;
|
||||||
|
import net.osmand.plus.OsmAndFormatter;
|
||||||
|
import net.osmand.plus.OsmAndLocationProvider.OsmAndCompassListener;
|
||||||
|
import net.osmand.plus.OsmAndLocationProvider.OsmAndLocationListener;
|
||||||
|
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.activities.OsmandBaseExpandableListAdapter;
|
||||||
|
import net.osmand.plus.activities.OsmandExpandableListActivity;
|
||||||
|
import net.osmand.plus.activities.actions.ShareDialog;
|
||||||
|
import net.osmand.plus.base.MapViewTrackingUtilities;
|
||||||
|
import net.osmand.plus.helpers.AndroidUiHelper;
|
||||||
|
import net.osmand.plus.helpers.ColorDialogs;
|
||||||
|
import net.osmand.plus.osmo.OsMoGroups.OsMoGroupsUIListener;
|
||||||
|
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoDevice;
|
||||||
|
import net.osmand.plus.osmo.OsMoGroupsStorage.OsMoGroup;
|
||||||
|
import net.osmand.plus.osmo.OsMoService.SessionInfo;
|
||||||
|
import net.osmand.util.MapUtils;
|
||||||
|
|
||||||
|
import java.text.Collator;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import gnu.trove.list.array.TIntArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -530,7 +529,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
@Override
|
@Override
|
||||||
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
|
||||||
if (item.getItemId() == DELETE_ACTION_ID) {
|
if (item.getItemId() == DELETE_ACTION_ID) {
|
||||||
Builder bld = new AlertDialog.Builder(OsMoGroupsActivity.this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(OsMoGroupsActivity.this);
|
||||||
String name = ((OsMoGroup) selectedObject).getVisibleName(OsMoGroupsActivity.this);
|
String name = ((OsMoGroup) selectedObject).getVisibleName(OsMoGroupsActivity.this);
|
||||||
bld.setTitle(getString(R.string.osmo_leave_confirmation_msg, name));
|
bld.setTitle(getString(R.string.osmo_leave_confirmation_msg, name));
|
||||||
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
|
||||||
|
@ -578,7 +577,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
|
|
||||||
|
|
||||||
protected void showGroupInfo(final OsMoGroup group) {
|
protected void showGroupInfo(final OsMoGroup group) {
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
bld.setTitle(R.string.osmo_group);
|
bld.setTitle(R.string.osmo_group);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
if (group != null){
|
if (group != null){
|
||||||
|
@ -658,7 +657,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
setSupportProgressBarIndeterminateVisibility(true);
|
setSupportProgressBarIndeterminateVisibility(true);
|
||||||
signinPost(false);
|
signinPost(false);
|
||||||
} else {
|
} else {
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
String text = getString(R.string.logged_as, app.getSettings().OSMO_USER_NAME.get());
|
String text = getString(R.string.logged_as, app.getSettings().OSMO_USER_NAME.get());
|
||||||
bld.setMessage(text);
|
bld.setMessage(text);
|
||||||
bld.setPositiveButton(R.string.shared_string_ok, null);
|
bld.setPositiveButton(R.string.shared_string_ok, null);
|
||||||
|
@ -822,7 +821,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void signin() {
|
protected void signin() {
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle(R.string.osmo_sign_in);
|
builder.setTitle(R.string.osmo_sign_in);
|
||||||
String message = "";
|
String message = "";
|
||||||
if(app.getSettings().OSMO_USER_PWD.get() != null) {
|
if(app.getSettings().OSMO_USER_PWD.get() != null) {
|
||||||
|
@ -850,7 +849,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
signin();
|
signin();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final Builder builder = new AlertDialog.Builder(this);
|
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle(R.string.osmo_create_group);
|
builder.setTitle(R.string.osmo_create_group);
|
||||||
final View v = getLayoutInflater().inflate(R.layout.osmo_create_group, getExpandableListView(), false);
|
final View v = getLayoutInflater().inflate(R.layout.osmo_create_group, getExpandableListView(), false);
|
||||||
final EditText policy = (EditText) v.findViewById(R.id.Policy);
|
final EditText policy = (EditText) v.findViewById(R.id.Policy);
|
||||||
|
@ -918,7 +917,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void connectToDevice() {
|
private void connectToDevice() {
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
final View v = getLayoutInflater().inflate(R.layout.osmo_connect_to_device, getExpandableListView(), false);
|
final View v = getLayoutInflater().inflate(R.layout.osmo_connect_to_device, getExpandableListView(), false);
|
||||||
final TextView labelTracker = (TextView ) v.findViewById(R.id.LabelTrackerId);
|
final TextView labelTracker = (TextView ) v.findViewById(R.id.LabelTrackerId);
|
||||||
final TextView labelName = (TextView ) v.findViewById(R.id.LabelName);
|
final TextView labelName = (TextView ) v.findViewById(R.id.LabelName);
|
||||||
|
@ -1402,7 +1401,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
|
|
||||||
|
|
||||||
public static void showSettingsDialog(Context ctx, final OsMoPlugin plugin, final OsMoDevice device) {
|
public static void showSettingsDialog(Context ctx, final OsMoPlugin plugin, final OsMoDevice device) {
|
||||||
Builder bld = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
|
||||||
bld.setTitle(R.string.osmo_edit_device);
|
bld.setTitle(R.string.osmo_edit_device);
|
||||||
final LayoutInflater inflater = LayoutInflater.from(ctx);
|
final LayoutInflater inflater = LayoutInflater.from(ctx);
|
||||||
View view = inflater.inflate(R.layout.osmo_edit_device, null);
|
View view = inflater.inflate(R.layout.osmo_edit_device, null);
|
||||||
|
@ -1526,7 +1525,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showHint() {
|
private void showHint() {
|
||||||
Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setTitle(R.string.anonymous_user);
|
builder.setTitle(R.string.anonymous_user);
|
||||||
String message = getString(R.string.anonymous_user_hint);
|
String message = getString(R.string.anonymous_user_hint);
|
||||||
builder.setMessage(message);
|
builder.setMessage(message);
|
||||||
|
|
|
@ -1,13 +1,21 @@
|
||||||
package net.osmand.plus.osmo;
|
package net.osmand.plus.osmo;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import android.app.Activity;
|
||||||
import java.io.IOException;
|
import android.app.Notification;
|
||||||
import java.io.InputStream;
|
import android.app.NotificationManager;
|
||||||
import java.io.InputStreamReader;
|
import android.app.PendingIntent;
|
||||||
import java.util.ArrayList;
|
import android.content.BroadcastReceiver;
|
||||||
import java.util.Collections;
|
import android.content.Context;
|
||||||
import java.util.List;
|
import android.content.DialogInterface;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.provider.Settings.Secure;
|
||||||
|
import android.support.v4.app.NotificationCompat;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
|
@ -27,23 +35,14 @@ import org.json.JSONArray;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import android.app.Activity;
|
import java.io.BufferedReader;
|
||||||
import android.app.AlertDialog;
|
import java.io.IOException;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.io.InputStream;
|
||||||
import android.app.Notification;
|
import java.io.InputStreamReader;
|
||||||
import android.app.NotificationManager;
|
import java.util.ArrayList;
|
||||||
import android.app.PendingIntent;
|
import java.util.Collections;
|
||||||
import android.content.BroadcastReceiver;
|
import java.util.List;
|
||||||
import android.content.Context;
|
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.DialogInterface.OnClickListener;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.IntentFilter;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.provider.Settings.Secure;
|
|
||||||
import android.support.v4.app.NotificationCompat;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
|
|
||||||
public class OsMoService implements OsMoReactor {
|
public class OsMoService implements OsMoReactor {
|
||||||
private static final String HTTP_API_PREPARE = "http://api.osmo.mobi/prepare";
|
private static final String HTTP_API_PREPARE = "http://api.osmo.mobi/prepare";
|
||||||
|
@ -362,7 +361,7 @@ public class OsMoService implements OsMoReactor {
|
||||||
|
|
||||||
|
|
||||||
protected void showRegisterAgain(Activity ga, String msg) {
|
protected void showRegisterAgain(Activity ga, String msg) {
|
||||||
Builder bld = new AlertDialog.Builder(ga);
|
AlertDialog.Builder bld = new AlertDialog.Builder(ga);
|
||||||
bld.setMessage(msg);
|
bld.setMessage(msg);
|
||||||
bld.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.osmand.plus.osmo;
|
package net.osmand.plus.osmo;
|
||||||
|
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.DialogInterface.OnClickListener;
|
import android.content.DialogInterface.OnClickListener;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
@ -11,6 +9,7 @@ import android.os.Bundle;
|
||||||
import android.preference.CheckBoxPreference;
|
import android.preference.CheckBoxPreference;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.widget.ScrollView;
|
import android.widget.ScrollView;
|
||||||
|
@ -119,7 +118,7 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
|
||||||
final OsMoPlugin plugin = OsMoPlugin.getEnabledPlugin(OsMoPlugin.class);
|
final OsMoPlugin plugin = OsMoPlugin.getEnabledPlugin(OsMoPlugin.class);
|
||||||
if (preference == debugPref) {
|
if (preference == debugPref) {
|
||||||
updateDebugPref();
|
updateDebugPref();
|
||||||
Builder bld = new AlertDialog.Builder(this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(this);
|
||||||
StringBuilder bs = new StringBuilder();
|
StringBuilder bs = new StringBuilder();
|
||||||
List<String> hs = plugin.getService().getHistoryOfCommands();
|
List<String> hs = plugin.getService().getHistoryOfCommands();
|
||||||
if(hs != null) {
|
if(hs != null) {
|
||||||
|
@ -173,7 +172,7 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
Builder bld = new AlertDialog.Builder(SettingsOsMoActivity.this);
|
AlertDialog.Builder bld = new AlertDialog.Builder(SettingsOsMoActivity.this);
|
||||||
bld.setMessage(R.string.osmo_regenerate_login_ids_confirm);
|
bld.setMessage(R.string.osmo_regenerate_login_ids_confirm);
|
||||||
bld.setPositiveButton(R.string.shared_string_yes, new OnClickListener() {
|
bld.setPositiveButton(R.string.shared_string_yes, new OnClickListener() {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
package net.osmand.plus.parkingpoint;
|
package net.osmand.plus.parkingpoint;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.Typeface;
|
import android.graphics.Typeface;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
|
|
@ -2,11 +2,10 @@ package net.osmand.plus.parkingpoint;
|
||||||
|
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.text.format.DateFormat;
|
import android.text.format.DateFormat;
|
||||||
import android.text.format.Time;
|
import android.text.format.Time;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
@ -290,7 +289,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
||||||
* Method creates confirmation dialog for deletion of a parking location.
|
* Method creates confirmation dialog for deletion of a parking location.
|
||||||
*/
|
*/
|
||||||
public AlertDialog showDeleteDialog(final Activity activity) {
|
public AlertDialog showDeleteDialog(final Activity activity) {
|
||||||
Builder confirm = new AlertDialog.Builder(activity);
|
AlertDialog.Builder confirm = new AlertDialog.Builder(activity);
|
||||||
confirm.setTitle(activity.getString(R.string.osmand_parking_delete));
|
confirm.setTitle(activity.getString(R.string.osmand_parking_delete));
|
||||||
confirm.setMessage(activity.getString(R.string.osmand_parking_delete_confirm));
|
confirm.setMessage(activity.getString(R.string.osmand_parking_delete_confirm));
|
||||||
confirm.setCancelable(true);
|
confirm.setCancelable(true);
|
||||||
|
@ -317,7 +316,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
||||||
*/
|
*/
|
||||||
private void showSetTimeLimitDialog(final MapActivity mapActivity, final Dialog choose) {
|
private void showSetTimeLimitDialog(final MapActivity mapActivity, final Dialog choose) {
|
||||||
final View setTimeParking = mapActivity.getLayoutInflater().inflate(R.layout.parking_set_time_limit, null);
|
final View setTimeParking = mapActivity.getLayoutInflater().inflate(R.layout.parking_set_time_limit, null);
|
||||||
Builder setTime = new AlertDialog.Builder(mapActivity);
|
AlertDialog.Builder setTime = new AlertDialog.Builder(mapActivity);
|
||||||
setTime.setView(setTimeParking);
|
setTime.setView(setTimeParking);
|
||||||
setTime.setTitle(mapActivity.getString(R.string.osmand_parking_time_limit_title));
|
setTime.setTitle(mapActivity.getString(R.string.osmand_parking_time_limit_title));
|
||||||
setTime.setNegativeButton(R.string.shared_string_cancel, new DialogInterface.OnClickListener() {
|
setTime.setNegativeButton(R.string.shared_string_cancel, new DialogInterface.OnClickListener() {
|
||||||
|
@ -407,7 +406,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
|
||||||
*/
|
*/
|
||||||
private void showDeleteEventWarning(final Activity activity) {
|
private void showDeleteEventWarning(final Activity activity) {
|
||||||
if (isParkingEventAdded()) {
|
if (isParkingEventAdded()) {
|
||||||
Builder deleteEventWarning = new AlertDialog.Builder(activity);
|
AlertDialog.Builder deleteEventWarning = new AlertDialog.Builder(activity);
|
||||||
deleteEventWarning.setTitle(activity.getString(R.string.osmand_parking_warning));
|
deleteEventWarning.setTitle(activity.getString(R.string.osmand_parking_warning));
|
||||||
deleteEventWarning.setMessage(activity.getString(R.string.osmand_parking_warning_text));
|
deleteEventWarning.setMessage(activity.getString(R.string.osmand_parking_warning_text));
|
||||||
deleteEventWarning.setNeutralButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
deleteEventWarning.setNeutralButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
package net.osmand.plus.rastermaps;
|
package net.osmand.plus.rastermaps;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.AdapterView.OnItemSelectedListener;
|
import android.widget.AdapterView.OnItemSelectedListener;
|
||||||
|
@ -150,7 +149,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
||||||
final MapActivityLayers layers = activity.getMapLayers();
|
final MapActivityLayers layers = activity.getMapLayers();
|
||||||
Map<String, String> entriesMap = settings.getTileSourceEntries();
|
Map<String, String> entriesMap = settings.getTileSourceEntries();
|
||||||
final ArrayList<String> keys = new ArrayList<String>(entriesMap.keySet());
|
final ArrayList<String> keys = new ArrayList<String>(entriesMap.keySet());
|
||||||
Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
final String[] items = new String[entriesMap.size() + 1];
|
final String[] items = new String[entriesMap.size() + 1];
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for(String it : entriesMap.values()){
|
for(String it : entriesMap.values()){
|
||||||
|
@ -285,7 +284,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
||||||
AccessibleToast.makeText(activity, R.string.shared_string_io_error, Toast.LENGTH_SHORT).show();
|
AccessibleToast.makeText(activity, R.string.shared_string_io_error, Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Builder builder = new AlertDialog.Builder(activity);
|
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||||
String[] names = new String[downloaded.size()];
|
String[] names = new String[downloaded.size()];
|
||||||
for (int i = 0; i < names.length; i++) {
|
for (int i = 0; i < names.length; i++) {
|
||||||
names[i] = downloaded.get(i).getName();
|
names[i] = downloaded.get(i).getName();
|
||||||
|
@ -339,7 +338,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
|
||||||
TileSourceTemplate ts = new TileSourceTemplate("NewMapnik","http://mapnik.osmand.net/{0}/{1}/{2}.png",
|
TileSourceTemplate ts = new TileSourceTemplate("NewMapnik","http://mapnik.osmand.net/{0}/{1}/{2}.png",
|
||||||
"png", 17, 5, 256, 16, 32000);
|
"png", 17, 5, 256, 16, 32000);
|
||||||
final TileSourceTemplate[] result = new TileSourceTemplate[] { ts };
|
final TileSourceTemplate[] result = new TileSourceTemplate[] { ts };
|
||||||
Builder bld = new AlertDialog.Builder(activity);
|
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
|
||||||
View view = activity.getLayoutInflater().inflate(R.layout.editing_tile_source, null);
|
View view = activity.getLayoutInflater().inflate(R.layout.editing_tile_source, null);
|
||||||
final EditText name = (EditText) view.findViewById(R.id.Name);
|
final EditText name = (EditText) view.findViewById(R.id.Name);
|
||||||
final Spinner existing = (Spinner) view.findViewById(R.id.TileSourceSpinner);
|
final Spinner existing = (Spinner) view.findViewById(R.id.TileSourceSpinner);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package net.osmand.plus.views;
|
package net.osmand.plus.views;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.graphics.Canvas;
|
import android.graphics.Canvas;
|
||||||
|
@ -10,6 +9,7 @@ import android.graphics.PointF;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
package net.osmand.plus.views;
|
package net.osmand.plus.views;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import android.content.Context;
|
||||||
import java.util.List;
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.PointF;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
|
||||||
import net.osmand.access.AccessibleToast;
|
|
||||||
import net.osmand.data.LatLon;
|
import net.osmand.data.LatLon;
|
||||||
import net.osmand.data.PointDescription;
|
import net.osmand.data.PointDescription;
|
||||||
import net.osmand.data.QuadRect;
|
import net.osmand.data.QuadRect;
|
||||||
|
@ -13,16 +18,9 @@ import net.osmand.plus.ContextMenuAdapter;
|
||||||
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
import net.osmand.plus.resources.TransportIndexRepository;
|
import net.osmand.plus.resources.TransportIndexRepository;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
import java.util.ArrayList;
|
||||||
import android.content.Context;
|
import java.util.List;
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.graphics.PointF;
|
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider {
|
public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider {
|
||||||
private static final int startZoom = 12;
|
private static final int startZoom = 12;
|
||||||
|
@ -164,7 +162,7 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showDescriptionDialog(TransportStop a) {
|
private void showDescriptionDialog(TransportStop a) {
|
||||||
Builder bs = new AlertDialog.Builder(view.getContext());
|
AlertDialog.Builder bs = new AlertDialog.Builder(view.getContext());
|
||||||
bs.setTitle(a.getName(view.getSettings().MAP_PREFERRED_LOCALE.get()));
|
bs.setTitle(a.getName(view.getSettings().MAP_PREFERRED_LOCALE.get()));
|
||||||
bs.setMessage(getStopDescription(a, true));
|
bs.setMessage(getStopDescription(a, true));
|
||||||
bs.show();
|
bs.show();
|
||||||
|
|
|
@ -1,5 +1,16 @@
|
||||||
package net.osmand.plus.views.mapwidgets;
|
package net.osmand.plus.views.mapwidgets;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import net.osmand.Location;
|
import net.osmand.Location;
|
||||||
import net.osmand.ValueHolder;
|
import net.osmand.ValueHolder;
|
||||||
import net.osmand.binary.RouteDataObject;
|
import net.osmand.binary.RouteDataObject;
|
||||||
|
@ -25,17 +36,6 @@ import net.osmand.plus.views.OsmandMapLayer.DrawSettings;
|
||||||
import net.osmand.plus.views.controls.MapRouteInfoControl;
|
import net.osmand.plus.views.controls.MapRouteInfoControl;
|
||||||
import net.osmand.plus.views.mapwidgets.NextTurnInfoWidget.TurnDrawable;
|
import net.osmand.plus.views.mapwidgets.NextTurnInfoWidget.TurnDrawable;
|
||||||
import net.osmand.router.TurnType;
|
import net.osmand.router.TurnType;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.app.AlertDialog.Builder;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
public class MapInfoWidgetsFactory {
|
public class MapInfoWidgetsFactory {
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public class MapInfoWidgetsFactory {
|
||||||
final ValueHolder<Integer> vs = new ValueHolder<Integer>();
|
final ValueHolder<Integer> vs = new ValueHolder<Integer>();
|
||||||
vs.value = app.getSettings().SERVICE_OFF_INTERVAL.get();
|
vs.value = app.getSettings().SERVICE_OFF_INTERVAL.get();
|
||||||
final AlertDialog[] dlgshow = new AlertDialog[1];
|
final AlertDialog[] dlgshow = new AlertDialog[1];
|
||||||
Builder dlg = new AlertDialog.Builder(map);
|
AlertDialog.Builder dlg = new AlertDialog.Builder(map);
|
||||||
dlg.setTitle(app.getString(R.string.enable_sleep_mode));
|
dlg.setTitle(app.getString(R.string.enable_sleep_mode));
|
||||||
WindowManager mgr = (WindowManager) map.getSystemService(Context.WINDOW_SERVICE);
|
WindowManager mgr = (WindowManager) map.getSystemService(Context.WINDOW_SERVICE);
|
||||||
DisplayMetrics dm = new DisplayMetrics();
|
DisplayMetrics dm = new DisplayMetrics();
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
package net.osmand.plus.voice;
|
package net.osmand.plus.voice;
|
||||||
|
|
||||||
import java.io.File;
|
import android.app.Activity;
|
||||||
import java.util.HashMap;
|
import android.content.Context;
|
||||||
import java.util.List;
|
import android.content.DialogInterface;
|
||||||
import java.util.Locale;
|
import android.content.Intent;
|
||||||
import java.util.Map;
|
import android.net.Uri;
|
||||||
|
import android.speech.tts.TextToSpeech;
|
||||||
|
import android.speech.tts.TextToSpeech.OnInitListener;
|
||||||
|
import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
import android.app.Notification;
|
|
||||||
import android.app.PendingIntent;
|
|
||||||
import android.support.v4.app.NotificationCompat;
|
|
||||||
import android.support.v4.app.NotificationManagerCompat;
|
|
||||||
import net.osmand.PlatformUtil;
|
import net.osmand.PlatformUtil;
|
||||||
import net.osmand.plus.OsmandApplication;
|
import net.osmand.plus.OsmandApplication;
|
||||||
import net.osmand.plus.R;
|
import net.osmand.plus.R;
|
||||||
|
@ -21,16 +21,11 @@ import org.apache.commons.logging.Log;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import android.app.Activity;
|
import java.io.File;
|
||||||
import android.app.AlertDialog;
|
import java.util.HashMap;
|
||||||
import android.app.AlertDialog.Builder;
|
import java.util.List;
|
||||||
import android.content.Context;
|
import java.util.Locale;
|
||||||
import android.content.DialogInterface;
|
import java.util.Map;
|
||||||
import android.content.Intent;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.speech.tts.TextToSpeech;
|
|
||||||
import android.speech.tts.TextToSpeech.OnInitListener;
|
|
||||||
import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener;
|
|
||||||
|
|
||||||
|
|
||||||
public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
||||||
|
@ -161,7 +156,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
||||||
{
|
{
|
||||||
case TextToSpeech.LANG_MISSING_DATA:
|
case TextToSpeech.LANG_MISSING_DATA:
|
||||||
if (isSettingsActivity(act)) {
|
if (isSettingsActivity(act)) {
|
||||||
Builder builder = createAlertDialog(
|
AlertDialog.Builder builder = createAlertDialog(
|
||||||
R.string.tts_missing_language_data_title,
|
R.string.tts_missing_language_data_title,
|
||||||
R.string.tts_missing_language_data,
|
R.string.tts_missing_language_data,
|
||||||
new IntentStarter(
|
new IntentStarter(
|
||||||
|
@ -183,7 +178,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
||||||
//maybe weird, but I didn't want to introduce parameter in around 5 methods just to do
|
//maybe weird, but I didn't want to introduce parameter in around 5 methods just to do
|
||||||
//this if condition
|
//this if condition
|
||||||
if (isSettingsActivity(act)) {
|
if (isSettingsActivity(act)) {
|
||||||
Builder builder = createAlertDialog(
|
AlertDialog.Builder builder = createAlertDialog(
|
||||||
R.string.tts_language_not_supported_title,
|
R.string.tts_language_not_supported_title,
|
||||||
R.string.tts_language_not_supported,
|
R.string.tts_language_not_supported,
|
||||||
new IntentStarter(
|
new IntentStarter(
|
||||||
|
@ -214,9 +209,9 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Builder createAlertDialog(int titleResID, int messageResID,
|
private AlertDialog.Builder createAlertDialog(int titleResID, int messageResID,
|
||||||
IntentStarter intentStarter, final Activity ctx) {
|
IntentStarter intentStarter, final Activity ctx) {
|
||||||
Builder builder = new AlertDialog.Builder(ctx);
|
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
|
||||||
builder.setCancelable(true);
|
builder.setCancelable(true);
|
||||||
builder.setNegativeButton(R.string.shared_string_no, null);
|
builder.setNegativeButton(R.string.shared_string_no, null);
|
||||||
builder.setPositiveButton(R.string.shared_string_yes, intentStarter);
|
builder.setPositiveButton(R.string.shared_string_yes, intentStarter);
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.osmand.nautical;
|
||||||
|
|
||||||
import net.osmand.nauticalPlugin.R;
|
import net.osmand.nauticalPlugin.R;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package net.osmand.parkingPlugin;
|
package net.osmand.parkingPlugin;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -10,6 +9,7 @@ import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
public class ParkingPluginActivity extends Activity {
|
public class ParkingPluginActivity extends Activity {
|
||||||
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package net.osmand.srtmPlugin;
|
package net.osmand.srtmPlugin;
|
||||||
|
|
||||||
import net.osmand.srtmPlugin.paid.R;
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
@ -11,6 +9,9 @@ import android.content.pm.PackageManager;
|
||||||
import android.content.pm.ResolveInfo;
|
import android.content.pm.ResolveInfo;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AlertDialog;
|
||||||
|
|
||||||
|
import net.osmand.srtmPlugin.paid.R;
|
||||||
|
|
||||||
public class SRTMPluginActivity extends Activity {
|
public class SRTMPluginActivity extends Activity {
|
||||||
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$
|
||||||
|
|
|
@ -2,7 +2,7 @@ package net.osmand.skimaps;
|
||||||
|
|
||||||
import net.osmand.skimapsPlugin.R;
|
import net.osmand.skimapsPlugin.R;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.content.ActivityNotFoundException;
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
|
Loading…
Reference in a new issue