Code cleanup and strings refactoring

This commit is contained in:
Arty Bishop committed 2020-05-09 15:50:28 +01:00
1 parent 32df8c4c04
commit 7c60fa9b2b
3 files changed
+5 -11

No files matched your search

@@ -92,9 +92,8 @@ class MapViewFragment : Fragment(R.layout.fragment_map_view) {
binding.fabMap.setOnClickListener { showSelectSatDialog(satPassList) }
selectedSat = satPassList.first().tle
predictor = satPassList.first().predictor
mapView = MapView(mainActivity)
mapView = MapView(mainActivity, gsp)
mapView.setList(satPassList)
mapView.setGSP(gsp)
mapView.setChecked(checkedItem)
binding.frameMap.addView(mapView)
refreshView()
@@ -132,8 +131,6 @@ class MapViewFragment : Fragment(R.layout.fragment_map_view) {
checkedItem = which
selectedSat = list[which].tle
predictor = list[which].predictor
mapView.setList(satPassList)
mapView.setGSP(gsp)
mapView.setChecked(checkedItem)
mapView.invalidate()
dialog.dismiss()
@@ -16,6 +16,10 @@ import kotlin.math.abs
class MapView(context: Context) : View(context) {
constructor(context: Context, groundStationPosition: GroundStationPosition) : this(context) {
gsp = groundStationPosition
}
private lateinit var passList: List<SatPass>
private lateinit var gsp: GroundStationPosition
private lateinit var selectedSat: TLE
@@ -62,10 +66,6 @@ class MapView(context: Context) : View(context) {
passList = satPassList
}
fun setGSP(groundStationPosition: GroundStationPosition) {
gsp = groundStationPosition
}
fun setChecked(item: Int) {
checked = item
selectedSat = passList[checked].tle
@@ -2,7 +2,6 @@ package com.rtbishop.look4sat.ui.views
import android.content.Context
import android.graphics.Canvas
import android.graphics.Matrix
import android.graphics.Paint
import android.graphics.Path
import android.view.View
@@ -24,7 +23,6 @@ class PolarView(context: Context) : View(context) {
private val radius = polarWidth * 0.49f
private val txtSize = scale * 15
private val path: Path = Path()
private val mMatrix = Matrix()
var azimuth = 0f
private val radarPaint = Paint().apply {
@@ -51,7 +49,6 @@ class PolarView(context: Context) : View(context) {
}
override fun onDraw(canvas: Canvas) {
// Log.w("myTag", "$measuredWidth, $measuredHeight")
canvas.rotate(-azimuth, polarCenter, polarCenter)
canvas.translate(polarCenter, polarCenter)
drawRadarView(canvas)