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
fa3b6d1b
Commit
fa3b6d1b
authored
Oct 27, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preserve Explore search results on going back
parent
7e2defa8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
app/src/main/java/app/insti/fragment/ExploreFragment.java
app/src/main/java/app/insti/fragment/ExploreFragment.java
+9
-4
No files found.
app/src/main/java/app/insti/fragment/ExploreFragment.java
View file @
fa3b6d1b
...
@@ -84,6 +84,8 @@ public class ExploreFragment extends Fragment {
...
@@ -84,6 +84,8 @@ public class ExploreFragment extends Fragment {
Toolbar
toolbar
=
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
Toolbar
toolbar
=
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
toolbar
.
setTitle
(
"Explore"
);
toolbar
.
setTitle
(
"Explore"
);
final
EditText
searchEditText
=
getView
().
findViewById
(
R
.
id
.
explore_search
);
// Get all bodies
// Get all bodies
if
(
allBodies
.
size
()
==
0
)
{
if
(
allBodies
.
size
()
==
0
)
{
RetrofitInterface
retrofitInterface
=
Utils
.
getRetrofitInterface
();
RetrofitInterface
retrofitInterface
=
Utils
.
getRetrofitInterface
();
...
@@ -95,14 +97,16 @@ public class ExploreFragment extends Fragment {
...
@@ -95,14 +97,16 @@ public class ExploreFragment extends Fragment {
updateAdapter
(
allBodies
,
new
ArrayList
<
Event
>(),
new
ArrayList
<
User
>());
updateAdapter
(
allBodies
,
new
ArrayList
<
Event
>(),
new
ArrayList
<
User
>());
}
}
});
});
}
else
{
// Check if search box is not empty
if
(
searchEditText
.
getText
()
!=
null
&&
!
searchEditText
.
getText
().
toString
().
equals
(
""
))
{
updateAdapter
(
bodies
,
events
,
users
);
}
else
{
}
else
{
updateAdapter
(
allBodies
,
new
ArrayList
<
Event
>(),
new
ArrayList
<
User
>());
updateAdapter
(
allBodies
,
new
ArrayList
<
Event
>(),
new
ArrayList
<
User
>());
}
getView
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
getView
().
findViewById
(
R
.
id
.
loadingPanel
).
setVisibility
(
View
.
GONE
);
}
}
// Search on text change in search
final
EditText
searchEditText
=
getView
().
findViewById
(
R
.
id
.
explore_search
);
// Close keyboard on search click
// Close keyboard on search click
searchEditText
.
setOnEditorActionListener
(
new
TextView
.
OnEditorActionListener
()
{
searchEditText
.
setOnEditorActionListener
(
new
TextView
.
OnEditorActionListener
()
{
@Override
@Override
...
@@ -115,6 +119,7 @@ public class ExploreFragment extends Fragment {
...
@@ -115,6 +119,7 @@ public class ExploreFragment extends Fragment {
}
}
});
});
// Search on text change in search
searchEditText
.
addTextChangedListener
(
new
TextWatcher
()
{
searchEditText
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
...
...
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