+/* 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 <http://www.gnu.org/licenses/>.
+ */
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;
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.
public void updateContainerView(View view) {
- SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
+ 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);
TextView location = (TextView) view.findViewById(R.id.location);
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);
+ }
}