Skip to content

Commit

Permalink
improve information display
Browse files Browse the repository at this point in the history
  • Loading branch information
wuan committed Jan 23, 2025
1 parent 69b5dde commit 126c68c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ android {
applicationId "org.blitzortung.android.app"
minSdkVersion 21
targetSdkVersion 34
versionCode 329
versionCode 330
versionName '2.3.0'
multiDexEnabled false
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import org.blitzortung.android.map.overlay.StrikeListOverlay
import org.blitzortung.android.protocol.Event
import org.blitzortung.android.util.TabletAwareView

private const val SMALL_TEXT_SCALE = 0.6f
private const val SMALL_TEXT_SCALE = 0.7f

class HistogramView @JvmOverloads constructor(
context: Context,
Expand Down Expand Up @@ -111,14 +111,9 @@ class HistogramView @JvmOverloads constructor(

var topCoordinate = padding

val bb = mapFragment.mapView.boundingBox
val text = "%.2f..%.2f %.2f..%.2f".format(bb.lonWest, bb.lonEast, bb.latSouth, bb.latNorth)
canvas.drawText(text, width - padding, topCoordinate + textSize / 1.2f * SMALL_TEXT_SCALE, smallTextPaint)
topCoordinate += (textSize + padding) * SMALL_TEXT_SCALE

val gridParameters = gridParameters
if (gridParameters != null) {
val text = "%.2f..%.2f %.2f..%.2f".format(gridParameters.longitudeStart, gridParameters.longitudeEnd, gridParameters.latitudeEnd, gridParameters.latitudeStart)
if (gridParameters != null && !gridParameters.isGlobal) {
val text = "%.1f..%.1f %.1f..%.1f".format(gridParameters.longitudeStart, gridParameters.longitudeEnd, gridParameters.latitudeEnd, gridParameters.latitudeStart)
canvas.drawText(text, width - padding, topCoordinate + textSize / 1.2f * SMALL_TEXT_SCALE, smallTextPaint)
topCoordinate += (textSize + padding) * SMALL_TEXT_SCALE
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class LegendView @JvmOverloads constructor(
for ((index, regionNumberString) in resources.getStringArray(R.array.regions_values).withIndex()) {
if (regionNumber == Integer.parseInt(regionNumberString)) {
val detail = if (regionNumber < 0) {
" ($dataArea)"
" [$dataArea]"
} else {
""
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ class MainDataHandler @Inject constructor(
return if (event != null) {
val mapView = event.source as OwnMapView
val updated = updateLocation(mapView.boundingBox)
// Log.v(LOG_TAG, "MainDataHandler.onScroll() update: $updated")
ensureUpdate(updated, mapView)
} else {
false
Expand All @@ -425,7 +424,6 @@ class MainDataHandler @Inject constructor(
val updateAutoGridSize = updateAutoGridSize(event.zoomLevel)
val updateLocation = updateLocation(mapView.boundingBox, updateAutoGridSize)
val updated = updateLocation || updateAutoGridSize
// Log.v(LOG_TAG, "MainDataHandler.onZoom() update: $updated (location: $updateLocation, autoGrid: $updateAutoGridSize)")
ensureUpdate(updated, mapView)
} else {
false
Expand Down

0 comments on commit 126c68c

Please sign in to comment.