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
d50c1365
Commit
d50c1365
authored
Dec 24, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename function (login -> connect)
parent
73d78ad2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
ServerPresenter.kt
...oid/authentication/server/presentation/ServerPresenter.kt
+4
-1
ServerFragment.kt
...rocket/android/authentication/server/ui/ServerFragment.kt
+1
-1
No files found.
app/src/main/java/chat/rocket/android/authentication/server/presentation/ServerPresenter.kt
View file @
d50c1365
...
@@ -6,18 +6,21 @@ import chat.rocket.android.authentication.presentation.AuthenticationNavigator
...
@@ -6,18 +6,21 @@ import chat.rocket.android.authentication.presentation.AuthenticationNavigator
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.core.lifecycle.CancelStrategy
import
chat.rocket.android.helper.NetworkHelper
import
chat.rocket.android.helper.NetworkHelper
import
chat.rocket.android.util.launchUI
import
chat.rocket.android.util.launchUI
import
chat.rocket.core.RocketChatClient
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
strategy
:
CancelStrategy
,
private
val
navigator
:
AuthenticationNavigator
)
{
private
val
navigator
:
AuthenticationNavigator
)
{
@Inject
lateinit
var
client
:
RocketChatClient
fun
login
(
context
:
Context
,
server
:
String
)
{
fun
connect
(
context
:
Context
,
server
:
String
)
{
launchUI
(
strategy
)
{
launchUI
(
strategy
)
{
if
(
NetworkHelper
.
hasInternetAccess
())
{
if
(
NetworkHelper
.
hasInternetAccess
())
{
view
.
showLoading
()
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
// client.connect(server)
view
.
hideLoading
()
view
.
hideLoading
()
navigator
.
toLogin
(
server
)
navigator
.
toLogin
(
server
)
...
...
app/src/main/java/chat/rocket/android/authentication/server/ui/ServerFragment.kt
View file @
d50c1365
...
@@ -43,7 +43,7 @@ class ServerFragment : Fragment(), ServerView {
...
@@ -43,7 +43,7 @@ class ServerFragment : Fragment(), ServerView {
activity
?.
applicationContext
?.
apply
{
activity
?.
applicationContext
?.
apply
{
button_connect
.
setOnClickListener
{
button_connect
.
setOnClickListener
{
val
url
=
text_server_url
.
textContent
.
ifEmpty
(
text_server_url
.
hintContent
)
val
url
=
text_server_url
.
textContent
.
ifEmpty
(
text_server_url
.
hintContent
)
presenter
.
login
(
this
,
text_server_protocol
.
textContent
+
url
)
presenter
.
connect
(
this
,
text_server_protocol
.
textContent
+
url
)
}
}
}
}
}
}
...
...
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