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
7e2defa8
Commit
7e2defa8
authored
Oct 27, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup, make minor tweaks to Explore
parent
d78ef929
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
14 deletions
+22
-14
app/src/main/java/app/insti/fragment/ExploreFragment.java
app/src/main/java/app/insti/fragment/ExploreFragment.java
+18
-1
app/src/main/res/layout/fragment_explore.xml
app/src/main/res/layout/fragment_explore.xml
+4
-13
No files found.
app/src/main/java/app/insti/fragment/ExploreFragment.java
View file @
7e2defa8
...
...
@@ -8,16 +8,20 @@ import android.support.v7.widget.RecyclerView;
import
android.support.v7.widget.Toolbar
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.view.KeyEvent
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.inputmethod.EditorInfo
;
import
android.widget.EditText
;
import
android.widget.TextView
;
import
java.util.ArrayList
;
import
java.util.List
;
import
app.insti.R
;
import
app.insti.Utils
;
import
app.insti.activity.MainActivity
;
import
app.insti.adapter.GenericAdapter
;
import
app.insti.api.EmptyCallback
;
import
app.insti.api.RetrofitInterface
;
...
...
@@ -98,6 +102,19 @@ public class ExploreFragment extends Fragment {
// Search on text change in search
final
EditText
searchEditText
=
getView
().
findViewById
(
R
.
id
.
explore_search
);
// Close keyboard on search click
searchEditText
.
setOnEditorActionListener
(
new
TextView
.
OnEditorActionListener
()
{
@Override
public
boolean
onEditorAction
(
TextView
v
,
int
actionId
,
KeyEvent
event
)
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
MainActivity
.
hideKeyboard
(
getActivity
());
return
true
;
}
return
false
;
}
});
searchEditText
.
addTextChangedListener
(
new
TextWatcher
()
{
@Override
public
void
beforeTextChanged
(
CharSequence
s
,
int
start
,
int
count
,
int
after
)
{
...
...
@@ -176,7 +193,7 @@ public class ExploreFragment extends Fragment {
public
void
initRecyclerView
()
{
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
RecyclerView
bodiesRecyclerView
=
getView
().
findViewById
(
R
.
id
.
explore_
body_
recycler_view
);
RecyclerView
bodiesRecyclerView
=
getView
().
findViewById
(
R
.
id
.
explore_recycler_view
);
genericAdapter
=
new
GenericAdapter
(
cards
,
this
);
bodiesRecyclerView
.
setAdapter
(
genericAdapter
);
bodiesRecyclerView
.
setLayoutManager
(
new
LinearLayoutManager
(
getContext
()));
...
...
app/src/main/res/layout/fragment_explore.xml
View file @
7e2defa8
...
...
@@ -23,7 +23,9 @@
android:paddingRight=
"6dp"
android:paddingTop=
"3dp"
android:textColor=
"@color/primaryTextColor"
android:textColorHint=
"@color/primaryTextColor"
/>
android:textColorHint=
"@color/primaryTextColor"
android:imeOptions=
"actionSearch"
android:inputType=
"text"
/>
<LinearLayout
android:layout_width=
"match_parent"
...
...
@@ -31,18 +33,7 @@
android:orientation=
"vertical"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/explore_body_recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/explore_event_recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/explore_user_recycler_view"
android:id=
"@+id/explore_recycler_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
...
...
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