Commit 32239224 authored by Leonardo Aramaki's avatar Leonardo Aramaki

Fix again mistaken refactoring.

parent 72430ee3
...@@ -29,8 +29,8 @@ class ProfilePresenter @Inject constructor (private val view: ProfileView, ...@@ -29,8 +29,8 @@ class ProfilePresenter @Inject constructor (private val view: ProfileView,
val avatarUrl = UrlHelper.getAvatarUrl(serverUrl, myself.username!!) val avatarUrl = UrlHelper.getAvatarUrl(serverUrl, myself.username!!)
view.showProfile( view.showProfile(
avatarUrl, avatarUrl,
myself.name!!, myself.name ?: "",
myself.username!!, myself.username ?: "",
myself.emails?.get(0)?.address!! myself.emails?.get(0)?.address!!
) )
} catch (exception: RocketChatException) { } catch (exception: RocketChatException) {
......
...@@ -50,7 +50,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback { ...@@ -50,7 +50,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
override fun showProfile(avatarUrl: String, name: String, username: String, email: String) { override fun showProfile(avatarUrl: String, name: String, username: String, email: String) {
image_avatar.setImageURI(avatarUrl) image_avatar.setImageURI(avatarUrl)
text_username.textContent = name text_name.textContent = name
text_username.textContent = username text_username.textContent = username
text_email.textContent = email text_email.textContent = email
...@@ -124,13 +124,13 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback { ...@@ -124,13 +124,13 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
} }
private fun listenToChanges() { private fun listenToChanges() {
Observables.combineLatest(text_username.asObservable(), text_username.asObservable(), text_email.asObservable()).subscribe({ t -> Observables.combineLatest(text_name.asObservable(), text_username.asObservable(), text_email.asObservable()).subscribe({ t ->
if (t.first.toString() != currentName || t.second.toString() != currentUsername || t.third.toString() != currentEmail) { if (t.first.toString() != currentName || t.second.toString() != currentUsername || t.third.toString() != currentEmail) {
startActionMode() startActionMode()
} else { } else {
finishActionMode() finishActionMode()
} }
}) })
} }
private fun startActionMode() { private fun startActionMode() {
......
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