X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fde%2Fdhbwloe%2Fcampusapp%2Ffragments%2FVorlesungsplanUpcomingCourseListItem.java;h=41b8f7c3680dcfe3bb50a3d63b3c1a2471d919a4;hb=48e758721a39298a85c69ecc7267f3daf6993e78;hp=6fc45f45227d8d834faa3751c4e9f7c929a8efe0;hpb=cea4ee15ef92f521ae962404bd1b3c25042219fa;p=DHBWCampusApp.git diff --git a/app/src/main/java/de/dhbwloe/campusapp/fragments/VorlesungsplanUpcomingCourseListItem.java b/app/src/main/java/de/dhbwloe/campusapp/fragments/VorlesungsplanUpcomingCourseListItem.java index 6fc45f4..41b8f7c 100644 --- a/app/src/main/java/de/dhbwloe/campusapp/fragments/VorlesungsplanUpcomingCourseListItem.java +++ b/app/src/main/java/de/dhbwloe/campusapp/fragments/VorlesungsplanUpcomingCourseListItem.java @@ -1,6 +1,21 @@ +/* VorlesungsplanUpcomingCourseListItem.java + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ package de.dhbwloe.campusapp.fragments; - import android.content.Context; +import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; @@ -11,6 +26,7 @@ import java.util.Date; import de.dhbwloe.campusapp.CampusAppContext; import de.dhbwloe.campusapp.R; import de.dhbwloe.campusapp.vorlesungen.CourseEvent; +import de.dhbwloe.campusapp.vorlesungen.CourseGroup; /** * Created by pk910 on 20.02.2016. @@ -24,6 +40,14 @@ public class VorlesungsplanUpcomingCourseListItem { public void updateContainerView(View view) { + android.support.v7.widget.CardView cardView = (android.support.v7.widget.CardView) view.findViewById(R.id.card_upcomingday); + cardView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onEventClicked(); + } + }); + SimpleDateFormat dateFormat = new SimpleDateFormat(CampusAppContext.getInstance().getResString(R.string.timeformat_vorlesungsplan_time)); TextView timeFrom = (TextView) view.findViewById(R.id.timeFrom); TextView timeTo = (TextView) view.findViewById(R.id.timeTo); @@ -39,4 +63,13 @@ public class VorlesungsplanUpcomingCourseListItem { location.setText(event.getEventLocation()); courseTitle.setText(event.getEventTitle()); } + + private void onEventClicked() { + Bundle args = new Bundle(); + CourseGroup group = event.getCourseGroup(); + if(group == null) + return; + args.putString("groupid", Integer.toString(group.getGroupId())); + CampusAppContext.getInstance().getNavigationManager().navigatePage("Vorlesungsplan", args); + } }