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
bc33aad4
Unverified
Commit
bc33aad4
authored
Dec 21, 2017
by
Leonardo Aramaki
Committed by
GitHub
Dec 21, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #637 from aniketsingh03/patch-2
[FIX] Dismiss server url view on entering correct url
parents
a2603630
34c69c82
Changes
3
Hide 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 @
bc33aad4
...
...
@@ -7,7 +7,7 @@ public interface InputHostnameContract {
interface
View
extends
BaseContract
.
View
{
void
showLoader
();
void
hideLoader
();
void
hideLoader
(
Boolean
isValidServerUrl
);
void
showInvalidServerError
();
...
...
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnameFragment.java
View file @
bc33aad4
...
...
@@ -96,9 +96,11 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
}
@Override
public
void
hideLoader
()
{
waitingView
.
setVisibility
(
View
.
GONE
);
container
.
setVisibility
(
View
.
VISIBLE
);
public
void
hideLoader
(
Boolean
isValidServerUrl
)
{
if
(!
isValidServerUrl
)
{
waitingView
.
setVisibility
(
View
.
GONE
);
container
.
setVisibility
(
View
.
VISIBLE
);
}
}
@Override
...
...
app/src/main/java/chat/rocket/android/fragment/add_server/InputHostnamePresenter.java
View file @
bc33aad4
...
...
@@ -15,6 +15,7 @@ import io.reactivex.disposables.Disposable;
public
class
InputHostnamePresenter
extends
BasePresenter
<
InputHostnameContract
.
View
>
implements
InputHostnameContract
.
Presenter
{
private
final
ConnectivityManagerApi
connectivityManager
;
private
boolean
isValidServerUrl
;
public
InputHostnamePresenter
(
ConnectivityManagerApi
connectivityManager
)
{
this
.
connectivityManager
=
connectivityManager
;
...
...
@@ -35,10 +36,11 @@ public class InputHostnamePresenter extends BasePresenter<InputHostnameContract.
final
Disposable
subscription
=
ServerPolicyHelper
.
isApiVersionValid
(
validationHelper
)
.
subscribeOn
(
AndroidSchedulers
.
from
(
BackgroundLooper
.
get
()))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doOnTerminate
(()
->
view
.
hideLoader
())
.
doOnTerminate
(()
->
view
.
hideLoader
(
isValidServerUrl
))
.
subscribe
(
serverValidation
->
{
if
(
serverValidation
.
isValid
())
{
isValidServerUrl
=
true
;
onServerValid
(
hostname
,
serverValidation
.
usesSecureConnection
());
}
else
{
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