From cb59d82846e0cc7f660df20317bd968337ed3b94 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 11 Jul 2022 12:50:14 +0100 Subject: [PATCH] extracting the notification action ids to their own file --- .../notifications/NotificationActionIds.kt | 41 +++++++++++++++++++ .../notifications/NotificationUtils.kt | 22 ---------- 2 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 vector/src/main/java/im/vector/app/features/notifications/NotificationActionIds.kt diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationActionIds.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationActionIds.kt new file mode 100644 index 0000000000..c83a1f2f4a --- /dev/null +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationActionIds.kt @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2022 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package im.vector.app.features.notifications + +import im.vector.app.core.resources.BuildMeta +import javax.inject.Inject + +/** + * Util class for creating notifications. + * Note: Cannot inject ColorProvider in the constructor, because it requires an Activity + */ + +data class NotificationActionIds @Inject constructor( + private val buildMeta: BuildMeta, +) { + + val JOIN_ACTION = "${buildMeta.applicationId}.NotificationActions.JOIN_ACTION" + val REJECT_ACTION = "${buildMeta.applicationId}.NotificationActions.REJECT_ACTION" + val QUICK_LAUNCH_ACTION = "${buildMeta.applicationId}.NotificationActions.QUICK_LAUNCH_ACTION" + val MARK_ROOM_READ_ACTION = "${buildMeta.applicationId}.NotificationActions.MARK_ROOM_READ_ACTION" + val SMART_REPLY_ACTION = "${buildMeta.applicationId}.NotificationActions.SMART_REPLY_ACTION" + val DISMISS_SUMMARY_ACTION = "${buildMeta.applicationId}.NotificationActions.DISMISS_SUMMARY_ACTION" + val DISMISS_ROOM_NOTIF_ACTION = "${buildMeta.applicationId}.NotificationActions.DISMISS_ROOM_NOTIF_ACTION" + val TAP_TO_VIEW_ACTION = "${buildMeta.applicationId}.NotificationActions.TAP_TO_VIEW_ACTION" + val DIAGNOSTIC_ACTION = "${buildMeta.applicationId}.NotificationActions.DIAGNOSTIC" + val PUSH_ACTION = "${buildMeta.applicationId}.PUSH" +} diff --git a/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt b/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt index 02667cee7f..2fdba3b524 100755 --- a/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt +++ b/vector/src/main/java/im/vector/app/features/notifications/NotificationUtils.kt @@ -48,7 +48,6 @@ import androidx.fragment.app.Fragment import im.vector.app.R import im.vector.app.core.extensions.createIgnoredUri import im.vector.app.core.platform.PendingIntentCompat -import im.vector.app.core.resources.BuildMeta import im.vector.app.core.resources.StringProvider import im.vector.app.core.services.CallAndroidService import im.vector.app.core.time.Clock @@ -69,27 +68,6 @@ import javax.inject.Inject import javax.inject.Singleton import kotlin.random.Random -/** - * Util class for creating notifications. - * Note: Cannot inject ColorProvider in the constructor, because it requires an Activity - */ - -data class NotificationActionIds @Inject constructor( - private val buildMeta: BuildMeta, -) { - - val JOIN_ACTION = "${buildMeta.applicationId}.NotificationActions.JOIN_ACTION" - val REJECT_ACTION = "${buildMeta.applicationId}.NotificationActions.REJECT_ACTION" - val QUICK_LAUNCH_ACTION = "${buildMeta.applicationId}.NotificationActions.QUICK_LAUNCH_ACTION" - val MARK_ROOM_READ_ACTION = "${buildMeta.applicationId}.NotificationActions.MARK_ROOM_READ_ACTION" - val SMART_REPLY_ACTION = "${buildMeta.applicationId}.NotificationActions.SMART_REPLY_ACTION" - val DISMISS_SUMMARY_ACTION = "${buildMeta.applicationId}.NotificationActions.DISMISS_SUMMARY_ACTION" - val DISMISS_ROOM_NOTIF_ACTION = "${buildMeta.applicationId}.NotificationActions.DISMISS_ROOM_NOTIF_ACTION" - val TAP_TO_VIEW_ACTION = "${buildMeta.applicationId}.NotificationActions.TAP_TO_VIEW_ACTION" - val DIAGNOSTIC_ACTION = "${buildMeta.applicationId}.NotificationActions.DIAGNOSTIC" - val PUSH_ACTION = "${buildMeta.applicationId}.PUSH" -} - @Singleton class NotificationUtils @Inject constructor( private val context: Context,