Integrated the data update fix from v3.1.3

develop
Arty Bishop 2023-06-03 16:03:04 +01:00
rodzic 63ccd30356
commit 4e06c91eee
8 zmienionych plików z 56 dodań i 45 usunięć

Wyświetl plik

@ -12,8 +12,8 @@ android {
applicationId "com.rtbishop.look4sat"
minSdk 21
targetSdk 33
versionCode 312
versionName "3.1.2"
versionCode 313
versionName '3.1.3'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
@ -69,6 +69,7 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$lifecycle_version"
implementation "androidx.navigation:navigation-compose:$navigation_version"
// Utility
implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
implementation "org.osmdroid:osmdroid-android:$osmdroid_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"

Wyświetl plik

@ -27,6 +27,7 @@ import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.SupervisorJob
import okhttp3.OkHttpClient
import org.osmdroid.config.Configuration
class MainContainer(private val context: Context) {
@ -57,8 +58,9 @@ class MainContainer(private val context: Context) {
}
private fun provideDatabaseRepo(): IDatabaseRepo {
val httpClient = OkHttpClient.Builder().build()
val dataParser = DataParser(Dispatchers.Default)
val dataSource = DataSource(context.contentResolver, Dispatchers.IO)
val dataSource = DataSource(context.contentResolver, httpClient, Dispatchers.IO)
return DatabaseRepo(Dispatchers.Default, dataParser, dataSource, localStorage, settingsRepo)
}

Wyświetl plik

@ -22,18 +22,26 @@ import android.net.Uri
import com.rtbishop.look4sat.data.IDataSource
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext
import okhttp3.OkHttpClient
import okhttp3.Request
import java.io.InputStream
import java.net.URL
class DataSource(
private val resolver: ContentResolver, private val dispatcher: CoroutineDispatcher
private val contentResolver: ContentResolver,
private val httpClient: OkHttpClient,
private val dispatcher: CoroutineDispatcher
) : IDataSource {
override suspend fun getFileStream(uri: String): InputStream? {
return withContext(dispatcher) { resolver.openInputStream(Uri.parse(uri)) }
return withContext(dispatcher) { contentResolver.openInputStream(Uri.parse(uri)) }
}
override suspend fun getNetworkStream(url: String): InputStream? {
return withContext(dispatcher) { URL(url).openStream() }
override suspend fun getNetworkStream(url: String): InputStream? = withContext(dispatcher) {
try {
val request = Request.Builder().url(url).build()
httpClient.newCall(request).execute().body?.byteStream()
} catch (exception: Exception) {
null
}
}
}

Wyświetl plik

@ -28,32 +28,32 @@ interface ISettingsRepo {
val radioSourceUrl: String get() = "https://db.satnogs.org/api/transmitters/?format=json"
val satelliteSourcesMap: Map<String, String>
get() = mapOf(
"All" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=active&FORMAT=csv",
"All" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=active&FORMAT=csv",
"Amsat" to "https://amsat.org/tle/current/nasabare.txt",
"Amateur" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=amateur&FORMAT=csv",
"Amateur" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=amateur&FORMAT=csv",
"Classified" to "https://www.mmccants.org/tles/classfd.zip",
"Cubesat" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=cubesat&FORMAT=csv",
"Education" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=education&FORMAT=csv",
"Engineer" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=engineering&FORMAT=csv",
"Geostationary" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=geo&FORMAT=csv",
"Globalstar" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=globalstar&FORMAT=csv",
"GNSS" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=gnss&FORMAT=csv",
"Intelsat" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=intelsat&FORMAT=csv",
"Iridium" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=iridium-NEXT&FORMAT=csv",
"Cubesat" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=cubesat&FORMAT=csv",
"Education" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=education&FORMAT=csv",
"Engineer" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=engineering&FORMAT=csv",
"Geostationary" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=geo&FORMAT=csv",
"Globalstar" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=globalstar&FORMAT=csv",
"GNSS" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=gnss&FORMAT=csv",
"Intelsat" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=intelsat&FORMAT=csv",
"Iridium" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=iridium-NEXT&FORMAT=csv",
"McCants" to "https://www.mmccants.org/tles/inttles.zip",
"Military" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=military&FORMAT=csv",
"New" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=last-30-days&FORMAT=csv",
"OneWeb" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=oneweb&FORMAT=csv",
"Orbcomm" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=orbcomm&FORMAT=csv",
"Military" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=military&FORMAT=csv",
"New" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=last-30-days&FORMAT=csv",
"OneWeb" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=oneweb&FORMAT=csv",
"Orbcomm" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=orbcomm&FORMAT=csv",
"R4UAB" to "https://r4uab.ru/satonline.txt",
"Resource" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=resource&FORMAT=csv",
"SatNOGS" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=satnogs&FORMAT=csv",
"Science" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=science&FORMAT=csv",
"Spire" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=spire&FORMAT=csv",
"Starlink" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=starlink&FORMAT=csv",
"Swarm" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=swarm&FORMAT=csv",
"Weather" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=weather&FORMAT=csv",
"X-Comm" to "https://celestrak.com/NORAD/elements/gp.php?GROUP=x-comm&FORMAT=csv"
"Resource" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=resource&FORMAT=csv",
"SatNOGS" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=satnogs&FORMAT=csv",
"Science" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=science&FORMAT=csv",
"Spire" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=spire&FORMAT=csv",
"Starlink" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=starlink&FORMAT=csv",
"Swarm" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=swarm&FORMAT=csv",
"Weather" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=weather&FORMAT=csv",
"X-Comm" to "https://celestrak.org/NORAD/elements/gp.php?GROUP=x-comm&FORMAT=csv"
)
//region # Station position settings

Wyświetl plik

@ -1,27 +1,28 @@
buildscript {
ext {
gradle_plugin_version = '8.0.0'
gradle_plugin_version = '8.0.2'
library_plugin_version = '7.1.2'
ksp_version = '1.8.10-1.0.9'
kotlin_android_version = '1.8.10'
ksp_version = '1.8.21-1.0.11'
kotlin_android_version = '1.8.21'
// Android
splashscreen_version = '1.0.0'
splashscreen_version = '1.0.1'
room_version = '2.5.1'
// Compose
activity_compose_version = '1.7.0'
compose_version = '1.4.1'
compose_compiler_version = '1.4.5'
material3_version = '1.0.1'
activity_compose_version = '1.7.2'
compose_version = '1.4.3'
compose_compiler_version = '1.4.7'
material3_version = '1.1.0'
lifecycle_version = '2.6.1'
navigation_version = '2.5.3'
// Utility
okhttp_version = '4.10.0'
osmdroid_version = '6.1.16'
json_version = '20230227'
leakcanary_version = '2.10'
leakcanary_version = '2.11'
// Test
junit_version = '4.13.2'
mockk_version = '1.13.5'
coroutines_test_version = '1.6.4'
coroutines_test_version = '1.7.1'
}
}

Wyświetl plik

@ -1,2 +1 @@
Added calendar reminder support by zhou2008
Added Sinhala translation by Dilshan Hapuarachchi
Fixed the satellite data update bug #108

Wyświetl plik

@ -21,7 +21,7 @@
# 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.defaults.buildfeatures.buildconfig=true
android.enableJetifier=false
android.nonFinalResIds=false
android.nonTransitiveRClass=true

Wyświetl plik

@ -1,6 +1,6 @@
#Fri Apr 14 10:44:38 BST 2023
#Fri Apr 21 15:31:10 BST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists