Permalink
Browse files

Bug/#1214 -General cleanup (#1215)

* android-wms cleanup

- no appcompat needed
- no robolectrix needed
- custom runner is not used

* osmdroid-simple-map cleanup

- switch to appcompat
- misc cleanup

* mapsforge cleanup

* geopackage cleanup

remove unnecessary imports

* tilpackager cleanup

* OpenStreetMapViewer cleanup

- remove unnecessary imports
- remove unnecessary casts
- remove unnecessary modifiers
- remove obsolete SDK checks
- misc
  • Loading branch information...
cbalster authored and spyhunter99 committed Dec 13, 2018
1 parent cdceec8 commit fe223f1c2afbc12fe4c05096858c3bf221660575
Showing with 389 additions and 594 deletions.
  1. +4 −4 OSMMapTilePackager/build.gradle
  2. +1 −1 OSMMapTilePackager/src/main/java/org/osmdroid/mtp/OSMMapTilePackager.java
  3. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/BugsTestingActivity.java
  4. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/ExtraSamplesActivity.java
  5. +2 −2 OpenStreetMapViewer/src/main/java/org/osmdroid/LicenseActivity.java
  6. +5 −5 OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java
  7. +28 −28 OpenStreetMapViewer/src/main/java/org/osmdroid/PreferenceActivity.java
  8. +3 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/bugtestfragments/Bug164EndlessOnScolls.java
  9. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/bugtestfragments/Bug419Zoom.java
  10. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/bugtestfragments/Bug512CacheManagerWp.java
  11. +0 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/bugtestfragments/Bug82WinDeath.java
  12. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/bugtestfragments/SampleBug57.java
  13. +4 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/bugtestfragments/WeathForceActivity.java
  14. +11 −11 OpenStreetMapViewer/src/main/java/org/osmdroid/constants/OpenStreetMapConstants.java
  15. +3 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/debug/CacheAnalyzerActivity.java
  16. +3 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/debug/browser/CacheAdapter.java
  17. +1 −2 OpenStreetMapViewer/src/main/java/org/osmdroid/debug/browser/CacheBrowserActivity.java
  18. +0 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/debug/util/FileDateUtil.java
  19. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/diag/DiagnosticsActivity.java
  20. +0 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/intro/AboutFragment.java
  21. +4 −8 OpenStreetMapViewer/src/main/java/org/osmdroid/intro/IntroActivity.java
  22. +0 −2 OpenStreetMapViewer/src/main/java/org/osmdroid/intro/IntroSliderAdapter.java
  23. +3 −10 OpenStreetMapViewer/src/main/java/org/osmdroid/intro/StorageAdapter.java
  24. +7 −7 OpenStreetMapViewer/src/main/java/org/osmdroid/intro/StoragePreferenceFragment.java
  25. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/animations/AnimatedMarkerHandler.java
  26. +1 −1 ...tMapViewer/src/main/java/org/osmdroid/samplefragments/animations/AnimatedMarkerTypeEvaluator.java
  27. +1 −1 ...tMapViewer/src/main/java/org/osmdroid/samplefragments/animations/AnimatedMarkerValueAnimator.java
  28. +4 −4 ...treetMapViewer/src/main/java/org/osmdroid/samplefragments/animations/FastZoomSpeedAnimations.java
  29. +4 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/bookmarks/BookmarkSample.java
  30. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/CacheImport.java
  31. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/CachePurge.java
  32. +1 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleAlternateCacheDir.java
  33. +13 −13 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDelete.java
  34. +13 −13 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDownloader.java
  35. +14 −17 ...treetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDownloaderArchive.java
  36. +13 −13 ...reetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleCacheDownloaderCustomUI.java
  37. +0 −6 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/cache/SampleJumboCache.java
  38. +2 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/AsyncTaskDemoFragment.java
  39. +0 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/IISTrackerBase.java
  40. +0 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/SampleOsmPath.java
  41. +0 −7 ...StreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/SampleSimpleFastPointOverlay.java
  42. +0 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/SampleSimpleLocation.java
  43. +6 −6 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/drawing/DrawCircle10km.java
  44. +7 −7 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/drawing/DrawPolygon.java
  45. +9 −9 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/drawing/DrawPolygonHoles.java
  46. +6 −7 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/drawing/PressToPlot.java
  47. +7 −7 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/drawing/SampleDrawPolyline.java
  48. +2 −2 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/events/SampleMapEventListener.java
  49. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/events/SampleZoomToBounding.java
  50. +3 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/events/ZoomToBoundsOnStartup.java
  51. +4 −5 ...StreetMapViewer/src/main/java/org/osmdroid/samplefragments/geopackage/GeopackageFeatureTiles.java
  52. +4 −5 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/geopackage/GeopackageFeatures.java
  53. +4 −5 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/geopackage/GeopackageSample.java
  54. +4 −6 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layers/LayerManager.java
  55. +1 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layers/OverlayAdapter.java
  56. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layouts/MapInAViewPagerFragment.java
  57. +1 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layouts/MapInScrollView.java
  58. +2 −6 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layouts/RecyclerCardView.java
  59. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layouts/SampleFragmentXmlLayout.java
  60. +2 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layouts/SampleSplitScreen.java
  61. +2 −2 ...r/src/main/java/org/osmdroid/samplefragments/layouts/list/MyStreetAddressRecyclerViewAdapter.java
  62. +1 −1 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layouts/pager/WebviewFragment.java
  63. +3 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/layouts/rec/CustomRecycler.java
  64. +2 −2 .../src/main/java/org/osmdroid/samplefragments/location/SampleCustomIconDirectedLocationOverlay.java
  65. +3 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/location/SampleFollowMe.java
  66. +5 −5 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/location/SampleHeadingCompassUp.java
  67. +0 −1 ...treetMapViewer/src/main/java/org/osmdroid/samplefragments/location/SampleMyLocationWithClick.java
  68. +4 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/location/SampleRotation.java
  69. +7 −7 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/milstd2525/ListPicker.java
  70. +4 −4 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/milstd2525/MilStdAdapter.java
  71. +0 −20 ...tMapViewer/src/main/java/org/osmdroid/samplefragments/milstd2525/MilStdCustomPaintingSurface.java
  72. +0 −2 ...treetMapViewer/src/main/java/org/osmdroid/samplefragments/milstd2525/MilStdMultipointOverlay.java
  73. +0 −1 ...etMapViewer/src/main/java/org/osmdroid/samplefragments/milstd2525/MilStdPointPlottingOverlay.java
  74. +66 −66 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/milstd2525/ModifierPicker.java
  75. +12 −12 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/milstd2525/Plotter.java
  76. +2 −3 ...pViewer/src/main/java/org/osmdroid/samplefragments/tileproviders/MapsforgeTileProviderSample.java
  77. +19 −26 ...StreetMapViewer/src/main/java/org/osmdroid/samplefragments/tileproviders/OfflinePickerSample.java
  78. +4 −5 ...wer/src/main/java/org/osmdroid/samplefragments/tileproviders/SampleAssetsOnlyRepetitionModes.java
  79. +0 −2 ...reetMapViewer/src/main/java/org/osmdroid/samplefragments/tileproviders/SampleOfflineGemfOnly.java
  80. +2 −3 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/tilesources/SampleMapBox.java
  81. +0 −2 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/tilesources/SampleWMSSource.java
  82. +0 −2 ...reetMapViewer/src/main/java/org/osmdroid/samplefragments/tilesources/SampleWhackyColorFilter.java
  83. +2 −2 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/ui/ExpandableListAdapter.java
  84. +1 −5 OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/ui/SamplesMenuFragment.java
  85. +1 −2 osmdroid-android-it/src/main/java/org/osmdroid/test/CacheAnalyzerTest.java
  86. +0 −2 osmdroid-android-it/src/main/java/org/osmdroid/test/CacheBrowserTest.java
  87. +0 −1 osmdroid-android-it/src/main/java/org/osmdroid/test/ExtraSamplesTest.java
  88. +0 −2 osmdroid-android-it/src/main/java/org/osmdroid/test/MapActivityTest.java
  89. +0 −1 osmdroid-android-it/src/main/java/org/osmdroid/tileprovider/BitmapPoolTest.java
  90. +0 −1 osmdroid-geopackage/build.gradle
  91. +0 −4 osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java
  92. +0 −3 osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/MarkerOptions.java
  93. +0 −1 osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/MultiLatLng.java
  94. +0 −7 osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmDroidMapShape.java
  95. +0 −7 osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/PolylineOptions.java
  96. +0 −1 ...roid-geopackage/src/main/java/org/osmdroid/gpkg/tiles/raster/GeoPackageMapTileModuleProvider.java
  97. +1 −2 osmdroid-mapsforge/build.gradle
  98. +1 −5 osmdroid-mapsforge/src/main/java/org/osmdroid/mapsforge/MapsForgeTileProvider.java
  99. +1 −4 osmdroid-simple-map/build.gradle
  100. +5 −4 osmdroid-simple-map/src/main/AndroidManifest.xml
  101. +17 −12 osmdroid-simple-map/src/main/java/org/osmdroid/sample/MapActivity.java
  102. +2 −4 osmdroid-simple-map/src/main/res/layout/activity_main.xml
  103. +1 −10 osmdroid-wms/build.gradle
  104. +1 −4 osmdroid-wms/src/main/AndroidManifest.xml
  105. +0 −38 osmdroid-wms/src/test/java/org/osmdroid/wms/CustomTestRunner.java
  106. +1 −19 osmdroid-wms/src/test/java/org/osmdroid/wms/ParserTest.java
@@ -17,15 +17,15 @@ dependencies {

//copy the instrumentation tests from the maven osmdroid-android-it src folder
task preBuildTask1(type: Copy) {
println("copying StreamUtils sources");
println("copying StreamUtils sources")
description 'copy java classes from osmdroid-android.'
from("${rootDir}/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/StreamUtils.java")
into "src/main/java/org/osmdroid/tileprovider/util/"

}

task preBuildTask2(type: Copy) {
println("copying GEMF sources");
println("copying GEMF sources")
description 'copy java classes from osmdroid-android.'
from("${rootDir}/osmdroid-android/src/main/java/org/osmdroid/util/GEMFFile.java")
into "src/main/java/org/osmdroid/util/"
@@ -34,7 +34,7 @@ task preBuildTask2(type: Copy) {


task preBuildTask3(type: Copy) {
println("copying api sources");
println("copying api sources")
description 'copy java classes from osmdroid-android.'
from("${rootDir}/osmdroid-android/src/main/java/org/osmdroid/api/") {
exclude 'IMyLocationOverlay.java'
@@ -48,7 +48,7 @@ task preBuildTask3(type: Copy) {


task preBuildTask4(type: Delete) {
println("removing android specific api sources");
println("removing android specific api sources")
delete "${projectDir}/src/main/java/org/osmdroid/api/"
delete "${projectDir}/src/main/java/org/osmdroid/api/IMyLocationOverlay.java"
delete "${projectDir}/src/main/java/org/osmdroid/api/Polyline.java"
@@ -178,7 +178,7 @@ private static void run(final String pServerURL, final String pDestinationFile,

public interface ProgressNotification {

public void updateProgress(String msg);
void updateProgress(String msg);
}

public static void execute(final String pServerURL, final String pDestinationFile,
@@ -29,7 +29,7 @@ protected void onCreate(Bundle savedInstanceState) {
MainActivity.updateStoragePrefreneces(this); //needed for unit tests
setContentView(R.layout.activity_extra_samples);

Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
Toolbar myToolbar = findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);

FragmentManager fm = this.getSupportFragmentManager();
@@ -25,7 +25,7 @@ protected void onCreate(Bundle savedInstanceState) {
MainActivity.updateStoragePrefreneces(this); //needed for unit tests
setContentView(R.layout.activity_extra_samples);

Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
Toolbar myToolbar = findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);

FragmentManager fm = this.getSupportFragmentManager();
@@ -26,11 +26,11 @@
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_license);
Spinner spinner = (Spinner) findViewById(R.id.license_module_spinner);
Spinner spinner = findViewById(R.id.license_module_spinner);
ArrayAdapter<String> array = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, values);
array.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(array);
license = (TextView) findViewById(R.id.license_body);
license = findViewById(R.id.license_body);
spinner.setOnItemSelectedListener(this);
}

@@ -47,7 +47,7 @@
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
Toolbar myToolbar = findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
// Generate a ListView with Sample Maps
final ArrayList<String> list = new ArrayList<>();
@@ -68,7 +68,7 @@ public void onCreate(final Bundle savedInstanceState) {
if (BuildConfig.VERSION_CODE >= 11)
list.add("Cache Analyzer");

ListView lv = (ListView) findViewById(R.id.activitylist);
ListView lv = findViewById(R.id.activitylist);
ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);

lv.setAdapter(adapter);
@@ -230,7 +230,7 @@ private void updateStorageInfo(){
long cacheSize = updateStoragePrefreneces(this);
//cache management ends here

TextView tv = (TextView) findViewById(R.id.sdcardstate_value);
TextView tv = findViewById(R.id.sdcardstate_value);
final String state = Environment.getExternalStorageState();

boolean mSdCardAvailable = Environment.MEDIA_MOUNTED.equals(state);
@@ -240,10 +240,10 @@ private void updateStorageInfo(){
tv.setTypeface(null, Typeface.BOLD);
}

tv = (TextView) findViewById(R.id.version_text);
tv = findViewById(R.id.version_text);
tv.setText(BuildConfig.VERSION_NAME + " " + BuildConfig.BUILD_TYPE);

tv = (TextView) findViewById(R.id.mainstorageInfo);
tv = findViewById(R.id.mainstorageInfo);
tv.setText(Configuration.getInstance().getOsmdroidTileCache().getAbsolutePath() + "\n" +
"Cache size: " + Formatter.formatFileSize(this,cacheSize));
}
@@ -72,60 +72,60 @@
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_prefs);
Toolbar myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
Toolbar myToolbar = findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);

checkBoxDebugTileProvider = (CheckBox) findViewById(R.id.checkBoxDebugTileProvider);
checkBoxDebugMode = (CheckBox) findViewById(R.id.checkBoxDebugMode);
checkBoxHardwareAcceleration = (CheckBox) findViewById(R.id.checkBoxHardwareAcceleration);
checkBoxDebugDownloading = (CheckBox) findViewById(R.id.checkBoxDebugDownloading);
checkBoxMapViewDebug = (CheckBox) findViewById(R.id.checkBoxMapViewDebug);
checkBoxDebugTileProvider = findViewById(R.id.checkBoxDebugTileProvider);
checkBoxDebugMode = findViewById(R.id.checkBoxDebugMode);
checkBoxHardwareAcceleration = findViewById(R.id.checkBoxHardwareAcceleration);
checkBoxDebugDownloading = findViewById(R.id.checkBoxDebugDownloading);
checkBoxMapViewDebug = findViewById(R.id.checkBoxMapViewDebug);
checkBoxDebugTileProvider.setOnClickListener(this);
checkBoxDebugMode.setOnClickListener(this);
checkBoxHardwareAcceleration.setOnClickListener(this);
checkBoxMapViewDebug.setOnClickListener(this);

textViewCacheDirectory = (TextView) findViewById(R.id.textViewCacheDirectory);
textViewBaseDirectory = (TextView) findViewById(R.id.textViewBaseDirectory);
buttonPurgeCache = (Button) findViewById(R.id.buttonPurgeCache);
httpUserAgent = (EditText) findViewById(R.id.httpUserAgent);
tileDownloadThreads = (EditText) findViewById(R.id.tileDownloadThreads);
textViewCacheDirectory = findViewById(R.id.textViewCacheDirectory);
textViewBaseDirectory = findViewById(R.id.textViewBaseDirectory);
buttonPurgeCache = findViewById(R.id.buttonPurgeCache);
httpUserAgent = findViewById(R.id.httpUserAgent);
tileDownloadThreads = findViewById(R.id.tileDownloadThreads);
tileDownloadThreads.addTextChangedListener(new PositiveShortTextValidator(tileDownloadThreads));
tileDownloadMaxQueueSize = (EditText) findViewById(R.id.tileDownloadMaxQueueSize);
tileDownloadMaxQueueSize = findViewById(R.id.tileDownloadMaxQueueSize);
tileDownloadMaxQueueSize.addTextChangedListener(new PositiveShortTextValidator(tileDownloadMaxQueueSize));
cacheMapTileCount = (EditText) findViewById(R.id.cacheMapTileCount);
cacheMapTileCount = findViewById(R.id.cacheMapTileCount);
cacheMapTileCount.addTextChangedListener(new PositiveShortTextValidator(cacheMapTileCount));
tileFileSystemThreads = (EditText) findViewById(R.id.tileFileSystemThreads);
tileFileSystemThreads = findViewById(R.id.tileFileSystemThreads);
tileFileSystemThreads.addTextChangedListener(new PositiveShortTextValidator(tileFileSystemThreads));
tileFileSystemMaxQueueSize = (EditText) findViewById(R.id.tileFileSystemMaxQueueSize);
tileFileSystemMaxQueueSize = findViewById(R.id.tileFileSystemMaxQueueSize);
tileFileSystemMaxQueueSize.addTextChangedListener(new PositiveShortTextValidator(tileFileSystemMaxQueueSize));
gpsWaitTime = (EditText) findViewById(R.id.gpsWaitTime);
gpsWaitTime = findViewById(R.id.gpsWaitTime);
gpsWaitTime.addTextChangedListener(new PositiveLongTextValidator(gpsWaitTime,1));
additionalExpirationTime = (EditText) findViewById(R.id.additionalExpirationTime);
additionalExpirationTime = findViewById(R.id.additionalExpirationTime);
additionalExpirationTime .addTextChangedListener(new PositiveLongTextValidator(additionalExpirationTime,0));

cacheMaxSize = (EditText) findViewById(R.id.cacheMaxSize);
cacheTrimSize = (EditText) findViewById(R.id.cacheTrimSize);
cacheMaxSize = findViewById(R.id.cacheMaxSize);
cacheTrimSize = findViewById(R.id.cacheTrimSize);
cacheMaxSize.addTextChangedListener(new PositiveLongTextValidator(cacheMaxSize,0));
cacheTrimSize.addTextChangedListener(new PositiveLongTextValidator(cacheTrimSize,0));

overrideExpirationTime = (EditText) findViewById(R.id.overrideExpirationTime);
zoomSpeedDefault = (EditText) findViewById(R.id.zoomSpeedDefault);
overrideExpirationTime = findViewById(R.id.overrideExpirationTime);
zoomSpeedDefault = findViewById(R.id.zoomSpeedDefault);
zoomSpeedDefault.addTextChangedListener(new PositiveLongTextValidator(zoomSpeedDefault,1));
zoomSpeedShort = (EditText) findViewById(R.id.zoomSpeedShort);
zoomSpeedShort = findViewById(R.id.zoomSpeedShort);
zoomSpeedShort.addTextChangedListener(new PositiveLongTextValidator(zoomSpeedShort,1));


buttonSetBase = (Button) findViewById(R.id.buttonSetBase);
buttonSetBase = findViewById(R.id.buttonSetBase);
buttonSetBase.setOnClickListener(this);
buttonSetCache = (Button) findViewById(R.id.buttonSetCache);
buttonManualCacheEntry = (Button) findViewById(R.id.buttonManualCacheEntry);
buttonSetCache = findViewById(R.id.buttonSetCache);
buttonManualCacheEntry = findViewById(R.id.buttonManualCacheEntry);
buttonSetCache.setOnClickListener(this);
buttonManualBaseEntry = (Button) findViewById(R.id.buttonManualBaseEntry);
buttonManualBaseEntry = findViewById(R.id.buttonManualBaseEntry);
buttonManualBaseEntry.setOnClickListener(this);
buttonManualCacheEntry.setOnClickListener(this);
buttonPurgeCache.setOnClickListener(this);
buttonReset = (Button) findViewById(R.id.buttonReset);
buttonReset = findViewById(R.id.buttonReset);
buttonReset.setOnClickListener(this);

findViewById(R.id.baseDirTitle).setOnClickListener(this);
@@ -414,7 +414,7 @@ public void onClick(DialogInterface dialog, int which) {
tv.setText(item.path + File.separator + "osmdroid" + File.separator + postfix);
} catch (Exception ex) {
ex.printStackTrace();
Toast.makeText(PreferenceActivity.this, "Invalid entry: " + ex.getMessage(), Toast.LENGTH_LONG);
Toast.makeText(PreferenceActivity.this, "Invalid entry: " + ex.getMessage(), Toast.LENGTH_LONG).show();
}

}
@@ -35,9 +35,9 @@ public String getSampleTitle() {
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(R.layout.map_with_locationbox164, container,false);
mMapView = (MapView) root.findViewById(R.id.mapview);
textViewCurrentLocation = (TextView) root.findViewById(R.id.textViewCurrentLocation);
animateTo = (Button)root.findViewById(R.id.animateTo);
mMapView = root.findViewById(R.id.mapview);
textViewCurrentLocation = root.findViewById(R.id.textViewCurrentLocation);
animateTo = root.findViewById(R.id.animateTo);
animateTo.setOnClickListener(this);
Log.d(TAG, "onCreateView");
return root;
@@ -33,7 +33,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

mMapView = new MapView(getActivity());
((LinearLayout) root.findViewById(R.id.mapview)).addView(mMapView);
btnCache = (Button) root.findViewById(R.id.btnCache);
btnCache = root.findViewById(R.id.btnCache);
btnCache.setOnClickListener(this);
btnCache.setText("Zoom Test");
return root;
@@ -41,7 +41,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

View root = inflater.inflate(R.layout.sample_cachemgr, container,false);

btnCache = (Button) root.findViewById(R.id.btnCache);
btnCache = root.findViewById(R.id.btnCache);
btnCache.setOnClickListener(this);
btnCache.setText("Run job (watch logcat output)");

@@ -1,6 +1,5 @@
package org.osmdroid.bugtestfragments;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
@@ -33,7 +33,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa

mMapView = new MapView(getActivity());
((LinearLayout) root.findViewById(R.id.mapview)).addView(mMapView);
Button btn = (Button) root.findViewById(R.id.btnCache);
Button btn = root.findViewById(R.id.btnCache);
btn.setOnClickListener(this);
btn.setText("To Step 2");
return root;
@@ -64,7 +64,7 @@ protected void onCreate(Bundle savedInstanceState) {
//as the app id.
Configuration.getInstance().setUserAgentValue(getPackageName());

mMapView = (MapView) findViewById(R.id.mapview);
mMapView = findViewById(R.id.mapview);
mMapView.setTileSource(TileSourceFactory.MAPNIK);


@@ -136,8 +136,8 @@ protected void onResume() {

return;
}
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, (LocationListener) this);
lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, (LocationListener) this);
lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, this);
lm.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, this);
} catch (Exception ex) {
}
compass = new InternalCompassOrientationProvider(this);
@@ -236,7 +236,7 @@ public void run() {
if (this!=null ) {
Log.i(TAG
, "GPS Speed: " + gpsspeed + "m/s GPS Bearing: " + gpsbearing +
"\nDevice Orientation: " + (int) deviceOrientation + " Compass heading: " + (int) orientationToMagneticNorth + "\n" +
"\nDevice Orientation: " + deviceOrientation + " Compass heading: " + (int) orientationToMagneticNorth + "\n" +
"True north: " + trueNorth.intValue() + " Map Orientation: " + (int) mMapView.getMapOrientation());
}
}
@@ -13,24 +13,24 @@
// Final Fields
// ===========================================================

public static final String PREFS_NAME = "org.andnav.osm.prefs";
public static final String PREFS_TILE_SOURCE = "tilesource";
String PREFS_NAME = "org.andnav.osm.prefs";
String PREFS_TILE_SOURCE = "tilesource";
@Deprecated
public static final String PREFS_SCROLL_X = "scrollX";
String PREFS_SCROLL_X = "scrollX";
@Deprecated
public static final String PREFS_SCROLL_Y = "scrollY";
String PREFS_SCROLL_Y = "scrollY";
/**
* as String because we cannot use double in Preferences, only float
* and float is not accurate enough
*/
public static final String PREFS_LATITUDE_STRING = "latitudeString";
public static final String PREFS_LONGITUDE_STRING = "longitudeString";
public static final String PREFS_ORIENTATION = "orientation";
String PREFS_LATITUDE_STRING = "latitudeString";
String PREFS_LONGITUDE_STRING = "longitudeString";
String PREFS_ORIENTATION = "orientation";
@Deprecated
public static final String PREFS_ZOOM_LEVEL = "zoomLevel";
public static final String PREFS_ZOOM_LEVEL_DOUBLE = "zoomLevelDouble";
public static final String PREFS_SHOW_LOCATION = "showLocation";
public static final String PREFS_SHOW_COMPASS = "showCompass";
String PREFS_ZOOM_LEVEL = "zoomLevel";
String PREFS_ZOOM_LEVEL_DOUBLE = "zoomLevelDouble";
String PREFS_SHOW_LOCATION = "showLocation";
String PREFS_SHOW_COMPASS = "showCompass";

// ===========================================================
// Methods
@@ -41,15 +41,15 @@
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_cache_analyzer);
cacheStats = (TextView) findViewById(R.id.cacheStats);
cacheStats = findViewById(R.id.cacheStats);

final ArrayList<String> list = new ArrayList<>();
list.add("Browse the cache");
list.add("Purge the cache");
list.add("Purge a specific tile source");
list.add("See the debug counters");

ListView lv = (ListView) findViewById(R.id.statslist);
ListView lv = findViewById(R.id.statslist);
ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, list);

lv.setAdapter(adapter);
@@ -179,7 +179,7 @@ public void run() {
@Override
public void run() {
try {
TextView tv = (TextView) findViewById(R.id.cacheStats);
TextView tv = findViewById(R.id.cacheStats);

if (tv != null) {
tv.setText(sb.toString());
@@ -69,9 +69,9 @@ public View getView(int position, View convertView, ViewGroup parent) {
MapTileExt p = (MapTileExt) getItem(position);
if (p != null) {
// Find fields to populate in inflated template
TextView source = (TextView) convertView.findViewById(R.id.tvSource);
TextView key = (TextView) convertView.findViewById(R.id.tvDbKey);
TextView expires = (TextView) convertView.findViewById(R.id.tvExpires);
TextView source = convertView.findViewById(R.id.tvSource);
TextView key = convertView.findViewById(R.id.tvDbKey);
TextView expires = convertView.findViewById(R.id.tvExpires);

source.setText(p.source);
key.setText(p.key + "");
@@ -10,7 +10,6 @@
import org.osmdroid.debug.model.SqlTileWriterExt;
import org.osmdroid.debug.util.FileDateUtil;
import org.osmdroid.intro.StorageAdapter;
import org.osmdroid.tileprovider.util.StorageUtils;

/**
* A simple view for browsing the osmdroid tile cache database
@@ -37,7 +36,7 @@ public void onResume() {
cache = new SqlTileWriterExt();
CacheAdapter adapter = new CacheAdapter(this, cache);

ListView lv = (ListView) findViewById(R.id.cacheListView);
ListView lv = findViewById(R.id.cacheListView);
lv.setAdapter(adapter);

((TextView) findViewById(R.id.rows)).setText(cache.getRowCount(null) + "");
@@ -4,7 +4,6 @@
import android.os.Build;
import android.text.format.DateFormat;

import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
Oops, something went wrong.

0 comments on commit fe223f1

Please sign in to comment.