@@ -0,0 +1,2930 @@
+/*%0A * Copyright 2015 Quality and Usability Lab, Telekom Innvation Laboratories, TU Berlin..%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage de.tel.moccha.activities.fragments.course;%0A%0Aimport android.os.Bundle;%0Aimport de.tel.moccha.entities.course.Course;%0Aimport de.tel.moccha.entities.course.CourseCategory;%0Aimport de.zell.android.util.fragments.EntityListFragment;%0Aimport java.util.List;%0A%0A/**%0A * Represents a factory for the course category list and course list fragments.%0A * For a given content category the corresponding entity list fragment will be created%0A * with the given list values.%0A * %0A * @author Christopher Zell %3Czelldon91@googlemail.com%3E%0A */%0Apublic class ListFragmentFactory %7B%0A%0A  /**%0A   * Creates for the given content category the corresponding entity list fragment.%0A   * %0A   * @param category the category which is chosen%0A   * @param values the values for the list view%0A   * @return the corresponding list view%0A   */%0A  public static EntityListFragment createListFragment(ContentCategories category, List values) %7B%0A    if (category == ContentCategories.CourseOfStudies) %7B%0A      return createCourseCategoryListFragment(values);%0A    %7D else if (category == ContentCategories.Courses) %7B%0A      return createCourseListFragment(values);%0A    %7D else %7B%0A      return null;%0A    %7D%0A  %7D%0A%0A  /**%0A   * Creates for the course category list the corresponding course category list%0A   * fragment.%0A   *%0A   * @param categories the course categories%0A   * @return the corresponding list fragment%0A   */%0A  private static EntityListFragment createCourseCategoryListFragment(List categories) %7B%0A    EntityListFragment frg = new CourseCategoryListFragment();%0A    if (categories != null) %7B%0A      Bundle args = new Bundle();%0A      args.putSerializable(EntityListFragment.ARG_ENTITIES, categories.toArray(new CourseCategory%5Bcategories.size()%5D));%0A      frg.setArguments(args);%0A    %7D%0A    return frg;%0A  %7D%0A%0A  /**%0A   * Creates for the course list the corresponding course list fragment.%0A   *%0A   * @param courses the courses%0A   * @return the corresponding list fragment%0A   */%0A  private static EntityListFragment createCourseListFragment(List courses) %7B%0A    EntityListFragment frg = new CourseListFragment();%0A    if (courses != null) %7B%0A      Bundle args = new Bundle();%0A      args.putSerializable(EntityListFragment.ARG_ENTITIES, courses.toArray(new Course%5Bcourses.size()%5D));%0A      frg.setArguments(args);%0A    %7D%0A    return frg;%0A  %7D%0A%0A%7D%0A

Create a list fragment view factory