mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Now using theme colors for RadarView and WorldMapView
This commit is contained in:
1 parent
4d3930db89
commit
8bbd7cb4d2
3 files changed
+11
-15
No files matched your search
@@ -115,24 +115,24 @@ class RadarFragment : Fragment() {
|
||||
}
|
||||
private val radarPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
color = Color.parseColor("#C0C0C0")
|
||||
color = resources.getColor(R.color.lightOnDark, (activity as MainActivity).theme)
|
||||
style = Paint.Style.STROKE
|
||||
strokeWidth = scale
|
||||
}
|
||||
private val txtPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
color = Color.parseColor("#FFE082")
|
||||
color = resources.getColor(R.color.themeAccent, (activity as MainActivity).theme)
|
||||
textSize = txtSize
|
||||
}
|
||||
private val passPaint = Paint().apply {
|
||||
private val trackPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
color = Color.RED
|
||||
color = resources.getColor(R.color.satTrack, (activity as MainActivity).theme)
|
||||
style = Paint.Style.STROKE
|
||||
strokeWidth = scale
|
||||
}
|
||||
private val satPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
color = Color.parseColor("#FFE082")
|
||||
color = resources.getColor(R.color.themeAccent, (activity as MainActivity).theme)
|
||||
style = Paint.Style.FILL
|
||||
}
|
||||
private val path: Path = Path()
|
||||
@@ -189,7 +189,7 @@ class RadarFragment : Fragment() {
|
||||
}
|
||||
startTime.time += delay
|
||||
}
|
||||
cvs.drawPath(path, passPaint)
|
||||
cvs.drawPath(path, trackPaint)
|
||||
}
|
||||
|
||||
private fun drawSatellite() {
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.rtbishop.lookingsat.ui
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Path
|
||||
import android.os.Bundle
|
||||
@@ -102,13 +101,13 @@ class WorldMapFragment : Fragment() {
|
||||
inner class TrackView(context: Context) : View(context) {
|
||||
private val groundTrackPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
color = Color.RED
|
||||
color = resources.getColor(R.color.satTrack, (activity as MainActivity).theme)
|
||||
style = Paint.Style.STROKE
|
||||
strokeWidth = scale
|
||||
}
|
||||
private val footprintPaint = Paint().apply {
|
||||
isAntiAlias = true
|
||||
color = Color.YELLOW
|
||||
color = resources.getColor(R.color.satFootprint, (activity as MainActivity).theme)
|
||||
style = Paint.Style.STROKE
|
||||
strokeWidth = scale
|
||||
}
|
||||
@@ -120,17 +119,12 @@ class WorldMapFragment : Fragment() {
|
||||
val frameHeight = mapFrame.measuredHeight
|
||||
val currentTime = getDateFor(System.currentTimeMillis())
|
||||
val orbitalPeriod = (24 * 60 / selectedSat.meanmo).toInt()
|
||||
val orbitEndTime = getDateFor(currentTime.time + orbitalPeriod * 60 * 1000)
|
||||
val satPos = predictor.getSatPos(currentTime)
|
||||
val footprintPositions = satPos.rangeCircle
|
||||
|
||||
var positions = predictor.getPositions(currentTime, 60, orbitalPeriod, orbitalPeriod)
|
||||
drawGroundTrack(canvas, frameWidth, frameHeight, positions)
|
||||
positions = predictor.getPositions(orbitEndTime, 60, 1, orbitalPeriod)
|
||||
val positions = predictor.getPositions(currentTime, 60, 0, orbitalPeriod * 3)
|
||||
drawGroundTrack(canvas, frameWidth, frameHeight, positions)
|
||||
drawFootprint(canvas, frameWidth, frameHeight, footprintPositions)
|
||||
var longitude = rad2Deg(satPos.longitude)
|
||||
|
||||
if (longitude > 180.0) longitude -= 180.0
|
||||
else longitude += 180.0
|
||||
}
|
||||
|
||||
@@ -6,4 +6,6 @@
|
||||
<color name="toolbarButton">#191919</color>
|
||||
<color name="backgroundDark">#080808</color>
|
||||
<color name="error">#800000</color>
|
||||
<color name="satTrack">#D50000</color>
|
||||
<color name="satFootprint">#FFE082</color>
|
||||
</resources>
|
||||
Reference in new issue
Block a user