use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.
the class NoteService method getNoteByStudentByModule.
public void getNoteByStudentByModule(String moduleId, final INote callBack) throws JSONException {
System.out.println("AVANT ABSENCE 2 ");
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_NOTE_BY_MODULES + "/" + App.getInstance().getUser().getString("_id") + "/" + moduleId, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
callBack.onDataReceived(response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
}
use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.
the class AbsenceService method getAbsneceBySeance.
public void getAbsneceBySeance(String idSeance, final IAbsence callBack) {
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_ABSENCE_BY_SEANCE + "/" + idSeance, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
callBack.onDataReceived(response);
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
}
use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.
the class RendeVousFragment 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(getActivity(), 2));
} else {
lstView.setLayoutManager(new LinearLayoutManager(getActivity()));
}
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));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
}
use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.
the class NoteFragment method getNoteByStudent.
public void getNoteByStudent() {
try {
System.out.println("AVANT ABSENCE 2 ");
CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_NOTE_BY_MODULES + "/" + user.getString("_id") + "/" + moduleID, null, new Response.Listener<JSONArray>() {
@Override
public void onResponse(JSONArray response) {
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());
mRecyclerView.setAdapter(new NoteAdapter(response));
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
}
});
App.getInstance().addToRequestQueue(jsonReq);
} catch (JSONException e) {
e.printStackTrace();
}
}
use of dz.easy.androidclient.Util.CustomRequestArray 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);
}
Aggregations