File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
app/src/main/kotlin/li/songe/gkd Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,8 @@ import rikka.shizuku.Shizuku
3838
3939val appScope by lazy { MainScope () }
4040
41- private lateinit var innerApp: Application
42- val app: Application
41+ private lateinit var innerApp: App
42+ val app: App
4343 get() = innerApp
4444
4545private val applicationInfo by lazy {
@@ -74,6 +74,8 @@ class App : Application() {
7474 }
7575 }
7676
77+ val startTime = System .currentTimeMillis()
78+
7779 override fun onCreate () {
7880 super .onCreate()
7981 innerApp = this
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ import kotlin.reflect.KClass
6969import kotlin.reflect.jvm.jvmName
7070
7171class MainActivity : ComponentActivity () {
72+ val startTime = System .currentTimeMillis()
7273 val mainVm by viewModels<MainViewModel >()
7374 val launcher by lazy { StartActivityLauncher (this ) }
7475 val pickContentLauncher by lazy { PickContentLauncher (this ) }
@@ -126,6 +127,9 @@ class MainActivity : ComponentActivity() {
126127
127128 override fun onResume () {
128129 super .onResume()
130+ if (startTime - app.startTime < 2000 ) {
131+ return
132+ }
129133 syncFixState()
130134 }
131135
You can’t perform that action at this time.
0 commit comments