Search in sources :

Example 1 with CustomRequestArray

use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.

the class ModuleService method getModulesByStudent.

public void getModulesByStudent(final IModule callBack) {
    try {
        CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_MODULES_BY_STUDENT + "/" + App.getInstance().getUser().getString("section") + "/" + App.getInstance().getUser().getString("groupe"), null, new Response.Listener<JSONArray>() {

            @Override
            public void onResponse(JSONArray response) {
                callBack.onDataRecieved(response);
            }
        }, new Response.ErrorListener() {

            @Override
            public void onErrorResponse(VolleyError error) {
            }
        });
        App.getInstance().addToRequestQueue(jsonReq);
    } catch (JSONException e) {
        e.printStackTrace();
    }
}
Also used : Response(com.android.volley.Response) VolleyError(com.android.volley.VolleyError) CustomRequestArray(dz.easy.androidclient.Util.CustomRequestArray) JSONArray(org.json.JSONArray) JSONException(org.json.JSONException)

Example 2 with CustomRequestArray

use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.

the class ModuleService method getModulesByTeacher.

private void getModulesByTeacher(final IModule callBack) throws JSONException {
    // dialogListner.showDialog();
    /* Starting Download Service */
    CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_MODULES_BY_TEACHER + "/" + App.getInstance().getUser().getString("_id"), null, new Response.Listener<JSONArray>() {

        @Override
        public void onResponse(JSONArray response) {
            callBack.onDataRecieved(response);
        }
    }, new Response.ErrorListener() {

        @Override
        public void onErrorResponse(VolleyError error) {
        }
    });
    App.getInstance().addToRequestQueue(jsonReq);
}
Also used : Response(com.android.volley.Response) VolleyError(com.android.volley.VolleyError) CustomRequestArray(dz.easy.androidclient.Util.CustomRequestArray) JSONArray(org.json.JSONArray)

Example 3 with CustomRequestArray

use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.

the class AbsenceService method getAbsenceByStudentByModule.

public void getAbsenceByStudentByModule(String moduleID, final IAbsence callBack) throws JSONException {
    CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_ABSENCE_BY_STUDENT + "/" + 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);
}
Also used : Response(com.android.volley.Response) VolleyError(com.android.volley.VolleyError) CustomRequestArray(dz.easy.androidclient.Util.CustomRequestArray) JSONArray(org.json.JSONArray)

Example 4 with CustomRequestArray

use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.

the class RendezVousService method getRendeVousByStudent.

private void getRendeVousByStudent(String rdvState, final IRendezVous callBack) throws JSONException {
    CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_RDV_BY_STUDENT + "/" + rdvState + "/" + App.getInstance().getUser().getString("_id"), null, new Response.Listener<JSONArray>() {

        @Override
        public void onResponse(JSONArray response) {
            callBack.onDataRecieved(response);
        // recyclerViewRendeVous.setAdapter(new TestRecyclerViewAdapter(response));
        }
    }, new Response.ErrorListener() {

        @Override
        public void onErrorResponse(VolleyError error) {
        }
    });
    App.getInstance().addToRequestQueue(jsonReq);
}
Also used : Response(com.android.volley.Response) VolleyError(com.android.volley.VolleyError) CustomRequestArray(dz.easy.androidclient.Util.CustomRequestArray) JSONArray(org.json.JSONArray)

Example 5 with CustomRequestArray

use of dz.easy.androidclient.Util.CustomRequestArray in project easy by MehdiBenmesa.

the class RendezVousService method getRendezVousByTeacher.

private void getRendezVousByTeacher(String rdvState, final IRendezVous callBack) throws JSONException {
    CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_RDV_BY_TEACHER + "/" + rdvState + "/" + App.getInstance().getUser().getString("_id"), null, new Response.Listener<JSONArray>() {

        @Override
        public void onResponse(JSONArray response) {
            callBack.onDataRecieved(response);
        // recyclerViewRendeVous.setAdapter(new TestRecyclerViewAdapter(response));
        }
    }, new Response.ErrorListener() {

        @Override
        public void onErrorResponse(VolleyError error) {
        }
    });
    App.getInstance().addToRequestQueue(jsonReq);
}
Also used : Response(com.android.volley.Response) VolleyError(com.android.volley.VolleyError) CustomRequestArray(dz.easy.androidclient.Util.CustomRequestArray) JSONArray(org.json.JSONArray)

Aggregations

Response (com.android.volley.Response)18 VolleyError (com.android.volley.VolleyError)18 CustomRequestArray (dz.easy.androidclient.Util.CustomRequestArray)18 JSONArray (org.json.JSONArray)18 GridLayoutManager (android.support.v7.widget.GridLayoutManager)6 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)6 MaterialViewPagerHeaderDecorator (com.github.florent37.materialviewpager.header.MaterialViewPagerHeaderDecorator)6 JSONException (org.json.JSONException)5 TeachersAdapter (dz.easy.androidclient.Adapters.TeachersAdapter)2 JSONObject (org.json.JSONObject)2 NoteAdapter (dz.easy.androidclient.Adapters.NoteAdapter)1