use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RendeVousFragment method getTeachers.
private void getTeachers() {
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_TEACHERS, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
JSONArray teachers = response;
if (GRID_LAYOUT) {
lstView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
lstView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
lstView.setHasFixedSize(true);
//Use this now
lstView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
//lstView.setAdapter(new TeachersAdapter(teachers));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class NoteFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
ButterKnife.bind(this, view);
mReceiver = new DataReceiver(new Handler());
mReceiver.setReceiver(this);
if (GRID_LAYOUT) {
mRecyclerView.setLayoutManager(new GridLayoutManager(getActivity(), 2));
} else {
mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
mRecyclerView.setHasFixedSize(true);
//Use this now
mRecyclerView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
getNoteByStudent();
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RendezVousActivity method getTeachersSearcheed.
private void getTeachersSearcheed(final String newTextS) {
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_TEACHERS, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
JSONArray teachers = response;
if (GRID_LAYOUT) {
lstView.setLayoutManager(new GridLayoutManager(RendezVousActivity.this, 2));
} else {
lstView.setLayoutManager(new LinearLayoutManager(RendezVousActivity.this));
}
lstView.setHasFixedSize(true);
//Use this now
lstView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
//Search action
JSONArray lstFound = new JSONArray();
JSONObject item = null;
for (int i = 0; i < teachers.length(); i++) {
try {
item = teachers.getJSONObject(i);
} catch (JSONException e) {
e.printStackTrace();
}
try {
if (item.getString("name").contains(newTextS) || item.getString("lastname").contains(newTextS)) {
lstFound.put(item);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
/*ArrayAdapter adapter = new ArrayAdapter(RendeVous.this, android.R.layout.simple_list_item_1, lstFound);
lstView.setAdapter(adapter);*/
lstView.setAdapter(new TeachersAdapter(lstFound, (TeachersAdapter.AdapterInterface) RendezVousActivity.this));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
}
use of com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator in project easy by MehdiBenmesa.
the class RendezVousActivity method getTeachers.
private void getTeachers() {
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_TEACHERS, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
JSONArray teachers = response;
if (GRID_LAYOUT) {
lstView.setLayoutManager(new GridLayoutManager(RendezVousActivity.this, 2));
} else {
lstView.setLayoutManager(new LinearLayoutManager(RendezVousActivity.this));
}
lstView.setHasFixedSize(true);
//Use this now
lstView.addItemDecoration(new MaterialViewPagerHeaderDecorator());
lstView.setAdapter(new TeachersAdapter(teachers, (TeachersAdapter.AdapterInterface) RendezVousActivity.this));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
}
Aggregations