mirror of
https://github.com/atsunatsu/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Fixed display and font size scaling for MainActivity
This commit is contained in:
1 parent
549a915b24
commit
4b63882c70
6 files changed
+24
-14
No files matched your search
@@ -43,21 +43,21 @@ dependencies {
|
|||||||
ksp("androidx.room:room-compiler:2.5.2")
|
ksp("androidx.room:room-compiler:2.5.2")
|
||||||
|
|
||||||
implementation("androidx.activity:activity-compose:1.7.2")
|
implementation("androidx.activity:activity-compose:1.7.2")
|
||||||
implementation("androidx.compose.animation:animation:1.5.1")
|
implementation("androidx.compose.animation:animation:1.5.2")
|
||||||
implementation("androidx.compose.compiler:compiler:1.5.3")
|
implementation("androidx.compose.compiler:compiler:1.5.3")
|
||||||
implementation("androidx.compose.material3:material3:1.1.1")
|
implementation("androidx.compose.material3:material3:1.1.2")
|
||||||
implementation("androidx.compose.runtime:runtime:1.5.1")
|
implementation("androidx.compose.runtime:runtime:1.5.2")
|
||||||
implementation("androidx.compose.ui:ui-tooling-preview:1.5.1")
|
implementation("androidx.compose.ui:ui-tooling-preview:1.5.2")
|
||||||
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2")
|
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.2")
|
||||||
implementation("androidx.navigation:navigation-compose:2.7.2")
|
implementation("androidx.navigation:navigation-compose:2.7.3")
|
||||||
|
|
||||||
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||||||
implementation("org.osmdroid:osmdroid-android:6.1.17")
|
implementation("org.osmdroid:osmdroid-android:6.1.17")
|
||||||
debugImplementation("androidx.compose.ui:ui-tooling:1.5.1")
|
debugImplementation("androidx.compose.ui:ui-tooling:1.5.2")
|
||||||
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.1")
|
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.2")
|
||||||
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
testImplementation("junit:junit:4.13.2")
|
||||||
testImplementation("io.mockk:mockk:1.13.7")
|
testImplementation("io.mockk:mockk:1.13.8")
|
||||||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
||||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.1")
|
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.2")
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,9 @@ package com.rtbishop.look4sat
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.res.Configuration
|
import android.content.res.Configuration
|
||||||
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.util.DisplayMetrics
|
||||||
import androidx.activity.ComponentActivity
|
import androidx.activity.ComponentActivity
|
||||||
import androidx.activity.compose.setContent
|
import androidx.activity.compose.setContent
|
||||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||||
@@ -35,7 +37,12 @@ class MainActivity : ComponentActivity() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun attachBaseContext(newBase: Context?) {
|
override fun attachBaseContext(newBase: Context?) {
|
||||||
val newConfig = Configuration(newBase?.resources?.configuration).apply { fontScale = 1.0f }
|
val newConfig = Configuration(newBase?.resources?.configuration).apply {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
densityDpi = DisplayMetrics.DENSITY_DEVICE_STABLE
|
||||||
|
}
|
||||||
|
fontScale = 1.0f
|
||||||
|
}
|
||||||
applyOverrideConfiguration(newConfig)
|
applyOverrideConfiguration(newConfig)
|
||||||
super.attachBaseContext(newBase)
|
super.attachBaseContext(newBase)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("com.android.application") version "8.1.1" apply false
|
id("com.android.application") version "8.1.2" apply false
|
||||||
id("com.android.library") version "8.1.1" apply false
|
id("com.android.library") version "8.1.2" apply false
|
||||||
id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false
|
id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
|
id("org.jetbrains.kotlin.android") version "1.9.10" apply false
|
||||||
id("org.jetbrains.kotlin.jvm") version "1.9.10" apply false
|
id("org.jetbrains.kotlin.jvm") version "1.9.10" apply false
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ dependencies {
|
|||||||
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
implementation("com.squareup.okhttp3:okhttp:4.10.0")
|
||||||
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
testImplementation("junit:junit:4.13.2")
|
||||||
testImplementation("io.mockk:mockk:1.13.7")
|
testImplementation("io.mockk:mockk:1.13.8")
|
||||||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
||||||
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
androidTestImplementation("androidx.test.ext:junit:1.1.5")
|
||||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
|
||||||
|
|||||||
@@ -11,6 +11,6 @@ dependencies {
|
|||||||
implementation("org.json:json:20230618")
|
implementation("org.json:json:20230618")
|
||||||
|
|
||||||
testImplementation("junit:junit:4.13.2")
|
testImplementation("junit:junit:4.13.2")
|
||||||
testImplementation("io.mockk:mockk:1.13.7")
|
testImplementation("io.mockk:mockk:1.13.8")
|
||||||
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3")
|
||||||
}
|
}
|
||||||
@@ -97,6 +97,7 @@ class DataParser(private val dispatcher: CoroutineDispatcher) {
|
|||||||
val bstar = values[14].toDouble()
|
val bstar = values[14].toDouble()
|
||||||
OrbitalData(name, epoch, meanmo, eccn, incl, raan, argper, meanan, catnum, bstar)
|
OrbitalData(name, epoch, meanmo, eccn, incl, raan, argper, meanan, catnum, bstar)
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
println("CSV parsing exception: $exception")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,6 +124,7 @@ class DataParser(private val dispatcher: CoroutineDispatcher) {
|
|||||||
val bstar: Double = 1.0e-5 * tle[1].substring(53, 59).toDouble() / 10.0.pow(tle[1].substring(60, 61).toDouble())
|
val bstar: Double = 1.0e-5 * tle[1].substring(53, 59).toDouble() / 10.0.pow(tle[1].substring(60, 61).toDouble())
|
||||||
OrbitalData(name, epoch, meanmo, eccn, incl, raan, argper, meanan, catnum, bstar)
|
OrbitalData(name, epoch, meanmo, eccn, incl, raan, argper, meanan, catnum, bstar)
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
println("TLE parsing exception: $exception")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,6 +142,7 @@ class DataParser(private val dispatcher: CoroutineDispatcher) {
|
|||||||
val catnum = if (json.isNull("norad_cat_id")) null else json.getInt("norad_cat_id")
|
val catnum = if (json.isNull("norad_cat_id")) null else json.getInt("norad_cat_id")
|
||||||
SatRadio(uuid, info, alive, dlinkLow, dlinkHigh, dlinkMode, ulinkLow, ulinkHigh, ulinkMode, inverted, catnum)
|
SatRadio(uuid, info, alive, dlinkLow, dlinkHigh, dlinkMode, ulinkLow, ulinkHigh, ulinkMode, inverted, catnum)
|
||||||
} catch (exception: Exception) {
|
} catch (exception: Exception) {
|
||||||
|
println("JSON parsing exception: $exception")
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user