Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
922a9abd
Commit
922a9abd
authored
Mar 05, 2018
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix more refactoring mistakes once again
parent
8247ced2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
ProfilePresenter.kt
...t/rocket/android/profile/presentation/ProfilePresenter.kt
+13
-13
ProfileFragment.kt
...in/java/chat/rocket/android/profile/ui/ProfileFragment.kt
+3
-3
No files found.
app/src/main/java/chat/rocket/android/profile/presentation/ProfilePresenter.kt
View file @
922a9abd
...
...
@@ -12,10 +12,10 @@ import chat.rocket.core.internal.rest.me
import
chat.rocket.core.internal.rest.updateProfile
import
javax.inject.Inject
class
ProfilePresenter
@Inject
constructor
(
private
val
view
:
ProfileView
,
private
val
strategy
:
CancelStrategy
,
serverInteractor
:
GetCurrentServerInteractor
,
factory
:
RocketChatClientFactory
)
{
class
ProfilePresenter
@Inject
constructor
(
private
val
view
:
ProfileView
,
private
val
strategy
:
CancelStrategy
,
serverInteractor
:
GetCurrentServerInteractor
,
factory
:
RocketChatClientFactory
)
{
private
val
serverUrl
=
serverInteractor
.
get
()
!!
private
val
client
:
RocketChatClient
=
factory
.
create
(
serverUrl
)
private
lateinit
var
myselfId
:
String
...
...
@@ -28,17 +28,17 @@ class ProfilePresenter @Inject constructor (private val view: ProfileView,
myselfId
=
myself
.
id
val
avatarUrl
=
UrlHelper
.
getAvatarUrl
(
serverUrl
,
myself
.
username
!!
)
view
.
showProfile
(
avatarUrl
,
myself
.
name
?:
""
,
myself
.
username
?:
""
,
myself
.
emails
?.
get
(
0
)
?.
address
!!
avatarUrl
,
myself
.
name
?:
""
,
myself
.
username
?:
""
,
myself
.
emails
?.
get
(
0
)
?.
address
!!
)
}
catch
(
exception
:
RocketChatException
)
{
exception
.
message
?.
let
{
view
.
showMessage
(
it
)
}.
ifNull
{
view
.
showGenericErrorMessage
()
}
view
.
showGenericErrorMessage
()
}
}
finally
{
view
.
hideLoading
()
}
...
...
@@ -49,15 +49,15 @@ class ProfilePresenter @Inject constructor (private val view: ProfileView,
launchUI
(
strategy
)
{
view
.
showLoading
()
try
{
val
user
=
client
.
updateProfile
(
myselfId
,
email
,
name
,
username
)
val
user
=
client
.
updateProfile
(
myselfId
,
email
,
name
,
null
,
username
)
view
.
showProfileUpdateSuccessfullyMessage
()
loadUserProfile
()
}
catch
(
exception
:
RocketChatException
)
{
exception
.
message
?.
let
{
view
.
showMessage
(
it
)
}.
ifNull
{
view
.
showGenericErrorMessage
()
}
view
.
showGenericErrorMessage
()
}
}
finally
{
view
.
hideLoading
()
}
...
...
app/src/main/java/chat/rocket/android/profile/ui/ProfileFragment.kt
View file @
922a9abd
...
...
@@ -54,8 +54,8 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
text_username
.
textContent
=
username
text_email
.
textContent
=
email
currentName
=
name
currentUsername
=
user
name
currentName
=
user
name
currentUsername
=
name
currentEmail
=
email
profile_container
.
setVisible
(
true
)
...
...
@@ -92,7 +92,7 @@ class ProfileFragment : Fragment(), ProfileView, ActionMode.Callback {
override
fun
onActionItemClicked
(
mode
:
ActionMode
,
menuItem
:
MenuItem
):
Boolean
{
return
when
(
menuItem
.
itemId
)
{
R
.
id
.
action_profile
->
{
presenter
.
updateUserProfile
(
text_email
.
textContent
,
text_
user
name
.
textContent
,
text_username
.
textContent
)
presenter
.
updateUserProfile
(
text_email
.
textContent
,
text_name
.
textContent
,
text_username
.
textContent
)
mode
.
finish
()
true
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment