Commit 649535f8 authored by Matthieu's avatar Matthieu
Browse files

Add comment notification type

parent ebec547d
......@@ -87,7 +87,8 @@ class NotificationsFragment : CachedFeedFragment<Notification>() {
val intent: Intent =
when (type) {
Notification.NotificationType.mention, Notification.NotificationType.favourite,
Notification.NotificationType.poll, Notification.NotificationType.reblog -> {
Notification.NotificationType.poll, Notification.NotificationType.reblog,
Notification.NotificationType.comment -> {
openPostFromNotification()
}
Notification.NotificationType.follow -> {
......@@ -113,39 +114,38 @@ class NotificationsFragment : CachedFeedFragment<Notification>() {
) {
val context = textView.context
val (format: String, drawable: Drawable?) = when (type) {
Notification.NotificationType.follow -> {
Notification.NotificationType.follow ->
getStringAndDrawable(
context,
R.string.followed_notification,
R.drawable.ic_follow
)
}
Notification.NotificationType.mention -> {
Notification.NotificationType.mention ->
getStringAndDrawable(
context,
R.string.mention_notification,
R.drawable.mention_at_24dp
)
}
Notification.NotificationType.reblog -> {
Notification.NotificationType.comment ->
getStringAndDrawable(
context,
R.string.comment_notification,
R.drawable.ic_comment_empty
)
Notification.NotificationType.reblog ->
getStringAndDrawable(
context,
R.string.shared_notification,
R.drawable.ic_reblog_blue
)
}
Notification.NotificationType.favourite -> {
Notification.NotificationType.favourite ->
getStringAndDrawable(
context,
R.string.liked_notification,
R.drawable.ic_like_full
)
}
Notification.NotificationType.poll -> {
Notification.NotificationType.poll ->
getStringAndDrawable(context, R.string.poll_notification, R.drawable.poll)
}
}
textView.text = format.format(username)
textView.setCompoundDrawablesWithIntrinsicBounds(
......
......@@ -38,6 +38,6 @@ data class Notification(
override var instance_uri: String,
): FeedContent, FeedContentDatabase {
enum class NotificationType: Serializable {
follow, mention, reblog, favourite, poll
follow, mention, reblog, favourite, poll, comment
}
}
\ No newline at end of file
......@@ -50,6 +50,12 @@
<!-- Notifications: end of poll notification -->
<string name="poll_notification">"%1$s's poll has ended"</string>
<!-- Notifications: comment notification -->
<string name="comment_notification">%1$s commented on your post</string>
<!-- Notifications: other notification -->
<string name="other_notification">"Notification from %1$s"</string>
<!-- Login page -->
<string name="whats_an_instance">"What's an instance?"</string>
<string name="whats_an_instance_explanation">"You might be confused by the text field asking for the domain of your 'instance'.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment