mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 20:06:51 +03:00
Merge pull request #1226 from ndarilek/develop
Set `tickerText` to improve accessibility of notifications.
This commit is contained in:
commit
b36759deb4
5 changed files with 15 additions and 4 deletions
|
@ -5,7 +5,7 @@ Features ✨:
|
|||
-
|
||||
|
||||
Improvements 🙌:
|
||||
-
|
||||
- Improve notification accessibility with ticker text (#1226)
|
||||
|
||||
Bugfix 🐛:
|
||||
- Sometimes the same device appears twice in the list of devices of a user (#1329)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# The setting is particularly useful for tweaking memory settings.
|
||||
android.enableJetifier=true
|
||||
android.useAndroidX=true
|
||||
org.gradle.jvmargs=-Xmx1536m
|
||||
org.gradle.jvmargs=-Xmx8192m
|
||||
# When configured, Gradle will run in incubating parallel mode.
|
||||
# This option should only be used with decoupled projects. More details, visit
|
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||
|
|
|
@ -348,12 +348,19 @@ class NotificationDrawerManager @Inject constructor(private val context: Context
|
|||
globalLastMessageTimestamp = lastMessageTimestamp
|
||||
}
|
||||
|
||||
val tickerText = if (roomEventGroupInfo.isDirect) {
|
||||
stringProvider.getString(R.string.notification_ticker_text_dm, events.last().senderName, events.last().description)
|
||||
} else {
|
||||
stringProvider.getString(R.string.notification_ticker_text_group, roomName, events.last().senderName, events.last().description)
|
||||
}
|
||||
|
||||
val notification = notificationUtils.buildMessagesListNotification(
|
||||
style,
|
||||
roomEventGroupInfo,
|
||||
largeBitmap,
|
||||
lastMessageTimestamp,
|
||||
myUserDisplayName)
|
||||
myUserDisplayName,
|
||||
tickerText)
|
||||
|
||||
// is there an id for this room?
|
||||
notificationUtils.showNotificationMessage(roomId, ROOM_MESSAGES_NOTIFICATION_ID, notification)
|
||||
|
|
|
@ -381,7 +381,8 @@ class NotificationUtils @Inject constructor(private val context: Context,
|
|||
roomInfo: RoomEventGroupInfo,
|
||||
largeIcon: Bitmap?,
|
||||
lastMessageTimestamp: Long,
|
||||
senderDisplayNameForReplyCompat: String?): Notification {
|
||||
senderDisplayNameForReplyCompat: String?,
|
||||
tickerText: String): Notification {
|
||||
val accentColor = ContextCompat.getColor(context, R.color.notification_accent_color)
|
||||
// Build the pending intent for when the notification is clicked
|
||||
val openRoomIntent = buildOpenRoomIntent(roomInfo.roomId)
|
||||
|
@ -478,6 +479,7 @@ class NotificationUtils @Inject constructor(private val context: Context,
|
|||
System.currentTimeMillis().toInt(), intent, PendingIntent.FLAG_UPDATE_CURRENT)
|
||||
setDeleteIntent(pendingIntent)
|
||||
}
|
||||
.setTicker(tickerText)
|
||||
.build()
|
||||
}
|
||||
|
||||
|
|
|
@ -1089,6 +1089,8 @@
|
|||
<string name="notification_new_invitation">New Invitation</string>
|
||||
<string name="notification_sender_me">Me</string>
|
||||
<string name="notification_inline_reply_failed">** Failed to send - please open room</string>
|
||||
<string name="notification_ticker_text_dm">%1$s: %2$s</string>
|
||||
<string name="notification_ticker_text_group">%1$s: %2$s %3$s</string>
|
||||
|
||||
<!-- historical -->
|
||||
<string name="historical_placeholder">Search for historical</string>
|
||||
|
|
Loading…
Reference in a new issue