mirror of
https://github.com/rt-bishop/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")
|
||||
|
||||
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.material3:material3:1.1.1")
|
||||
implementation("androidx.compose.runtime:runtime:1.5.1")
|
||||
implementation("androidx.compose.ui:ui-tooling-preview:1.5.1")
|
||||
implementation("androidx.compose.material3:material3:1.1.2")
|
||||
implementation("androidx.compose.runtime:runtime:1.5.2")
|
||||
implementation("androidx.compose.ui:ui-tooling-preview:1.5.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("org.osmdroid:osmdroid-android:6.1.17")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling:1.5.1")
|
||||
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.1")
|
||||
debugImplementation("androidx.compose.ui:ui-tooling:1.5.2")
|
||||
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.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")
|
||||
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.res.Configuration
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.DisplayMetrics
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
@@ -35,7 +37,12 @@ class MainActivity : ComponentActivity() {
|
||||
}
|
||||
|
||||
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)
|
||||
super.attachBaseContext(newBase)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user