Skip to content

Commit

Permalink
feat: update notification channel settings (#89)
Browse files Browse the repository at this point in the history
update notification channel settings
  • Loading branch information
migulyaev authored Oct 2, 2023
1 parent 3101141 commit a008a30
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ fun LetroTabs(
val uiState by viewModel.uiState.collectAsState()

val tabTitles = listOf(
stringResource(id = R.string.top_bar_tab_conversations),
stringResource(id = R.string.conversations),
stringResource(id = R.string.top_bar_tab_contacts),
stringResource(id = R.string.top_bar_tab_notifications),
)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/tech/relaycorp/letro/push/PushManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class PushManagerImpl @Inject constructor(
channels
.map { channel ->
NotificationChannel(channel.id, context.getString(channel.name), NotificationManager.IMPORTANCE_DEFAULT).apply {
description = context.getString(channel.description)
group = groupName
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ object PushesModule {
fun providePushChannels(): List<PushChannel> {
return listOf(
PushChannel(
id = PushChannel.ChannelId.ID_DEFAULT,
name = R.string.push_channel_default_name,
description = R.string.push_channel_default_description,
id = PushChannel.ChannelId.ID_CONVERSATIONS,
name = R.string.conversations,
),
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ package tech.relaycorp.letro.push.model

import androidx.annotation.StringDef
import androidx.annotation.StringRes
import tech.relaycorp.letro.push.model.PushChannel.ChannelId.Companion.ID_DEFAULT
import tech.relaycorp.letro.push.model.PushChannel.ChannelId.Companion.ID_CONVERSATIONS

data class PushChannel(
@ChannelId val id: String,
@StringRes val name: Int,
@StringRes val description: Int,
) {

@StringDef(ID_DEFAULT)
@StringDef(ID_CONVERSATIONS)
annotation class ChannelId {
companion object {
const val ID_DEFAULT = "default"
const val ID_CONVERSATIONS = "default"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ data class PushData(
val action: PushAction,
val notificationId: Int,
val recipientAccountId: String,
@PushChannel.ChannelId val channelId: String = PushChannel.ChannelId.ID_DEFAULT,
@PushChannel.ChannelId val channelId: String = PushChannel.ChannelId.ID_CONVERSATIONS,
)

sealed interface PushAction : Parcelable {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es-rVE/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<string name="pair_request_was_already_sent_hint">Ya intentaste conectar con este usuario, pero podemos intentarlo nuevamente si quieres.</string>
<string name="pair_request_already_paired">Ustedes dos ya están conectados.</string>
<string name="pair_request_already_in_progress">La conexión con este usuario ya está en progreso.</string>
<string name="top_bar_tab_conversations">Conversaciones</string>
<string name="conversations">Conversaciones</string>
<string name="top_bar_tab_contacts">Contactos</string>
<string name="top_bar_tab_notifications">Notificaciones</string>
<string name="floating_action_button_write_new_message_content_description">Escribe un mensaje nuevo</string>
Expand Down
5 changes: 1 addition & 4 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<string name="pair_request_already_in_progress">Your pairing with this user is already under way.</string>
<string name="pair_request_invalid_id">Enter an id like “[email protected]“ or “example.com“.</string>

<string name="top_bar_tab_conversations">Conversations</string>
<string name="conversations">Conversations</string>
<string name="top_bar_tab_contacts">Contacts</string>
<string name="top_bar_tab_notifications">Notifications</string>

Expand Down Expand Up @@ -128,9 +128,6 @@
<string name="sent">Sent</string>
<string name="archive">Archive</string>

<string name="push_channel_default_name">Name</string>
<string name="push_channel_default_description">Description</string>

<plurals name="new_notifications_group_count">
<item quantity="one">%d new notification</item>
<item quantity="other">%d new notifications</item>
Expand Down

0 comments on commit a008a30

Please sign in to comment.