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
1934aae1
Commit
1934aae1
authored
Aug 16, 2017
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update SidebarMainFragment.java
parent
45c2e5dc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
10 deletions
+6
-10
SidebarMainFragment.java
.../rocket/android/fragment/sidebar/SidebarMainFragment.java
+6
-10
No files found.
app/src/main/java/chat/rocket/android/fragment/sidebar/SidebarMainFragment.java
View file @
1934aae1
...
@@ -48,6 +48,8 @@ import java.util.ArrayList;
...
@@ -48,6 +48,8 @@ import java.util.ArrayList;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
rx.Subscriber
;
import
rx.functions.Action1
;
public
class
SidebarMainFragment
extends
AbstractFragment
implements
SidebarMainContract
.
View
{
public
class
SidebarMainFragment
extends
AbstractFragment
implements
SidebarMainContract
.
View
{
private
SidebarMainContract
.
Presenter
presenter
;
private
SidebarMainContract
.
Presenter
presenter
;
...
@@ -55,7 +57,6 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -55,7 +57,6 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
private
String
hostname
;
private
String
hostname
;
private
MethodCallHelper
methodCallHelper
;
private
MethodCallHelper
methodCallHelper
;
private
RealmSpotlightRepository
realmSpotlightRepository
;
private
SearchView
searchView
;
private
SearchView
searchView
;
private
static
final
String
HOSTNAME
=
"hostname"
;
private
static
final
String
HOSTNAME
=
"hostname"
;
...
@@ -83,7 +84,6 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -83,7 +84,6 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
hostname
=
args
==
null
?
null
:
args
.
getString
(
HOSTNAME
);
hostname
=
args
==
null
?
null
:
args
.
getString
(
HOSTNAME
);
methodCallHelper
=
new
MethodCallHelper
(
getContext
(),
hostname
);
methodCallHelper
=
new
MethodCallHelper
(
getContext
(),
hostname
);
realmSpotlightRepository
=
new
RealmSpotlightRepository
(
hostname
);
RealmUserRepository
userRepository
=
new
RealmUserRepository
(
hostname
);
RealmUserRepository
userRepository
=
new
RealmUserRepository
(
hostname
);
...
@@ -100,7 +100,8 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -100,7 +100,8 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
userRepository
,
userRepository
,
new
RocketChatCache
(
getContext
()),
new
RocketChatCache
(
getContext
()),
absoluteUrlHelper
,
absoluteUrlHelper
,
TextUtils
.
isEmpty
(
hostname
)
?
null
:
new
MethodCallHelper
(
getContext
(),
hostname
)
TextUtils
.
isEmpty
(
hostname
)
?
null
:
new
MethodCallHelper
(
getContext
(),
hostname
),
new
RealmSpotlightRepository
(
hostname
)
);
);
}
}
...
@@ -175,15 +176,10 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
...
@@ -175,15 +176,10 @@ public class SidebarMainFragment extends AbstractFragment implements SidebarMain
return
Observable
.
just
(
Collections
.<
Spotlight
>
emptyList
());
return
Observable
.
just
(
Collections
.<
Spotlight
>
emptyList
());
}
else
{
}
else
{
adapter
.
setMode
(
RoomListAdapter
.
MODE_SPOTLIGHT
);
adapter
.
setMode
(
RoomListAdapter
.
MODE_SPOTLIGHT
);
final
String
queryString
=
charSequence
.
toString
();
return
presenter
.
searchSpotlight
(
charSequence
.
toString
()).
toObservable
();
methodCallHelper
.
searchSpotlight
(
queryString
);
return
realmSpotlightRepository
.
getSuggestionsFor
(
queryString
,
SortDirection
.
ASC
,
10
).
toObservable
();
}
}
})
})
.
subscribe
(
.
subscribe
(
this
::
showSearchSuggestions
,
Logger:
:
report
);
this
::
showSearchSuggestions
,
Logger:
:
report
);
}
}
private
void
showSearchSuggestions
(
List
<
Spotlight
>
spotlightList
)
{
private
void
showSearchSuggestions
(
List
<
Spotlight
>
spotlightList
)
{
...
...
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