Skip to content

Commit

Permalink
update badge when click notify
Browse files Browse the repository at this point in the history
  • Loading branch information
ekibun committed Nov 13, 2019
1 parent 8206d6e commit 542e2eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/soko/ekibun/bangumi/ui/main/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ class MainActivity : BaseActivity() {
when(it.itemId){
R.id.notify_type_inbox -> {
mainPresenter.user?.notify = Pair(0, mainPresenter.user?.notify?.second ?: 0)
notifyMenu?.badge = mainPresenter.user?.notify?.let { it.first + it.second } ?: 0
WebActivity.launchUrl(this, "${Bangumi.SERVER}/pm")
}
R.id.notify_type_notify -> {
mainPresenter.user?.notify = Pair(mainPresenter.user?.notify?.first ?: 0, 0)
notifyMenu?.badge = mainPresenter.user?.notify?.let { it.first + it.second } ?: 0
WebActivity.launchUrl(this, "${Bangumi.SERVER}/notify" + if (notify == 0) "/all" else "")
}
}
Expand Down

0 comments on commit 542e2eb

Please sign in to comment.