Search in sources :

Example 6 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 7 with CustomRequestArray

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

the class GroupService method getGroupsByModuleByTeacher.

public void getGroupsByModuleByTeacher(final IGroupe callBack, String moduleId) {
    try {
        CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_GROUPS_BY_TEACHER_MODULE + "/" + moduleId + "/" + 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);
    } 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 8 with CustomRequestArray

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

the class ModuleService method getTeachers.

private void getTeachers(final IModule callBack) {
    CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_TEACHERS, null, new Response.Listener<JSONArray>() {

        @Override
        public void onResponse(JSONArray response) {
            //setup materialviewpager
            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 9 with CustomRequestArray

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

the class AbsenceService method getAbsenceByStudent.

private void getAbsenceByStudent(final IAbsence callBack) throws JSONException {
    CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_ABSENCE_BY_STUDENT + "/" + App.getInstance().getUser().get("_id"), 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 10 with CustomRequestArray

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

the class NoteService method getNotesByStudent.

private void getNotesByStudent(final INote callBack) throws JSONException {
    CustomRequestArray jsonReq = new CustomRequestArray(Request.Method.GET, GET_NOTE_BY_STUDENT + "/" + App.getInstance().getUser().get("_id"), 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)

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