diff --git a/.idea/misc.xml b/.idea/misc.xml index 515e7e8..be0475d 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,6 +8,7 @@ + diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index fa56670..ba1cd88 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -61,5 +61,17 @@ android:excludeFromRecents="true" android:exported="true" android:theme="@android:style/Theme.Translucent.NoTitleBar" /> + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/fankes/coloros/notify/service/QuickStartTileService.kt b/app/src/main/java/com/fankes/coloros/notify/service/QuickStartTileService.kt new file mode 100644 index 0000000..da900aa --- /dev/null +++ b/app/src/main/java/com/fankes/coloros/notify/service/QuickStartTileService.kt @@ -0,0 +1,36 @@ +/* + * ColorOSNotifyIcon - Optimize notification icons for ColorOS and adapt to native notification icon specifications. + * Copyright (C) 2019-2022 Fankes Studio(qzmmcn@163.com) + * https://github.com/fankes/ColorOSNotifyIcon + * + * This software is non-free but opensource software: you can redistribute it + * and/or modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + *

+ * + * This software is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * and eula along with this software. If not, see + * + * + * This file is Created by fankes on 2022/3/26. + */ +package com.fankes.coloros.notify.service + +import android.service.quicksettings.TileService +import com.fankes.coloros.notify.ui.activity.ConfigureActivity +import com.fankes.coloros.notify.utils.factory.navigate + +class QuickStartTileService : TileService() { + + override fun onClick() { + super.onClick() + /** 启动通知图标优化列表窗口 */ + navigate() + } +} \ No newline at end of file diff --git a/app/src/main/java/com/fankes/coloros/notify/utils/factory/FunctionFactory.kt b/app/src/main/java/com/fankes/coloros/notify/utils/factory/FunctionFactory.kt index e6dfb89..9651709 100644 --- a/app/src/main/java/com/fankes/coloros/notify/utils/factory/FunctionFactory.kt +++ b/app/src/main/java/com/fankes/coloros/notify/utils/factory/FunctionFactory.kt @@ -26,6 +26,7 @@ package com.fankes.coloros.notify.utils.factory import android.app.Activity import android.app.Notification +import android.app.Service import android.app.WallpaperManager import android.app.WallpaperManager.FLAG_SYSTEM import android.content.ClipData @@ -312,7 +313,15 @@ fun toast(msg: String) = Toast.makeText(appContext, msg, Toast.LENGTH_SHORT).sho * * [T] 为指定的 [Activity] */ -inline fun Context.navigate() = startActivity(Intent(this, T::class.java)) +inline fun Context.navigate() = runInSafe { startActivity(Intent(this, T::class.java)) } + +/** + * 跳转到指定页面 + * + * [T] 为指定的 [Activity] + */ +inline fun Service.navigate() = + runInSafe { startActivity(Intent(this, T::class.java).apply { flags = Intent.FLAG_ACTIVITY_NEW_TASK }) } /** * 弹出 [Snackbar] diff --git a/app/src/main/res/drawable/ic_notify_icon.xml b/app/src/main/res/drawable/ic_notify_icon.xml new file mode 100644 index 0000000..28818a5 --- /dev/null +++ b/app/src/main/res/drawable/ic_notify_icon.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 63666a5..17c5321 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,3 +1,4 @@ ColorOS 通知图标增强 + 通知图标 \ No newline at end of file