Commit 2ff1ba14 authored by Fabius's avatar Fabius Committed by Toni Beier

Veranstaltungstypen werden nun im Stundenplan angezeigt #

parent 7aa6e1cf
......@@ -88,6 +88,53 @@ public class TimetableAdapter extends CategoryListViewAdapter<Course> {
return key;
}
private static String parseLectureType(Context context,int type){
String key = "n/a";
switch (type){
case 1:
key = context.getResources().getString(R.string.module_timetable_course_type_lecture);
break;
case 2:
key = context.getResources().getString(R.string.module_timetable_course_type_tutorial);
break;
case 3:
key = context.getResources().getString(R.string.module_timetable_course_type_intership);
break;
case 4:
key = context.getResources().getString(R.string.module_timetable_course_type_seminar);
break;
case 5:
key = context.getResources().getString(R.string.module_timetable_course_type_exercise);
break;
case 6:
key = context.getResources().getString(R.string.module_timetable_course_type_advanced_seminar);
break;
case 7:
key = context.getResources().getString(R.string.module_timetable_course_type_proseminar);
break;
case 8:
key = context.getResources().getString(R.string.module_timetable_course_type_oberseminar);
break;
case 9:
key = context.getResources().getString(R.string.module_timetable_course_type_excursion);
break;
case 10:
key = context.getResources().getString(R.string.module_timetable_course_type_colloquium);
break;
case 11:
key = context.getResources().getString(R.string.module_timetable_course_type_project);
break;
case 12:
key = context.getResources().getString(R.string.module_timetable_course_type_exam);
break;
case 0:
key = context.getResources().getString(R.string.module_timetable_course_type_other);
default:
break;
}
return key;
}
@Override
protected LinearLayout addItemView(final int position, final LayoutInflater inflater) {
final Course item = (Course) getItem(position);
......@@ -96,10 +143,17 @@ public class TimetableAdapter extends CategoryListViewAdapter<Course> {
addTitle(item, row);
addDescription(item, row);
addTime(item, row);
addType(item, row);
addCallback(item, row, getCallback());
return row;
}
private void addType(Course item, LinearLayout row) {
final String type = parseLectureType(getContext(),item.getType());
final TextView typeView = (TextView) row.findViewById(R.id.listItemType);
typeView.setText(type);
}
private void addTime(final Course course, final LinearLayout row) {
final String time = getTime(course);
final TextView timeView = (TextView) row.findViewById(R.id.timeTableTimeView);
......
......@@ -68,6 +68,9 @@ public class Course extends AbstractDatabaseObject implements IListItem {
private String titleAndRoom;
@AsistColumnDescription(position = 2)
@AsistDescription
@ASiSTDetail(i18nKey = "timetable_lecturer_title", position = 6)
@DatabaseField
private Integer type;
......
......@@ -2,8 +2,12 @@ package de.bps.asist.module.timetable.model;
import android.content.Context;
import com.j256.ormlite.field.DatabaseField;
import java.io.Serializable;
import java.util.Collection;
import de.bps.asist.R;
import de.bps.asist.core.annotation.ASiSTDetail;
import de.bps.asist.module.poi.PoiModule;
import de.bps.asist.module.poi.model.PoiItem;
......@@ -32,12 +36,16 @@ public class CourseDescription implements Serializable {
@ASiSTDetail(i18nKey = "module_course_detail_description", position = 5)
private String desc;
@ASiSTDetail(i18nKey = "timetable_lecture_type", position = 6)
private String types;
private PoiItem poi;
private CourseTimespan timeSpan;
private Course course;
private Integer type;
public CourseDescription(Context context, Course course) {
......@@ -68,6 +76,8 @@ public class CourseDescription implements Serializable {
}
}
timeSpan = course.getCourseTime();
type = course.getType();
types = parseLectureType(context,type);
}
public String getLecturer() {
......@@ -138,4 +148,67 @@ public class CourseDescription implements Serializable {
this.desc = desc;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
private static String parseLectureType(Context context,int type){
String key = "n/a";
switch (type){
case 1:
key = context.getResources().getString(R.string.module_timetable_course_type_lecture);
break;
case 2:
key = context.getResources().getString(R.string.module_timetable_course_type_tutorial);
break;
case 3:
key = context.getResources().getString(R.string.module_timetable_course_type_intership);
break;
case 4:
key = context.getResources().getString(R.string.module_timetable_course_type_seminar);
break;
case 5:
key = context.getResources().getString(R.string.module_timetable_course_type_exercise);
break;
case 6:
key = context.getResources().getString(R.string.module_timetable_course_type_advanced_seminar);
break;
case 7:
key = context.getResources().getString(R.string.module_timetable_course_type_proseminar);
break;
case 8:
key = context.getResources().getString(R.string.module_timetable_course_type_oberseminar);
break;
case 9:
key = context.getResources().getString(R.string.module_timetable_course_type_excursion);
break;
case 10:
key = context.getResources().getString(R.string.module_timetable_course_type_colloquium);
break;
case 11:
key = context.getResources().getString(R.string.module_timetable_course_type_project);
break;
case 12:
key = context.getResources().getString(R.string.module_timetable_course_type_exam);
break;
case 0:
key = context.getResources().getString(R.string.module_timetable_course_type_other);
default:
break;
}
return key;
}
public String getTypes() {
return types;
}
public void setTypes(String types) {
this.types = types;
}
}
......@@ -52,6 +52,14 @@
android:layout_height="wrap_content"
android:textColor="@color/descColor"
android:text="Description"/>
<TextView
android:id="@+id/listItemType"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textColor="@color/descColor"
android:textSize="@dimen/descTextSize"
android:text="@string/module_timetable_course_type_other"/>
</LinearLayout>
......
......@@ -191,6 +191,20 @@
<string name="generic_list_showmore">Show more</string>
<!-- timetable -->
<string name="module_timetable_course_type_other">other</string>
<string name="module_timetable_course_type_lecture">lecture</string>
<string name="module_timetable_course_type_tutorial">tutorial</string>
<string name="module_timetable_course_type_intership">intership</string>
<string name="module_timetable_course_type_seminar">seminar</string>
<string name="module_timetable_course_type_exercise">exercise</string>
<string name="module_timetable_course_type_advanced_seminar">advanced seminar</string>
<string name="module_timetable_course_type_proseminar">proseminar</string>
<string name="module_timetable_course_type_oberseminar">oberseminar</string>
<string name="module_timetable_course_type_excursion">excursion</string>
<string name="module_timetable_course_type_colloquium">colloquium</string>
<string name="module_timetable_course_type_project">project</string>
<string name="module_timetable_course_type_exam">exam</string>
<string name="timetable_lecture_type">type:</string>
<!-- Feedback Module -->
<string name="module_feedback_name">Lecture feedback</string>
......
......@@ -200,6 +200,21 @@
<!-- timetable -->
<string name="module_timetable_course_code_not_found" formatted="false">Aktualisierung konnte nicht durchgeführt werden.\nImportieren Sie zuerst Ihren Stundenplan.</string>
<string name="module_timetable_course_update_failure" formatted="false">Während der Aktualisierung des Stundplanes ist ein Fehler aufgetreten</string>
<string name="module_timetable_course_type_other">Sonstiges</string>
<string name="module_timetable_course_type_lecture">Vorlesung</string>
<string name="module_timetable_course_type_tutorial">Tutorium</string>
<string name="module_timetable_course_type_intership">Praktikum</string>
<string name="module_timetable_course_type_seminar">Seminar</string>
<string name="module_timetable_course_type_exercise">Übung</string>
<string name="module_timetable_course_type_advanced_seminar">Hauptseminar</string>
<string name="module_timetable_course_type_proseminar">Proseminar</string>
<string name="module_timetable_course_type_oberseminar">Oberseminar</string>
<string name="module_timetable_course_type_excursion">Exkursion</string>
<string name="module_timetable_course_type_colloquium">Kolloquium</string>
<string name="module_timetable_course_type_project">Projekt</string>
<string name="module_timetable_course_type_exam">Klausur</string>
<string name="timetable_lecture_type">Art:</string>
<!-- Feedback Module -->
<string name="module_feedback_name">Vorlesungs-Feedback</string>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment