Dialogs replaced with AppCompatDialogs

This commit is contained in:
GaidamakUA 2015-11-11 12:42:13 +02:00
parent 4f97ccc711
commit b3266d86af
69 changed files with 1368 additions and 1130 deletions

View file

@ -1,63 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionName="@string/app_version"
android:versionCode="231"
package="net.osmand.plus">
package="net.osmand.plus"
android:installLocation="auto"
android:versionCode="231"
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-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-feature
android:name="android.hardware.camera.autofocus"
android:required="false" />
<uses-feature
android:name="android.hardware.microphone"
android:required="false" />
<uses-feature
android:name="android.hardware.wifi"
android:required="false" />
<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" />
<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" />
<supports-screens
android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<android:uses-permission android:name="android.permission.READ_PHONE_STATE" />
<android:uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- android:theme="@style/OsmandLightDarkActionBarTheme" -->
<application
android:name=".OsmandApplication"
android:allowBackup="true"
android:backupAgent=".OsmandBackupAgent"
android:configChanges="locale"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:largeHeap="true"
android:restoreAnyVersion="true"
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="" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<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: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" />
<activity android:name=".activities.HelpActivity" />
<activity android:name=".activities.ExitActivity" />
<provider
android:name="android.support.v4.content.FileProvider"
@ -69,224 +123,355 @@
android:resource="@xml/paths" />
</provider>
<activity android:name="net.osmand.plus.activities.MapActivity" android:label="@string/app_name"
android:screenOrientation="unspecified" android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="content" android:host="*" android:mimeType="binary/octet-stream" />
<data android:scheme="content" android:host="*" android:mimeType="application/octet-stream" />
</intent-filter>
<activity
android:name=".activities.MapActivity"
android:label="@string/app_name"
android:launchMode="singleTop"
android:screenOrientation="unspecified" >
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.SEND" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<category android:name="android.intent.category.DEFAULT" />
<intent-filter>
<data android:scheme="http" />
<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>
<data
android:host="*"
android:mimeType="binary/octet-stream"
android:scheme="content" />
<data
android:host="*"
android:mimeType="application/octet-stream"
android:scheme="content" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<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>
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
</intent-filter>
<intent-filter>
<data android:scheme="http" />
<data android:host="osmand.net" />
<data android:pathPrefix="/go" />
<action android:name="android.intent.action.VIEW" />
<!-- android matches non-greedy : http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i-->
<!-- mimeType&host are both needed or you will either have unwanted matching or no match when needed -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<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=".*\\..*\\..*\\..*\\.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>
<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>
<intent-filter>
<data android:scheme="https" />
<data android:host="osmand.net" />
<data android:pathPrefix="/go" />
<!-- google navigation intent -->
<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>
<action android:name="android.intent.action.VIEW" />
<receiver android:name="net.osmand.plus.audionotes.MediaRemoteControlReceiver">
<intent-filter>
<action android:name="android.intent.action.CAMERA_BUTTON" />
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
<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>
<activity android:name="net.osmand.plus.activities.SettingsActivity" android:label="@string/shared_string_settings" android:configChanges="keyboardHidden|orientation" />
<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" />
<!-- android matches non-greedy : http://stackoverflow.com/questions/3400072/pathpattern-to-match-file-extension-does-not-work-if-a-period-exists-elsewhere-i -->
<!-- mimeType&host are both needed or you will either have unwanted matching or no match when needed -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<activity android:name="net.osmand.plus.osmedit.SettingsOsmEditingActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="net.osmand.plus.development.SettingsDevelopmentActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="net.osmand.plus.audionotes.SettingsAudioVideoActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="net.osmand.access.SettingsAccessibilityActivity" android:configChanges="keyboardHidden|orientation" />
<category android:name="android.intent.category.DEFAULT" />
<activity android:name="net.osmand.plus.activities.search.SearchActivity" android:label="@string/search_activity" />
<activity android:name="net.osmand.plus.activities.ShowRouteInfoActivity" android:label="@string/show_route" />
<activity android:name="net.osmand.plus.activities.FavoritesListActivity" android:label="@string/favourites_list_activity" />
<activity android:name=".myplaces.FavoritesActivity" android:windowSoftInputMode="adjustPan" />
<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" />
<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=".*\\..*\\..*\\..*\\.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>
<!-- google navigation intent -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<activity android:name="net.osmand.plus.osmo.SettingsOsMoActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="net.osmand.plus.osmo.OsMoGroupsActivity">
<intent-filter>
<data android:scheme="http" android:host="z.osmo.mobi" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
</intent-filter>
</activity>
<category android:name="android.intent.category.DEFAULT" />
<activity android:name="net.osmand.plus.activities.search.SearchPOIActivity" android:label="@string/searchpoi_activity" />
<activity android:name="net.osmand.plus.activities.search.SearchAddressActivity" android:label="@string/select_address_activity" />
<activity android:name="net.osmand.plus.activities.search.SearchCityByNameActivity" />
<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" />
<data android:scheme="google.navigation" />
<data android:scheme="osmand.navigation" />
</intent-filter>
</activity>
<activity android:name="net.osmand.plus.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:scheme="http" android:host="www.google.com" android:pathPrefix="/maps" />
<data android:scheme="https" android:host="www.google.com" android:pathPrefix="/maps" />
<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" android:host="openstreetmap.de" android:pathPrefix="/karte" />
<data android:scheme="https" android:host="openstreetmap.de" android:pathPrefix="/karte" />
<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" android:host="download.osmand.net" android:pathPrefix="/go" />
<data android:scheme="http" android:host="download.osmand.net" 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>
<!-- requires read permission -->
<!--
<receiver android:name=".audionotes.MediaRemoteControlReceiver" >
<intent-filter>
<action android:name="android.intent.action.CAMERA_BUTTON" />
<action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>
</receiver>
<activity
android:name=".activities.SettingsActivity"
android:configChanges="keyboardHidden|orientation"
android:label="@string/shared_string_settings" />
<activity
android:name=".activities.SettingsGeneralActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name=".activities.SettingsNavigationActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name=".monitoring.SettingsMonitoringActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name=".rastermaps.SettingsRasterMapsActivity"
android:configChanges="keyboardHidden|orientation" />
<activity android:name=".routepointsnavigation.RoutePointsActivity" />
<activity
android:name=".osmedit.SettingsOsmEditingActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name=".development.SettingsDevelopmentActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name=".audionotes.SettingsAudioVideoActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name="net.osmand.access.SettingsAccessibilityActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name=".activities.search.SearchActivity"
android:label="@string/search_activity" />
<activity
android:name=".activities.ShowRouteInfoActivity"
android:label="@string/show_route" />
<activity
android:name=".activities.FavoritesListActivity"
android:label="@string/favourites_list_activity" />
<activity
android:name=".myplaces.FavoritesActivity"
android:windowSoftInputMode="adjustPan" />
<activity android:name=".activities.TrackActivity" />
<activity android:name=".activities.PluginsActivity" />
<activity android:name=".activities.PluginActivity" />
<activity
android:name=".activities.ContributionVersionActivity"
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">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/postal-address_v2" />
</intent-filter>
-->
</activity>
-->
</activity>
<activity android:name=".development.TestVoiceActivity" />
<activity
android:name=".download.DownloadActivity"
android:label="" />
<activity android:name="net.osmand.plus.development.TestVoiceActivity" />
<activity android:name="net.osmand.plus.download.DownloadActivity" android:label="" />
<!-- keep android:process on a separate line !! -->
<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 !! -->
<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=".OnNavigationServiceAlarmReceiver" />
<receiver android:name="net.osmand.plus.OnNavigationServiceAlarmReceiver" />
<activity android:name="net.osmand.plus.activities.PrintDialogActivity" />
<activity android:name=".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" />
<receiver
android:name=".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>
<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>
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED" />
</intent-filter>
</receiver>
</application>
</manifest>

View file

@ -1,9 +1,10 @@
package net.osmand.access;
import android.content.Context;
import android.support.v7.app.AlertDialog;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.R;
import android.app.AlertDialog.Builder;
import android.content.Context;
// Since usual message in an AlertDialog that is set by
// AlertDialog.Builder.setMessage() is spoken only once
@ -17,7 +18,7 @@ import android.content.Context;
// or system accessibility service is turned off this class
// 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
// starting from API level 11, so store it here.
@ -33,14 +34,14 @@ public class AccessibleAlertBuilder extends Builder {
// Provided setMessage() alternatives.
@Override
public Builder setMessage(CharSequence msg) {
public AlertDialog.Builder setMessage(CharSequence msg) {
if (((OsmandApplication) context.getApplicationContext()).accessibilityExtensions())
return setView(TextMessage.makeView(context, msg, R.layout.alert));
return super.setMessage(msg);
}
@Override
public Builder setMessage(int msgid) {
public AlertDialog.Builder setMessage(int msgid) {
if (((OsmandApplication) context.getApplicationContext()).accessibilityExtensions())
return setView(TextMessage.makeView(context, msgid, R.layout.alert));
return super.setMessage(msgid);

View file

@ -1,8 +1,10 @@
package net.osmand.access;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.content.DialogInterface;
import android.os.SystemClock;
import android.support.v7.app.AlertDialog;
import net.osmand.Location;
import net.osmand.data.LatLon;
@ -12,10 +14,9 @@ import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.access.RelativeDirectionStyle;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.SystemClock;
import java.util.ArrayList;
import java.util.List;
public class NavigationInfo {
@ -26,14 +27,14 @@ public class NavigationInfo {
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.right,
R.string.back_right,
R.string.back,
R.string.back_left,
R.string.left,
R.string.front_left };
R.string.front_left};
private RelativeDirectionStyle style;
private int value;
@ -107,7 +108,7 @@ 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_east,
R.string.east_north_east,
@ -122,7 +123,7 @@ public class NavigationInfo {
R.string.west,
R.string.west_north_west,
R.string.north_west,
R.string.north_north_west };
R.string.north_north_west};
private final OsmandApplication context;
private final OsmandSettings settings;

View file

@ -1,12 +1,12 @@
package net.osmand.plus;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AlertDialog;
import net.osmand.IProgress;
import net.osmand.IndexConstants;

View file

@ -1,5 +1,18 @@
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.FileInputStream;
import java.io.FileOutputStream;
@ -12,19 +25,6 @@ import java.util.List;
import java.util.Map;
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 interface FavoritesUpdatedListener {

View file

@ -1,24 +1,5 @@
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.DialogInterface;
import android.content.Intent;
@ -36,8 +17,28 @@ import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v7.app.AlertDialog;
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 {
private static final String SIMULATED_PROVIDER = "OsmAnd";

View file

@ -1,18 +1,9 @@
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.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.CompoundButton.OnCheckedChangeListener;
@ -22,6 +13,15 @@ import android.widget.SeekBar;
import android.widget.TextView;
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 {
private Thread routeAnimation;
@ -53,7 +53,7 @@ public class OsmAndLocationSimulation {
public void startStopRouteAnimation(final Activity ma, final Runnable runnable) {
if (!isRouteAnimating()) {
Builder builder = new AlertDialog.Builder(ma);
AlertDialog.Builder builder = new AlertDialog.Builder(ma);
builder.setTitle(R.string.animate_route);
final View view = ma.getLayoutInflater().inflate(R.layout.animate_route, null);

View file

@ -2,8 +2,6 @@ package net.osmand.plus;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Application;
import android.app.PendingIntent;
import android.content.Context;
@ -16,6 +14,7 @@ import android.os.AsyncTask;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AlertDialog;
import android.text.format.DateFormat;
import android.util.TypedValue;
import android.view.View;
@ -342,7 +341,7 @@ public class OsmandApplication extends Application {
String voiceProvider = osmandSettings.VOICE_PROVIDER.get();
if (voiceProvider == null || OsmandSettings.VOICE_PROVIDER_NOT_USE.equals(voiceProvider)) {
if (warningNoneProvider && voiceProvider == null) {
Builder builder = new AccessibleAlertBuilder(uiContext);
AlertDialog.Builder builder = new AccessibleAlertBuilder(uiContext);
LinearLayout ll = new LinearLayout(uiContext);
ll.setOrientation(LinearLayout.VERTICAL);
final TextView tv = new TextView(uiContext);
@ -408,7 +407,7 @@ public class OsmandApplication extends Application {
public synchronized void closeApplication(final Activity activity) {
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.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override

View file

@ -1,13 +1,9 @@
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.os.Build.VERSION;
import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.v4.view.ViewCompat;
import android.support.v7.widget.Toolbar;
import android.util.TypedValue;
@ -15,7 +11,11 @@ import android.view.View;
import android.view.ViewGroup;
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 View shadowView;
@ -26,7 +26,7 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
@Override
protected void onCreate(final Bundle savedInstanceState) {
//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;
if (settings.OSMAND_THEME.get() == OsmandSettings.OSMAND_DARK_THEME) {
t = R.style.OsmandDarkTheme;
@ -44,7 +44,7 @@ public abstract class ActionBarPreferenceActivity extends PreferenceActivity {
shadowView = null;
}
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.setTitleTextColor(getResources().getColor(getResIdFromAttribute(this, R.attr.pstsTextColor)));
tb.setNavigationOnClickListener(new View.OnClickListener() {

View file

@ -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;
}
}

View file

@ -1,16 +1,19 @@
package net.osmand.plus.activities;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URL;
import java.net.URLConnection;
import java.text.MessageFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Filterable;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.AndroidUtils;
import net.osmand.access.AccessibleToast;
@ -20,21 +23,16 @@ import net.osmand.plus.R;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserFactory;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Filterable;
import android.widget.TextView;
import android.widget.Toast;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URLConnection;
import java.text.MessageFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ContributionVersionActivity extends OsmandListActivity {
@ -210,7 +208,7 @@ public class ContributionVersionActivity extends OsmandListActivity {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
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,
AndroidUtils.formatDateTime(getMyApplication(), item.date.getTime()), item.size));
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {

View file

@ -1,8 +1,14 @@
package net.osmand.plus.activities;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.List;
import android.app.ProgressDialog;
import android.content.Context;
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.access.AccessibleToast;
@ -23,18 +29,8 @@ import net.osmand.util.MapUtils;
import org.apache.commons.logging.Log;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
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;
import java.text.MessageFormat;
import java.util.List;
public class DownloadTilesDialog {
@ -67,7 +63,7 @@ public class DownloadTilesDialog {
final int zoom = rb.getZoom();
// 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);
View view = inflater.inflate(R.layout.download_tiles, null);

View file

@ -4,27 +4,10 @@
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.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
@ -35,9 +18,25 @@ import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.ListView;
import android.widget.ScrollView;
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();
View v = lv.getChildAt(0);
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>();
Set<String> acceptedCategories = filter.getAcceptedSubtypes(poiCategory);
if (acceptedCategories != null) {

View file

@ -1,16 +1,39 @@
package net.osmand.plus.activities;
import gnu.trove.list.array.TIntArrayList;
import java.io.File;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
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.data.FavouritePoint;
@ -32,41 +55,18 @@ import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.plus.myplaces.FavoritesActivity;
import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.AsyncTask;
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;
import java.io.File;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import gnu.trove.list.array.TIntArrayList;
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) {
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);
final View v = LayoutInflater.from(ctx).inflate(R.layout.favorite_edit_dialog,
null, false);
@ -247,7 +247,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
private boolean deletePoint(final FavouritePoint point) {
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.setNegativeButton(R.string.shared_string_no, null);
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@ -295,7 +295,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
final TargetPointsHelper targetPointsHelper = getMyApplication().getTargetPointsHelper();
if (targetPointsHelper.getIntermediatePoints().size() > 0) {
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.setItems(
new String[] { act.getString(R.string.keep_intermediate_points),
@ -491,7 +491,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
}
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);
final EditText nameEditText = (EditText) view.findViewById(R.id.nameEditText);
@ -532,7 +532,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
private void deleteFavoritesAction() {
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.setPositiveButton(R.string.shared_string_delete, new DialogInterface.OnClickListener() {
@Override
@ -615,7 +615,7 @@ public class FavoritesTreeFragment extends OsmandExpandableListFragment {
};
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() {
@Override
public void onClick(DialogInterface dialog, int which) {

View file

@ -1,29 +1,12 @@
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.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnShowListener;
import android.graphics.Color;
import android.os.AsyncTask;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
@ -38,6 +21,23 @@ import android.widget.ListView;
import android.widget.ProgressBar;
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 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.setInverseBackgroundForced(true);
lv.setBackgroundColor(Color.WHITE);

View file

@ -1,14 +1,13 @@
package net.osmand.plus.activities;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
@ -20,6 +19,7 @@ import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import net.londatiga.android.ActionItem;
import net.londatiga.android.QuickAction;
import net.osmand.IndexConstants;
@ -85,7 +85,7 @@ public class MapActivityActions implements DialogProvider {
private OsmandSettings settings;
private RoutingHelper routingHelper;
public MapActivityActions(MapActivity mapActivity){
public MapActivityActions(MapActivity mapActivity) {
this.mapActivity = mapActivity;
settings = mapActivity.getMyApplication().getSettings();
routingHelper = mapActivity.getMyApplication().getRoutingHelper();
@ -94,14 +94,14 @@ public class MapActivityActions implements DialogProvider {
public void showNavigationContextMenuPoint(final double latitude, final double longitude) {
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(
R.drawable.ic_action_gdirections_dark).reg();
adapter.item(R.string.context_menu_item_directions_from).iconColor(
R.drawable.ic_action_gdirections_dark).reg();
}
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_intermediate_point).iconColor(R.drawable.ic_action_flage_dark).reg();
// For button-less search UI
@ -111,9 +111,9 @@ public class MapActivityActions implements DialogProvider {
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);
final ArrayAdapter<?> listAdapter =
final ArrayAdapter<?> listAdapter =
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() {
@ -152,7 +152,7 @@ public class MapActivityActions implements DialogProvider {
public void addAsWaypoint(double latitude, double longitude) {
TargetPointsHelper targets = getMyApplication().getTargetPointsHelper();
boolean destination = (targets.getPointToNavigate() == null);
boolean destination = (targets.getPointToNavigate() == null);
targets.navigateToPoint(new LatLon(latitude, longitude), true,
destination ? -1 : targets.getIntermediatePoints().size(),
@ -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;
PointDescription pointDescription = mapActivity.getContextMenu().getPointDescription();
if (!pointDescription.isWpt() && !mapActivity.getContextMenu().isAddressUnknown()) {
@ -188,12 +188,12 @@ public class MapActivityActions implements DialogProvider {
} else {
name = "";
}
enhance(dialogBundle,latitude,longitude, name);
mapActivity.showDialog(DIALOG_ADD_WAYPOINT);
}
enhance(dialogBundle, latitude, longitude, name);
mapActivity.showDialog(DIALOG_ADD_WAYPOINT);
}
private Dialog createAddWaypointDialog(final Bundle args) {
Builder builder = new AlertDialog.Builder(mapActivity);
private Dialog createAddWaypointDialog(final Bundle args) {
AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
builder.setTitle(R.string.add_waypoint_dialog_title);
View view = mapActivity.getLayoutInflater().inflate(R.layout.add_gpx_point_dialog, null);
final EditText editText = (EditText) view.findViewById(android.R.id.edit);
@ -222,34 +222,34 @@ public class MapActivityActions implements DialogProvider {
}
});
return alertDialog;
}
}
public void reloadTile(final int zoom, final double latitude, final double longitude){
enhance(dialogBundle,latitude,longitude,zoom);
mapActivity.showDialog(DIALOG_RELOAD_TITLE);
}
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){
return mapActivity.getString(res);
}
protected String getString(int res) {
return mapActivity.getString(res);
}
protected void showToast(final String msg){
mapActivity.runOnUiThread(new Runnable() {
protected void showToast(final String msg) {
mapActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
AccessibleToast.makeText(mapActivity, msg, Toast.LENGTH_LONG).show();
}
});
}
}
public void aboutRoute() {
Intent intent = new Intent(mapActivity, ShowRouteInfoActivity.class);
public void aboutRoute() {
Intent intent = new Intent(mapActivity, ShowRouteInfoActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
mapActivity.startActivity(intent);
}
}
protected Location getLastKnownLocation() {
protected Location getLastKnownLocation() {
return getMyApplication().getLocationProvider().getLastKnownLocation();
}
@ -261,7 +261,7 @@ public class MapActivityActions implements DialogProvider {
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 File fileDir = app.getAppPath(IndexConstants.GPX_INDEX_DIR);
final Dialog dlg = new Dialog(activity);
@ -269,13 +269,13 @@ public class MapActivityActions implements DialogProvider {
dlg.setContentView(R.layout.save_directions_dialog);
final EditText edit = (EditText) dlg.findViewById(R.id.FileNameEdit);
final GPXRouteParamsBuilder rp = routingHelper.getCurrentGPXRoute();
final String editText;
if (rp == null || rp.getFile() == null || rp.getFile().path == null) {
editText = "_" + MessageFormat.format("{0,date,yyyy-MM-dd}", new Date()) + "_";
} else {
editText = new File(rp.getFile().path).getName();
}
final GPXRouteParamsBuilder rp = routingHelper.getCurrentGPXRoute();
final String editText;
if (rp == null || rp.getFile() == null || rp.getFile().path == null) {
editText = "_" + MessageFormat.format("{0,date,yyyy-MM-dd}", new Date()) + "_";
} else {
editText = new File(rp.getFile().path).getName();
}
edit.setText(editText);
((Button) dlg.findViewById(R.id.Save)).setOnClickListener(new View.OnClickListener() {
@ -331,7 +331,7 @@ public class MapActivityActions implements DialogProvider {
@Override
protected void onPostExecute(String result) {
if(result != null){
if (result != null) {
AccessibleToast.makeText(app, result, Toast.LENGTH_LONG).show();
}
}
@ -344,8 +344,8 @@ public class MapActivityActions implements DialogProvider {
OsmandPlugin.registerMapContextMenu(mapActivity, latitude, longitude, adapter, selectedObj);
getMyApplication().getAppCustomization().prepareLocationMenu(mapActivity, adapter);
final Builder builder = new AlertDialog.Builder(mapActivity);
final ArrayAdapter<?> listAdapter =
final AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
final ArrayAdapter<?> listAdapter =
adapter.createListAdapter(mapActivity, getMyApplication().getSettings().isLightContent());
builder.setAdapter(listAdapter, new DialogInterface.OnClickListener() {
@ -368,7 +368,7 @@ public class MapActivityActions implements DialogProvider {
}
public void setGPXRouteParams(GPXFile result) {
if(result == null) {
if (result == null) {
mapActivity.getRoutingHelper().setGpxParams(null);
settings.FOLLOW_THE_GPX_ROUTE.set(null);
} else {
@ -410,8 +410,8 @@ public class MapActivityActions implements DialogProvider {
}
if (gpxFiles.size() > 0 && !useCurrentGPX) {
Builder bld = new AlertDialog.Builder(mapActivity);
if (gpxFiles.size() == 1){
AlertDialog.Builder bld = new AlertDialog.Builder(mapActivity);
if (gpxFiles.size() == 1) {
bld.setMessage(R.string.use_displayed_track_for_navigation);
bld.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@Override
@ -421,15 +421,15 @@ public class MapActivityActions implements DialogProvider {
});
} else {
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
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);
}
String path = getItem(position).path;
String name = path.substring(path.lastIndexOf("/") + 1,path.length());
((TextView)convertView.findViewById(R.id.title)).setText(name);
String name = path.substring(path.lastIndexOf("/") + 1, path.length());
((TextView) convertView.findViewById(R.id.title)).setText(name);
convertView.findViewById(R.id.icon).setVisibility(View.GONE);
convertView.findViewById(R.id.check_item).setVisibility(View.GONE);
return convertView;
@ -478,7 +478,7 @@ public class MapActivityActions implements DialogProvider {
mapActivity.getMapViewTrackingUtilities().switchToRoutePlanningMode();
mapActivity.getMapView().refreshMap(true);
mapActivity.getMapLayers().getMapControlsLayer().showDialog();
if(targets.hasTooLongDistanceToNavigate()) {
if (targets.hasTooLongDistanceToNavigate()) {
app.showToastMessage(R.string.route_is_too_long);
}
}
@ -494,39 +494,39 @@ public class MapActivityActions implements DialogProvider {
from = new LatLon(ll.getLatitude(), ll.getLongitude());
}
}
if( selected != ApplicationMode.DEFAULT) {
if (selected != ApplicationMode.DEFAULT) {
mode = selected;
} else if (mode == ApplicationMode.DEFAULT) {
mode = ApplicationMode.CAR;
if(settings.LAST_ROUTING_APPLICATION_MODE != null &&
if (settings.LAST_ROUTING_APPLICATION_MODE != null &&
settings.LAST_ROUTING_APPLICATION_MODE != ApplicationMode.DEFAULT) {
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(),
targets.getPointToNavigate().getLongitude());
if(dist >= 50000 && mode.isDerivedRoutingFrom(ApplicationMode.PEDESTRIAN)) {
mode = ApplicationMode.CAR ;
} else if(dist >= 300000 && mode.isDerivedRoutingFrom(ApplicationMode.BICYCLE)) {
mode = ApplicationMode.CAR ;
} else if(dist < 2000 && mode.isDerivedRoutingFrom(ApplicationMode.CAR)) {
mode = ApplicationMode.PEDESTRIAN ;
if (dist >= 50000 && mode.isDerivedRoutingFrom(ApplicationMode.PEDESTRIAN)) {
mode = ApplicationMode.CAR;
} else if (dist >= 300000 && mode.isDerivedRoutingFrom(ApplicationMode.BICYCLE)) {
mode = ApplicationMode.CAR;
} else if (dist < 2000 && mode.isDerivedRoutingFrom(ApplicationMode.CAR)) {
mode = ApplicationMode.PEDESTRIAN;
}
}
}
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);
}
private Dialog createReloadTitleDialog(final Bundle args) {
Builder builder = new AccessibleAlertBuilder(mapActivity);
builder.setMessage(R.string.context_menu_item_update_map_confirm);
builder.setNegativeButton(R.string.shared_string_cancel, null);
final OsmandMapTileView mapView = mapActivity.getMapView();
builder.setPositiveButton(R.string.context_menu_item_update_map, new DialogInterface.OnClickListener() {
AlertDialog.Builder builder = new AccessibleAlertBuilder(mapActivity);
builder.setMessage(R.string.context_menu_item_update_map_confirm);
builder.setNegativeButton(R.string.shared_string_cancel, null);
final OsmandMapTileView mapView = mapActivity.getMapView();
builder.setPositiveButton(R.string.context_menu_item_update_map, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
int zoom = args.getInt(KEY_ZOOM);
@ -558,8 +558,7 @@ public class MapActivityActions implements DialogProvider {
}
});
return builder.create();
}
}
@Override
@ -584,21 +583,21 @@ public class MapActivityActions implements DialogProvider {
public void onPrepareDialog(int id, Dialog dialog) {
Bundle args = dialogBundle;
switch (id) {
case DIALOG_ADD_FAVORITE:
FavoriteDialogs.prepareAddFavouriteDialog(mapActivity, dialog, args,
args.getDouble(KEY_LATITUDE), args.getDouble(KEY_LONGITUDE),
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, args.getString(KEY_NAME)));
break;
case DIALOG_ADD_WAYPOINT:
EditText v = (EditText) dialog.getWindow().findViewById(android.R.id.edit);
v.setPadding(5, 0, 5, 0);
if(args.getString(KEY_NAME) != null) {
v.setText(args.getString(KEY_NAME));
v.selectAll();
} else {
v.setText("");
}
break;
case DIALOG_ADD_FAVORITE:
FavoriteDialogs.prepareAddFavouriteDialog(mapActivity, dialog, args,
args.getDouble(KEY_LATITUDE), args.getDouble(KEY_LONGITUDE),
new PointDescription(PointDescription.POINT_TYPE_FAVORITE, args.getString(KEY_NAME)));
break;
case DIALOG_ADD_WAYPOINT:
EditText v = (EditText) dialog.getWindow().findViewById(android.R.id.edit);
v.setPadding(5, 0, 5, 0);
if (args.getString(KEY_NAME) != null) {
v.setText(args.getString(KEY_NAME));
v.selectAll();
} else {
v.setText("");
}
break;
}
}
@ -650,7 +649,7 @@ public class MapActivityActions implements DialogProvider {
LatLon loc = mapActivity.getMapLocation();
newIntent.putExtra(SearchActivity.SEARCH_LAT, loc.getLatitude());
newIntent.putExtra(SearchActivity.SEARCH_LON, loc.getLongitude());
if(mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation()) {
if (mapActivity.getMapViewTrackingUtilities().isMapLinkedToLocation()) {
newIntent.putExtra(SearchActivity.SEARCH_NEARBY, true);
}
newIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
@ -699,10 +698,10 @@ public class MapActivityActions implements DialogProvider {
}
}).reg();
String d = getString(R.string.index_settings);
if(app.getDownloadThread().getIndexes().isDownloadedFromInternet) {
if (app.getDownloadThread().getIndexes().isDownloadedFromInternet) {
List<IndexItem> updt = app.getDownloadThread().getIndexes().getItemsToUpdate();
if(updt != null && updt.size() > 0) {
d += " ("+updt.size()+")";
if (updt != null && updt.size() > 0) {
d += " (" + updt.size() + ")";
}
}
optionsMenuHelper.item(R.string.index_settings).name(d).iconColor(R.drawable.ic_type_archive)
@ -742,13 +741,13 @@ public class MapActivityActions implements DialogProvider {
}
}).reg();
optionsMenuHelper.item(R.string.shared_string_help).iconColor(R.drawable.ic_action_help)
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
mapActivity.startActivity(new Intent(mapActivity, HelpActivity.class));
return true;
}
}).reg();
.listen(new OnContextMenuClick() {
@Override
public boolean onContextMenuClick(ArrayAdapter<?> adapter, int itemId, int pos, boolean isChecked) {
mapActivity.startActivity(new Intent(mapActivity, HelpActivity.class));
return true;
}
}).reg();
//////////// Others
OsmandPlugin.registerOptionsMenu(mapActivity, optionsMenuHelper);
@ -774,11 +773,11 @@ public class MapActivityActions implements DialogProvider {
}
public void openIntermediatePointsDialog(){
public void openIntermediatePointsDialog() {
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
}
public void openIntermediateEditPointsDialog(){
public void openIntermediateEditPointsDialog() {
mapActivity.getDashboard().setDashboardVisibility(true, DashboardType.WAYPOINTS);
}
@ -787,7 +786,7 @@ public class MapActivityActions implements DialogProvider {
}
public void stopNavigationWithoutConfirm() {
if(getMyApplication().getLocationProvider().getLocationSimulation().isRouteAnimating()) {
if (getMyApplication().getLocationProvider().getLocationSimulation().isRouteAnimating()) {
getMyApplication().getLocationProvider().getLocationSimulation().startStopRouteAnimation(mapActivity);
}
routingHelper.getVoiceRouter().interruptRouteCommands();
@ -799,7 +798,7 @@ public class MapActivityActions implements DialogProvider {
}
public AlertDialog stopNavigationActionConfirm() {
Builder builder = new AlertDialog.Builder(mapActivity);
AlertDialog.Builder builder = new AlertDialog.Builder(mapActivity);
// Stop the navigation
builder.setTitle(getString(R.string.cancel_route));
builder.setMessage(getString(R.string.stop_routing_confirm));
@ -814,7 +813,6 @@ public class MapActivityActions implements DialogProvider {
}
public void whereAmIDialog() {
final List<String> items = new ArrayList<String>();
items.add(getString(R.string.show_location));
@ -825,15 +823,15 @@ public class MapActivityActions implements DialogProvider {
public void onClick(DialogInterface dialog, int item) {
dialog.dismiss();
switch (item) {
case 0:
mapActivity.getMapViewTrackingUtilities().backToLocationImpl();
break;
case 1:
OsmAndLocationProvider locationProvider = getMyApplication().getLocationProvider();
locationProvider.showNavigationInfo(mapActivity.getPointToNavigate(), mapActivity);
break;
default:
break;
case 0:
mapActivity.getMapViewTrackingUtilities().backToLocationImpl();
break;
case 1:
OsmAndLocationProvider locationProvider = getMyApplication().getLocationProvider();
locationProvider.showNavigationInfo(mapActivity.getPointToNavigate(), mapActivity);
break;
default:
break;
}
}
});
@ -841,14 +839,11 @@ public class MapActivityActions implements DialogProvider {
}
public static void showObjectContextMenu(final ContextMenuAdapter qa, final Activity activity,
final OnClickListener onShow) {
final OnClickListener onShow) {
OsmandApplication app = (OsmandApplication) activity.getApplication();
if(app.accessibilityEnabled()) {
Builder builder = new AlertDialog.Builder(activity);
if (app.accessibilityEnabled()) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
String[] values = qa.getItemNames();
builder.setItems(values, new DialogInterface.OnClickListener() {
@Override

View file

@ -1,20 +1,10 @@
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.DialogInterface;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.graphics.Typeface;
import android.support.v7.app.AlertDialog;
import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
@ -26,6 +16,16 @@ import android.widget.TextView;
import android.widget.TimePicker;
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 {
private final Context ctx;
@ -160,7 +160,7 @@ public class OpeningHoursView {
}
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;
Calendar inst = Calendar.getInstance();

View file

@ -1,13 +1,25 @@
package net.osmand.plus.activities;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
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.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.plus.ApplicationMode;
@ -18,28 +30,15 @@ import net.osmand.plus.OsmandSettings.OsmandPreference;
import net.osmand.plus.R;
import net.osmand.plus.activities.actions.AppModeDialog;
import net.osmand.plus.views.SeekBarPreference;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnMultiChoiceClickListener;
import android.graphics.Color;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
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;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
@ -399,7 +398,7 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
}
protected void profileDialog() {
Builder b = new AlertDialog.Builder(this);
AlertDialog.Builder b = new AlertDialog.Builder(this);
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>();
View v = AppModeDialog.prepareAppModeView(this, selected, false, null, true,
new View.OnClickListener() {
@ -538,7 +537,7 @@ public abstract class SettingsBaseActivity extends ActionBarPreferenceActivity
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];
for (int i = 0; i < prefs.length; i++) {
checkedItems[i] = prefs[i].get();

View file

@ -1,8 +1,6 @@
package net.osmand.plus.activities;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@ -21,9 +19,11 @@ 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.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Toast;
import net.osmand.IProgress;
import net.osmand.IndexConstants;
import net.osmand.access.AccessibleToast;
@ -62,7 +62,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
public void onCreate(Bundle savedInstanceState) {
((OsmandApplication) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState);
getToolbar().setTitle(R.string.global_app_settings);
@ -73,10 +73,9 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
settings = getMyApplication().getSettings();
ApplicationMode[] appModes = ApplicationMode.values(settings).toArray(new ApplicationMode[0]);
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());
}
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});
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 Integer[] {ActivityInfo.SCREEN_ORIENTATION_PORTRAIT, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED});
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});
addLocalPrefs((PreferenceGroup) screen.findPreference("localization"));
addVoicePrefs((PreferenceGroup) screen.findPreference("voice"));
@ -99,17 +98,16 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
applicationModePreference = (ListPreference) screen.findPreference(settings.APPLICATION_MODE.getId());
applicationModePreference.setOnPreferenceChangeListener(this);
drivingRegionPreference = (ListPreference) screen.findPreference(settings.DRIVING_REGION.getId());
}
}
private void addVoicePrefs(PreferenceGroup cat) {
if (!Version.isBlackberry((OsmandApplication) getApplication())) {
ListPreference lp = createListPreference(
settings.AUDIO_STREAM_GUIDANCE,
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,
AudioManager.STREAM_NOTIFICATION, AudioManager.STREAM_VOICE_CALL }, R.string.choose_audio_stream,
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,
AudioManager.STREAM_NOTIFICATION, AudioManager.STREAM_VOICE_CALL}, R.string.choose_audio_stream,
R.string.choose_audio_stream_descr);
final OnPreferenceChangeListener prev = lp.getOnPreferenceChangeListener();
lp.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@ -131,21 +129,20 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
}
private void addLocalPrefs(PreferenceGroup screen) {
String[] entries;
String[] entrieValues;
DrivingRegion[] drs = DrivingRegion.values();
DrivingRegion[] drs = DrivingRegion.values();
entries = new String[drs.length];
for (int i = 0; i < entries.length; i++) {
entries[i] = getString(drs[i].name); // + " (" + drs[i].defMetrics.toHumanString(this) +")" ;
}
registerListPreference(settings.DRIVING_REGION, screen, entries, drs);
MetricsConstants[] mvls = MetricsConstants.values();
MetricsConstants[] mvls = MetricsConstants.values();
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());
}
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) + ")";
//getResources().getAssets().getLocales();
entrieValues = new String[] { "",
entrieValues = new String[]{"",
"en",
"af",
"al",
@ -204,7 +201,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
"uk",
"vi",
"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_af) + incompleteSuffix,
getString(R.string.lang_al) + incompleteSuffix,
@ -309,18 +306,18 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
}
public void showAppDirDialog(){
if(Build.VERSION.SDK_INT >= 19) {
showAppDirDialogV19();
return;
public void showAppDirDialog() {
if (Build.VERSION.SDK_INT >= 19) {
showAppDirDialogV19();
return;
}
AlertDialog.Builder editalert = new AlertDialog.Builder(SettingsGeneralActivity.this);
editalert.setTitle(R.string.application_dir);
final EditText input = new EditText(SettingsGeneralActivity.this);
input.setText(settings.getExternalStorageDirectory().getAbsolutePath());
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.bottomMargin = lp.topMargin = 5;
input.setLayoutParams(lp);
@ -328,16 +325,16 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
editalert.setView(input);
editalert.setNegativeButton(R.string.shared_string_cancel, null);
editalert.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
warnAboutChangingStorage(input.getText().toString());
}
public void onClick(DialogInterface dialog, int whichButton) {
warnAboutChangingStorage(input.getText().toString());
}
});
editalert.show();
}
private void showAppDirDialogV19() {
Builder bld = new AlertDialog.Builder(this);
AlertDialog.Builder bld = new AlertDialog.Builder(this);
ChooseAppDirFragment frg = new DashChooseAppDirFragment.ChooseAppDirFragment(this, (Dialog) null);
bld.setView(frg.initView(getLayoutInflater(), null, null));
AlertDialog dlg = bld.show();
@ -345,7 +342,6 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
}
private void addMiscPreferences(PreferenceGroup misc) {
if (!Version.isBlackberry(getMyApplication())) {
applicationDir = new Preference(this);
@ -380,7 +376,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
registerListPreference(
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});
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() {
if(applicationDir != null) {
if (applicationDir != null) {
String storageDir = settings.getExternalStorageDirectory().getAbsolutePath();
applicationDir.setSummary(storageDir);
}
@ -445,15 +440,14 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
}
private void restartApp() {
Builder bld = new AlertDialog.Builder(this);
AlertDialog.Builder bld = new AlertDialog.Builder(this);
bld.setMessage(R.string.restart_is_required);
bld.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {
@Override
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();
// finish();
// startActivity(intent);
@ -463,12 +457,11 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
}
private void warnAboutChangingStorage(final String newValue) {
String newDir = newValue != null ? newValue.trim() : newValue;
if(!newDir.replace('/', ' ').trim().
if (!newDir.replace('/', ' ').trim().
toLowerCase().endsWith(IndexConstants.APP_DIR.replace('/', ' ').trim())) {
newDir += "/" +IndexConstants.APP_DIR;
newDir += "/" + IndexConstants.APP_DIR;
}
final File path = new File(newDir);
path.mkdirs();
@ -476,14 +469,14 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
AccessibleToast.makeText(this, R.string.specified_dir_doesnt_exist, Toast.LENGTH_LONG).show();
return;
}
Builder builder = new AlertDialog.Builder(this);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage(getString(R.string.application_dir_change_warning3));
builder.setPositiveButton(R.string.shared_string_yes, new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
MoveFilesToDifferentDirectory task =
new MoveFilesToDifferentDirectory(SettingsGeneralActivity.this,
settings.getExternalStorageDirectory(), path);
settings.getExternalStorageDirectory(), path);
task.setRunOnSuccess(new Runnable() {
@Override
public void run() {
@ -515,7 +508,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
public void reloadIndexes() {
setProgressVisibility(true);
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));
new AsyncTask<Void, Void, List<String>>() {
@ -597,7 +590,7 @@ public class SettingsGeneralActivity extends SettingsBaseActivity {
entrieValues[k] = OsmandSettings.VOICE_PROVIDER_NOT_USE;
entries[k++] = getString(R.string.shared_string_do_not_use);
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);
entrieValues[k] = s;
k++;

View file

@ -1,9 +1,18 @@
package net.osmand.plus.activities;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
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.DeviceAdminRecv;
@ -18,19 +27,10 @@ import net.osmand.plus.routing.RouteProvider.RouteService;
import net.osmand.router.GeneralRouter;
import net.osmand.router.GeneralRouter.RoutingParameter;
import net.osmand.router.GeneralRouter.RoutingParameterType;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
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 java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class SettingsNavigationActivity extends SettingsBaseActivity {
@ -391,7 +391,7 @@ public class SettingsNavigationActivity extends SettingsBaseActivity {
}
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.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) {
Builder bld = new AlertDialog.Builder(this);
AlertDialog.Builder bld = new AlertDialog.Builder(this);
boolean[] checkedItems = new boolean[prefs.length];
for (int i = 0; i < prefs.length; i++) {
checkedItems[i] = prefs[i].get();

View file

@ -1,15 +1,6 @@
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.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.DialogInterface;
@ -18,10 +9,19 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.text.ClipboardManager;
import android.text.Html;
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 {
private Activity a;
@ -113,7 +113,7 @@ public class ShareDialog {
if(type == ACTION) {
runnable.run();
} else if(type == VIEW) {
Builder bld = new AlertDialog.Builder(a);
AlertDialog.Builder bld = new AlertDialog.Builder(a);
bld.setTitle(title);
bld.setMessage(content);
bld.show();
@ -131,7 +131,7 @@ public class ShareDialog {
}
public void showDialog() {
AlertDialog.Builder builder = new Builder(a);
AlertDialog.Builder builder = new AlertDialog.Builder(a);
builder.setTitle(title);
String[] shareStrings = new String[share.size()];
for(int i = 0; i < shareStrings.length; i++) {

View file

@ -1,12 +1,6 @@
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.AlertDialog;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
@ -16,6 +10,7 @@ import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
@ -28,6 +23,12 @@ import android.widget.ListView;
import android.widget.TextView;
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 enum GpsStatusApps {

View file

@ -1,12 +1,11 @@
package net.osmand.plus.activities.search;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
import android.view.LayoutInflater;
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.search.SearchActivity.SearchActivityChild;
import net.osmand.plus.dashboard.DashLocationFragment;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.helpers.SearchHistoryHelper;
import net.osmand.plus.helpers.SearchHistoryHelper.HistoryEntry;
import net.osmand.util.MapUtils;
@ -80,7 +78,7 @@ public class SearchHistoryFragment extends OsmAndListFragment implements SearchA
}
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.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {

View file

@ -3,16 +3,37 @@
*/
package net.osmand.plus.activities.search;
import gnu.trove.set.hash.TLongHashSet;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.AsyncTask.Status;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AlertDialog;
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.ResultMatcher;
@ -43,38 +64,17 @@ import net.osmand.util.Algorithms;
import net.osmand.util.MapUtils;
import net.osmand.util.OpeningHoursParser;
import net.osmand.util.OpeningHoursParser.OpeningHours;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.AsyncTask.Status;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
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 java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import gnu.trove.set.hash.TLongHashSet;
/**
* Search poi activity
@ -860,7 +860,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
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.setNegativeButton(R.string.shared_string_no, null);
builder.setPositiveButton(R.string.shared_string_yes, new DialogInterface.OnClickListener() {
@ -881,7 +881,7 @@ public class SearchPOIActivity extends OsmandListActivity implements OsmAndCompa
}
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);
final EditText editText = new EditText(this);
if(filter.isStandardFilter()) {

View file

@ -1,32 +1,31 @@
package net.osmand.plus.base;
import java.io.File;
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.support.v7.app.AlertDialog;
import android.widget.TextView;
import net.osmand.PlatformUtil;
import net.osmand.access.AccessibleAlertBuilder;
import net.osmand.data.LatLon;
import net.osmand.plus.GPXUtilities;
import net.osmand.plus.GPXUtilities.GPXFile;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.OsmandApplication;
import net.osmand.plus.OsmandSettings;
import net.osmand.plus.R;
import net.osmand.plus.TargetPointsHelper;
import net.osmand.plus.TargetPointsHelper.TargetPoint;
import net.osmand.plus.activities.MapActivity;
import net.osmand.plus.routing.RoutingHelper;
import net.osmand.plus.routing.RouteProvider.GPXRouteParamsBuilder;
import net.osmand.plus.routing.RoutingHelper;
import org.apache.commons.logging.Log;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
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;
import java.io.File;
import java.util.ArrayList;
public class FailSafeFuntions {
private static boolean quitRouteRestoreDialog = false;
@ -49,7 +48,7 @@ public class FailSafeFuntions {
@Override
public void run() {
Builder builder = new AccessibleAlertBuilder(ma);
AlertDialog.Builder builder = new AccessibleAlertBuilder(ma);
final TextView tv = new TextView(ma);
tv.setText(ma.getString(R.string.continue_follow_previous_route_auto, delay + ""));
tv.setPadding(7, 5, 7, 5);

View file

@ -1,6 +1,37 @@
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.FileInputStream;
@ -13,37 +44,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Locale;
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 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;
import gnu.trove.list.array.TIntArrayList;
public class DashChooseAppDirFragment {

View file

@ -1,10 +1,10 @@
package net.osmand.plus.dashboard;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;

View file

@ -1,10 +1,9 @@
package net.osmand.plus.dashboard;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
import android.view.LayoutInflater;
import android.view.MenuItem;
@ -195,7 +194,7 @@ public class DashWaypointsFragment extends DashLocationFragment {
protected void deletePointConfirm(final TargetPoint point, View view) {
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
builder.setTitle(getString(R.string.delete_target_point));
builder.setMessage(PointDescription.getSimpleName(point, getActivity()));

View file

@ -2,8 +2,6 @@ package net.osmand.plus.development;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Intent;
import android.os.Bundle;
import android.os.Debug;
@ -13,6 +11,7 @@ import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceCategory;
import android.preference.PreferenceScreen;
import android.support.v7.app.AlertDialog;
import android.view.View;
import net.osmand.plus.ApplicationMode;
@ -207,7 +206,7 @@ public class SettingsDevelopmentActivity extends SettingsBaseActivity {
}
protected void availableProfileDialog() {
Builder b = new AlertDialog.Builder(this);
AlertDialog.Builder b = new AlertDialog.Builder(this);
final List<ApplicationMode> modes = ApplicationMode.allPossibleValues();
modes.remove(ApplicationMode.DEFAULT);
final Set<ApplicationMode> selected = new LinkedHashSet<ApplicationMode>(ApplicationMode.values(settings));

View file

@ -1,12 +1,11 @@
package net.osmand.plus.development;
import android.app.ActionBar;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.pm.ActivityInfo;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
@ -106,7 +105,7 @@ public class TestVoiceActivity extends OsmandActionBarActivity {
}
k++;
}
Builder bld = new AlertDialog.Builder(this);
AlertDialog.Builder bld = new AlertDialog.Builder(this);
bld.setSingleChoiceItems(entrieValues, selected, new DialogInterface.OnClickListener() {
@Override

View file

@ -1,9 +1,8 @@
package net.osmand.plus.dialogs;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.PopupMenu;
import net.osmand.data.LatLon;
@ -23,7 +22,7 @@ public class DirectionsDialogs {
final OsmandApplication ctx = (OsmandApplication) act.getApplication();
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
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.setItems(
new String[] { act.getString(R.string.keep_intermediate_points),
@ -51,7 +50,7 @@ public class DirectionsDialogs {
final OsmandApplication ctx = (OsmandApplication) act.getApplication();
final TargetPointsHelper targetPointsHelper = ctx.getTargetPointsHelper();
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.setItems(
new String[] { act.getString(R.string.replace_destination_point),

View file

@ -1,8 +1,6 @@
package net.osmand.plus.dialogs;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
@ -10,6 +8,7 @@ import android.content.DialogInterface.OnClickListener;
import android.content.DialogInterface.OnDismissListener;
import android.content.res.Resources;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
@ -98,7 +97,7 @@ public class FavoriteDialogs {
}
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);
final View v = activity.getLayoutInflater().inflate(R.layout.favorite_edit_dialog, null, false);
final FavouritesDbHelper helper = ((OsmandApplication) activity.getApplication()).getFavorites();
@ -138,7 +137,7 @@ public class FavoriteDialogs {
point.setName(editText.getText().toString().trim());
point.setDescription(description.getText().toString().trim());
point.setCategory(categoryStr);
Builder bld = FavouritesDbHelper.checkDuplicates(point, helper, activity);
AlertDialog.Builder bld = FavouritesDbHelper.checkDuplicates(point, helper, activity);
if(bld != null) {
bld.setPositiveButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {
@Override
@ -172,7 +171,7 @@ public class FavoriteDialogs {
final FavouritesAdapter favouritesAdapter, final OnItemClickListener click,
final OnDismissListener dismissListener, final Dialog[] dialogHolder, final boolean sortByDist) {
ListView listView = new ListView(uiContext);
Builder bld = new AlertDialog.Builder(uiContext);
AlertDialog.Builder bld = new AlertDialog.Builder(uiContext);
final Collator inst = Collator.getInstance();
favouritesAdapter.sort(new Comparator<FavouritePoint>() {

View file

@ -1,8 +1,6 @@
package net.osmand.plus.distancecalculator;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
@ -17,6 +15,7 @@ import android.graphics.Paint.Style;
import android.graphics.Path;
import android.graphics.PointF;
import android.os.AsyncTask;
import android.support.v7.app.AlertDialog;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
@ -170,7 +169,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
}
}
private void showDialog(final MapActivity activity) {
Builder bld = new AlertDialog.Builder(activity);
AlertDialog.Builder bld = new AlertDialog.Builder(activity);
final TIntArrayList list = new TIntArrayList();
if(distanceMeasurementMode == 0) {
list.add(R.string.distance_measurement_start_editing);
@ -257,7 +256,7 @@ public class DistanceCalculatorPlugin extends OsmandPlugin {
}
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);
LinearLayout ll = new LinearLayout(activity);
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);
pref.makeGlobal();
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.setNegativeButton(R.string.shared_string_do_not_show_again, new OnClickListener() {

View file

@ -2,7 +2,6 @@ package net.osmand.plus.download;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@ -16,6 +15,7 @@ import android.os.AsyncTask.Status;
import android.os.Build;
import android.os.StatFs;
import android.support.annotation.UiThread;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.NotificationCompat;
import android.support.v7.app.NotificationCompat.Builder;
import android.view.View;

View file

@ -1,19 +1,5 @@
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.content.ActivityNotFoundException;
import android.content.Context;
@ -22,12 +8,20 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.UiThread;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AlertDialog;
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 static final int MAXIMUM_AVAILABLE_FREE_DOWNLOADS = 5;
protected OsmandSettings settings;
@ -85,13 +79,12 @@ public class DownloadValidationManager {
private void downloadFileCheck_Final_Run(FragmentActivity activity, IndexItem[] items) {
downloadThread.runDownloadFiles(items);
if(activity instanceof DownloadEvents) {
if (activity instanceof DownloadEvents) {
((DownloadEvents) activity).downloadInProgress();
}
}
protected void downloadFilesWithAllChecks(FragmentActivity activity, IndexItem[] items) {
downloadFilesCheck_1_FreeVersion(activity, items);
}
@ -132,7 +125,6 @@ public class DownloadValidationManager {
}
public void makeSureUserCancelDownload(Context ctx, final IndexItem item) {
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
bld.setTitle(ctx.getString(R.string.shared_string_cancel));
@ -150,6 +142,7 @@ public class DownloadValidationManager {
public static class InstallPaidVersionDialogFragment extends DialogFragment {
public static final String TAG = "InstallPaidVersionDialogFragment";
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

View file

@ -1,21 +1,22 @@
package net.osmand.plus.download.ui;
import java.util.ArrayList;
import java.util.List;
import android.app.Dialog;
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.download.DownloadActivity;
import net.osmand.plus.download.DownloadIndexesThread.DownloadEvents;
import net.osmand.plus.download.IndexItem;
import android.app.AlertDialog;
import android.app.Dialog;
import android.os.Bundle;
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;
import java.util.ArrayList;
import java.util.List;
public class ActiveDownloadsDialogFragment extends DialogFragment implements DownloadEvents {

View file

@ -1,7 +1,6 @@
package net.osmand.plus.download.ui;
import android.annotation.SuppressLint;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Resources;
@ -369,7 +368,7 @@ public class ItemViewHolder {
: LocalIndexType.VOICE_DATA;
}
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() {
@Override
public void onClick(DialogInterface dialog, int which) {

View file

@ -1,20 +1,40 @@
package net.osmand.plus.download.ui;
import java.io.File;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import android.app.Activity;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.ActionBar;
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.PlatformUtil;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.ContextMenuAdapter;
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.util.Algorithms;
import org.apache.commons.logging.Log;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
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;
import java.io.File;
import java.text.Collator;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class LocalIndexesFragment extends OsmandExpandableListFragment implements DownloadEvents {
@ -170,7 +166,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
}
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());
basicFileOperation(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) {
new LocalIndexOperationTask(getDownloadActivity(), listAdapter, LocalIndexOperationTask.RESTORE_OPERATION).execute(info);
} 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() {
@Override
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) {
Builder b = new AlertDialog.Builder(a);
AlertDialog.Builder b = new AlertDialog.Builder(a);
if (f.exists()) {
int xt = f.getName().lastIndexOf('.');
final String ext = xt == -1 ? "" : f.getName().substring(xt);
@ -679,7 +675,7 @@ public class LocalIndexesFragment extends OsmandExpandableListFragment implement
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.setPositiveButton(actionButton, listener);
builder.setNegativeButton(R.string.shared_string_cancel, null);

View file

@ -1,8 +1,7 @@
package net.osmand.plus.helpers;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
@ -103,7 +102,7 @@ public class AvoidSpecificRoads {
}
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);
if (getMissingRoads().size() == 0){
bld.setMessage(R.string.avoid_roads_msg);

View file

@ -1,6 +1,5 @@
package net.osmand.plus.helpers;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
@ -9,7 +8,9 @@ import android.net.Uri;
import android.os.AsyncTask;
import android.os.ParcelFileDescriptor;
import android.provider.OpenableColumns;
import android.support.v7.app.AlertDialog;
import android.widget.Toast;
import net.osmand.IndexConstants;
import net.osmand.access.AccessibleToast;
import net.osmand.data.FavouritePoint;

View file

@ -1,10 +1,10 @@
package net.osmand.plus.mapcontextmenu.controllers;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.support.v7.app.AlertDialog;
import net.osmand.binary.BinaryMapDataObject;
import net.osmand.data.LatLon;

View file

@ -1,11 +1,11 @@
package net.osmand.plus.mapcontextmenu.editors;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Button;

View file

@ -1,11 +1,11 @@
package net.osmand.plus.mapcontextmenu.editors;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View file

@ -1,7 +1,6 @@
package net.osmand.plus.mapcontextmenu.editors;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.res.Resources;
import android.graphics.PorterDuff;
@ -9,6 +8,7 @@ import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.util.TypedValue;
import android.view.View;
import android.widget.Button;

View file

@ -1,11 +1,10 @@
package net.osmand.plus.monitoring;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.support.v7.app.AlertDialog;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.WindowManager;
@ -247,7 +246,7 @@ public class OsmandMonitoringPlugin extends OsmandPlugin {
private void controlDialog(final Activity map) {
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();
if(wasTrackMonitored) {
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,
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);
WindowManager mgr = (WindowManager) uiCtx.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();

View file

@ -1,8 +1,6 @@
package net.osmand.plus.myplaces;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@ -13,6 +11,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.PopupMenu;
import android.support.v7.widget.SearchView;
@ -32,6 +31,7 @@ import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import net.osmand.IndexConstants;
import net.osmand.access.AccessibleToast;
import net.osmand.plus.ContextMenuAdapter;
@ -526,7 +526,7 @@ public class AvailableGPXFragment extends OsmandExpandableListFragment {
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(),
selectedItems.size()));
builder.setPositiveButton(actionButton, listener);

View file

@ -2,8 +2,6 @@ package net.osmand.plus.myplaces;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
@ -11,7 +9,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.PopupMenu;
import android.support.v7.app.AlertDialog;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.Menu;
@ -30,7 +28,6 @@ import android.widget.TextView;
import net.osmand.data.FavouritePoint;
import net.osmand.data.LatLon;
import net.osmand.data.PointDescription;
import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.FavouritesDbHelper;
import net.osmand.plus.GPXUtilities.GPXFile;
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.TrackActivity;
import net.osmand.plus.base.FavoriteImageDrawable;
import net.osmand.plus.dialogs.DirectionsDialogs;
import net.osmand.plus.helpers.ColorDialogs;
import net.osmand.util.Algorithms;
@ -206,7 +202,7 @@ public class SelectedGPXFragment extends OsmAndListFragment {
}
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 List<GpxDisplayGroup> gs = filterGroups(gpxDisplayItemType);
if (gs.size() == 0) {
@ -280,7 +276,7 @@ public class SelectedGPXFragment extends OsmAndListFragment {
ColorDialogs.setupColorSpinner(getActivity(), getGpx().getColor(0), colorSpinner, list);
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 TIntArrayList timeSplit = new TIntArrayList();
if(groups.size() == 0) {

View file

@ -1,11 +1,10 @@
package net.osmand.plus.openseamapsplugin;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import net.osmand.IndexConstants;
import net.osmand.plus.OsmandApplication;
@ -59,7 +58,7 @@ public class NauticalMapsPlugin extends OsmandPlugin {
app.getSettings().RENDERER.set(RendererRegistry.NAUTICAL_RENDER);
if(!app.getResourceManager().getIndexFileNames().containsKey("World_seamarks"+
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.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {

View file

@ -1,9 +1,9 @@
package net.osmand.plus.osmedit;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View file

@ -1,8 +1,6 @@
package net.osmand.plus.osmedit;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.Canvas;
@ -10,6 +8,7 @@ import android.graphics.Paint;
import android.graphics.PointF;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.util.Xml;
import android.view.View;
import android.widget.EditText;
@ -320,7 +319,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
private Dialog createOpenBugDialog(final Bundle args) {
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.setView(openBug);
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) {
Builder builder = new AlertDialog.Builder(activity);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.osb_comment_dialog_title);
final View view = activity.getLayoutInflater().inflate(R.layout.open_bug, null);
builder.setView(view);
@ -453,7 +452,7 @@ public class OsmBugsLayer extends OsmandMapLayer implements IContextMenuProvider
}
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.setNegativeButton(R.string.shared_string_cancel, null);
builder.setPositiveButton(R.string.osb_close_dialog_close_button, new DialogInterface.OnClickListener() {

View file

@ -1,13 +1,12 @@
package net.osmand.plus.osmedit;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
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();
return false;
}
Builder bldr = new AlertDialog.Builder(la);
AlertDialog.Builder bldr = new AlertDialog.Builder(la);
LayoutInflater inflater = (LayoutInflater) la.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final View view = inflater.inflate(R.layout.send_gpx_osm, null);
final EditText descr = (EditText) view.findViewById(R.id.memory_size);

View file

@ -1,6 +1,5 @@
package net.osmand.plus.osmedit;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
@ -11,6 +10,7 @@ import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.PopupMenu;
import android.util.Xml;

View file

@ -1,11 +1,11 @@
package net.osmand.plus.osmedit.dialogs;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import net.osmand.data.Amenity;
import net.osmand.osm.MapPoiTypes;

View file

@ -1,11 +1,11 @@
package net.osmand.plus.osmedit.dialogs;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import net.osmand.data.Amenity;
import net.osmand.osm.MapPoiTypes;

View file

@ -1,11 +1,11 @@
package net.osmand.plus.osmedit.dialogs;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.DialogFragment;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.CheckBox;
import android.widget.EditText;

View file

@ -3,48 +3,8 @@
*/
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.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
@ -67,6 +27,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
@ -100,6 +61,44 @@ import android.widget.Spinner;
import android.widget.TextView;
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
public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
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);
bld.setTitle(getString(R.string.osmo_leave_confirmation_msg, name));
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) {
Builder bld = new AlertDialog.Builder(this);
AlertDialog.Builder bld = new AlertDialog.Builder(this);
bld.setTitle(R.string.osmo_group);
StringBuilder sb = new StringBuilder();
if (group != null){
@ -658,7 +657,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
setSupportProgressBarIndeterminateVisibility(true);
signinPost(false);
} 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());
bld.setMessage(text);
bld.setPositiveButton(R.string.shared_string_ok, null);
@ -822,7 +821,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
}
protected void signin() {
Builder builder = new AlertDialog.Builder(this);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.osmo_sign_in);
String message = "";
if(app.getSettings().OSMO_USER_PWD.get() != null) {
@ -850,7 +849,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
signin();
return;
}
final Builder builder = new AlertDialog.Builder(this);
final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.osmo_create_group);
final View v = getLayoutInflater().inflate(R.layout.osmo_create_group, getExpandableListView(), false);
final EditText policy = (EditText) v.findViewById(R.id.Policy);
@ -918,7 +917,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
}
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 TextView labelTracker = (TextView ) v.findViewById(R.id.LabelTrackerId);
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) {
Builder bld = new AlertDialog.Builder(ctx);
AlertDialog.Builder bld = new AlertDialog.Builder(ctx);
bld.setTitle(R.string.osmo_edit_device);
final LayoutInflater inflater = LayoutInflater.from(ctx);
View view = inflater.inflate(R.layout.osmo_edit_device, null);
@ -1526,7 +1525,7 @@ public class OsMoGroupsActivity extends OsmandExpandableListActivity implements
}
private void showHint() {
Builder builder = new AlertDialog.Builder(this);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.anonymous_user);
String message = getString(R.string.anonymous_user_hint);
builder.setMessage(message);

View file

@ -1,13 +1,21 @@
package net.osmand.plus.osmo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
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.support.v7.app.AlertDialog;
import android.text.TextUtils;
import net.osmand.PlatformUtil;
import net.osmand.plus.OsmandApplication;
@ -27,23 +35,14 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
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;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
public class OsMoService implements OsMoReactor {
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) {
Builder bld = new AlertDialog.Builder(ga);
AlertDialog.Builder bld = new AlertDialog.Builder(ga);
bld.setMessage(msg);
bld.setPositiveButton(R.string.shared_string_ok, new OnClickListener() {

View file

@ -1,8 +1,6 @@
package net.osmand.plus.osmo;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
@ -11,6 +9,7 @@ import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.Preference;
import android.preference.PreferenceScreen;
import android.support.v7.app.AlertDialog;
import android.text.method.LinkMovementMethod;
import android.util.TypedValue;
import android.widget.ScrollView;
@ -119,7 +118,7 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
final OsMoPlugin plugin = OsMoPlugin.getEnabledPlugin(OsMoPlugin.class);
if (preference == debugPref) {
updateDebugPref();
Builder bld = new AlertDialog.Builder(this);
AlertDialog.Builder bld = new AlertDialog.Builder(this);
StringBuilder bs = new StringBuilder();
List<String> hs = plugin.getService().getHistoryOfCommands();
if(hs != null) {
@ -173,7 +172,7 @@ public class SettingsOsMoActivity extends SettingsBaseActivity {
@Override
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.setPositiveButton(R.string.shared_string_yes, new OnClickListener() {

View file

@ -1,10 +1,10 @@
package net.osmand.plus.parkingpoint;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

View file

@ -2,11 +2,10 @@ package net.osmand.plus.parkingpoint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.support.v7.app.AlertDialog;
import android.text.format.DateFormat;
import android.text.format.Time;
import android.view.View;
@ -290,7 +289,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
* Method creates confirmation dialog for deletion of a parking location.
*/
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.setMessage(activity.getString(R.string.osmand_parking_delete_confirm));
confirm.setCancelable(true);
@ -317,7 +316,7 @@ public class ParkingPositionPlugin extends OsmandPlugin {
*/
private void showSetTimeLimitDialog(final MapActivity mapActivity, final Dialog choose) {
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.setTitle(mapActivity.getString(R.string.osmand_parking_time_limit_title));
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) {
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.setMessage(activity.getString(R.string.osmand_parking_warning_text));
deleteEventWarning.setNeutralButton(R.string.shared_string_ok, new DialogInterface.OnClickListener() {

View file

@ -1,10 +1,9 @@
package net.osmand.plus.rastermaps;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.DialogInterface;
import android.os.AsyncTask;
import android.support.v7.app.AlertDialog;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;
@ -150,7 +149,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin {
final MapActivityLayers layers = activity.getMapLayers();
Map<String, String> entriesMap = settings.getTileSourceEntries();
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];
int i = 0;
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();
return;
}
Builder builder = new AlertDialog.Builder(activity);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
String[] names = new String[downloaded.size()];
for (int i = 0; i < names.length; i++) {
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",
"png", 17, 5, 256, 16, 32000);
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);
final EditText name = (EditText) view.findViewById(R.id.Name);
final Spinner existing = (Spinner) view.findViewById(R.id.TileSourceSpinner);

View file

@ -1,6 +1,5 @@
package net.osmand.plus.views;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Canvas;
@ -10,6 +9,7 @@ import android.graphics.PointF;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.support.v7.app.AlertDialog;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;

View file

@ -1,9 +1,14 @@
package net.osmand.plus.views;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
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.PointDescription;
import net.osmand.data.QuadRect;
@ -13,16 +18,9 @@ import net.osmand.plus.ContextMenuAdapter;
import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick;
import net.osmand.plus.R;
import net.osmand.plus.resources.TransportIndexRepository;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
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;
import java.util.ArrayList;
import java.util.List;
public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider {
private static final int startZoom = 12;
@ -164,7 +162,7 @@ public class TransportStopsLayer extends OsmandMapLayer implements ContextMenuLa
}
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.setMessage(getStopDescription(a, true));
bs.show();

View file

@ -1,5 +1,16 @@
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.ValueHolder;
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.mapwidgets.NextTurnInfoWidget.TurnDrawable;
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 {
@ -125,7 +125,7 @@ public class MapInfoWidgetsFactory {
final ValueHolder<Integer> vs = new ValueHolder<Integer>();
vs.value = app.getSettings().SERVICE_OFF_INTERVAL.get();
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));
WindowManager mgr = (WindowManager) map.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();

View file

@ -1,15 +1,15 @@
package net.osmand.plus.voice;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
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;
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.plus.OsmandApplication;
import net.osmand.plus.R;
@ -21,16 +21,11 @@ import org.apache.commons.logging.Log;
import org.json.JSONArray;
import org.json.JSONObject;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
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;
import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
@ -161,7 +156,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer {
{
case TextToSpeech.LANG_MISSING_DATA:
if (isSettingsActivity(act)) {
Builder builder = createAlertDialog(
AlertDialog.Builder builder = createAlertDialog(
R.string.tts_missing_language_data_title,
R.string.tts_missing_language_data,
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
//this if condition
if (isSettingsActivity(act)) {
Builder builder = createAlertDialog(
AlertDialog.Builder builder = createAlertDialog(
R.string.tts_language_not_supported_title,
R.string.tts_language_not_supported,
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) {
Builder builder = new AlertDialog.Builder(ctx);
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
builder.setCancelable(true);
builder.setNegativeButton(R.string.shared_string_no, null);
builder.setPositiveButton(R.string.shared_string_yes, intentStarter);

View file

@ -2,7 +2,7 @@ package net.osmand.nautical;
import net.osmand.nauticalPlugin.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.support.v7.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.DialogInterface;

View file

@ -1,7 +1,6 @@
package net.osmand.parkingPlugin;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.DialogInterface;
@ -10,6 +9,7 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
public class ParkingPluginActivity extends Activity {
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$

View file

@ -1,8 +1,6 @@
package net.osmand.srtmPlugin;
import net.osmand.srtmPlugin.paid.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.DialogInterface;
@ -11,6 +9,9 @@ import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import net.osmand.srtmPlugin.paid.R;
public class SRTMPluginActivity extends Activity {
private static final String OSMAND_COMPONENT = "net.osmand"; //$NON-NLS-1$

View file

@ -2,7 +2,7 @@ package net.osmand.skimaps;
import net.osmand.skimapsPlugin.R;
import android.app.Activity;
import android.app.AlertDialog;
import android.support.v7.app.AlertDialog;
import android.content.ActivityNotFoundException;
import android.content.ComponentName;
import android.content.DialogInterface;