|
|
@ -41,13 +41,9 @@ class App : Application() { |
|
|
|
} catch (e: PackageManager.NameNotFoundException) { |
|
|
|
} catch (e: PackageManager.NameNotFoundException) { |
|
|
|
0 |
|
|
|
0 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!ThemeStore.isConfigured(this, versionCode)) upThemeStore() |
|
|
|
initNightTheme() |
|
|
|
initNightTheme() |
|
|
|
if (!ThemeStore.isConfigured(this, versionCode)) { |
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) createChannelId() |
|
|
|
upThemeStore() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { |
|
|
|
|
|
|
|
createChannelId() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun initNightTheme() { |
|
|
|
fun initNightTheme() { |
|
|
@ -85,7 +81,6 @@ class App : Application() { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建通知ID |
|
|
|
* 创建通知ID |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
@RequiresApi(Build.VERSION_CODES.O) |
|
|
|
@RequiresApi(Build.VERSION_CODES.O) |
|
|
|
private fun createChannelId() { |
|
|
|
private fun createChannelId() { |
|
|
|
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager |
|
|
|
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager |
|
|
|