Updated gradle plugin and dependencies versions

This commit is contained in:
Arty Bishop committed 2025-12-27 15:01:45 +00:00
1 parent 0ca372b73f
commit 7191e02f99
19 files changed
+147 -113

No files matched your search

+1 -1
View File
@@ -32,7 +32,7 @@ android {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
composeOptions { kotlinCompilerExtensionVersion = "1.4.7" }
composeOptions { kotlinCompilerExtensionVersion = "1.5.1" }
packaging { resources { excludes += listOf("META-INF/{AL2.0,LGPL2.1}") } }
}
@@ -18,10 +18,10 @@
package com.rtbishop.look4sat
import android.app.Application
import kotlinx.coroutines.launch
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
import kotlinx.coroutines.launch
class MainApplication : Application() {
@@ -3,7 +3,10 @@ package com.rtbishop.look4sat.presentation
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.*
import androidx.compose.material3.Icon
import androidx.compose.material3.NavigationBar
import androidx.compose.material3.NavigationBarItem
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
@@ -23,14 +26,13 @@ import com.rtbishop.look4sat.presentation.radar.RadarScreen
import com.rtbishop.look4sat.presentation.settings.SettingsScreen
sealed class Screen(var title: String, var icon: Int, var route: String) {
object Entries : Screen("Entries", R.drawable.ic_entries, "entries")
object Passes : Screen("Passes", R.drawable.ic_passes, "passes")
object Radar : Screen("Radar", R.drawable.ic_radar, "radar")
object Map : Screen("World Map", R.drawable.ic_world_map, "world_map")
object Settings : Screen("Settings", R.drawable.ic_settings, "settings")
data object Entries : Screen("Entries", R.drawable.ic_entries, "entries")
data object Passes : Screen("Passes", R.drawable.ic_passes, "passes")
data object Radar : Screen("Radar", R.drawable.ic_radar, "radar")
data object Map : Screen("World Map", R.drawable.ic_world_map, "world_map")
data object Settings : Screen("Settings", R.drawable.ic_settings, "settings")
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MainScreen(navController: NavHostController = rememberNavController()) {
Scaffold(bottomBar = { MainNavBar(navController = navController) }) { innerPadding ->
@@ -21,7 +21,10 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.*
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
@@ -38,17 +41,13 @@ private fun FilterDialogPreview() {
MainTheme { FilterDialog(8, 16.0, {}) { _, _ -> } }
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun FilterDialog(hours: Int, elevation: Double, toggle: () -> Unit, save: (Int, Double) -> Unit) {
val hoursValue = rememberSaveable { mutableStateOf(hours) }
val elevValue = rememberSaveable { mutableStateOf(elevation) }
Dialog(onDismissRequest = { toggle() }) {
ElevatedCard {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth(1f)
) {
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.fillMaxWidth(1f)) {
Text(text = "Filter passes", color = MaterialTheme.colorScheme.primary)
Text(text = "Show passes that occur within X hours")
OutlinedTextField(value = hoursValue.value.toString(), onValueChange = { newValue ->
@@ -68,10 +67,7 @@ fun FilterDialog(hours: Int, elevation: Double, toggle: () -> Unit, save: (Int,
}
elevValue.value = maxElevation
})
Row(
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier.fillMaxWidth()
) {
Row(horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth()) {
CardButton(onClick = { toggle() }, text = "Cancel")
CardButton(
onClick = {
@@ -4,7 +4,10 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.*
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
@@ -23,29 +26,17 @@ private fun LocatorDialogPreview() {
MainTheme { LocatorDialog("IO91vl", {}) { } }
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun LocatorDialog(qthLocator: String, hide: () -> Unit, save: (String) -> Unit) {
val locator = rememberSaveable { mutableStateOf(qthLocator) }
Dialog(onDismissRequest = { hide() }) {
ElevatedCard {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth(1f)
) {
Text(
text = stringResource(id = R.string.locator_title),
color = MaterialTheme.colorScheme.primary
)
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.fillMaxWidth(1f)) {
Text(text = stringResource(id = R.string.locator_title), color = MaterialTheme.colorScheme.primary)
Text(text = stringResource(id = R.string.locator_text))
OutlinedTextField(value = locator.value, onValueChange = { locator.value = it })
Row(
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier.fillMaxWidth()
) {
CardButton(
onClick = { hide() }, text = stringResource(id = R.string.btn_cancel)
)
Row(horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth()) {
CardButton(onClick = { hide() }, text = stringResource(id = R.string.btn_cancel))
CardButton(
onClick = {
save(locator.value)
@@ -2,11 +2,19 @@ package com.rtbishop.look4sat.presentation.dialogs
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.material3.*
import androidx.compose.material3.Checkbox
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
@@ -26,7 +34,7 @@ private val allModes = listOf(
"LRPT", "LSB", "MFSK", "MSK", "MSK AX.100 Mode 5", "MSK AX.100 Mode 6", "OFDM", "OQPSK",
"PSK", "PSK31", "PSK63", "QPSK", "QPSK31", "QPSK63", "SSTV", "USB", "WSJT"
)
private val selectedModes = mutableListOf<String>("AFSK", "AFSK S-Net")
private val selectedModes = mutableListOf("AFSK", "AFSK S-Net")
@Preview(showBackground = true)
@Composable
@@ -41,12 +49,7 @@ private fun ModesDialogPreview() {
}
@Composable
fun ModesDialog(
list: List<String>,
selected: List<String>,
toggle: () -> Unit,
click: (String) -> Unit
) {
fun ModesDialog(list: List<String>, selected: List<String>, toggle: () -> Unit, click: (String) -> Unit) {
Dialog(onDismissRequest = { toggle() }) {
ElevatedCard(modifier = Modifier.fillMaxHeight(0.9f)) {
LazyVerticalGrid(
@@ -4,7 +4,10 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.*
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
@@ -23,32 +26,22 @@ private fun PositionDialogPreview() {
MainTheme { PositionDialog(0.0, 0.0, {}) { _, _ -> } }
}
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun PositionDialog(lat: Double, lon: Double, hide: () -> Unit, save: (Double, Double) -> Unit) {
val latValue = rememberSaveable { mutableStateOf(lat.toString()) }
val lonValue = rememberSaveable { mutableStateOf(lon.toString()) }
Dialog(onDismissRequest = { hide() }) {
ElevatedCard {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
modifier = Modifier.fillMaxWidth(1f)
) {
Column(horizontalAlignment = Alignment.CenterHorizontally, modifier = Modifier.fillMaxWidth(1f)) {
Text(
text = stringResource(id = R.string.position_title),
color = MaterialTheme.colorScheme.primary
text = stringResource(id = R.string.position_title), color = MaterialTheme.colorScheme.primary
)
Text(text = stringResource(id = R.string.position_lat_text))
OutlinedTextField(value = latValue.value, onValueChange = { latValue.value = it })
Text(text = stringResource(id = R.string.position_lon_text))
OutlinedTextField(value = lonValue.value, onValueChange = { lonValue.value = it })
Row(
horizontalArrangement = Arrangement.SpaceBetween,
modifier = Modifier.fillMaxWidth()
) {
CardButton(
onClick = { hide() }, text = stringResource(id = R.string.btn_cancel)
)
Row(horizontalArrangement = Arrangement.SpaceBetween, modifier = Modifier.fillMaxWidth()) {
CardButton(onClick = { hide() }, text = stringResource(id = R.string.btn_cancel))
CardButton(
onClick = { saveValues(latValue.value, lonValue.value, hide, save) },
text = stringResource(id = R.string.btn_accept)
@@ -2,10 +2,18 @@ package com.rtbishop.look4sat.presentation.dialogs
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.*
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.RadioButton
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@@ -3,11 +3,26 @@ package com.rtbishop.look4sat.presentation.entries
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material3.*
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Checkbox
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable
@@ -97,9 +112,7 @@ private fun SearchBar(setQuery: (String) -> Unit, modifier: Modifier = Modifier)
singleLine = true,
modifier = modifier.padding(start = 12.dp),
textStyle = TextStyle(
fontSize = 16.sp,
fontWeight = FontWeight.Medium,
color = MaterialTheme.colorScheme.onSurface
fontSize = 16.sp, fontWeight = FontWeight.Medium, color = MaterialTheme.colorScheme.onSurface
),
decorationBox = { innerTextField ->
if (currentQuery.value.isEmpty()) {
@@ -31,6 +31,10 @@ import com.rtbishop.look4sat.domain.repository.ISettingsRepo
import com.rtbishop.look4sat.domain.utility.QthConverter
import com.rtbishop.look4sat.domain.utility.toDegrees
import com.rtbishop.look4sat.domain.utility.toTimerString
import java.util.Date
import kotlin.collections.set
import kotlin.math.max
import kotlin.math.min
import kotlinx.coroutines.Job
import kotlinx.coroutines.cancelAndJoin
import kotlinx.coroutines.delay
@@ -39,10 +43,6 @@ import kotlinx.coroutines.flow.SharedFlow
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import java.util.Date
import kotlin.collections.set
import kotlin.math.max
import kotlin.math.min
class MapViewModel(private val satelliteRepo: ISatelliteRepo, settingsRepo: ISettingsRepo) : ViewModel() {
@@ -3,10 +3,25 @@ package com.rtbishop.look4sat.presentation.passes
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.*
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.mutableStateOf
@@ -19,14 +34,15 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.*
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.viewmodel.compose.viewModel
import com.rtbishop.look4sat.R
import com.rtbishop.look4sat.domain.model.DataState
import com.rtbishop.look4sat.domain.predict.NearEarthSatellite
import com.rtbishop.look4sat.domain.predict.OrbitalData
import com.rtbishop.look4sat.domain.predict.SatPass
import com.rtbishop.look4sat.presentation.*
import com.rtbishop.look4sat.presentation.MainTheme
import com.rtbishop.look4sat.presentation.dialogs.FilterDialog
import com.rtbishop.look4sat.presentation.pullRefresh.PullRefreshIndicator
import com.rtbishop.look4sat.presentation.pullRefresh.PullRefreshState
@@ -27,7 +27,11 @@ import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.contentColorFor
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.Immutable
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
@@ -17,14 +17,23 @@
package com.rtbishop.look4sat.presentation.pullRefresh
import androidx.compose.animation.core.animate
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.State
import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.rememberUpdatedState
import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import kotlin.math.abs
import kotlin.math.pow
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
/**
* Creates a [PullRefreshState] that is remembered across compositions.
@@ -2,7 +2,10 @@
package com.rtbishop.look4sat.presentation.radar
import androidx.compose.animation.core.*
import androidx.compose.animation.core.animateFloat
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.Canvas
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
@@ -10,9 +13,23 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.*
import androidx.compose.ui.graphics.drawscope.*
import androidx.compose.ui.text.*
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Path
import androidx.compose.ui.graphics.PathEffect
import androidx.compose.ui.graphics.PathMeasure
import androidx.compose.ui.graphics.ShaderBrush
import androidx.compose.ui.graphics.StampedPathEffectStyle
import androidx.compose.ui.graphics.SweepGradientShader
import androidx.compose.ui.graphics.drawscope.DrawScope
import androidx.compose.ui.graphics.drawscope.Fill
import androidx.compose.ui.graphics.drawscope.Stroke
import androidx.compose.ui.graphics.drawscope.rotate
import androidx.compose.ui.graphics.drawscope.translate
import androidx.compose.ui.text.ExperimentalTextApi
import androidx.compose.ui.text.TextMeasurer
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.drawText
import androidx.compose.ui.text.rememberTextMeasurer
import androidx.compose.ui.unit.sp
import com.rtbishop.look4sat.domain.predict.PI_2
import com.rtbishop.look4sat.domain.predict.SatPos
+4 -3
View File
@@ -1,8 +1,9 @@
plugins {
id("com.android.application") version "8.0.2" apply false
id("com.android.application") version "8.1.0" apply false
id("com.android.library") version "7.1.2" apply false
id("com.google.devtools.ksp") version "1.8.21-1.0.11" apply false
id("org.jetbrains.kotlin.android") version "1.8.21" apply false
id("com.google.devtools.ksp") version "1.9.0-1.0.13" apply false
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
id("org.jetbrains.kotlin.jvm") version "1.9.0" apply false
}
tasks.register("clean", Delete::class.java) {
@@ -17,7 +17,11 @@
*/
package com.rtbishop.look4sat.data.database.dao
import androidx.room.*
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Transaction
import com.rtbishop.look4sat.data.database.entity.SatEntry
import com.rtbishop.look4sat.data.database.entity.SatItem
import com.rtbishop.look4sat.data.database.entity.SatRadio
+1 -1
View File
@@ -1,5 +1,5 @@
plugins {
id("kotlin")
id("org.jetbrains.kotlin.jvm")
}
kotlin {
@@ -21,6 +21,6 @@ sealed class DataState<out T> {
data class Success<out T>(val data: T) : DataState<T>()
data class Error(val resId: Int?) : DataState<Nothing>()
data class Exception(val message: String?) : DataState<Nothing>()
object Handled : DataState<Nothing>()
object Loading : DataState<Nothing>()
data object Handled : DataState<Nothing>()
data object Loading : DataState<Nothing>()
}
-23
View File
@@ -1,26 +1,3 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
#org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
#android.useAndroidX=true
# Kotlin code style for this project: "official" or "obsolete":
#kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
#android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=false
android.enableJetifier=false
android.nonFinalResIds=true