kopia lustrzana https://github.com/ge0rg/aprsdroid
icons: made icons 'nodpi', requires API r8
rodzic
f748391b9b
commit
78ca04995c
|
|
@ -5,7 +5,7 @@
|
|||
android:versionName="1.3.0"
|
||||
android:installLocation="auto">
|
||||
|
||||
<uses-sdk android:minSdkVersion="3"
|
||||
<uses-sdk android:minSdkVersion="8"
|
||||
android:targetSdkVersion="19" />
|
||||
|
||||
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
|
||||
|
|
|
|||
Plik binarny nie jest wyświetlany.
|
Przed Szerokość: | Wysokość: | Rozmiar: 81 KiB |
Plik binarny nie jest wyświetlany.
|
Przed Szerokość: | Wysokość: | Rozmiar: 260 KiB Po Szerokość: | Wysokość: | Rozmiar: 301 KiB |
Plik binarny nie jest wyświetlany.
|
Przed Szerokość: | Wysokość: | Rozmiar: 175 KiB |
Plik binarny nie jest wyświetlany.
|
Przed Szerokość: | Wysokość: | Rozmiar: 180 KiB |
Plik binarny nie jest wyświetlany.
|
Przed Szerokość: | Wysokość: | Rozmiar: 74 KiB |
|
|
@ -175,7 +175,9 @@ class StationOverlay(icons : Drawable, context : MapAct, db : StorageDatabase) e
|
|||
// prevent android bug #11666
|
||||
populate()
|
||||
|
||||
lazy val symbolSize = (context.getResources().getDisplayMetrics().density * 16).toInt
|
||||
val iconbitmap = icons.asInstanceOf[BitmapDrawable].getBitmap
|
||||
val symbolSize = iconbitmap.getWidth()/16
|
||||
lazy val drawSize = (context.getResources().getDisplayMetrics().density * 24).toInt
|
||||
|
||||
override def size() = stations.size()
|
||||
override def createItem(idx : Int) : Station = stations.get(idx)
|
||||
|
|
@ -228,7 +230,8 @@ class StationOverlay(icons : Drawable, context : MapAct, db : StorageDatabase) e
|
|||
override def draw(c : Canvas, m : MapView, shadow : Boolean) : Unit = {
|
||||
if (shadow) return;
|
||||
|
||||
val fontSize = symbolSize*7/8
|
||||
Log.d(TAG, "draw: symbolSize=" + symbolSize + " drawSize=" + drawSize)
|
||||
val fontSize = drawSize*7/8
|
||||
val textPaint = new Paint()
|
||||
textPaint.setColor(0xff000000)
|
||||
textPaint.setTextAlign(Paint.Align.CENTER)
|
||||
|
|
@ -238,7 +241,7 @@ class StationOverlay(icons : Drawable, context : MapAct, db : StorageDatabase) e
|
|||
|
||||
val symbPaint = new Paint(textPaint)
|
||||
symbPaint.setARGB(255, 255, 255, 255)
|
||||
symbPaint.setTextSize(symbolSize*3/4 - 1)
|
||||
symbPaint.setTextSize(drawSize*3/4 - 1)
|
||||
|
||||
val strokePaint = new Paint(textPaint)
|
||||
strokePaint.setColor(0xffc8ffc8)
|
||||
|
|
@ -247,17 +250,16 @@ class StationOverlay(icons : Drawable, context : MapAct, db : StorageDatabase) e
|
|||
|
||||
val symbStrPaint = new Paint(strokePaint)
|
||||
symbStrPaint.setColor(0xff000000)
|
||||
symbStrPaint.setTextSize(symbolSize*3/4 - 1)
|
||||
symbStrPaint.setTextSize(drawSize*3/4 - 1)
|
||||
|
||||
strokePaint.setShadowLayer(2, 0, 0, 0xffc8ffc8)
|
||||
|
||||
val iconbitmap = icons.asInstanceOf[BitmapDrawable].getBitmap
|
||||
|
||||
val p = new Point()
|
||||
val proj = m.getProjection()
|
||||
val zoom = m.getZoomLevel()
|
||||
val (width, height) = (c.getWidth(), c.getHeight())
|
||||
val ss = symbolSize/2
|
||||
val ss = drawSize/2
|
||||
for (s <- stations) {
|
||||
proj.toPixels(s.pt, p)
|
||||
if (p.x >= 0 && p.y >= 0 && p.x < width && p.y < height) {
|
||||
|
|
|
|||
|
|
@ -6,11 +6,22 @@ import _root_.android.graphics.{Bitmap, BitmapFactory, Canvas, Matrix, Paint, Pa
|
|||
import _root_.android.util.AttributeSet
|
||||
import _root_.android.widget.ImageView
|
||||
|
||||
object SymbolView {
|
||||
var iconbitmap : Bitmap = null
|
||||
|
||||
def getSingleton(context : Context) = {
|
||||
if (iconbitmap == null) {
|
||||
iconbitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.allicons)
|
||||
}
|
||||
iconbitmap
|
||||
}
|
||||
}
|
||||
|
||||
class SymbolView(context : Context, attrs : AttributeSet) extends ImageView(context, attrs) {
|
||||
|
||||
var symbol : String = "/$"
|
||||
lazy val iconbitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.allicons)
|
||||
lazy val symbolSize = (context.getResources().getDisplayMetrics().density * 16).toInt
|
||||
lazy val iconbitmap = SymbolView.getSingleton(context)
|
||||
lazy val symbolSize = iconbitmap.getWidth()/16
|
||||
|
||||
|
||||
def setSymbol(new_sym : String) {
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue