From 64a3356845b01a90053dc03c003957d8f4e95db2 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 29 Jan 2013 18:47:17 +0100 Subject: [PATCH] Package/class renaming --- .../plus/AmenityIndexRepositoryBinary.java | 6 +-- .../plus/AmenityIndexRepositoryOdb.java | 6 +-- .../net/osmand/plus/AsyncLoadingThread.java | 4 +- .../net/osmand/plus/OsmandApplication.java | 4 +- OsmAnd/src/net/osmand/plus/OsmandPlugin.java | 2 +- .../plus/RegionAddressRepositoryBinary.java | 2 +- .../src/net/osmand/plus/ResourceManager.java | 10 ++-- .../src/net/osmand/plus/SQLiteTileSource.java | 4 +- .../plus/activities/DayNightHelper.java | 2 +- .../activities/DownloadIndexActivity.java | 4 +- .../plus/activities/LocalIndexesActivity.java | 4 +- .../osmand/plus/activities/MapActivity.java | 6 +-- .../activities/search/SearchActivity.java | 6 +-- .../search/SearchAddressActivity.java | 52 +++++++++---------- .../search/SearchAddressOnlineActivity.java | 4 +- .../search/SearchBuildingByNameActivity.java | 6 +-- .../activities/search/SearchPOIActivity.java | 12 ++--- .../search/SearchTransportActivity.java | 8 +-- .../osmand/plus/api/AudioFocusHelperImpl.java | 1 - .../plus/api/ExternalServiceAPIImpl.java | 5 +- .../osmand/plus/api/InternalToDoAPIImpl.java | 1 - .../audionotes/AudioVideoNotesPlugin.java | 4 +- .../development/OsmandDevelopmentPlugin.java | 2 +- .../plus/osmedit/OpenstreetmapRemoteUtil.java | 5 +- .../osmand/plus/osmedit/OsmEditingPlugin.java | 6 +-- .../rastermaps/OsmandRasterMapsPlugin.java | 4 +- .../plus/render/MapRenderRepositories.java | 6 +-- .../plus/render/NativeOsmandLibrary.java | 3 +- .../osmand/plus/render/OsmandRenderer.java | 8 +-- .../osmand/plus/views/MapInfoControls.java | 4 +- .../net/osmand/plus/views/MapInfoLayer.java | 4 +- .../osmand/plus/views/RouteInfoControls.java | 6 +-- .../plus/views/YandexTrafficAdapter.java | 10 ++-- .../plus/voice/MediaCommandPlayerImpl.java | 2 - .../plus/voice/TTSCommandPlayerImpl.java | 5 +- 35 files changed, 106 insertions(+), 112 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java index 685fd110f8..91638a86f8 100644 --- a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryBinary.java @@ -7,7 +7,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.binary.BinaryMapIndexReader; @@ -18,6 +17,7 @@ import net.osmand.data.Amenity; import net.osmand.data.AmenityType; import net.osmand.osm.LatLon; import net.osmand.osm.MapUtils; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -137,8 +137,8 @@ public class AmenityIndexRepositoryBinary implements AmenityIndexRepository { int zoom, String filterId, List toFill, boolean fillFound){ boolean inside = cTopLatitude >= topLatitude && cLeftLongitude <= leftLongitude && cRightLongitude >= rightLongitude && cBottomLatitude <= bottomLatitude && zoom == cZoom; - boolean noNeedToSearch = inside && Algoritms.objectEquals(filterId, cFilterId); - if((inside || fillFound) && toFill != null && Algoritms.objectEquals(filterId, cFilterId)){ + boolean noNeedToSearch = inside && Algorithms.objectEquals(filterId, cFilterId); + if((inside || fillFound) && toFill != null && Algorithms.objectEquals(filterId, cFilterId)){ for(Amenity a : cachedObjects){ LatLon location = a.getLocation(); if (location.getLatitude() <= topLatitude && location.getLongitude() >= leftLongitude && location.getLongitude() <= rightLongitude diff --git a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java index 1dceaa011c..05b09173f6 100644 --- a/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java +++ b/OsmAnd/src/net/osmand/plus/AmenityIndexRepositoryOdb.java @@ -11,7 +11,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import net.osmand.Algoritms; import net.osmand.IProgress; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; @@ -25,6 +24,7 @@ import net.osmand.osm.MapUtils; import net.osmand.osm.Node; import net.osmand.osm.io.IOsmStorageFilter; import net.osmand.osm.io.OsmBaseStorage; +import net.osmand.util.Algorithms; import net.sf.junidecode.Junidecode; import org.apache.commons.logging.Log; @@ -136,8 +136,8 @@ public class AmenityIndexRepositoryOdb extends BaseLocationIndexRepository= topLatitude && cLeftLongitude <= leftLongitude && cRightLongitude >= rightLongitude && cBottomLatitude <= bottomLatitude && zoom == cZoom; - boolean noNeedToSearch = inside && Algoritms.objectEquals(filterId, cFilterId); - if((inside || fillFound) && toFill != null && Algoritms.objectEquals(filterId, cFilterId)){ + boolean noNeedToSearch = inside && Algorithms.objectEquals(filterId, cFilterId); + if((inside || fillFound) && toFill != null && Algorithms.objectEquals(filterId, cFilterId)){ for(Amenity a : cachedObjects){ LatLon location = a.getLocation(); if (location.getLatitude() <= topLatitude && location.getLongitude() >= leftLongitude && location.getLongitude() <= rightLongitude diff --git a/OsmAnd/src/net/osmand/plus/AsyncLoadingThread.java b/OsmAnd/src/net/osmand/plus/AsyncLoadingThread.java index cb8320f975..f40fa381ee 100644 --- a/OsmAnd/src/net/osmand/plus/AsyncLoadingThread.java +++ b/OsmAnd/src/net/osmand/plus/AsyncLoadingThread.java @@ -6,7 +6,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Stack; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.data.Amenity; @@ -14,6 +13,7 @@ import net.osmand.data.TransportStop; import net.osmand.map.ITileSource; import net.osmand.map.MapTileDownloader.DownloadRequest; import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -295,7 +295,7 @@ public class AsyncLoadingThread extends Thread { return false; } public boolean recalculateRequest(AmenityLoadRequest req) { - if (this.zoom != req.zoom || !Algoritms.objectEquals(this.filter, req.filter) || req.repoHasChange()) { + if (this.zoom != req.zoom || !Algorithms.objectEquals(this.filter, req.filter) || req.repoHasChange()) { return true; } return !isContains(req.topLatitude, req.leftLongitude, req.bottomLatitude, req.rightLongitude); diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 055d2b78f4..5149064c4e 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -11,7 +11,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; -import net.osmand.Algoritms; import net.osmand.FavouritePoint; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; @@ -36,6 +35,7 @@ import net.osmand.plus.voice.CommandPlayer; import net.osmand.plus.voice.CommandPlayerException; import net.osmand.plus.voice.CommandPlayerFactory; import net.osmand.render.RenderingRulesStorage; +import net.osmand.util.Algorithms; import android.app.Activity; import android.app.AlarmManager; import android.app.AlertDialog; @@ -328,7 +328,7 @@ public class OsmandApplication extends Application implements ClientContext { } } else { - if (player == null || !Algoritms.objectEquals(voiceProvider, player.getCurrentVoice())) { + if (player == null || !Algorithms.objectEquals(voiceProvider, player.getCurrentVoice())) { initVoiceDataInDifferentThread(uiContext, voiceProvider, run); } } diff --git a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java index dd1a6f0d63..0e14bfa829 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandPlugin.java +++ b/OsmAnd/src/net/osmand/plus/OsmandPlugin.java @@ -9,8 +9,8 @@ import net.osmand.IProgress; import net.osmand.PlatformUtil; import net.osmand.access.AccessibilityPlugin; import net.osmand.plus.activities.LocalIndexInfo; -import net.osmand.plus.activities.LocalIndexesActivity.LoadLocalIndexTask; import net.osmand.plus.activities.LocalIndexesActivity; +import net.osmand.plus.activities.LocalIndexesActivity.LoadLocalIndexTask; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.SettingsActivity; import net.osmand.plus.audionotes.AudioVideoNotesPlugin; diff --git a/OsmAnd/src/net/osmand/plus/RegionAddressRepositoryBinary.java b/OsmAnd/src/net/osmand/plus/RegionAddressRepositoryBinary.java index d4bd13e780..42d3c97e99 100644 --- a/OsmAnd/src/net/osmand/plus/RegionAddressRepositoryBinary.java +++ b/OsmAnd/src/net/osmand/plus/RegionAddressRepositoryBinary.java @@ -133,7 +133,7 @@ public class RegionAddressRepositoryBinary implements RegionAddressRepository { } try { // essentially index is created that cities towns are first in cities map - if (/*name.length() >= 2 && Algoritms.containsDigit(name) && */searchVillages) { + if (/*name.length() >= 2 && Algorithms.containsDigit(name) && */searchVillages) { // also try to identify postcodes String uName = name.toUpperCase(); List foundCities = file.getCities(region, BinaryMapIndexReader.buildAddressRequest(resultMatcher), diff --git a/OsmAnd/src/net/osmand/plus/ResourceManager.java b/OsmAnd/src/net/osmand/plus/ResourceManager.java index 2339d1a97b..7730bb1eb2 100644 --- a/OsmAnd/src/net/osmand/plus/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/ResourceManager.java @@ -19,7 +19,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; -import net.osmand.Algoritms; import net.osmand.GeoidAltitudeCorrection; import net.osmand.IProgress; import net.osmand.PlatformUtil; @@ -44,6 +43,7 @@ import net.osmand.plus.render.NativeOsmandLibrary; import net.osmand.plus.srtmplugin.SRTMPlugin; import net.osmand.plus.views.OsmandMapLayer.DrawSettings; import net.osmand.render.RenderingRulesStorage; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; import org.xmlpull.v1.XmlPullParser; @@ -495,14 +495,14 @@ public class ResourceManager { //TODO consider some other place for this method? public static void copyAssets(AssetManager assetManager, String assetName, File file) throws IOException { if(file.exists()){ - Algoritms.removeAllFiles(file); + Algorithms.removeAllFiles(file); } file.getParentFile().mkdirs(); InputStream is = assetManager.open(assetName, AssetManager.ACCESS_STREAMING); FileOutputStream out = new FileOutputStream(file); - Algoritms.streamCopy(is, out); - Algoritms.closeStream(out); - Algoritms.closeStream(is); + Algorithms.streamCopy(is, out); + Algorithms.closeStream(out); + Algorithms.closeStream(is); } private void initRenderers(IProgress progress) { diff --git a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java index 2dfe354bb9..000afb6a20 100644 --- a/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java +++ b/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java @@ -7,13 +7,13 @@ import java.nio.ByteBuffer; import java.text.MessageFormat; import java.util.List; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.data.IndexConstants; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.api.SQLiteAPI.SQLiteConnection; import net.osmand.plus.api.SQLiteAPI.SQLiteCursor; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -145,7 +145,7 @@ public class SQLiteTileSource implements ITileSource { db = ctx.getSQLiteAPI().openByAbsolutePath(file.getAbsolutePath(), false); try { String template = db.compileStatement("SELECT url FROM info").simpleQueryForString(); //$NON-NLS-1$ - if(!Algoritms.isEmpty(template)){ + if(!Algorithms.isEmpty(template)){ urlTemplate = template; } } catch (RuntimeException e) { diff --git a/OsmAnd/src/net/osmand/plus/activities/DayNightHelper.java b/OsmAnd/src/net/osmand/plus/activities/DayNightHelper.java index 0531c878c0..67ef91bef8 100644 --- a/OsmAnd/src/net/osmand/plus/activities/DayNightHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/DayNightHelper.java @@ -6,9 +6,9 @@ import java.util.List; import java.util.TimeZone; import net.osmand.PlatformUtil; -import net.osmand.SunriseSunset; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings.DayNightMode; +import net.osmand.util.SunriseSunset; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java b/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java index a297fa574a..259a80714e 100644 --- a/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/DownloadIndexActivity.java @@ -14,7 +14,6 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; -import net.osmand.Algoritms; import net.osmand.IProgress; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; @@ -41,6 +40,7 @@ import net.osmand.plus.download.IndexItem; import net.osmand.plus.download.IndexItemCategory; import net.osmand.plus.download.SrtmIndexItem; import net.osmand.plus.srtmplugin.SRTMPlugin; +import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.Dialog; @@ -700,7 +700,7 @@ public class DownloadIndexActivity extends OsmandExpandableListActivity { downloads.set(downloads.get() + 1); } if (entry.existingBackupFile != null) { - Algoritms.removeAllFiles(entry.existingBackupFile); + Algorithms.removeAllFiles(entry.existingBackupFile); } trackEvent(entry); publishProgress(entry); diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java index 1f928f6987..7105e47118 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java @@ -10,7 +10,6 @@ import java.util.Locale; import java.util.Map; import java.util.Set; -import net.osmand.Algoritms; import net.osmand.IProgress; import net.osmand.access.AccessibleToast; import net.osmand.data.IndexConstants; @@ -22,6 +21,7 @@ import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.activities.EnumAdapter.IEnumWithResource; import net.osmand.plus.activities.LocalIndexHelper.LocalIndexType; +import net.osmand.util.Algorithms; import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; @@ -353,7 +353,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { boolean successfull = false; if(operation == DELETE_OPERATION){ File f = new File(info.getPathToData()); - successfull = Algoritms.removeAllFiles(f); + successfull = Algorithms.removeAllFiles(f); } else if(operation == RESTORE_OPERATION){ successfull = move(new File(info.getPathToData()), getFileToRestore(info)); if(successfull){ diff --git a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java index b485bbda77..8a3294b0cc 100644 --- a/OsmAnd/src/net/osmand/plus/activities/MapActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/MapActivity.java @@ -7,7 +7,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.access.AccessibilityPlugin; import net.osmand.access.AccessibleActivity; @@ -44,6 +43,7 @@ import net.osmand.plus.views.AnimateDraggingMapThread; import net.osmand.plus.views.OsmandMapLayer; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.PointLocationLayer; +import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.Dialog; @@ -343,8 +343,8 @@ public class MapActivity extends AccessibleActivity implements IMapLocationListe // if destination point was changed try to recalculate route TargetPointsHelper targets = getTargetPoints(); if (routingHelper.isFollowingMode() && ( - !Algoritms.objectEquals(targets.getPointToNavigate(), routingHelper.getFinalLocation() )|| - !Algoritms.objectEquals(targets.getIntermediatePoints(), routingHelper.getIntermediatePoints()) + !Algorithms.objectEquals(targets.getPointToNavigate(), routingHelper.getFinalLocation() )|| + !Algorithms.objectEquals(targets.getIntermediatePoints(), routingHelper.getIntermediatePoints()) )) { routingHelper.setFinalAndCurrentLocation(targets.getPointToNavigate(), targets.getIntermediatePoints(), diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java index 7bc0820f06..7023a0f612 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchActivity.java @@ -6,7 +6,6 @@ import java.util.Arrays; import java.util.Formatter; import java.util.Locale; -import net.osmand.Algoritms; import net.osmand.FavouritePoint; import net.osmand.osm.LatLon; import net.osmand.plus.OsmandApplication; @@ -14,6 +13,7 @@ import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.activities.FavouritesListActivity; import net.osmand.plus.activities.NavigatePointActivity; +import net.osmand.util.Algorithms; import android.app.Activity; import android.app.TabActivity; import android.content.Intent; @@ -286,7 +286,7 @@ public class SearchActivity extends TabActivity { double lon = intent.getDoubleExtra(SEARCH_LON, 0); if (lat != 0 || lon != 0) { LatLon l = new LatLon(lat, lon); - if(!Algoritms.objectEquals(reqSearchPoint, l)){ + if(!Algorithms.objectEquals(reqSearchPoint, l)){ reqSearchPoint = l; updateSearchPoint(reqSearchPoint, getString(R.string.search_position_fixed), true); } @@ -295,7 +295,7 @@ public class SearchActivity extends TabActivity { if(searchPoint == null){ LatLon last = settings.getLastKnownMapLocation(); - if(!Algoritms.objectEquals(reqSearchPoint, last)){ + if(!Algorithms.objectEquals(reqSearchPoint, last)){ reqSearchPoint = last; updateSearchPoint(last, getString(R.string.search_position_fixed), true); } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java index 6787e63ef4..4e0e30f950 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressActivity.java @@ -3,7 +3,6 @@ package net.osmand.plus.activities.search; import java.text.MessageFormat; -import net.osmand.Algoritms; import net.osmand.osm.LatLon; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; @@ -11,6 +10,7 @@ import net.osmand.plus.R; import net.osmand.plus.RegionAddressRepository; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivityActions; +import net.osmand.util.Algorithms; import android.app.Activity; import android.content.Intent; import android.os.Bundle; @@ -205,24 +205,24 @@ public class SearchAddressActivity extends Activity { String historyName = null; String objectName = ""; int zoom = 12; - if (!Algoritms.isEmpty(street2) && !Algoritms.isEmpty(street)) { - String cityName = !Algoritms.isEmpty(postcode) ? postcode : city; + if (!Algorithms.isEmpty(street2) && !Algorithms.isEmpty(street)) { + String cityName = !Algorithms.isEmpty(postcode) ? postcode : city; objectName = street; historyName = MessageFormat.format(getString(R.string.search_history_int_streets), street, street2, cityName); zoom = 16; - } else if (!Algoritms.isEmpty(building)) { - String cityName = !Algoritms.isEmpty(postcode) ? postcode : city; + } else if (!Algorithms.isEmpty(building)) { + String cityName = !Algorithms.isEmpty(postcode) ? postcode : city; objectName = street + " " + building; historyName = MessageFormat.format(getString(R.string.search_history_building), building, street, cityName); zoom = 16; - } else if (!Algoritms.isEmpty(street)) { + } else if (!Algorithms.isEmpty(street)) { String cityName = postcode != null ? postcode : city; objectName = street; historyName = MessageFormat.format(getString(R.string.search_history_street), street, cityName); zoom = 15; - } else if (!Algoritms.isEmpty(city)) { + } else if (!Algorithms.isEmpty(city)) { historyName = MessageFormat.format(getString(R.string.search_history_city), city); objectName = city; zoom = 13; @@ -250,20 +250,20 @@ public class SearchAddressActivity extends Activity { protected void updateBuildingSection(){ if(radioBuilding){ ((TextView)findViewById(R.id.BuildingText)).setText(R.string.search_address_building); - if(Algoritms.isEmpty(building)){ + if(Algorithms.isEmpty(building)){ ((TextView)findViewById(R.id.BuildingButton)).setText(R.string.choose_building); } else { ((TextView)findViewById(R.id.BuildingButton)).setText(building); } } else { ((TextView)findViewById(R.id.BuildingText)).setText(R.string.search_address_street); - if(Algoritms.isEmpty(street2)){ + if(Algorithms.isEmpty(street2)){ ((TextView)findViewById(R.id.BuildingButton)).setText(R.string.choose_intersected_street); } else { ((TextView)findViewById(R.id.BuildingButton)).setText(street2); } } - findViewById(R.id.ResetBuilding).setEnabled(!Algoritms.isEmpty(street2) || !Algoritms.isEmpty(building)); + findViewById(R.id.ResetBuilding).setEnabled(!Algorithms.isEmpty(street2) || !Algorithms.isEmpty(building)); } protected void updateUI(){ @@ -278,34 +278,34 @@ public class SearchAddressActivity extends Activity { findViewById(R.id.SearchOnline).setVisibility(View.VISIBLE); showOnMap.setVisibility(View.VISIBLE); } - findViewById(R.id.ResetCountry).setEnabled(!Algoritms.isEmpty(region)); - if(Algoritms.isEmpty(region)){ + findViewById(R.id.ResetCountry).setEnabled(!Algorithms.isEmpty(region)); + if(Algorithms.isEmpty(region)){ countryButton.setText(R.string.ChooseCountry); } else { countryButton.setText(region); } - findViewById(R.id.ResetCity).setEnabled(!Algoritms.isEmpty(city) || !Algoritms.isEmpty(postcode)); - if(Algoritms.isEmpty(city) && Algoritms.isEmpty(postcode)){ + findViewById(R.id.ResetCity).setEnabled(!Algorithms.isEmpty(city) || !Algorithms.isEmpty(postcode)); + if(Algorithms.isEmpty(city) && Algorithms.isEmpty(postcode)){ cityButton.setText(R.string.choose_city); } else { - if(!Algoritms.isEmpty(postcode)){ + if(!Algorithms.isEmpty(postcode)){ cityButton.setText(postcode); } else { cityButton.setText(city); } } - cityButton.setEnabled(!Algoritms.isEmpty(region)); + cityButton.setEnabled(!Algorithms.isEmpty(region)); - findViewById(R.id.ResetStreet).setEnabled(!Algoritms.isEmpty(street)); - if(Algoritms.isEmpty(street)){ + findViewById(R.id.ResetStreet).setEnabled(!Algorithms.isEmpty(street)); + if(Algorithms.isEmpty(street)){ streetButton.setText(R.string.choose_street); } else { streetButton.setText(street); } - streetButton.setEnabled(!Algoritms.isEmpty(city) || !Algoritms.isEmpty(postcode)); + streetButton.setEnabled(!Algorithms.isEmpty(city) || !Algorithms.isEmpty(postcode)); - buildingButton.setEnabled(!Algoritms.isEmpty(street)); - ((RadioGroup)findViewById(R.id.RadioGroup)).setVisibility(Algoritms.isEmpty(street) ? View.GONE : View.VISIBLE); + buildingButton.setEnabled(!Algorithms.isEmpty(street)); + ((RadioGroup)findViewById(R.id.RadioGroup)).setVisibility(Algorithms.isEmpty(street) ? View.GONE : View.VISIBLE); if(radioBuilding){ ((RadioButton)findViewById(R.id.RadioBuilding)).setChecked(true); @@ -317,19 +317,19 @@ public class SearchAddressActivity extends Activity { } public void loadData() { - if (!Algoritms.isEmpty(region)) { + if (!Algorithms.isEmpty(region)) { String postcodeStr = osmandSettings.getLastSearchedPostcode(); - if (!Algoritms.isEmpty(postcodeStr)) { + if (!Algorithms.isEmpty(postcodeStr)) { postcode = postcodeStr; } else { city = osmandSettings.getLastSearchedCityName(); } - if (!Algoritms.isEmpty(postcode) || !Algoritms.isEmpty(city)) { + if (!Algorithms.isEmpty(postcode) || !Algorithms.isEmpty(city)) { street = osmandSettings.getLastSearchedStreet(); - if (!Algoritms.isEmpty(street)) { + if (!Algorithms.isEmpty(street)) { String str = osmandSettings.getLastSearchedIntersectedStreet(); - radioBuilding = Algoritms.isEmpty(str); + radioBuilding = Algorithms.isEmpty(str); if (!radioBuilding) { street2 = str; } else { diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineActivity.java index 78a1fe8c08..566785a568 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchAddressOnlineActivity.java @@ -9,7 +9,6 @@ import java.util.List; import java.util.Locale; import net.londatiga.android.QuickAction; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.osm.LatLon; @@ -22,6 +21,7 @@ import net.osmand.plus.Version; import net.osmand.plus.activities.MapActivityActions; import net.osmand.plus.activities.OsmandListActivity; import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; import org.xmlpull.v1.XmlPullParser; @@ -125,7 +125,7 @@ public class SearchAddressOnlineActivity extends OsmandListActivity implements S } protected void searchPlaces(final String search) { - if(Algoritms.isEmpty(search)){ + if(Algorithms.isEmpty(search)){ return; } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java index eeb4ba884d..09a3da03a5 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java @@ -3,7 +3,6 @@ package net.osmand.plus.activities.search; import java.util.Comparator; import java.util.List; -import net.osmand.Algoritms; import net.osmand.ResultMatcher; import net.osmand.data.Building; import net.osmand.data.City; @@ -12,6 +11,7 @@ import net.osmand.osm.LatLon; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; import net.osmand.plus.RegionAddressRepository; +import net.osmand.util.Algorithms; import android.os.AsyncTask; import android.view.View; import android.widget.Toast; @@ -26,8 +26,8 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity() { @Override public int compare(Building o1, Building o2) { - int i1 = Algoritms.extractFirstIntegerNumber(o1.getName()); - int i2 = Algoritms.extractFirstIntegerNumber(o2.getName()); + int i1 = Algorithms.extractFirstIntegerNumber(o1.getName()); + int i2 = Algorithms.extractFirstIntegerNumber(o2.getName()); return i1 - i2; } }; diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java index 5294c68efa..9d937b13bb 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchPOIActivity.java @@ -17,7 +17,6 @@ import java.util.Map.Entry; import net.londatiga.android.ActionItem; import net.londatiga.android.QuickAction; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.ResultMatcher; import net.osmand.access.AccessibleToast; @@ -39,6 +38,7 @@ import net.osmand.plus.activities.EditPOIFilterActivity; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.MapActivityActions; import net.osmand.plus.activities.OsmandListActivity; +import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.Context; @@ -156,12 +156,12 @@ public class SearchPOIActivity extends OsmandListActivity implements SensorEvent return; } if(isNameFinderFilter() && - !Algoritms.objectEquals(((NameFinderPoiFilter) filter).getQuery(), query)){ + !Algorithms.objectEquals(((NameFinderPoiFilter) filter).getQuery(), query)){ filter.clearPreviousZoom(); ((NameFinderPoiFilter) filter).setQuery(query); runNewSearchQuery(SearchAmenityRequest.buildRequest(location, SearchAmenityRequest.NEW_SEARCH_INIT)); } else if(isSearchByNameFilter() && - !Algoritms.objectEquals(((SearchByNameFilter) filter).getQuery(), query)){ + !Algorithms.objectEquals(((SearchByNameFilter) filter).getQuery(), query)){ showFilter.setVisibility(View.INVISIBLE); filter.clearPreviousZoom(); showPoiCategoriesByNameFilter(query, location); @@ -626,7 +626,7 @@ public class SearchPOIActivity extends OsmandListActivity implements SensorEvent searchPOILevel.setEnabled(filter.isSearchFurtherAvailable()); searchPOILevel.setText(R.string.search_POI_level_btn); if (isNameFinderFilter()) { - if (!Algoritms.isEmpty(((NameFinderPoiFilter) filter).getLastError())) { + if (!Algorithms.isEmpty(((NameFinderPoiFilter) filter).getLastError())) { AccessibleToast.makeText(SearchPOIActivity.this, ((NameFinderPoiFilter) filter).getLastError(), Toast.LENGTH_LONG).show(); } amenityAdapter.setNewModel(result, ""); @@ -888,13 +888,13 @@ public class SearchPOIActivity extends OsmandListActivity implements SensorEvent setLocation(null); } if (!isRunningOnEmulator() && service.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) { - if (!Algoritms.objectEquals(currentLocationProvider, LocationManager.NETWORK_PROVIDER)) { + if (!Algorithms.objectEquals(currentLocationProvider, LocationManager.NETWORK_PROVIDER)) { currentLocationProvider = LocationManager.NETWORK_PROVIDER; service.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, GPS_TIMEOUT_REQUEST, GPS_DIST_REQUEST, this); } } } else if (LocationProvider.AVAILABLE == status) { - if (!Algoritms.objectEquals(currentLocationProvider, LocationManager.GPS_PROVIDER)) { + if (!Algorithms.objectEquals(currentLocationProvider, LocationManager.GPS_PROVIDER)) { currentLocationProvider = LocationManager.GPS_PROVIDER; service.removeUpdates(networkListener); } diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchTransportActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchTransportActivity.java index 2da19e89d9..85a4fff04d 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchTransportActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchTransportActivity.java @@ -7,7 +7,6 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; -import net.osmand.Algoritms; import net.osmand.data.TransportRoute; import net.osmand.data.TransportStop; import net.osmand.osm.LatLon; @@ -21,6 +20,7 @@ import net.osmand.plus.TransportIndexRepository; import net.osmand.plus.TransportIndexRepository.RouteInfoLocation; import net.osmand.plus.activities.TransportRouteHelper; import net.osmand.plus.activities.search.SearchActivity.SearchActivityChild; +import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.ListActivity; @@ -145,8 +145,8 @@ public class SearchTransportActivity extends ListActivity implements SearchActiv } OsmandApplication app = (OsmandApplication) getApplication(); LatLon pointToNavigate = app.getTargetPointsHelper().getPointToNavigate(); - if(!Algoritms.objectEquals(pointToNavigate, this.destinationLocation) || - !Algoritms.objectEquals(startPoint, this.lastKnownMapLocation)){ + if(!Algorithms.objectEquals(pointToNavigate, this.destinationLocation) || + !Algorithms.objectEquals(startPoint, this.lastKnownMapLocation)){ destinationLocation = pointToNavigate; selectedDestinationLocation = destinationLocation; lastKnownMapLocation = startPoint; @@ -156,7 +156,7 @@ public class SearchTransportActivity extends ListActivity implements SearchActiv @Override public void locationUpdate(LatLon l) { - if(!Algoritms.objectEquals(l, this.lastKnownMapLocation)){ + if(!Algorithms.objectEquals(l, this.lastKnownMapLocation)){ lastKnownMapLocation = l; searchTransport(); } diff --git a/OsmAnd/src/net/osmand/plus/api/AudioFocusHelperImpl.java b/OsmAnd/src/net/osmand/plus/api/AudioFocusHelperImpl.java index 7e420d9f9f..08a2f56162 100644 --- a/OsmAnd/src/net/osmand/plus/api/AudioFocusHelperImpl.java +++ b/OsmAnd/src/net/osmand/plus/api/AudioFocusHelperImpl.java @@ -1,7 +1,6 @@ package net.osmand.plus.api; import net.osmand.PlatformUtil; - import net.osmand.plus.ClientContext; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/api/ExternalServiceAPIImpl.java b/OsmAnd/src/net/osmand/plus/api/ExternalServiceAPIImpl.java index e382ef9437..f119619bf1 100644 --- a/OsmAnd/src/net/osmand/plus/api/ExternalServiceAPIImpl.java +++ b/OsmAnd/src/net/osmand/plus/api/ExternalServiceAPIImpl.java @@ -1,9 +1,10 @@ package net.osmand.plus.api; -import org.apache.commons.logging.Log; - import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; + +import org.apache.commons.logging.Log; + import android.content.Context; import android.hardware.Sensor; import android.hardware.SensorManager; diff --git a/OsmAnd/src/net/osmand/plus/api/InternalToDoAPIImpl.java b/OsmAnd/src/net/osmand/plus/api/InternalToDoAPIImpl.java index 3f852f6694..f51dea288f 100644 --- a/OsmAnd/src/net/osmand/plus/api/InternalToDoAPIImpl.java +++ b/OsmAnd/src/net/osmand/plus/api/InternalToDoAPIImpl.java @@ -7,7 +7,6 @@ import net.osmand.binary.BinaryMapIndexReader; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.OsmandApplication; -import net.osmand.plus.SearchHistoryHelper; import net.osmand.plus.OsmandSettings.DayNightMode; import net.osmand.plus.SQLiteTileSource; diff --git a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java index 1ae257f9d8..c717d43aea 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/AudioVideoNotesPlugin.java @@ -14,7 +14,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import net.osmand.Algoritms; import net.osmand.IProgress; import net.osmand.Location; import net.osmand.PlatformUtil; @@ -41,6 +40,7 @@ import net.osmand.plus.views.MapInfoLayer; import net.osmand.plus.views.MapStackControl; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.TextInfoControl; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -722,7 +722,7 @@ public class AudioVideoNotesPlugin extends OsmandPlugin { public void deleteRecording(Recording r) { recordings.unregisterObject(r.lat, r.lon, r); recordingByFileName.remove(r.file.getName()); - Algoritms.removeAllFiles(r.file); + Algorithms.removeAllFiles(r.file); activity.getMapLayers().getContextMenuLayer().setLocation(null, ""); activity.getMapView().refreshMap(); } diff --git a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java index b7c40fb2d4..1bd57419fb 100644 --- a/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java +++ b/OsmAnd/src/net/osmand/plus/development/OsmandDevelopmentPlugin.java @@ -2,7 +2,6 @@ package net.osmand.plus.development; import java.text.SimpleDateFormat; -import net.osmand.SunriseSunset; import net.osmand.plus.OptionsMenuHelper; import net.osmand.plus.OptionsMenuHelper.OnOptionsMenuClick; import net.osmand.plus.OsmandApplication; @@ -13,6 +12,7 @@ import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.SettingsActivity; import net.osmand.plus.routing.RouteAnimation; import net.osmand.plus.routing.RoutingHelper; +import net.osmand.util.SunriseSunset; import android.content.Intent; import android.os.Debug; import android.os.Debug.MemoryInfo; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java index 80cb6525de..774df0c308 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OpenstreetmapRemoteUtil.java @@ -17,9 +17,6 @@ import java.text.MessageFormat; import java.util.LinkedHashMap; import java.util.Map; -import net.osmand.Algoritms; -import net.osmand.Base64; -import net.osmand.IOUtils; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.data.Amenity; @@ -34,6 +31,8 @@ import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.Version; +import net.osmand.util.Base64; +import net.osmand.util.IOUtils; import org.apache.commons.logging.Log; import org.apache.http.HttpResponse; diff --git a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java index 0e118fa480..b98910b01d 100644 --- a/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java +++ b/OsmAnd/src/net/osmand/plus/osmedit/OsmEditingPlugin.java @@ -1,6 +1,5 @@ package net.osmand.plus.osmedit; -import net.osmand.Algoritms; import net.osmand.access.AccessibleToast; import net.osmand.data.Amenity; import net.osmand.plus.ContextMenuAdapter; @@ -12,10 +11,11 @@ import net.osmand.plus.R; import net.osmand.plus.activities.EnumAdapter; import net.osmand.plus.activities.LocalIndexInfo; import net.osmand.plus.activities.LocalIndexesActivity; +import net.osmand.plus.activities.LocalIndexesActivity.UploadVisibility; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.activities.SettingsActivity; -import net.osmand.plus.activities.LocalIndexesActivity.UploadVisibility; import net.osmand.plus.views.OsmandMapTileView; +import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.Context; @@ -204,7 +204,7 @@ public class OsmEditingPlugin extends OsmandPlugin { public boolean sendGPXFiles(final LocalIndexesActivity la, final LocalIndexInfo... info){ String name = settings.USER_NAME.get(); String pwd = settings.USER_PASSWORD.get(); - if(Algoritms.isEmpty(name) || Algoritms.isEmpty(pwd)){ + if(Algorithms.isEmpty(name) || Algorithms.isEmpty(pwd)){ AccessibleToast.makeText(la, R.string.validate_gpx_upload_name_pwd, Toast.LENGTH_LONG).show(); return false; } diff --git a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java index 701dfb3e93..0a235add99 100644 --- a/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java +++ b/OsmAnd/src/net/osmand/plus/rastermaps/OsmandRasterMapsPlugin.java @@ -3,7 +3,6 @@ package net.osmand.plus.rastermaps; import java.util.ArrayList; import java.util.Map; -import net.osmand.Algoritms; import net.osmand.ResultMatcher; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager.TileSourceTemplate; @@ -22,6 +21,7 @@ import net.osmand.plus.views.BaseMapLayer; import net.osmand.plus.views.MapTileLayer; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.plus.views.SeekBarPreference; +import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.DialogInterface; @@ -98,7 +98,7 @@ public class OsmandRasterMapsPlugin extends OsmandPlugin { public void updateLayer(OsmandMapTileView mapView, OsmandSettings settings, MapTileLayer layer, CommonPreference preference, float layerOrder, boolean warnWhenSelected) { ITileSource overlay = settings.getTileSourceByName(preference.get(), warnWhenSelected); - if(!Algoritms.objectEquals(overlay, layer.getMap())){ + if(!Algorithms.objectEquals(overlay, layer.getMap())){ if(overlay == null){ mapView.removeLayer(layer); } else { diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 7f57a42271..2196434523 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -19,10 +19,9 @@ import java.util.List; import java.util.Map; import java.util.Set; -import net.osmand.Algoritms; import net.osmand.IProgress; -import net.osmand.PlatformUtil; import net.osmand.NativeLibrary.NativeSearchResult; +import net.osmand.PlatformUtil; import net.osmand.QuadRect; import net.osmand.access.AccessibleToast; import net.osmand.binary.BinaryMapDataObject; @@ -44,6 +43,7 @@ import net.osmand.render.RenderingRuleProperty; import net.osmand.render.RenderingRuleSearchRequest; import net.osmand.render.RenderingRuleStorageProperties; import net.osmand.render.RenderingRulesStorage; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -463,7 +463,7 @@ public class MapRenderRepositories { } else { CommonPreference settings = prefs.getCustomRenderProperty(customProp.getAttrName()); String res = settings.get(); - if (!Algoritms.isEmpty(res)) { + if (!Algorithms.isEmpty(res)) { if (customProp.isString()) { renderingReq.setStringFilter(customProp, res); } else if (customProp.isBoolean()) { diff --git a/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java b/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java index bf202c4e7a..047227bf94 100644 --- a/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java +++ b/OsmAnd/src/net/osmand/plus/render/NativeOsmandLibrary.java @@ -1,12 +1,11 @@ package net.osmand.plus.render; -import net.osmand.PlatformUtil; import net.osmand.NativeLibrary; +import net.osmand.PlatformUtil; import net.osmand.plus.render.OsmandRenderer.RenderingContext; import net.osmand.render.RenderingRuleSearchRequest; import net.osmand.render.RenderingRulesStorage; -import net.osmand.router.RouteSegmentResult; import org.apache.commons.logging.Log; diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index 603fdfc7b7..995d7e84ab 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -9,10 +9,9 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import net.osmand.Algoritms; -import net.osmand.PlatformUtil; import net.osmand.NativeLibrary; import net.osmand.NativeLibrary.NativeSearchResult; +import net.osmand.PlatformUtil; import net.osmand.binary.BinaryMapDataObject; import net.osmand.binary.BinaryMapIndexReader.TagValuePair; import net.osmand.map.MapTileDownloader.IMapDownloaderCallback; @@ -21,6 +20,7 @@ import net.osmand.plus.render.TextRenderer.TextDrawInfo; import net.osmand.render.RenderingRuleProperty; import net.osmand.render.RenderingRuleSearchRequest; import net.osmand.render.RenderingRulesStorage; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -534,13 +534,13 @@ public class OsmandRenderer { p.setStyle(Style.STROKE); p.setStrokeWidth(req.getFloatPropertyValue(rStrokeW)); String cap = req.getStringPropertyValue(rCap); - if(!Algoritms.isEmpty(cap)){ + if(!Algorithms.isEmpty(cap)){ p.setStrokeCap(Cap.valueOf(cap.toUpperCase())); } else { p.setStrokeCap(Cap.BUTT); } String pathEffect = req.getStringPropertyValue(rPathEff); - if (!Algoritms.isEmpty(pathEffect)) { + if (!Algorithms.isEmpty(pathEffect)) { p.setPathEffect(getDashEffect(pathEffect)); } else { p.setPathEffect(null); diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java b/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java index 9d307971b9..769c7c320d 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoControls.java @@ -9,11 +9,11 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import net.osmand.Algoritms; import net.osmand.plus.ApplicationMode; import net.osmand.plus.OsmandSettings; import net.osmand.plus.OsmandSettings.CommonPreference; import net.osmand.plus.OsmandSettings.OsmandPreference; +import net.osmand.util.Algorithms; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; @@ -88,7 +88,7 @@ public class MapInfoControls { public void removeApperanceWidgets(String category) { Iterator it = appearanceWidgets.iterator(); while(it.hasNext()) { - if(Algoritms.objectEquals(it.next().category, category)) { + if(Algorithms.objectEquals(it.next().category, category)) { it.remove(); } } diff --git a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java index 351300bb14..e0f883e7fb 100644 --- a/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/MapInfoLayer.java @@ -9,7 +9,6 @@ import java.util.EnumSet; import java.util.LinkedHashSet; import java.util.Set; -import net.osmand.Algoritms; import net.osmand.access.AccessibleToast; import net.osmand.binary.RouteDataObject; import net.osmand.plus.ApplicationMode; @@ -26,6 +25,7 @@ import net.osmand.plus.routing.RoutingHelper; import net.osmand.plus.views.MapInfoControls.MapInfoControlRegInfo; import net.osmand.render.RenderingRuleProperty; import net.osmand.render.RenderingRulesStorage; +import net.osmand.util.Algorithms; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.content.Context; @@ -474,7 +474,7 @@ public class MapInfoLayer extends OsmandMapLayer { public void fillAppearanceWidgets(Set widgets, String category, ArrayList registry) { for(MapInfoControlRegInfo w : widgets ) { - if(Algoritms.objectEquals(w.getCategory(), category)) { + if(Algorithms.objectEquals(w.getCategory(), category)) { registry.add(w); } } diff --git a/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java b/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java index 7e46d725ab..c23816eb3e 100644 --- a/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java +++ b/OsmAnd/src/net/osmand/plus/views/RouteInfoControls.java @@ -3,7 +3,6 @@ package net.osmand.plus.views; import java.util.Arrays; -import net.osmand.Algoritms; import net.osmand.GeoidAltitudeCorrection; import net.osmand.Location; import net.osmand.binary.RouteDataObject; @@ -20,6 +19,7 @@ import net.osmand.plus.routing.RouteCalculationResult.NextDirectionInfo; import net.osmand.plus.routing.RouteDirectionInfo; import net.osmand.plus.routing.RoutingHelper; import net.osmand.router.TurnType; +import net.osmand.util.Algorithms; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; @@ -69,7 +69,7 @@ public class RouteInfoControls { turnType = null; invalidate(); } - } else if (!Algoritms.objectEquals(turnType, showStraight ? straight : r.directionInfo.getTurnType())) { + } else if (!Algorithms.objectEquals(turnType, showStraight ? straight : r.directionInfo.getTurnType())) { turnType = showStraight ? straight : r.directionInfo.getTurnType(); TurnPathHelper.calcTurnPath(pathForTurn, turnType, pathTransform); if (turnType.getExitOut() > 0) { @@ -158,7 +158,7 @@ public class RouteInfoControls { turnType = null; invalidate(); } - } else if (!Algoritms.objectEquals(turnType, r.directionInfo.getTurnType())) { + } else if (!Algorithms.objectEquals(turnType, r.directionInfo.getTurnType())) { turnType = r.directionInfo.getTurnType(); TurnPathHelper.calcTurnPath(pathForTurn, turnType, pathTransform); invalidate(); diff --git a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java index 9df482ba67..6960a54c90 100644 --- a/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java +++ b/OsmAnd/src/net/osmand/plus/views/YandexTrafficAdapter.java @@ -7,12 +7,12 @@ import java.io.File; import java.io.IOException; import java.net.URL; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.access.AccessibleToast; import net.osmand.data.IndexConstants; import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.R; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -65,7 +65,7 @@ public class YandexTrafficAdapter extends MapTileAdapter { BufferedInputStream in = new BufferedInputStream(new URL("http://jgo.maps.yandex.net/trf/stat.js").openStream(), 1024); //$NON-NLS-1$ ByteArrayOutputStream dataStream = new ByteArrayOutputStream(); BufferedOutputStream out = new BufferedOutputStream(dataStream, 1024); - Algoritms.streamCopy(in, out); + Algorithms.streamCopy(in, out); out.flush(); String str = dataStream.toString(); // JSONObject json = new JSONObject(str.replace("YMaps.TrafficLoader.onLoad(\"stat\",", "").replace("});", "}")); @@ -78,8 +78,8 @@ public class YandexTrafficAdapter extends MapTileAdapter { } String newTimestamp = str.substring(start, end); lastTimestampUpdated = System.currentTimeMillis(); - Algoritms.closeStream(in); - Algoritms.closeStream(out); + Algorithms.closeStream(in); + Algorithms.closeStream(out); log.info("Timestamp updated"); //$NON-NLS-1$ if (!newTimestamp.equals(mTimestamp)) { mTimestamp = newTimestamp; @@ -104,7 +104,7 @@ public class YandexTrafficAdapter extends MapTileAdapter { File dir = view.getApplication().getAppPath(IndexConstants.TILES_INDEX_DIR); for (File ds : dir.listFiles()) { if (ds.isDirectory() && ds.getName().startsWith(YANDEX_PREFFIX)) { - Algoritms.removeAllFiles(ds); + Algorithms.removeAllFiles(ds); } } diff --git a/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java index 38b9994f43..076cf5a766 100644 --- a/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/MediaCommandPlayerImpl.java @@ -8,11 +8,9 @@ import java.util.List; import net.osmand.PlatformUtil; import net.osmand.plus.ClientContext; -import net.osmand.plus.OsmandSettings; import org.apache.commons.logging.Log; -import android.content.Context; import android.media.MediaPlayer; diff --git a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java index 567da52686..d132d11ca9 100644 --- a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java @@ -5,12 +5,11 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; -import net.osmand.Algoritms; import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; -import net.osmand.plus.OsmandSettings; import net.osmand.plus.R; import net.osmand.plus.activities.SettingsActivity; +import net.osmand.util.Algorithms; import org.apache.commons.logging.Log; @@ -71,7 +70,7 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer { if (langVal instanceof Struct) { language = ((Struct) langVal).getName(); } - if (Algoritms.isEmpty(language)) { + if (Algorithms.isEmpty(language)) { throw new CommandPlayerException( ctx.getString(R.string.voice_data_corrupted)); }