shorten some code in NotificationsFragment
This commit is contained in:
parent
c8bf78021f
commit
ed37bb27a2
|
@ -533,23 +533,21 @@ class NotificationsFragment :
|
||||||
menuInflater.inflate(R.menu.fragment_notifications, menu)
|
menuInflater.inflate(R.menu.fragment_notifications, menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onMenuItemSelected(menuItem: MenuItem): Boolean {
|
override fun onMenuItemSelected(menuItem: MenuItem) = when (menuItem.itemId) {
|
||||||
when (menuItem.itemId) {
|
R.id.action_refresh -> {
|
||||||
R.id.action_refresh -> {
|
binding.swipeRefreshLayout.isRefreshing = true
|
||||||
binding.swipeRefreshLayout.isRefreshing = true
|
onRefresh()
|
||||||
onRefresh()
|
true
|
||||||
return true
|
|
||||||
}
|
|
||||||
R.id.action_edit_notification_filter -> {
|
|
||||||
showFilterMenu()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
R.id.action_clear_notifications -> {
|
|
||||||
confirmClearNotifications()
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
else -> return false
|
|
||||||
}
|
}
|
||||||
|
R.id.action_edit_notification_filter -> {
|
||||||
|
showFilterMenu()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
R.id.action_clear_notifications -> {
|
||||||
|
confirmClearNotifications()
|
||||||
|
true
|
||||||
|
}
|
||||||
|
else -> false
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|
Loading…
Reference in New Issue