mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-04 03:37:21 +00:00
Added minor fixes to resources and build scripts
This commit is contained in:
1 parent
7191e02f99
commit
5a8108384f
27 files changed
+45
-101
No files matched your search
@@ -26,9 +26,9 @@ 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) {
|
||||
data object Entries : Screen("Entries", R.drawable.ic_entries, "entries")
|
||||
data object Entries : Screen("Entries", R.drawable.ic_sputnik, "entries")
|
||||
data object Passes : Screen("Passes", R.drawable.ic_passes, "passes")
|
||||
data object Radar : Screen("Radar", R.drawable.ic_radar, "radar")
|
||||
data object Radar : Screen("Radar", R.drawable.ic_settings, "radar")
|
||||
data object Map : Screen("World Map", R.drawable.ic_world_map, "world_map")
|
||||
data object Settings : Screen("Settings", R.drawable.ic_settings, "settings")
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ private fun SaveButton(saveSelection: () -> Unit, modifier: Modifier = Modifier)
|
||||
colors = CardDefaults.cardColors(containerColor = MaterialTheme.colorScheme.primary)
|
||||
) {
|
||||
Box(modifier = clickableModifier.fillMaxSize(), contentAlignment = Alignment.Center) {
|
||||
Icon(painter = painterResource(id = R.drawable.ic_checkmark), contentDescription = null)
|
||||
Icon(painter = painterResource(id = R.drawable.ic_done), contentDescription = null)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,7 @@ private fun EntryTypeCard(type: String, onClick: () -> Unit, modifier: Modifier
|
||||
.height(48.dp)
|
||||
.clickable { onClick() }) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_next),
|
||||
painter = painterResource(id = R.drawable.ic_arrow),
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
.size(36.dp)
|
||||
|
||||
@@ -29,12 +29,12 @@ import com.rtbishop.look4sat.domain.predict.Satellite
|
||||
import com.rtbishop.look4sat.domain.repository.ISatelliteRepo
|
||||
import com.rtbishop.look4sat.domain.repository.ISettingsRepo
|
||||
import com.rtbishop.look4sat.domain.utility.QthConverter
|
||||
import com.rtbishop.look4sat.domain.utility.clipLat
|
||||
import com.rtbishop.look4sat.domain.utility.clipLon
|
||||
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
|
||||
@@ -200,21 +200,6 @@ class MapViewModel(private val satelliteRepo: ISatelliteRepo, settingsRepo: ISet
|
||||
_mapData.emit(satData)
|
||||
}
|
||||
|
||||
private fun clipLat(latitude: Double): Double {
|
||||
return clip(latitude, -85.05, 85.05)
|
||||
}
|
||||
|
||||
private fun clipLon(longitude: Double): Double {
|
||||
var result = longitude
|
||||
while (result < -180.0) result += 360.0
|
||||
while (result > 180.0) result -= 360.0
|
||||
return clip(result, -180.0, 180.0)
|
||||
}
|
||||
|
||||
private fun clip(currentValue: Double, minValue: Double, maxValue: Double): Double {
|
||||
return min(max(currentValue, minValue), maxValue)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val Factory: ViewModelProvider.Factory = viewModelFactory {
|
||||
val applicationKey = ViewModelProvider.AndroidViewModelFactory.APPLICATION_KEY
|
||||
|
||||
@@ -114,7 +114,7 @@ private fun TransmitterItem(radio: SatRadio) {
|
||||
modifier = Modifier.fillMaxWidth()
|
||||
) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_next),
|
||||
painter = painterResource(id = R.drawable.ic_arrow),
|
||||
contentDescription = null, modifier = Modifier.rotate(180f)
|
||||
)
|
||||
Text(
|
||||
@@ -123,7 +123,7 @@ private fun TransmitterItem(radio: SatRadio) {
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_next),
|
||||
painter = painterResource(id = R.drawable.ic_arrow),
|
||||
contentDescription = null
|
||||
)
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ private fun CardAbout(version: String, modifier: Modifier = Modifier) {
|
||||
) {
|
||||
Row(horizontalArrangement = Arrangement.Center) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_entries),
|
||||
painter = painterResource(id = R.drawable.ic_sputnik),
|
||||
tint = MaterialTheme.colorScheme.secondary,
|
||||
contentDescription = null,
|
||||
modifier = Modifier
|
||||
|
||||
Reference in new issue
Block a user