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
ed3b28c1
Commit
ed3b28c1
authored
Mar 21, 2018
by
Lucio Maciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some issues.
parent
0d5bbd04
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
4 deletions
+21
-4
AuthenticationNavigator.kt
...id/authentication/presentation/AuthenticationNavigator.kt
+9
-1
ServerPresenter.kt
...oid/authentication/server/presentation/ServerPresenter.kt
+10
-1
MainActivity.kt
...src/main/java/chat/rocket/android/main/ui/MainActivity.kt
+1
-1
fragment_authentication_server.xml
app/src/main/res/layout/fragment_authentication_server.xml
+1
-1
No files found.
app/src/main/java/chat/rocket/android/authentication/presentation/AuthenticationNavigator.kt
View file @
ed3b28c1
...
@@ -6,7 +6,9 @@ import chat.rocket.android.authentication.login.ui.LoginFragment
...
@@ -6,7 +6,9 @@ import chat.rocket.android.authentication.login.ui.LoginFragment
import
chat.rocket.android.authentication.signup.ui.SignupFragment
import
chat.rocket.android.authentication.signup.ui.SignupFragment
import
chat.rocket.android.authentication.twofactor.ui.TwoFAFragment
import
chat.rocket.android.authentication.twofactor.ui.TwoFAFragment
import
chat.rocket.android.authentication.ui.AuthenticationActivity
import
chat.rocket.android.authentication.ui.AuthenticationActivity
import
chat.rocket.android.authentication.ui.newServerIntent
import
chat.rocket.android.main.ui.MainActivity
import
chat.rocket.android.main.ui.MainActivity
import
chat.rocket.android.server.ui.changeServerIntent
import
chat.rocket.android.util.extensions.addFragmentBackStack
import
chat.rocket.android.util.extensions.addFragmentBackStack
import
chat.rocket.android.webview.ui.webViewIntent
import
chat.rocket.android.webview.ui.webViewIntent
...
@@ -40,7 +42,13 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) {
...
@@ -40,7 +42,13 @@ class AuthenticationNavigator(internal val activity: AuthenticationActivity) {
activity
.
finish
()
activity
.
finish
()
}
}
fun
toChatList
(
serverUrl
:
String
)
{
activity
.
startActivity
(
activity
.
changeServerIntent
(
serverUrl
))
activity
.
finish
()
}
fun
toServerScreen
()
{
fun
toServerScreen
()
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
activity
.
startActivity
(
activity
.
newServerIntent
())
activity
.
finish
()
}
}
}
}
\ No newline at end of file
app/src/main/java/chat/rocket/android/authentication/server/presentation/ServerPresenter.kt
View file @
ed3b28c1
...
@@ -4,6 +4,7 @@ import chat.rocket.android.authentication.presentation.AuthenticationNavigator
...
@@ -4,6 +4,7 @@ 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.helper.UrlHelper
import
chat.rocket.android.helper.UrlHelper
import
chat.rocket.android.server.domain.GetAccountsInteractor
import
chat.rocket.android.server.domain.RefreshSettingsInteractor
import
chat.rocket.android.server.domain.RefreshSettingsInteractor
import
chat.rocket.android.server.domain.SaveCurrentServerInteractor
import
chat.rocket.android.server.domain.SaveCurrentServerInteractor
import
chat.rocket.android.util.extensions.launchUI
import
chat.rocket.android.util.extensions.launchUI
...
@@ -14,12 +15,20 @@ class ServerPresenter @Inject constructor(private val view: ServerView,
...
@@ -14,12 +15,20 @@ class ServerPresenter @Inject constructor(private val view: ServerView,
private
val
strategy
:
CancelStrategy
,
private
val
strategy
:
CancelStrategy
,
private
val
navigator
:
AuthenticationNavigator
,
private
val
navigator
:
AuthenticationNavigator
,
private
val
serverInteractor
:
SaveCurrentServerInteractor
,
private
val
serverInteractor
:
SaveCurrentServerInteractor
,
private
val
refreshSettingsInteractor
:
RefreshSettingsInteractor
)
{
private
val
refreshSettingsInteractor
:
RefreshSettingsInteractor
,
private
val
getAccountsInteractor
:
GetAccountsInteractor
)
{
fun
connect
(
server
:
String
)
{
fun
connect
(
server
:
String
)
{
if
(!
UrlHelper
.
isValidUrl
(
server
))
{
if
(!
UrlHelper
.
isValidUrl
(
server
))
{
view
.
showInvalidServerUrlMessage
()
view
.
showInvalidServerUrlMessage
()
}
else
{
}
else
{
launchUI
(
strategy
)
{
launchUI
(
strategy
)
{
// Check if we already have an account for this server...
val
account
=
getAccountsInteractor
.
get
().
firstOrNull
{
it
.
serverUrl
==
server
}
if
(
account
!=
null
)
{
navigator
.
toChatList
(
server
)
return
@launchUI
}
if
(
NetworkHelper
.
hasInternetAccess
())
{
if
(
NetworkHelper
.
hasInternetAccess
())
{
view
.
showLoading
()
view
.
showLoading
()
try
{
try
{
...
...
app/src/main/java/chat/rocket/android/main/ui/MainActivity.kt
View file @
ed3b28c1
...
@@ -75,7 +75,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
...
@@ -75,7 +75,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, HasSupp
}
}
override
fun
closeServerSelection
()
{
override
fun
closeServerSelection
()
{
view_navigation
.
getHeaderView
(
0
).
account_container
.
performClick
()
}
}
private
var
expanded
=
false
private
var
expanded
=
false
...
...
app/src/main/res/layout/fragment_authentication_server.xml
View file @
ed3b28c1
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
android:digits=
"0123456789abcdefghijklmnopqrstuvwxyz.-/:"
android:digits=
"0123456789abcdefghijklmnopqrstuvwxyz.-/:"
android:inputType=
"textUri"
android:inputType=
"textUri"
android:paddingEnd=
"0dp"
android:paddingEnd=
"0dp"
android:paddingStart=
"
2
dp"
/>
android:paddingStart=
"
4
dp"
/>
<TextView
<TextView
android:id=
"@+id/text_server_protocol"
android:id=
"@+id/text_server_protocol"
...
...
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