Search in sources :

Example 31 with Group

use of com.instructure.canvasapi2.models.Group in project instructure-android by instructure.

the class PeopleListPresenter method setCanvasContextList.

public void setCanvasContextList(ArrayList<CanvasContext> canvasContextList) {
    mCanvasContextList.clear();
    mGroupUserCallback.reset();
    clearData();
    for (CanvasContext canvasContext : canvasContextList) {
        if (CanvasContext.Type.isGroup(canvasContext)) {
            // make api call to get group members
            getGroupUsers(canvasContext);
        }
        // add it to the list so we can search for sections and remember which contexts we have selected if the user re-opens the dialog
        mCanvasContextList.add(canvasContext);
    }
    // we've made api calls to get the groups, now filter the rest
    filterCanvasContexts();
}
Also used : CanvasContext(com.instructure.canvasapi2.models.CanvasContext)

Aggregations

Group (com.instructure.canvasapi2.models.Group)17 ArrayList (java.util.ArrayList)12 List (java.util.List)9 Test (org.junit.Test)9 NonNull (android.support.annotation.NonNull)8 RestBuilder (com.instructure.canvasapi2.builders.RestBuilder)8 RestParams (com.instructure.canvasapi2.builders.RestParams)8 Course (com.instructure.canvasapi2.models.Course)7 CanvasContext (com.instructure.canvasapi2.models.CanvasContext)6 StatusCallback (com.instructure.canvasapi2.StatusCallback)5 ExhaustiveListCallback (com.instructure.canvasapi2.utils.ExhaustiveListCallback)5 Bundle (android.os.Bundle)3 View (android.view.View)3 ModuleItem (com.instructure.canvasapi2.models.ModuleItem)3 ApiType (com.instructure.canvasapi2.utils.ApiType)3 LinkHeaders (com.instructure.canvasapi2.utils.LinkHeaders)3 Response (retrofit2.Response)3 RecyclerView (android.support.v7.widget.RecyclerView)2 ViewGroup (android.view.ViewGroup)2 AdapterView (android.widget.AdapterView)2