parent
f917a5aa4b
commit
34fb546200
8 changed files with 28 additions and 28 deletions
|
@ -79,7 +79,7 @@ class AnnouncementsActivity : BaseActivity(), AnnouncementActionListener, OnEmoj
|
|||
announcementsList.addItemDecoration(divider)
|
||||
announcementsList.adapter = adapter
|
||||
|
||||
viewModel.announcements.observe(this, Observer {
|
||||
viewModel.announcements.observe(this) {
|
||||
when (it) {
|
||||
is Success -> {
|
||||
progressBar.hide()
|
||||
|
@ -104,11 +104,11 @@ class AnnouncementsActivity : BaseActivity(), AnnouncementActionListener, OnEmoj
|
|||
errorMessageView.show()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
viewModel.emojis.observe(this, Observer {
|
||||
viewModel.emojis.observe(this) {
|
||||
picker.adapter = EmojiAdapter(it, this)
|
||||
})
|
||||
}
|
||||
|
||||
viewModel.load()
|
||||
progressBar.show()
|
||||
|
|
|
@ -51,7 +51,7 @@ class AnnouncementsViewModel @Inject constructor(
|
|||
.map<Either<InstanceEntity, Instance>> { Either.Left(it) }
|
||||
.onErrorResumeNext(
|
||||
mastodonApi.getInstance()
|
||||
.map { Either.Right<InstanceEntity, Instance>(it) }
|
||||
.map { Either.Right(it) }
|
||||
)
|
||||
) { emojis, either ->
|
||||
either.asLeftOrNull()?.copy(emojiList = emojis)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue