Cleanup
This commit is contained in:
parent
adc419a06b
commit
94f7374e38
|
@ -81,24 +81,22 @@ class NotificationsFragment : CachedFeedFragment<Notification>() {
|
||||||
itemView.setOnClickListener {
|
itemView.setOnClickListener {
|
||||||
notification?.openActivity()
|
notification?.openActivity()
|
||||||
}
|
}
|
||||||
|
avatar.setOnClickListener {
|
||||||
|
val intent = notification?.openAccountFromNotification()
|
||||||
|
itemView.context.startActivity(intent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Notification.openActivity() {
|
private fun Notification.openActivity() {
|
||||||
val intent: Intent =
|
val intent: Intent =
|
||||||
when (type) {
|
when (type) {
|
||||||
Notification.NotificationType.favourite,
|
Notification.NotificationType.mention, Notification.NotificationType.favourite,
|
||||||
Notification.NotificationType.poll, Notification.NotificationType.reblog -> {
|
Notification.NotificationType.poll, Notification.NotificationType.reblog -> {
|
||||||
openPostFromNotification()
|
openPostFromNotification()
|
||||||
}
|
}
|
||||||
Notification.NotificationType.follow -> {
|
Notification.NotificationType.follow -> {
|
||||||
openAccountFromNotification()
|
openAccountFromNotification()
|
||||||
}
|
}
|
||||||
Notification.NotificationType.mention -> {
|
|
||||||
/*Intent(itemView.context, PostActivity::class.java).apply {
|
|
||||||
putExtra(Status.POST_TAG, status?.in_reply_to_id)
|
|
||||||
}*/ // TODO
|
|
||||||
openPostFromNotification()
|
|
||||||
}
|
|
||||||
null -> return
|
null -> return
|
||||||
}
|
}
|
||||||
itemView.context.startActivity(intent)
|
itemView.context.startActivity(intent)
|
||||||
|
@ -216,11 +214,6 @@ class NotificationsFragment : CachedFeedFragment<Notification>() {
|
||||||
itemView.context,
|
itemView.context,
|
||||||
lifecycleScope
|
lifecycleScope
|
||||||
)
|
)
|
||||||
|
|
||||||
avatar.setOnClickListener {
|
|
||||||
val intent = notification?.openAccountFromNotification()
|
|
||||||
itemView.context.startActivity(intent)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Loading…
Reference in New Issue