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
fad9b717
Commit
fad9b717
authored
Oct 13, 2018
by
Sajal Narang
Committed by
GitHub
Oct 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #228 from wncc/explore-patch1
Fix Explore data retention bugs
parents
eb245a15
7aaede54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
app/src/main/java/app/insti/fragment/ExploreFragment.java
app/src/main/java/app/insti/fragment/ExploreFragment.java
+12
-8
No files found.
app/src/main/java/app/insti/fragment/ExploreFragment.java
View file @
fad9b717
...
...
@@ -37,12 +37,11 @@ import retrofit2.Response;
*/
public
class
ExploreFragment
extends
Fragment
{
private
String
sessionId
;
private
static
List
<
Body
>
allBodies
=
new
ArrayList
<>();
private
static
List
<
Body
>
bodies
=
new
ArrayList
<>();
private
static
List
<
Event
>
events
=
new
ArrayList
<>();
private
static
List
<
User
>
users
=
new
ArrayList
<>();
private
String
sessionId
;
private
BodyAdapter
bodyAdapter
;
private
FeedAdapter
eventsAdapter
;
private
UserAdapter
userAdapter
;
...
...
@@ -93,7 +92,7 @@ public class ExploreFragment extends Fragment {
}
});
}
else
{
updateAdapters
(
bodies
,
events
,
users
);
updateAdapters
(
allBodies
,
new
ArrayList
<
Event
>(),
new
ArrayList
<
User
>()
);
getView
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
}
...
...
@@ -101,16 +100,21 @@ public class ExploreFragment extends Fragment {
final
EditText
searchEditText
=
getView
().
findViewById
(
R
.
id
.
explore_search
);
searchEditText
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{}
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
// Do nothing
}
@Override
public
void
onTextChanged
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{}
public
void
onTextChanged
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{
// Do nothing
}
@Override
public
void
afterTextChanged
(
Editable
s
)
{
if
(
searchEditText
.
getText
().
length
()
>=
3
)
{
currentQuery
=
s
.
toString
();
if
(
currentQuery
.
length
()
>=
3
)
{
doSearch
(
searchEditText
.
getText
().
toString
());
}
else
if
(
searchEditText
.
getText
()
.
length
()
==
0
)
{
}
else
if
(
currentQuery
.
length
()
==
0
)
{
updateAdapters
(
allBodies
,
new
ArrayList
<
Event
>(),
new
ArrayList
<
User
>());
}
}
...
...
@@ -188,4 +192,4 @@ public class ExploreFragment extends Fragment {
usersRecyclerView
.
setAdapter
(
userAdapter
);
usersRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
}
}
}
\ No newline at end of file
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