-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
36127f3
commit b9b8b3c
Showing
5 changed files
with
30 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,34 +17,22 @@ | |
package com.ave.vastgui.app | ||
|
||
import android.app.Application | ||
import android.content.Intent | ||
import com.ave.vastgui.app.activity.FileActivity | ||
import com.ave.vastgui.app.log.logFactory | ||
import com.ave.vastgui.app.log.marsLogger | ||
import com.ave.vastgui.tools.content.ContextHelper | ||
import com.ave.vastgui.tools.exception.AppCrashHandler | ||
import com.ave.vastgui.tools.lifecycle.ActivityLifecycleLogger | ||
import com.ave.vastgui.tools.exception.AppCrashHandler.Companion.setDefaultUncaughtExceptionHandler | ||
import com.ave.vastgui.tools.utils.DensityUtils.DP | ||
import com.kongzue.dialogx.DialogX | ||
import com.kongzue.dialogx.style.IOSStyle | ||
import kotlin.system.exitProcess | ||
|
||
|
||
// Author: Vast Gui | ||
// Email: [email protected] | ||
// Date: 2023/12/28 | ||
|
||
private val crashConfig = | ||
AppCrashHandler.Configuration(logFactory("App")) { _, _ -> | ||
val intent = Intent(ContextHelper.getAppContext(), FileActivity::class.java).apply { | ||
flags = Intent.FLAG_ACTIVITY_NEW_TASK | ||
} | ||
ContextHelper.getAppContext().startActivity(intent) | ||
exitProcess(0) | ||
} | ||
|
||
class App : Application() { | ||
|
||
private val mLogcat by lazy { logFactory("App") } | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
DialogX.dialogMaxWidth = 400f.DP.toInt() | ||
|
@@ -56,8 +44,10 @@ class App : Application() { | |
// createViewInterceptor.add(FabFactory()) | ||
// addThemeSkinExecutorBuilder(FabExecutorBuilder()) | ||
// } | ||
// ConstraintLayoutCompat.init() | ||
Thread.setDefaultUncaughtExceptionHandler(AppCrashHandler.getInstance(crashConfig)) | ||
// ConstraintLayoutCompat.init() | ||
setDefaultUncaughtExceptionHandler { t, e, stackTraceInfo -> | ||
mLogcat.e(stackTraceInfo) | ||
} | ||
} | ||
|
||
override fun onLowMemory() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters