1 package de.dhbwloe.campusapp.fragments;
3 import android.content.Context;
4 import android.os.Bundle;
5 import android.view.LayoutInflater;
6 import android.view.View;
7 import android.widget.TextView;
9 import java.text.SimpleDateFormat;
10 import java.util.Date;
12 import de.dhbwloe.campusapp.CampusAppContext;
13 import de.dhbwloe.campusapp.R;
14 import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
15 import de.dhbwloe.campusapp.vorlesungen.CourseGroup;
18 * Created by pk910 on 20.02.2016.
20 public class VorlesungsplanUpcomingCourseListItem {
21 private CourseEvent event;
23 public VorlesungsplanUpcomingCourseListItem(CourseEvent event) {
27 public void updateContainerView(View view) {
29 android.support.v7.widget.CardView cardView = (android.support.v7.widget.CardView) view.findViewById(R.id.card_upcomingday);
30 cardView.setOnClickListener(new View.OnClickListener() {
32 public void onClick(View v) {
37 SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_time));
38 TextView timeFrom = (TextView) view.findViewById(R.id.timeFrom);
39 TextView timeTo = (TextView) view.findViewById(R.id.timeTo);
40 TextView location = (TextView) view.findViewById(R.id.location);
41 TextView courseTitle = (TextView) view.findViewById(R.id.courseTitle);
43 Date dateFrom = (new Date(event.getEventFrom() * 1000));
44 timeFrom.setText(dateFormat.format(dateFrom));
46 Date dateTo = (new Date(event.getEventTo() * 1000));
47 timeTo.setText(dateFormat.format(dateTo));
49 location.setText(event.getEventLocation());
50 courseTitle.setText(event.getEventTitle());
53 private void onEventClicked() {
54 Bundle args = new Bundle();
55 CourseGroup group = event.getCourseGroup();
58 args.putString("groupid", Integer.toString(group.getGroupId()));
59 CampusAppContext.getInstance().getNavigationManager().navigatePage("Vorlesungsplan", args);