Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
3a35797a
Commit
3a35797a
authored
Oct 01, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure latest query is shown in explore fragment
parent
4c971757
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
app/src/main/java/app/insti/fragment/ExploreFragment.java
app/src/main/java/app/insti/fragment/ExploreFragment.java
+11
-1
No files found.
app/src/main/java/app/insti/fragment/ExploreFragment.java
View file @
3a35797a
...
...
@@ -49,6 +49,8 @@ public class ExploreFragment extends Fragment {
private
FeedAdapter
eventsAdapter
;
private
UserAdapter
userAdapter
;
private
String
currentQuery
=
null
;
public
ExploreFragment
()
{
// Required empty public constructor
}
...
...
@@ -124,17 +126,25 @@ public class ExploreFragment extends Fragment {
return
inflater
.
inflate
(
R
.
layout
.
fragment_explore
,
container
,
false
);
}
public
void
doSearch
(
String
query
)
{
public
void
doSearch
(
final
String
query
)
{
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
// Show loading spinner
getView
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
VISIBLE
);
// Set the lastest query
currentQuery
=
query
;
// Make request
RetrofitInterface
retrofitInterface
=
((
MainActivity
)
getActivity
()).
getRetrofitInterface
();
retrofitInterface
.
search
(
sessionId
,
query
).
enqueue
(
new
EmptyCallback
<
ExploreResponse
>()
{
@Override
public
void
onResponse
(
Call
<
ExploreResponse
>
call
,
Response
<
ExploreResponse
>
response
)
{
// Check if we already have a new query pending
if
(!
currentQuery
.
equals
(
query
))
{
return
;
}
// Get data
bodies
=
response
.
body
().
getBodies
();
events
=
response
.
body
().
getEvents
();
...
...
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