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
26f3f46a
Commit
26f3f46a
authored
Dec 20, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update ServerPresenter.kt
parent
7e4bc998
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
ServerPresenter.kt
...oid/authentication/server/presentation/ServerPresenter.kt
+19
-3
No files found.
app/src/main/java/chat/rocket/android/authentication/server/presentation/ServerPresenter.kt
View file @
26f3f46a
package
chat.rocket.android.authentication.server.presentation
package
chat.rocket.android.authentication.server.presentation
import
android.content.Context
import
chat.rocket.android.R
import
chat.rocket.android.authentication.presentation.AuthenticationNavigator
import
chat.rocket.android.authentication.presentation.AuthenticationNavigator
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.helper.NetworkHelper
import
chat.rocket.android.util.launchUI
import
javax.inject.Inject
import
javax.inject.Inject
class
ServerPresenter
@Inject
constructor
(
private
val
view
:
ServerView
,
class
ServerPresenter
@Inject
constructor
(
private
val
view
:
ServerView
,
private
val
strategy
:
CancelStrategy
,
private
val
navigator
:
AuthenticationNavigator
)
{
private
val
navigator
:
AuthenticationNavigator
)
{
fun
login
(
server
:
String
)
{
fun
login
(
context
:
Context
,
server
:
String
)
{
launchUI
(
strategy
)
{
if
(
NetworkHelper
.
hasInternetAccess
())
{
view
.
showLoading
()
// TODO - validate server URL and get server settings and info before going to Login screen
// TODO - validate server URL and get server settings and info before going to Login screen
view
.
hideLoading
()
navigator
.
toLogin
(
server
)
navigator
.
toLogin
(
server
)
}
else
{
view
.
showMessage
(
context
.
getString
(
R
.
string
.
msg_no_internet_connection
))
}
}
}
}
}
}
\ No newline at end of file
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