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
106791db
Commit
106791db
authored
Dec 14, 2017
by
Aniket
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:dismiss server url view on entering correct url
parent
8407c568
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
InputHostnameContract.java
...et/android/fragment/add_server/InputHostnameContract.java
+1
-1
InputHostnameFragment.java
...et/android/fragment/add_server/InputHostnameFragment.java
+5
-3
InputHostnamePresenter.java
...t/android/fragment/add_server/InputHostnamePresenter.java
+3
-1
No files found.
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnameContract.java
View file @
106791db
...
@@ -7,7 +7,7 @@ public interface InputHostnameContract {
...
@@ -7,7 +7,7 @@ public interface InputHostnameContract {
interface
View
extends
BaseContract
.
View
{
interface
View
extends
BaseContract
.
View
{
void
showLoader
();
void
showLoader
();
void
hideLoader
();
void
hideLoader
(
Boolean
isValidServerUrl
);
void
showInvalidServerError
();
void
showInvalidServerError
();
...
...
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnameFragment.java
View file @
106791db
...
@@ -97,10 +97,12 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
...
@@ -97,10 +97,12 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
}
}
@Override
@Override
public
void
hideLoader
()
{
public
void
hideLoader
(
Boolean
isValidServerUrl
)
{
if
(!
isValidServerUrl
)
{
waitingView
.
setVisibility
(
View
.
GONE
);
waitingView
.
setVisibility
(
View
.
GONE
);
container
.
setVisibility
(
View
.
VISIBLE
);
container
.
setVisibility
(
View
.
VISIBLE
);
}
}
}
@Override
@Override
public
void
showInvalidServerError
()
{
public
void
showInvalidServerError
()
{
...
...
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnamePresenter.java
View file @
106791db
...
@@ -16,6 +16,7 @@ import io.reactivex.disposables.Disposable;
...
@@ -16,6 +16,7 @@ import io.reactivex.disposables.Disposable;
public
class
InputHostnamePresenter
extends
BasePresenter
<
InputHostnameContract
.
View
>
implements
InputHostnameContract
.
Presenter
{
public
class
InputHostnamePresenter
extends
BasePresenter
<
InputHostnameContract
.
View
>
implements
InputHostnameContract
.
Presenter
{
private
final
RocketChatCache
rocketChatCache
;
private
final
RocketChatCache
rocketChatCache
;
private
final
ConnectivityManagerApi
connectivityManager
;
private
final
ConnectivityManagerApi
connectivityManager
;
private
boolean
isValidServerUrl
=
false
;
public
InputHostnamePresenter
(
RocketChatCache
rocketChatCache
,
ConnectivityManagerApi
connectivityManager
)
{
public
InputHostnamePresenter
(
RocketChatCache
rocketChatCache
,
ConnectivityManagerApi
connectivityManager
)
{
this
.
rocketChatCache
=
rocketChatCache
;
this
.
rocketChatCache
=
rocketChatCache
;
...
@@ -37,10 +38,11 @@ public class InputHostnamePresenter extends BasePresenter<InputHostnameContract.
...
@@ -37,10 +38,11 @@ public class InputHostnamePresenter extends BasePresenter<InputHostnameContract.
final
Disposable
subscription
=
ServerPolicyHelper
.
isApiVersionValid
(
validationHelper
)
final
Disposable
subscription
=
ServerPolicyHelper
.
isApiVersionValid
(
validationHelper
)
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doOnTerminate
(()
->
view
.
hideLoader
())
.
doOnTerminate
(()
->
view
.
hideLoader
(
isValidServerUrl
))
.
subscribe
(
.
subscribe
(
serverValidation
->
{
serverValidation
->
{
if
(
serverValidation
.
isValid
())
{
if
(
serverValidation
.
isValid
())
{
isValidServerUrl
=
true
;
onServerValid
(
hostname
,
serverValidation
.
usesSecureConnection
());
onServerValid
(
hostname
,
serverValidation
.
usesSecureConnection
());
}
else
{
}
else
{
view
.
showInvalidServerError
();
view
.
showInvalidServerError
();
...
...
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