mirror of
https://github.com/rt-bishop/Look4Sat.git
synced 2026-10-02 03:15:37 +00:00
Fixed an issue with messed up layouts via system override #83
This commit is contained in:
1 parent
550ffdf92d
commit
88228bfad7
1 file changed
+9
@@ -18,7 +18,9 @@
|
||||
package com.rtbishop.look4sat.presentation
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import android.content.pm.ActivityInfo
|
||||
import android.content.res.Configuration
|
||||
import android.os.Bundle
|
||||
import androidx.annotation.IdRes
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
@@ -40,6 +42,13 @@ class MainActivity : AppCompatActivity() {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(ActivityMainBinding.inflate(layoutInflater).root)
|
||||
}
|
||||
|
||||
override fun attachBaseContext(newBase: Context?) {
|
||||
val newConfig = Configuration(newBase?.resources?.configuration)
|
||||
newConfig.fontScale = 1.0f
|
||||
applyOverrideConfiguration(newConfig)
|
||||
super.attachBaseContext(newBase)
|
||||
}
|
||||
}
|
||||
|
||||
fun <T> Fragment.getNavResult(@IdRes id: Int, key: String, onResult: (result: T) -> Unit) {
|
||||
|
||||
Reference in new issue
Block a user