Commit d50c1365 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Rename function (login -> connect)

parent 73d78ad2
...@@ -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)
......
...@@ -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)
} }
} }
} }
......
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