PATRIK27 / osmdroid

Automatically exported from code.google.com/p/osmdroid
0 stars 0 forks source link

ScaleBarOverlay constructor should take Context rather than Activity as an argument #231

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The only place where an activity seems to be needed is in 
activity.getWindowManager(), but this could be changed to 
Context.getSystemService(Context.WINDOW_SERVICE) instead.

Original issue reported on code.google.com by toreleve...@gmail.com on 20 Jun 2011 at 12:24

GoogleCodeExporter commented 8 years ago
It's also used in the constructor for:

this.activity.getResources().getDisplayMetrics()

This is also incorrect, and should be resolved by updating the ResourceProxy to 
return a full set of DisplayMetrics rather than just the option to get the 
display density.

Original comment by kurtzm...@gmail.com on 27 Jun 2011 at 6:40

GoogleCodeExporter commented 8 years ago
getResources() is declared in Context.

Anyway, I ended up rewriting most of the class since I didn't like how it 
always made the scale bar 1 inch long, regardless of what odd distance that 
happens to represent on the map.

Original comment by toreleve...@gmail.com on 29 Jun 2011 at 11:06

GoogleCodeExporter commented 8 years ago
This is fixed in r1087.

Original comment by kurtzm...@gmail.com on 6 Apr 2012 at 8:44