mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Updated to API 36 (Android 16), bumped dependencies
This commit is contained in:
1 parent
bffb4842b1
commit
aa9365b2fd
11 files changed
+48
-47
No files matched your search
@@ -90,7 +90,7 @@ class MainContainer(private val context: Context) {
|
||||
|
||||
private fun provideLocalSource(): ILocalSource {
|
||||
val builder = Room.databaseBuilder(context, Look4SatDb::class.java, "Look4SatDBv313")
|
||||
val database = builder.apply { fallbackToDestructiveMigration() }.build()
|
||||
val database = builder.apply { fallbackToDestructiveMigration(false) }.build()
|
||||
return LocalSource(database.look4SatDao())
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.rtbishop.look4sat.presentation.components
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
@@ -46,6 +45,7 @@ import com.rtbishop.look4sat.presentation.MainTheme
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
import androidx.core.net.toUri
|
||||
|
||||
private val sdfTime = SimpleDateFormat("HH:mm:ss", Locale.ENGLISH)
|
||||
|
||||
@@ -225,7 +225,7 @@ fun CardLoadingIndicator() {
|
||||
}
|
||||
|
||||
fun gotoUrl(context: Context, url: String) {
|
||||
context.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
|
||||
context.startActivity(Intent(Intent.ACTION_VIEW, url.toUri()))
|
||||
}
|
||||
|
||||
fun getDefaultPass(): OrbitalPass {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.rtbishop.look4sat.presentation.map
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Color
|
||||
import android.graphics.ColorMatrix
|
||||
import android.graphics.ColorMatrixColorFilter
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Rect
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.graphics.drawable.Drawable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Box
|
||||
@@ -56,6 +54,9 @@ import org.osmdroid.views.MapView
|
||||
import org.osmdroid.views.overlay.FolderOverlay
|
||||
import org.osmdroid.views.overlay.Marker
|
||||
import org.osmdroid.views.overlay.Polyline
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.core.graphics.createBitmap
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
|
||||
private val minLat = MapView.getTileSystem().minLatitude
|
||||
private val maxLat = MapView.getTileSystem().maxLatitude
|
||||
@@ -69,12 +70,12 @@ private val trackPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
private val footprintPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
strokeWidth = 3f
|
||||
style = Paint.Style.FILL_AND_STROKE
|
||||
color = Color.parseColor("#FFE082")
|
||||
color = "#FFE082".toColorInt()
|
||||
}
|
||||
private val textPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
|
||||
textSize = 36f
|
||||
style = Paint.Style.FILL
|
||||
color = Color.parseColor("#FFE082")
|
||||
color = "#FFE082".toColorInt()
|
||||
setShadowLayer(3f, 3f, 3f, Color.BLACK)
|
||||
}
|
||||
private val labelRect = Rect()
|
||||
@@ -205,12 +206,12 @@ private fun getCustomTextIcon(textLabel: String, mapView: MapView): Drawable {
|
||||
val iconSize = 10f
|
||||
val width = labelRect.width() + iconSize * 2f
|
||||
val height = textPaint.textSize * 3f + iconSize * 2f
|
||||
val bitmap = Bitmap.createBitmap(width.toInt(), height.toInt(), Bitmap.Config.ARGB_8888)
|
||||
val bitmap = createBitmap(width.toInt(), height.toInt())
|
||||
Canvas(bitmap).run {
|
||||
drawCircle(width / 2f, height / 2f, iconSize, textPaint)
|
||||
drawText(textLabel, iconSize / 2f, height - iconSize, textPaint)
|
||||
}
|
||||
return BitmapDrawable(mapView.context.resources, bitmap)
|
||||
return bitmap.toDrawable(mapView.context.resources)
|
||||
}
|
||||
|
||||
private fun setSatelliteTrack(satTrack: List<List<GeoPos>>, mapView: MapView) {
|
||||
|
||||
Reference in new issue
Block a user