dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
- testCompile 'junit:junit:4.12'
+ testCompile 'junit:junit:4.11'
compile 'org.mnode.ical4j:ical4j:1.0.5'
compile 'backport-util-concurrent:backport-util-concurrent:3.1'
compile 'commons-codec:commons-codec:1.8'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
+ compile 'com.squareup.okhttp3:mockwebserver:3.1.2'
+ compile 'com.squareup.mimecraft:mimecraft:1.1.1'
+ compile 'com.android.support:cardview-v7:23.1.1'
+ compile 'com.android.support:recyclerview-v7:23.1.1'
}
+
+
+
+
+
+
+
import de.dhbwloe.campusapp.fragments.Impressum;
import de.dhbwloe.campusapp.fragments.Mensa;
import de.dhbwloe.campusapp.fragments.MensaCard;
-import de.dhbwloe.campusapp.fragments.MensaWochenplan;
import de.dhbwloe.campusapp.fragments.News;
import de.dhbwloe.campusapp.fragments.PopupFragment;
import de.dhbwloe.campusapp.fragments.SplashScreen;
return oContextVariables;
}
+ public String getResString(int id) {
+ String str = oMainActivity.getResources().getString(id);
+ return str;
+ }
+
}
import android.support.v4.app.Fragment;
import android.view.View;
+import java.lang.reflect.Field;
+
import de.dhbwloe.campusapp.search.SearchIndices;
/**
return new SearchIndices[0];
}
+ @Override
+ public void onDetach() {
+ super.onDetach();
+
+ try {
+ Field childFragmentManager = Fragment.class.getDeclaredField("mChildFragmentManager");
+ childFragmentManager.setAccessible(true);
+ childFragmentManager.set(this, null);
+
+ } catch (NoSuchFieldException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
}
package de.dhbwloe.campusapp;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
return decrypted;
}
+ public static void removeAllChildViews(ViewGroup viewGroup) {
+ for (int i = 0; i < viewGroup.getChildCount(); i++) {
+ View child = viewGroup.getChildAt(i);
+ if (child instanceof ViewGroup) {
+ if (child instanceof AdapterView) {
+ viewGroup.removeView(child);
+ return;
+ }
+ removeAllChildViews(((ViewGroup) child));
+ } else {
+ viewGroup.removeView(child);
+ }
+ }
+ }
+
}
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
+import net.fortuna.ical4j.model.Component;
import net.fortuna.ical4j.model.DateList;
import net.fortuna.ical4j.model.DateTime;
import net.fortuna.ical4j.model.Period;
*/
public class DatabaseManager {
private static final String DATABASE_NAME = "DHBWLoe.CampusApp.DEV";
- private static final int DATABASE_VERSION = 1;
+ private static final int DATABASE_VERSION = 2;
private CampusAppContext AppContext;
private SQLiteDatabase database;
private NewsDatabaseHelper newsDBHelper;
if(version < DATABASE_VERSION)
upgradeTables(version, DATABASE_VERSION);
-
+ //database.execSQL("DELETE FROM CourseCalendar");
+ //database.execSQL("DELETE FROM CourseCalendarEvent");
}
private void upgradeTables(int oldVersion, int newVersion) {
}
if(oldVersion < 2 && newVersion >= 2) {
// Version 2
+ database.execSQL("ALTER TABLE CourseCalendarEvent ADD EventType INT;");
+ }
+ if(oldVersion < 3 && newVersion >= 3) {
+ // Version 3
}
- database.execSQL("UPDATE Version SET Version = "+Integer.toString(newVersion));
+ database.execSQL("UPDATE Version SET Version = " + Integer.toString(newVersion));
}
public void addSearchIndices(SearchIndices[] indices) {
return nfcCardData;
}
- public void updateCourseCalendar(CourseEvent event) {
+ public void updateCourseCalendar(CourseEvent event, Component cevent) {
openDatabase();
if(vorlesungsplanDBHelper == null)
vorlesungsplanDBHelper = new VorlesungsplanDatabaseHelper(AppContext, database);
- vorlesungsplanDBHelper.updateCourseCalendar(event);
+ vorlesungsplanDBHelper.updateCourseCalendar(event, cevent);
}
public CourseEvent[] getCourseCalendarEvents(String coursename, long timeFrom, long timeTo) {
return vorlesungsplanDBHelper.getCourseCalendarEvents(coursename, timeFrom, timeTo);
}
+ public CourseEvent[] getCourseCalendarTimetable(String coursename, long timeFrom, int days) {
+ openDatabase();
+ if(vorlesungsplanDBHelper == null)
+ vorlesungsplanDBHelper = new VorlesungsplanDatabaseHelper(AppContext, database);
+ return vorlesungsplanDBHelper.getCourseCalendarTimetable(coursename, timeFrom, days);
+ }
+
public CourseGroup getCourseGroup(int courseGroupId) {
openDatabase();
if(vorlesungsplanDBHelper == null)
return vorlesungsplanDBHelper.addCourseGroup(coursename, groupname);
}
+ public CourseGroup[] getCourseGroups(String coursename, Date notBefore) {
+ openDatabase();
+ if(vorlesungsplanDBHelper == null)
+ vorlesungsplanDBHelper = new VorlesungsplanDatabaseHelper(AppContext, database);
+ return vorlesungsplanDBHelper.getCourseGroups(coursename, notBefore);
+ }
+
public void updateMensaTagesplan(MensaTagesplan plan) {
openDatabase();
if(mensaplanDBHelper == null)
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
+import android.os.Bundle;
import android.util.Log;
+import net.fortuna.ical4j.model.Component;
import net.fortuna.ical4j.model.DateList;
import net.fortuna.ical4j.model.DateTime;
import net.fortuna.ical4j.model.Period;
+import net.fortuna.ical4j.model.PeriodList;
import net.fortuna.ical4j.model.Recur;
import net.fortuna.ical4j.model.parameter.Value;
import net.fortuna.ical4j.model.property.RRule;
import java.text.ParseException;
+import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.TimeZone;
import de.dhbwloe.campusapp.CampusAppContext;
import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
}
- public void updateCourseCalendar(CourseEvent event) {
+ public void updateCourseCalendar(CourseEvent event, Component cevent) {
boolean isExisting = false;
String[] whereArgs = new String[] {
event.getCourseName(),
updateValues.put("CourseGroupId", event.getCourseGroup().getGroupId());
database.update("CourseCalendar", updateValues, "CourseName = ? AND UniqueId = ?", whereArgs);
- updateCourseCalendarEventTable(event, true);
+ updateCourseCalendarEventTable(event, true, cevent);
} catch(Exception e) {
e.printStackTrace();
}
long id = database.insertOrThrow("CourseCalendar", null, indexValues);
event.setEventId((int) id);
- updateCourseCalendarEventTable(event, false);
+ updateCourseCalendarEventTable(event, false, cevent);
} catch(Exception e) {
e.printStackTrace();
}
}
- private void updateCourseCalendarEventTable(CourseEvent event, boolean clear) {
+ private void updateCourseCalendarEventTable(CourseEvent dbevent, boolean clear, Component event) {
if(clear) {
String[] whereArgs = {
- Integer.toString(event.getEventId())
+ Integer.toString(dbevent.getEventId())
};
database.rawQuery("DELETE FROM CourseCalendarEvent WHERE EventId = ?", whereArgs);
}
- String rrule = event.getRecurRule();
- String exdates = event.getExcludeDates();
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd'T'hhmmss");
+ Date startDate = new Date((dbevent.getEventFrom())*1000);
+ Date endDate = new Date(startDate.getTime() + ((long)86400 * 365)*1000);
+ Period period = new Period(new DateTime(startDate), new DateTime(endDate));
+ PeriodList recurrances = event.calculateRecurrenceSet(period);
+
+ Log.i("DBM", "Update events table for " + dbevent.getUniqueId() + " ("+dbevent.getEventTitle()+")");
+ Log.i("DBM", "events: " + recurrances.size());
+
+ for (Iterator<Period> iter = recurrances.iterator(); iter.hasNext();) {
+ Period eventper = iter.next();
- if(rrule != null && rrule.length() > 0) {
- try {
- Log.i("DBM", "RRule: " + rrule);
- RRule rule = new RRule(rrule);
- Recur recur = rule.getRecur();
- Date startDate = new Date((event.getEventFrom())*1000);
- Date endDate = new Date(startDate.getTime() + (86400 * 365)*1000);
-
- DateTime startDateTime = new DateTime(startDate);
- DateList dates = recur.getDates(startDateTime, new Period(startDateTime, new DateTime(endDate)), Value.DATE);
-
- Log.i("DBM", "Update events table for " + event.getUniqueId());
- Log.i("DBM", "events: " +dates.size());
-
- for(int i = 0; i < dates.size(); i++) {
- net.fortuna.ical4j.model.Date date = (net.fortuna.ical4j.model.Date) dates.get(i);
- long eventStartTime = date.getTime() / 1000;
- long eventEndTime = (eventStartTime + (event.getEventTo() - event.getEventFrom())) / 1000;
-
- try {
- ContentValues indexValues = new ContentValues();
- indexValues.put("EventId", event.getEventId());
- indexValues.put("EventFrom", eventStartTime);
- indexValues.put("EventTo", eventEndTime);
- database.insertOrThrow("CourseCalendarEvent", null, indexValues);
- } catch(Exception e) {
- e.printStackTrace();
- }
- }
-
- } catch (ParseException e) {
- }
- } else {
try {
+ Log.i("DBM Add", dateFormat.format(eventper.getStart()) + " - " + dateFormat.format(eventper.getEnd()));
+
ContentValues indexValues = new ContentValues();
- indexValues.put("EventId", event.getEventId());
- indexValues.put("EventFrom", event.getEventFrom());
- indexValues.put("EventTo", event.getEventTo());
+ indexValues.put("EventId", dbevent.getEventId());
+ indexValues.put("EventFrom", eventper.getStart().getTime() / 1000);
+ indexValues.put("EventTo", eventper.getEnd().getTime() / 1000);
+ indexValues.put("EventType", dbevent.getCourseTypeId());
database.insertOrThrow("CourseCalendarEvent", null, indexValues);
} catch(Exception e) {
- e.printStackTrace();
+ //e.printStackTrace();
}
}
-
}
public CourseEvent[] getCourseCalendarEvents(String coursename, long timeFrom, long timeTo) {
Long.toString(timeFrom),
Long.toString(timeTo)
};
- Cursor resultSet = database.rawQuery("SELECT Id, CourseName, UniqueId, SequenceId, EventFrom, EventTo, EventTitle, EventLocation, EventStatus, RecurRule, ExcludeDates, CourseGroupId FROM CourseCalendar WHERE CourseName = ? AND EventTo >= ? AND EventFrom <= ?", whereArgs);
+ Cursor resultSet = database.rawQuery(
+ "SELECT " +
+ "Id, CourseName, UniqueId, SequenceId, CourseCalendarEvent.EventFrom, CourseCalendarEvent.EventTo, EventTitle, EventLocation, EventStatus, RecurRule, ExcludeDates, CourseGroupId, EventType " +
+ "FROM " +
+ "CourseCalendarEvent " +
+ "LEFT JOIN " +
+ "CourseCalendar ON CourseCalendar.Id = CourseCalendarEvent.EventId "+
+ "WHERE " +
+ "CourseName = ? AND CourseCalendarEvent.EventTo >= ? AND CourseCalendarEvent.EventFrom <= ? ",
+ whereArgs);
ArrayList<CourseEvent> events = new ArrayList<CourseEvent>();
if(resultSet.moveToFirst()) {
int[] columnIndexes = {
resultSet.getColumnIndex("EventStatus"),
resultSet.getColumnIndex("RecurRule"),
resultSet.getColumnIndex("ExcludeDates"),
- resultSet.getColumnIndex("CourseGroupId")
+ resultSet.getColumnIndex("CourseGroupId"),
+ resultSet.getColumnIndex("EventType")
};
do {
int groupId = resultSet.getInt(columnIndexes[11]);
group = CourseGroup.GetCourseGroupById(AppContext.getDatabaseManager(), groupId);
else
group = null;
+
+ int eventType = resultSet.getInt(columnIndexes[12]);
+
CourseEvent event = new CourseEvent(resultSet.getInt(columnIndexes[0]), resultSet.getString(columnIndexes[1]), resultSet.getString(columnIndexes[2]), resultSet.getInt(columnIndexes[3]),
resultSet.getLong(columnIndexes[4]), resultSet.getLong(columnIndexes[5]), resultSet.getString(columnIndexes[6]), resultSet.getString(columnIndexes[7]),
- resultSet.getString(columnIndexes[8]), resultSet.getString(columnIndexes[9]), resultSet.getString(columnIndexes[10]), group);
+ resultSet.getString(columnIndexes[8]), resultSet.getString(columnIndexes[9]), resultSet.getString(columnIndexes[10]), group, eventType);
events.add(event);
} while (resultSet.moveToNext());
return eventsArr;
}
+ public CourseEvent[] getCourseCalendarTimetable(String coursename, long timeFrom, int days) {
+ String[] whereArgs;
+ whereArgs = new String[] {
+ coursename,
+ Long.toString(timeFrom),
+ Integer.toString(days)
+ };
+ ArrayList<CourseEvent> events = new ArrayList<CourseEvent>();
+
+ Cursor resultSet = database.rawQuery(
+ "SELECT " +
+ "COUNT(*) as EventCount, " +
+ "strftime('%Y%m%d', datetime(CourseCalendarEvent.EventTo, 'unixepoch')) as DayId " +
+ "FROM "+
+ "CourseCalendarEvent " +
+ "LEFT JOIN CourseCalendar ON CourseCalendar.Id = CourseCalendarEvent.EventId " +
+ "WHERE " +
+ "CourseCalendar.CourseName = ? AND " +
+ "CourseCalendarEvent.EventTo >= ? " +
+ "GROUP BY DayId " +
+ "ORDER BY DayId ASC " +
+ "LIMIT ? ",
+ whereArgs);
+ if(resultSet.moveToFirst()) {
+ do {
+ int eventCount = resultSet.getInt(0);
+ int dayId = resultSet.getInt(1);
+
+ if(eventCount == 0)
+ continue;
+
+ whereArgs = new String[] {
+ Integer.toString(dayId),
+ coursename
+ };
+
+ Cursor resultSet2 = database.rawQuery(
+ "SELECT " +
+ "CourseCalendar.Id, CourseCalendar.CourseName, CourseCalendar.UniqueId, CourseCalendar.SequenceId, " +
+ "CourseCalendarEvent.EventFrom, CourseCalendarEvent.EventTo, CourseCalendar.EventTitle, CourseCalendar.EventLocation, " +
+ "CourseCalendar.EventStatus, CourseCalendar.RecurRule, CourseCalendar.ExcludeDates, CourseCalendar.CourseGroupId, EventType, " +
+ "strftime('%Y%m%d', datetime(CourseCalendarEvent.EventTo, 'unixepoch')) as DayId " +
+ "FROM " +
+ "CourseCalendarEvent " +
+ "LEFT JOIN CourseCalendar ON CourseCalendarEvent.EventId = CourseCalendar.Id " +
+ "WHERE DayId = ? AND " +
+ "CourseCalendar.CourseName = ? " +
+ "ORDER BY CourseCalendarEvent.EventFrom ASC",
+ whereArgs);
+
+ int[] columnIndexes = {
+ resultSet2.getColumnIndex("Id"),
+ resultSet2.getColumnIndex("CourseName"),
+ resultSet2.getColumnIndex("UniqueId"),
+ resultSet2.getColumnIndex("SequenceId"),
+ resultSet2.getColumnIndex("EventFrom"),
+ resultSet2.getColumnIndex("EventTo"),
+ resultSet2.getColumnIndex("EventTitle"),
+ resultSet2.getColumnIndex("EventLocation"),
+ resultSet2.getColumnIndex("EventStatus"),
+ resultSet2.getColumnIndex("RecurRule"),
+ resultSet2.getColumnIndex("ExcludeDates"),
+ resultSet2.getColumnIndex("CourseGroupId"),
+ resultSet2.getColumnIndex("EventType")
+ };
+ resultSet2.moveToFirst();
+ do {
+ int groupId = resultSet2.getInt(columnIndexes[11]);
+ CourseGroup group;
+ if(groupId > 0)
+ group = CourseGroup.GetCourseGroupById(AppContext.getDatabaseManager(), groupId);
+ else
+ group = null;
+ int eventType = resultSet2.getInt(columnIndexes[12]);
+ CourseEvent event = new CourseEvent(resultSet2.getInt(columnIndexes[0]), resultSet2.getString(columnIndexes[1]), resultSet2.getString(columnIndexes[2]), resultSet2.getInt(columnIndexes[3]),
+ resultSet2.getLong(columnIndexes[4]), resultSet2.getLong(columnIndexes[5]), resultSet2.getString(columnIndexes[6]), resultSet2.getString(columnIndexes[7]),
+ resultSet2.getString(columnIndexes[8]), resultSet2.getString(columnIndexes[9]), resultSet2.getString(columnIndexes[10]), group, eventType);
+
+ events.add(event);
+ } while (resultSet2.moveToNext());
+ resultSet2.close();
+ } while (resultSet.moveToNext());
+ resultSet.close();
+ }
+
+ CourseEvent[] eventsArr = new CourseEvent[events.size()];
+ eventsArr = events.toArray(eventsArr);
+ return eventsArr;
+ }
+
+
+
public CourseGroup getCourseGroup(int courseGroupId) {
CourseGroup coursegroup = null;
String[] whereArgs = new String[] {
return null;
}
+ public CourseGroup[] getCourseGroups(String coursename, Date notBefore) {
+ String[] whereArgs;
+ whereArgs = new String[] {
+ coursename
+ };
+ ArrayList<CourseGroup> groups = new ArrayList<CourseGroup>();
+
+ /*
+ Cursor resultSet = database.rawQuery(
+ "SELECT CourseCalendarGroup.GroupId, CourseCalendarGroup.CourseName, CourseCalendarGroup.GroupName, t1.FirstEvent, t1.LastEvent, t1.EventCount FROM " +
+ "CourseCalendarGroup, ( " +
+ "SELECT CourseCalendar.CourseGroupId, MIN(CourseCalendarEvent.EventFrom) as FirstEvent, MAX(CourseCalendarEvent.EventTo) as LastEvent, COUNT(*) as EventCount " +
+ "FROM CourseCalendarEvent " +
+ "LEFT JOIN CourseCalendar ON CourseCalendar.Id = CourseCalendarEvent.EventId " +
+ "GROUP BY CourseCalendar.CourseGroupId " +
+ ") as t1 " +
+ "WHERE " +
+ "CourseCalendarGroup.GroupId = t1.CourseGroupId AND " +
+ "CourseName = ? AND t1.LastEvent > ? " +
+ "ORDER BY FirstEvent ASC",
+ whereArgs);
+ */
+ Cursor resultSet = database.rawQuery(
+ "SELECT " +
+ "CourseCalendarGroup.GroupId, CourseCalendarGroup.CourseName, CourseCalendarGroup.GroupName, " +
+ "MIN(CourseCalendarEvent.EventFrom) as FirstEvent, " +
+ "MAX(" +
+ "CASE WHEN CourseCalendarEvent.EventType IN (0, 1) " +
+ "THEN CourseCalendarEvent.EventFrom " +
+ "ELSE 0 " +
+ "END) as LastEvent, " +
+ "MAX(CourseCalendarEvent.EventFrom) as LastEventFilter, " +
+ "COUNT(*) as EventCount, " +
+ "MIN(" +
+ "CASE WHEN CourseCalendarEvent.EventFrom < strftime('%s', 'now') " +
+ "THEN (strftime('%s', 'now')+(86400*365*5)+CourseCalendarEvent.EventFrom) " +
+ "ELSE CourseCalendarEvent.EventFrom " +
+ "END) as NextEvent, " +
+ "MIN(" +
+ "CASE WHEN CourseCalendarEvent.EventFrom < strftime('%s', 'now') OR CourseCalendarEvent.EventType NOT IN (2) " +
+ "THEN (strftime('%s', 'now')+(86400*365*5)+CourseCalendarEvent.EventFrom) " +
+ "ELSE CourseCalendarEvent.EventFrom " +
+ "END) as NextKlausurEvent, " +
+ "MIN(CASE WHEN CourseCalendarEvent.EventFrom <= strftime('%s', 'now') THEN 1 ELSE 0 END) as EventCompleted " +
+ "FROM " +
+ "CourseCalendarEvent " +
+ "LEFT JOIN CourseCalendar ON CourseCalendar.Id = CourseCalendarEvent.EventId " +
+ "LEFT JOIN CourseCalendarGroup ON CourseCalendarGroup.GroupId = CourseCalendar.CourseGroupId " +
+ "WHERE " +
+ "CourseCalendar.CourseName = ? " +
+ "GROUP BY CourseCalendarGroup.GroupId, CourseCalendarGroup.CourseName, CourseCalendarGroup.GroupName " +
+ "HAVING LastEventFilter > " + Long.toString((notBefore == null ? 0L : notBefore.getTime()/1000)) + " " +
+ "ORDER BY EventCompleted DESC, NextEvent ASC ",
+ whereArgs);
+ if(resultSet.moveToFirst()) {
+ int[] columnIndexes = {
+ resultSet.getColumnIndex("GroupId"),
+ resultSet.getColumnIndex("CourseName"),
+ resultSet.getColumnIndex("GroupName"),
+ resultSet.getColumnIndex("FirstEvent"),
+ resultSet.getColumnIndex("LastEvent"),
+ resultSet.getColumnIndex("EventCount"),
+ resultSet.getColumnIndex("NextEvent"),
+ resultSet.getColumnIndex("EventCompleted"),
+ resultSet.getColumnIndex("NextKlausurEvent"),
+ };
+ do {
+ CourseGroup coursegroup = new CourseGroup(resultSet.getInt(columnIndexes[0]), resultSet.getString(columnIndexes[1]), resultSet.getString(columnIndexes[2]));
+ Bundle extraData = coursegroup.getExtraData();
+
+ extraData.putLong("FirstEvent", resultSet.getLong(columnIndexes[3]));
+ extraData.putLong("LastEvent", resultSet.getLong(columnIndexes[4]));
+ extraData.putInt("EventCount", resultSet.getInt(columnIndexes[5]));
+ extraData.putLong("NextEvent", resultSet.getLong(columnIndexes[6]));
+ extraData.putLong("NextKlausurEvent", resultSet.getLong(columnIndexes[8]));
+ extraData.putBoolean("EventCompleted", (resultSet.getInt(columnIndexes[7]) == 1));
+
+ groups.add(coursegroup);
+
+ } while (resultSet.moveToNext());
+ resultSet.close();
+ }
+
+ CourseGroup[] groupsArr = new CourseGroup[groups.size()];
+ groupsArr = groups.toArray(groupsArr);
+ return groupsArr;
+ }
+
}
import de.dhbwloe.campusapp.CampusAppFragment;
import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentTransaction;
+import android.support.v7.widget.CardView;
+import android.view.InflateException;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import de.dhbwloe.campusapp.search.SearchIndices;
public class Dashboard extends CampusAppFragment {
+ private static View view;
/* implement this for search results ;) */
public static SearchIndices[] GetSearchIndices() {
return new SearchIndices[] {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+
+ AppContext.getDatabaseManager().setRuntimeCache("CourseName", "tif13a");
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.fragment_dashboard, container, false);
+ if (view != null) {
+ ViewGroup parent = (ViewGroup) view.getParent();
+ if (parent != null)
+ parent.removeView(view);
+ }
+
+ try {
+ view = inflater.inflate(R.layout.fragment_dashboard, container, false);
+ } catch (InflateException e) {
+ }
AppContext.setTitle("Dashboard");
-
+ String kursTag = AppContext.getDatabaseManager().getRuntimeCache("CourseName");
+ if(kursTag == null || kursTag.isEmpty()) {
+ CardView timetable = (CardView) view.findViewById(R.id.card_timetable);
+ timetable.setVisibility(View.GONE);
+ }
return view;
}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+import java.util.Date;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.mensaplan.MensaTagesplan;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class DashboardMensa extends CampusAppFragment {
+ private View view;
+
+ public DashboardMensa() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ view = inflater.inflate(R.layout.fragment_dashboard_mensa, container, false);
+ refreshMensaMenue();
+ return view;
+ }
+
+
+ private void refreshMensaMenue() {
+ if(AppContext == null)
+ AppContext = CampusAppContext.getInstance();
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(new Date());
+ cal.set(Calendar.HOUR_OF_DAY, 0);
+ cal.set(Calendar.MINUTE, 0);
+ cal.set(Calendar.SECOND, 0);
+ cal.set(Calendar.MILLISECOND, 0);
+ long now = (new Date()).getTime() / 1000;
+ long mensaCloseTime = (3600 * 13); // 13 uhr
+ long timeFrom = cal.getTime().getTime() / 1000;
+ if(now > timeFrom + mensaCloseTime)
+ timeFrom += 86400;
+ long timeTo = timeFrom + (86400 * 3) + 86399; // +3days for weekend
+
+ MensaTagesplan[] dayplans = AppContext.getDatabaseManager().getMensaTagesplan(timeFrom, timeTo);
+ if(dayplans.length == 0) {
+
+ return;
+ }
+ MensaTagesplan dayplan = dayplans[0];
+ TextView dateTextView = (TextView) view.findViewById(R.id.menuDate);
+ dateTextView.setText(getDateText(dayplan.getPlanDate(), now));
+
+ LinearLayout menueContainer = (LinearLayout) view.findViewById(R.id.menuList);
+ menueContainer.removeAllViews();
+
+ MensaTagesplan cmenue = dayplan;
+ int i = 0;
+ LayoutInflater li = LayoutInflater.from(AppContext.getMainActivity());
+ do {
+ RelativeLayout menu = (RelativeLayout) li.inflate(R.layout.fragment_dashboard_mensa_menu, null, false);
+ menueContainer.addView(menu);
+
+ TextView menuName = (TextView) menu.findViewById(R.id.menuName);
+ TextView menuPrice = (TextView) menu.findViewById(R.id.menuPrice);
+
+ menuName.setText(cmenue.getName());
+ double price = cmenue.getStudentPrice();
+ menuPrice.setText(Double.toString(price));
+ } while(i < dayplans.length && (cmenue = dayplans[++i]) != null && cmenue.getPlanDate() == dayplan.getPlanDate());
+ }
+
+ private String getDateText(long date, long now) {
+ String datetext;
+ if(now < date+86400)
+ datetext = AppContext.getResString(R.string.dashboard_calendar_today);
+ else if(now < date + (86400*2))
+ datetext = AppContext.getResString(R.string.dashboard_calendar_tomorrow);
+ else {
+ int weekdayResIds[] = new int[] { R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday, R.string.week_saturday };
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(new Date(date * 1000));
+ int dow = cal.get(Calendar.DAY_OF_WEEK);
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM");
+
+ datetext = AppContext.getResString(weekdayResIds[dow]) + ", " + dateFormat.format(cal.getTime());
+ }
+ return datetext;
+ }
+
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class DashboardNewsDhbw extends CampusAppFragment {
+
+
+ public DashboardNewsDhbw() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_dashboard_news_dhbw, container, false);
+ }
+
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class DashboardNewsStuv extends CampusAppFragment {
+
+
+ public DashboardNewsStuv() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_dashboard_news_stuv, container, false);
+ }
+
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Build;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.Tools;
+import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class DashboardVorlesungsplan extends CampusAppFragment {
+ private static int lastGeneratedViewId = 572000;
+ private View view;
+ private List<CourseEvent> events1 = new ArrayList<CourseEvent>();
+ private List<CourseEvent> events2 = new ArrayList<CourseEvent>();
+ private String courseName;
+
+ public DashboardVorlesungsplan() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ view = inflater.inflate(R.layout.fragment_dashboard_timetable, container, false);
+ String kursTag = AppContext.getDatabaseManager().getRuntimeCache("CourseName");
+ if(kursTag == null || kursTag.isEmpty()) {
+ return null;
+ }
+ courseName = kursTag;
+ return view;
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ if(courseName != null)
+ loadViewData();
+ }
+
+ private int getDayId(long time) {
+ Date date = new Date(time * 1000);
+ return getDayId(date);
+ }
+ private int getDayId(Date date) {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+ return Integer.parseInt(dateFormat.format(date));
+ }
+
+ private void loadViewData() {
+ if(AppContext == null)
+ AppContext = CampusAppContext.getInstance();
+ long now = (new Date()).getTime() / 1000;
+ long tomorrow = now + 86400;
+
+ CourseEvent events[] = AppContext.getDatabaseManager().getCourseCalendarTimetable(courseName, now, 2);
+ events1.clear();
+ events2.clear();
+ if(events.length > 0) {
+ int firstDayId = getDayId(events[0].getEventTo());
+ for (int i = 0; i < events.length; i++) {
+ if (i == 0 || getDayId(events[i].getEventTo()) == firstDayId)
+ events1.add(events[i]);
+ else
+ events2.add(events[i]);
+ }
+ }
+
+ RelativeLayout container;
+
+ container = (RelativeLayout)view.findViewById(R.id.date1Overview);
+ buildDayView(container, events1);
+ container.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Bundle args = new Bundle();
+ if (events1.size() > 0) {
+ long date = events1.get(0).getEventTo();
+ args.putLong("date", date);
+ }
+ AppContext.getNavigationManager().navigatePage("Vorlesungsplan", args);
+ }
+ });
+
+ container = (RelativeLayout)view.findViewById(R.id.date2Overview);
+ buildDayView(container, events2);
+ container.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Bundle args = new Bundle();
+ if (events1.size() > 0) {
+ long date = events2.get(0).getEventTo();
+ args.putLong("date", date);
+ }
+ AppContext.getNavigationManager().navigatePage("Vorlesungsplan", args);
+ }
+ });
+
+ int todayDayId = getDayId(now);
+ int tomorrowDayId = getDayId(tomorrow);
+ Date date;
+
+ TextView date1 = (TextView) view.findViewById(R.id.dateView1);
+ if(events1.size() > 0) {
+ date = new Date(events1.get(0).getEventTo() * 1000);
+ date1.setText(getDateText(date, todayDayId, tomorrowDayId));
+ } else
+ date1.setText("");
+
+ TextView date2 = (TextView) view.findViewById(R.id.dateView2);
+ if(events2.size() > 0) {
+ date = new Date(events2.get(0).getEventTo() * 1000);
+ date2.setText(getDateText(date, todayDayId, tomorrowDayId));
+ } else
+ date2.setText("");
+ }
+
+ private void buildDayView(RelativeLayout container, List<CourseEvent> events) {
+ container.removeAllViews();
+
+ Date date;
+ TextView leftCol, rightCol = null;
+ RelativeLayout.LayoutParams params;
+ SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
+ int firstLeftColId = 0;
+
+ if(events.size() > 0) {
+ leftCol = new TextView(AppContext.getMainActivity());
+ params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
+ RelativeLayout.LayoutParams.WRAP_CONTENT);
+ params.setMargins(8, 4, 0, 0);
+ leftCol.setLayoutParams(params);
+ leftCol.setId(generateViewId());
+ firstLeftColId = leftCol.getId();
+ container.addView(leftCol);
+ } else {
+ leftCol = null;
+ }
+
+ for(int i = 0; i < events.size(); i++) {
+ CourseEvent event = events.get(i);
+ date = new Date(event.getEventFrom()*1000);
+ leftCol.setText(dateFormat.format(date));
+
+ rightCol = new TextView(AppContext.getMainActivity());
+ rightCol.setId(generateViewId());
+ params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
+ RelativeLayout.LayoutParams.WRAP_CONTENT);
+ params.setMargins(12, 12, 0, 0);
+ /*
+ android:layout_alignTop="@+id/date1time2"
+ android:layout_toRightOf="@+id/date1time1"
+ android:layout_toEndOf="@+id/date1time1"
+ */
+ params.addRule(RelativeLayout.ALIGN_TOP, leftCol.getId());
+ params.addRule(RelativeLayout.RIGHT_OF, firstLeftColId);
+ params.addRule(RelativeLayout.END_OF, firstLeftColId);
+ rightCol.setLayoutParams(params);
+
+ String coursetitle = "";
+ if(event.getCourseType() == CourseEvent.CourseType.COURSETYPE_KLAUSUR)
+ coursetitle += AppContext.getResString(R.string.dashboard_calendar_klausur);
+ coursetitle += event.getEventShortTitle();
+ rightCol.setText(coursetitle);
+
+
+ leftCol = new TextView(AppContext.getMainActivity());
+ leftCol.setId(generateViewId());
+ params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,
+ RelativeLayout.LayoutParams.WRAP_CONTENT);
+ params.setMargins(8, -8, 0, 0);
+ params.addRule(RelativeLayout.BELOW, rightCol.getId());
+ leftCol.setLayoutParams(params);
+
+ date = new Date(event.getEventTo()*1000);
+ leftCol.setText(dateFormat.format(date));
+
+
+ container.addView(rightCol);
+ container.addView(leftCol);
+ }
+ }
+
+ private String getDateText(Date eventDate, int todayDayId, int tomorrowDayId) {
+ int date1DayId = getDayId(eventDate);
+ String datetext;
+ if(date1DayId == todayDayId)
+ datetext = AppContext.getResString(R.string.dashboard_calendar_today);
+ else if(date1DayId == tomorrowDayId)
+ datetext = AppContext.getResString(R.string.dashboard_calendar_tomorrow);
+ else {
+ int weekdayResIds[] = new int[] { R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday, R.string.week_saturday };
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(eventDate);
+ int dow = cal.get(Calendar.DAY_OF_WEEK);
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM");
+
+ datetext = AppContext.getResString(weekdayResIds[dow]) + ", " + dateFormat.format(eventDate);
+ }
+ return datetext;
+ }
+
+ private int generateViewId() {
+ if (Build.VERSION.SDK_INT >= 17)
+ return View.generateViewId();
+ else
+ return lastGeneratedViewId++;
+ }
+
+}
import java.text.SimpleDateFormat;
import java.util.ArrayList;
+import java.util.Calendar;
import java.util.Date;
import java.util.List;
private TabLayout tabLayout;
private ViewPager viewPager;
- private boolean viewDayplan;
private long viewDate;
@Override
long date;
if(showdate != null && !showdate.isEmpty() && (date = Long.parseLong(showdate)) > 0) {
viewDate = date;
- viewDayplan = true;
- viewmodeSet = true;
- }
- if(!viewmodeSet) {
- String viewmode = arguments.getString("viewmode");
- if(viewmode != null && !viewmode.isEmpty()) {
- if(viewmode.equalsIgnoreCase("day"))
- viewDayplan = true;
- else
- viewDayplan = false;
- viewmodeSet = true;
- }
- }
- }
- if(!viewmodeSet) {
- String lastViewmode = AppContext.getDatabaseManager().getRuntimeCache("MensaplanViewMode");
- if(lastViewmode != null && !lastViewmode.isEmpty()) {
- if(lastViewmode.equalsIgnoreCase("day"))
- viewDayplan = true;
- else
- viewDayplan = false;
- viewmodeSet = true;
}
}
- if(!viewmodeSet)
- viewDayplan = true;
- AppContext.setTitle("Mensa "+(viewDayplan ? "Tagesplan" : "Wochenplan"));
+ AppContext.setTitle("Mensa Speiseplan");
/*
toolbar = (Toolbar) view.findViewById(R.id.toolbar);
long[] showDates;
long now = (new Date()).getTime()/1000;
- if(viewDayplan)
- showDates = AppContext.getDatabaseManager().getDaysWithPlanData(now - (30 * 86400), now + (30 * 86400));
- else
- showDates = AppContext.getDatabaseManager().getDaysWithPlanData(now - (365 * 86400), now + (30 * 86400));
+ if(viewDate < now)
+ now = viewDate;
+
+ int weekdayResIds[] = new int[] { R.string.week_monday_short, R.string.week_tuesday_short, R.string.week_wednesday_short, R.string.week_thursday_short, R.string.week_friday_short, R.string.week_saturday_short, R.string.week_sunday_short };
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(new Date(now * 1000));
+ cal.set(Calendar.HOUR_OF_DAY, 0);
+ cal.set(Calendar.MINUTE, 0);
+ cal.set(Calendar.SECOND, 0);
+ cal.set(Calendar.MILLISECOND, 0);
+ long midnight = cal.getTimeInMillis() / 1000;
+ int dow = cal.get(Calendar.DAY_OF_WEEK);
+ dow -= 2;
+ if(dow < 0) // monday should be 0!
+ dow += 7;
+ long subTimeToWeekStart = (86400 * dow);
+ long showDateFrom = midnight - subTimeToWeekStart;
+
+ showDates = AppContext.getDatabaseManager().getDaysWithPlanData(showDateFrom, now + (30 * 86400));
int activeItem = -1;
long activeItemDiff = -1;
Bundle args = getArguments();
+ int lastWeekday = 0;
for(int i = 0; i < showDates.length; i++) {
long date = showDates[i];
Bundle bundle = new Bundle();
bundle.putAll(args);
String title;
SimpleDateFormat sdf;
- if(viewDayplan)
- sdf = new SimpleDateFormat("dd.MM.");
- else
- sdf = new SimpleDateFormat("WW");
+
+ cal.setTime(new Date(date * 1000));
+ int weekday = cal.get(Calendar.DAY_OF_WEEK);
+ weekday -= 2; // monday should be 0!
+ if(weekday < 0)
+ weekday += 7;
if(viewDate > 0) {
long diff = Math.abs(viewDate - date);
}
}
- title = sdf.format(new Date(date * 1000));
+ if(lastWeekday > weekday) {
+ adapter.addFragment(null, null);
+ }
+ lastWeekday = weekday;
+
+ title = AppContext.getResString(weekdayResIds[weekday]);
bundle.putLong("date", date);
adapter.addFragment(bundle, title);
}
viewPager.setAdapter(adapter);
viewPager.setCurrentItem(activeItem);
- if(viewDayplan) {
- MensaTagesplan tagesplan = (MensaTagesplan)adapter.getItem(activeItem);
- tagesplan.onSetActive();
- }
+
+ MensaTagesplan tagesplan = (MensaTagesplan)adapter.getItem(activeItem);
+ tagesplan.onSetActive();
+
viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
@Override
public void onPageSelected(int position) {
- if(viewDayplan) {
- MensaTagesplan tagesplan = (MensaTagesplan)adapter.getItem(position);
- tagesplan.onSetActive();
- }
+ MensaTagesplan tagesplan = (MensaTagesplan)adapter.getItem(position);
+ tagesplan.onSetActive();
}
@Override
}
if(mFragmentList.get(position) != null)
return mFragmentList.get(position);
- if(viewDayplan)
- fragment = new MensaTagesplan();
- else
- fragment = new MensaWochenplan();
+ fragment = new MensaTagesplan();
+
fragment.setArguments(mFragmentDataList.get(position));
mFragmentList.set(position, fragment);
return fragment;
}
public void addFragment(Bundle fragmentdata, String title) {
+ if(title == null) {
+ Bundle bnd = new Bundle();
+ bnd.putBoolean("parentIsMensaFragment", true);
+ mFragmentDataList.add(bnd);
+ mFragmentTitleList.add("");
+ return;
+ }
+
fragmentdata.putBoolean("parentIsMensaFragment", true);
mFragmentDataList.add(fragmentdata);
mFragmentTitleList.add(title);
import java.util.Calendar;
import java.util.Date;
+import de.dhbwloe.campusapp.CampusAppContext;
import de.dhbwloe.campusapp.CampusAppFragment;
import de.dhbwloe.campusapp.R;
private ArrayList<de.dhbwloe.campusapp.mensaplan.MensaTagesplan> tagesplanMenueItems = new ArrayList<>();
private Date viewPlanDate;
private boolean setActiveOnLoad = false;
+ private boolean redirectPage = true;
public void onSetActive() {
+ if(AppContext == null)
+ AppContext = CampusAppContext.getInstance();
if(viewPlanDate == null) {
+ AppContext.setTitle("");
setActiveOnLoad = true;
return;
}
Bundle args = getArguments();
Date planDay = null;
if(args != null) {
+ boolean mensaparent = args.getBoolean("parentIsMensaFragment");
+ if(mensaparent)
+ redirectPage = false;
long plandate = args.getLong("date");
if(plandate > 0) {
planDay = new Date(plandate * 1000);
View view = inflater.inflate(R.layout.fragment_mensa_tagesplan, container, false);
if(viewPlanDate == null) {
- AppContext.getNavigationManager().navigatePage("Mensa", null, false); // silent redirect
+ if(redirectPage)
+ AppContext.getNavigationManager().navigatePage("Mensa", null, false); // silent redirect
+ else {
+ return inflater.inflate(R.layout.fragment_mensa_weekend, container, false);
+ }
return null;
}
if(setActiveOnLoad) {
+++ /dev/null
-package de.dhbwloe.campusapp.fragments;
-
-
-import android.os.Bundle;
-import android.support.v4.app.Fragment;
-import android.support.v4.app.FragmentActivity;
-import android.view.LayoutInflater;
-import android.view.View;
-import android.view.ViewGroup;
-
-import de.dhbwloe.campusapp.CampusAppFragment;
-import de.dhbwloe.campusapp.R;
-import de.dhbwloe.campusapp.search.SearchIndices;
-
-/**
- * A simple {@link Fragment} subclass.
- */
-public class MensaWochenplan extends CampusAppFragment {
-
- @Override
- public View onCreateView(LayoutInflater inflater, ViewGroup container,
- Bundle savedInstanceState) {
- View view = inflater.inflate(R.layout.fragment_mensa_wochenplan, container, false);
- AppContext.setTitle("Mensa Wochenplan: ");
-
-
-
- return view;
- }
-
-}
import android.os.Bundle;
+import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentPagerAdapter;
+import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
import de.dhbwloe.campusapp.CampusAppFragment;
import de.dhbwloe.campusapp.R;
import de.dhbwloe.campusapp.search.SearchIndices;
* A simple {@link Fragment} subclass.
*/
public class Vorlesungsplan extends CampusAppFragment {
+ public interface VorlesungsplanFragment {
+ void setActive();
+ }
+
/* implement this for search results ;) */
public static SearchIndices[] GetSearchIndices() {
return new SearchIndices[] {
setDescription("Vorlesungsplan dienes Kurses");
addKeyWord("vorlesung, vorlesungen, plan, vorlesungsplan, stundenplan, termin, termine, kursplan, blockplan, block, zeit, zeiten");
}},
+ new SearchIndices("Vorlesungsplan", true) {{
+ setUpdateTime(1);
+ setTarget("#Vorlesungsplan#view=exams");
+ setTitle("Vorlesungsplan");
+ setDescription("Klausurübersicht dienes Kurses");
+ addKeyWord("klausuren, prüfungen, exams, termine, zeitpunkt, plan, ergebnisse");
+ }},
};
}
View view = inflater.inflate(R.layout.fragment_vorlesungsplan, container, false);
AppContext.setTitle("Vorlesungsplan");
+ ViewPager pager = (ViewPager) view.findViewById(R.id.viewpager);
+ setupViewPager(pager);
+
+ TabLayout tabLayout = (TabLayout) view.findViewById(R.id.tabs);
+ tabLayout.setupWithViewPager(pager);
+
return view;
}
+ private void setupViewPager(ViewPager viewPager) {
+ final ViewPagerAdapter adapter = new ViewPagerAdapter(getChildFragmentManager());
+
+ adapter.addFragment(new VorlesungsplanUpcoming(), AppContext.getResString(R.string.vorlesungsplan_upcoming));
+ adapter.addFragment(new VorlesungsplanGroups(), AppContext.getResString(R.string.vorlesungsplan_groups));
+ adapter.addFragment(new VorlesungsplanExams(), AppContext.getResString(R.string.vorlesungsplan_exams));
+
+ viewPager.setAdapter(adapter);
+ viewPager.setCurrentItem(0);
+
+ VorlesungsplanFragment fragment = (VorlesungsplanFragment)adapter.getItem(0);
+ fragment.setActive();
+
+
+ viewPager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
+ @Override
+ public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
+
+ }
+
+ @Override
+ public void onPageSelected(int position) {
+ VorlesungsplanFragment fragment = (VorlesungsplanFragment)adapter.getItem(position);
+ fragment.setActive();
+ }
+
+ @Override
+ public void onPageScrollStateChanged(int state) {
+
+ }
+ });
+ }
+
+ class ViewPagerAdapter extends FragmentPagerAdapter {
+ private final List<Fragment> mFragmentList = new ArrayList<>();
+ private final List<String> mFragmentTitleList = new ArrayList<>();
+
+ public ViewPagerAdapter(FragmentManager manager) {
+ super(manager);
+ }
+
+ @Override
+ public Fragment getItem(int position) {
+ return mFragmentList.get(position);
+ }
+
+ @Override
+ public int getCount() {
+ return mFragmentList.size();
+ }
+
+ public void addFragment(Fragment fragment, String title) {
+ mFragmentList.add(fragment);
+ mFragmentTitleList.add(title);
+ }
+
+ @Override
+ public CharSequence getPageTitle(int position) {
+ return mFragmentTitleList.get(position);
+ }
+ }
+
}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class VorlesungsplanExams extends CampusAppFragment implements Vorlesungsplan.VorlesungsplanFragment {
+
+
+ public VorlesungsplanExams() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ // Inflate the layout for this fragment
+ return inflater.inflate(R.layout.fragment_vorlesungsplan_exams, container, false);
+ }
+
+ @Override
+ public void setActive() {
+
+ }
+
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ListView;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.vorlesungen.CourseGroup;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class VorlesungsplanGroups extends CampusAppFragment implements Vorlesungsplan.VorlesungsplanFragment {
+ private String coursename;
+ private View view;
+ private VorlesungsplanGroupsListAdapter listAdapter;
+ private ArrayList<VorlesungsplanGroupsListItem> listItems = new ArrayList<VorlesungsplanGroupsListItem>();
+ private boolean showOldCourses = false;
+
+ public VorlesungsplanGroups() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ String kursTag = AppContext.getDatabaseManager().getRuntimeCache("CourseName");
+ if(kursTag == null || kursTag.isEmpty())
+ return null;
+ coursename = kursTag;
+
+ view = inflater.inflate(R.layout.fragment_vorlesungsplan_groups, container, false);
+
+ ListView listView = (ListView) view.findViewById(R.id.listView);
+ listAdapter = new VorlesungsplanGroupsListAdapter(view.getContext(), R.layout.fragment_vorlesungsplan_groups_course, listItems);
+ listView.setAdapter(listAdapter);
+
+ CheckBox showOldChkBox = (CheckBox) view.findViewById(R.id.showOldCourses);
+ showOldChkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+ @Override
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+ showOldCourses = isChecked;
+ updateCoursesList();
+ }
+ });
+
+ return view;
+ }
+
+ @Override
+ public void setActive() {
+
+ }
+
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ if(coursename != null)
+ updateCoursesList();
+ }
+
+ private void updateCoursesList() {
+ Date notBefore;
+ if(showOldCourses)
+ notBefore = null;
+ else
+ notBefore = new Date();
+
+ CourseGroup[] groups = AppContext.getDatabaseManager().getCourseGroups(coursename, notBefore);
+ listItems.clear();
+ for(CourseGroup group : groups) {
+ Bundle extraData = group.getExtraData();
+ long nextKlausur = extraData.getLong("NextKlausurEvent");
+ long lastEvent = extraData.getLong("LastEvent");
+
+ // wenn nextKlausur über 5 jahrevon LastEvent entfernt liegt gibt es in diesem kurs KEINE Klausur.
+ // der fiktive Wert musste zur technischen funktionalität der Datenbankabfrage eingefügt werden.
+ if(nextKlausur - lastEvent > (86400 * 365 * 5))
+ nextKlausur = 0;
+
+ VorlesungsplanGroupsListItem item = new VorlesungsplanGroupsListItem(
+ group.getGroupId(),
+ coursename,
+ group.getGroupName(),
+ extraData.getLong("FirstEvent"),
+ lastEvent,
+ extraData.getInt("EventCount"),
+ extraData.getLong("NextEvent"),
+ nextKlausur
+ );
+ listItems.add(item);
+ }
+ if(listAdapter != null)
+ listAdapter.notifyDataSetChanged();
+ }
+
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.R;
+
+/**
+ * Created by pk910 on 20.02.2016.
+ */
+public class VorlesungsplanGroupsListAdapter extends ArrayAdapter<VorlesungsplanGroupsListItem> {
+ private Context context;
+ private int layoutResourceId;
+ private ArrayList<VorlesungsplanGroupsListItem> data = new ArrayList<VorlesungsplanGroupsListItem>();
+
+ public VorlesungsplanGroupsListAdapter(Context context, int layoutResourceId, ArrayList<VorlesungsplanGroupsListItem> data) {
+ super(context, layoutResourceId, data);
+ this.layoutResourceId = layoutResourceId;
+ this.context = context;
+ this.data = data;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View row = convertView;
+ RecordHolder holder = null;
+
+ if (row == null) {
+ LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ row = inflater.inflate(layoutResourceId, parent, false);
+
+ holder = new RecordHolder(row);
+ row.setTag(holder);
+ } else {
+ holder = (RecordHolder) row.getTag();
+ }
+
+ final VorlesungsplanGroupsListAdapter that = this;
+ final VorlesungsplanGroupsListItem item = data.get(position);
+
+ holder.groupName.setText(item.getGroupName());
+ holder.nextEvent.setText(item.getNextEvent());
+ holder.lastEvent.setText(item.getLastEvent());
+
+ String klausurDate = item.getNextKlausurEvent();
+ if(klausurDate == null)
+ klausurDate = CampusAppContext.getInstance().getResString(R.string.vorlesungsplan_groups_noklausur);
+
+ holder.klausurEvent.setText(klausurDate);
+
+ return row;
+ }
+
+ static class RecordHolder {
+ TextView groupName;
+ TextView nextEvent;
+ TextView lastEvent;
+ TextView klausurEvent;
+ TextView klausurName;
+
+ public RecordHolder(View view) {
+ this.groupName = (TextView) view.findViewById(R.id.courseTitle);
+ this.nextEvent = (TextView) view.findViewById(R.id.nextEvent);
+ this.lastEvent = (TextView) view.findViewById(R.id.lastEvent);
+ this.klausurEvent = (TextView) view.findViewById(R.id.klausurEvent);
+ this.klausurName = (TextView) view.findViewById(R.id.klausurName);
+ }
+ }
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Created by pk910 on 20.02.2016.
+ */
+public class VorlesungsplanGroupsListItem {
+ private int groupId;
+ private String courseName;
+ private String groupName;
+ private long firstEvent, lastEvent, nextEvent, nextKlausurEvent;
+ private int eventCount;
+
+ public VorlesungsplanGroupsListItem(int groupid, String coursename, String groupname, long firstevent, long lastevent, int eventcount, long nextevent, long nextklausur) {
+ groupId = groupid;
+ courseName = coursename;
+ groupName = groupname;
+ firstEvent = firstevent;
+ lastEvent = lastevent;
+ eventCount = eventcount;
+ nextEvent = nextevent;
+ nextKlausurEvent = nextklausur;
+ }
+
+ public int getGroupId() {
+ return groupId;
+ }
+
+ public String getCourseName() {
+ return courseName;
+ }
+
+ public String getGroupName() {
+ return groupName;
+ }
+
+ public String getFirstEvent() {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+ Date date = new Date(firstEvent*1000);
+ return dateFormat.format(date);
+ }
+
+ public String getLastEvent() {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+ Date date = new Date(lastEvent*1000);
+ return dateFormat.format(date);
+ }
+
+ public String getNextEvent() {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+ Date date = new Date(nextEvent*1000);
+ return dateFormat.format(date);
+ }
+
+ public String getNextKlausurEvent() {
+ if(nextKlausurEvent == 0)
+ return null;
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.yyyy HH:mm");
+ Date date = new Date(nextKlausurEvent*1000);
+ return dateFormat.format(date);
+ }
+
+ public int getEventCount() {
+ return eventCount;
+ }
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ListView;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.CampusAppFragment;
+import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
+
+/**
+ * A simple {@link Fragment} subclass.
+ */
+public class VorlesungsplanUpcoming extends CampusAppFragment implements Vorlesungsplan.VorlesungsplanFragment {
+ private View view;
+ private String courseName;
+ private ArrayList<VorlesungsplanUpcomingDayListItem> upcomingDays = new ArrayList<VorlesungsplanUpcomingDayListItem>();
+ private VorlesungsplanUpcomingDayListAdapter upcomingDaysAdapter;
+
+ public VorlesungsplanUpcoming() {
+ // Required empty public constructor
+ }
+
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container,
+ Bundle savedInstanceState) {
+ view = inflater.inflate(R.layout.fragment_vorlesungsplan_upcoming, container, false);
+
+ String kursTag = AppContext.getDatabaseManager().getRuntimeCache("CourseName");
+ if(kursTag == null || kursTag.isEmpty()) {
+ return null;
+ }
+ courseName = kursTag;
+
+ ListView listView = (ListView) view.findViewById(R.id.listView);
+ upcomingDaysAdapter = new VorlesungsplanUpcomingDayListAdapter(view.getContext(), R.layout.fragment_vorlesungsplan_upcoming_day, upcomingDays);
+ listView.setAdapter(upcomingDaysAdapter);
+
+ return view;
+ }
+
+ @Override
+ public void setActive() {
+
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ if(courseName != null)
+ refreshUpcomingEvents();
+ }
+
+ private int getDayId(long time) {
+ Date date = new Date(time * 1000);
+ return getDayId(date);
+ }
+ private int getDayId(Date date) {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
+ return Integer.parseInt(dateFormat.format(date));
+ }
+
+ private void refreshUpcomingEvents() {
+ if(AppContext == null)
+ AppContext = CampusAppContext.getInstance();
+ long now = (new Date()).getTime() / 1000;
+
+ CourseEvent events[] = AppContext.getDatabaseManager().getCourseCalendarTimetable(courseName, now, 365);
+ int lastDayId = 0;
+ VorlesungsplanUpcomingDayListItem lastDayItem = null;
+ upcomingDays.clear();
+ for(int i = 0; i < events.length; i++) {
+ int dayId = getDayId(events[i].getEventTo());
+ if(dayId > lastDayId) {
+ lastDayItem = new VorlesungsplanUpcomingDayListItem(events[i].getEventTo());
+ upcomingDays.add(lastDayItem);
+ lastDayId = dayId;
+ }
+ lastDayItem.addCourseEvent(events[i]);
+ }
+ if(upcomingDaysAdapter != null) {
+ upcomingDaysAdapter.notifyDataSetChanged();
+ }
+ }
+
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.TextView;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
+
+/**
+ * Created by pk910 on 20.02.2016.
+ */
+public class VorlesungsplanUpcomingCourseListItem {
+ private CourseEvent event;
+
+ public VorlesungsplanUpcomingCourseListItem(CourseEvent event) {
+ this.event = event;
+ }
+
+ public void updateContainerView(View view) {
+
+ SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm");
+ TextView timeFrom = (TextView) view.findViewById(R.id.timeFrom);
+ TextView timeTo = (TextView) view.findViewById(R.id.timeTo);
+ TextView location = (TextView) view.findViewById(R.id.location);
+ TextView courseTitle = (TextView) view.findViewById(R.id.courseTitle);
+
+ Date dateFrom = (new Date(event.getEventFrom() * 1000));
+ timeFrom.setText(dateFormat.format(dateFrom));
+
+ Date dateTo = (new Date(event.getEventTo() * 1000));
+ timeTo.setText(dateFormat.format(dateTo));
+
+ location.setText(event.getEventLocation());
+ courseTitle.setText(event.getEventTitle());
+ }
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ArrayAdapter;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import java.util.ArrayList;
+
+import de.dhbwloe.campusapp.R;
+
+/**
+ * Created by pk910 on 20.02.2016.
+ */
+public class VorlesungsplanUpcomingDayListAdapter extends ArrayAdapter<VorlesungsplanUpcomingDayListItem> {
+ private Context context;
+ private int layoutResourceId;
+ private ArrayList<VorlesungsplanUpcomingDayListItem> data = new ArrayList<VorlesungsplanUpcomingDayListItem>();
+
+ public VorlesungsplanUpcomingDayListAdapter(Context context, int layoutResourceId, ArrayList<VorlesungsplanUpcomingDayListItem> data) {
+ super(context, layoutResourceId, data);
+ this.layoutResourceId = layoutResourceId;
+ this.context = context;
+ this.data = data;
+ }
+
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ View row = convertView;
+ RecordHolder holder = null;
+
+ if (row == null) {
+ LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ row = inflater.inflate(layoutResourceId, parent, false);
+
+ holder = new RecordHolder(row);
+ row.setTag(holder);
+ } else {
+ holder = (RecordHolder) row.getTag();
+ }
+
+ final VorlesungsplanUpcomingDayListAdapter that = this;
+ final VorlesungsplanUpcomingDayListItem item = data.get(position);
+
+ item.addCourseEventsToContainer(holder.container);
+ holder.cardDate.setText(item.getFormatedDate());
+
+ return row;
+ }
+
+ static class RecordHolder {
+ TextView cardDate;
+ LinearLayout container;
+
+ public RecordHolder(View view) {
+ this.cardDate = (TextView) view.findViewById(R.id.cardDate);
+ this.container = (LinearLayout) view.findViewById(R.id.cardCourses);
+ }
+ }
+}
--- /dev/null
+package de.dhbwloe.campusapp.fragments;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.Date;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+import de.dhbwloe.campusapp.R;
+import de.dhbwloe.campusapp.Tools;
+import de.dhbwloe.campusapp.vorlesungen.CourseEvent;
+
+/**
+ * Created by pk910 on 20.02.2016.
+ */
+public class VorlesungsplanUpcomingDayListItem {
+ private long cardDate;
+ private ArrayList<VorlesungsplanUpcomingCourseListItem> courses = new ArrayList<VorlesungsplanUpcomingCourseListItem>();
+
+ public VorlesungsplanUpcomingDayListItem(long date) {
+ cardDate = date;
+ }
+
+ public void addCourseEventsToContainer(LinearLayout container) {
+ int courseEntries = container.getChildCount();
+
+ CampusAppContext AppContext = CampusAppContext.getInstance();
+ LayoutInflater inflater = (LayoutInflater) AppContext.getMainActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+ while(courseEntries < courses.size()) {
+ View view = inflater.inflate(R.layout.fragment_vorlesungsplan_upcoming_course, null);
+ container.addView(view);
+ courseEntries++;
+ }
+
+ int i;
+ for(i = 0; i < courses.size(); i++) {
+ View child = container.getChildAt(i);
+ courses.get(i).updateContainerView(child);
+ child.setVisibility(View.VISIBLE);
+ }
+ for(;i < courseEntries; i++) {
+ View child = container.getChildAt(i);
+ child.setVisibility(View.GONE);
+ }
+ }
+
+ public String getFormatedDate() {
+ SimpleDateFormat dateFormat = new SimpleDateFormat("dd.MM.");
+ Date date = new Date(cardDate * 1000);
+
+ int weekdayResIds[] = new int[] { R.string.week_saturday, R.string.week_sunday, R.string.week_monday, R.string.week_tuesday, R.string.week_wednesday, R.string.week_thursday, R.string.week_friday };
+ Calendar cal = Calendar.getInstance();
+ cal.setTime(date);
+ int dow = cal.get(Calendar.DAY_OF_WEEK);
+
+ return CampusAppContext.getInstance().getResString(weekdayResIds[dow]) + ", " + dateFormat.format(date);
+ }
+
+ public void addCourseEvent(CourseEvent event) {
+ VorlesungsplanUpcomingCourseListItem courseItem = new VorlesungsplanUpcomingCourseListItem(event);
+ courses.add(courseItem);
+ }
+
+}
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.wifi.ScanResult;
+import android.net.wifi.SupplicantState;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiEnterpriseConfig;
import android.net.wifi.WifiInfo;
import de.dhbwloe.campusapp.CampusAppFragment;
import de.dhbwloe.campusapp.R;
import de.dhbwloe.campusapp.search.SearchIndices;
+import de.dhbwloe.campusapp.wifi.WifiConfigurationManager;
+import de.dhbwloe.campusapp.wifi.WifiNetworkSettings;
/**
* A simple {@link Fragment} subclass.
};
}
- private enum WifiNetworkAuthenticationTypes {
- WIFI_AUTHTYPE_NONE,
- WIFI_AUTHTYPE_WEP,
- WIFI_AUTHTYPE_WPA,
- WIFI_AUTHTYPE_WPA_ENTERPRISE,
- };
-
- private class WifiNetworkSettingsSet {
- String name;
- String ssid;
- WifiNetworkAuthenticationTypes authType;
- int[] authAlgorithms;
- int eapMethod;
- int phase2Method;
-
- String caCertStr;
- String caName;
-
- String usernameSuffix;
- String username;
- String password;
-
- TabLayout.Tab tab;
- boolean isInScanResult = false;
-
- public WifiNetworkSettingsSet(String name, String ssid, WifiNetworkAuthenticationTypes authType) {
- this.name = name;
- this.ssid = ssid;
- this.authType = authType;
- }
-
- public WifiNetworkSettingsSet setWpaEnterprise(int[] authAlgorithms, int eapMethod, int phase2Method, String username) {
- this.authAlgorithms = authAlgorithms;
- this.eapMethod = eapMethod;
- this.phase2Method = phase2Method;
- this.username = username;
- return this;
- }
-
- public WifiNetworkSettingsSet setPassword(String password) {
- this.password = password;
- return this;
- }
-
- public WifiNetworkSettingsSet setCACertificate(String caname, String certificate) {
- this.caName = caname;
- this.caCertStr = certificate;
- return this;
- }
-
- public WifiNetworkSettingsSet setUserSuffix(String suffix) {
- this.usernameSuffix = suffix;
- return this;
- }
-
- public void setAuthData(String username, String password) {
- this.username = username;
- this.password = password;
- }
-
- public void setAuthData(String password) {
- this.password = password;
- }
-
- public X509Certificate generateCertificate() throws CertificateException, IOException {
- byte[] decoded = Base64.decode(caCertStr.replaceAll("-----BEGIN CERTIFICATE-----", "").replaceAll("-----END CERTIFICATE-----", ""), Base64.DEFAULT);
- return (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(decoded));
- }
- }
-
private View view;
private TabLayout tablayout;
- private WifiNetworkSettingsSet[] wifiPresets;
+ private WifiNetworkSettings[] wifiPresets;
private WifiManager wifiManager;
+ private WifiConfigurationManager wifiConfigManager;
private ConnectivityManager connectivityManager;
private int selectedNetworkIndex = 0;
private boolean networkScanned = false;
private BroadcastReceiver wifiStateReceiver = new BroadcastReceiver() {
@Override
- public void onReceive(Context arg0, Intent arg1) {
- NetworkInfo networkInfo = (NetworkInfo) arg1.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
- if (networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
+ public void onReceive(Context arg0, Intent intent) {
+ String action = intent.getAction();
+ if(action.equals(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION)){
+ WifiInfo myWifiInfo = wifiManager.getConnectionInfo();
+
+ WifiNetworkSettings settings = null;
+ for(int i = 0; i < wifiPresets.length; i++) {
+ if(wifiPresets[i].getSSID().equalsIgnoreCase(myWifiInfo.getSSID())) {
+ settings = wifiPresets[i];
+ break;
+ }
+ }
+
+ SupplicantState supl_state=((SupplicantState)intent.getParcelableExtra(WifiManager.EXTRA_NEW_STATE));
+ switch(supl_state){
+ case ASSOCIATING:
+ settings.isAssociating = true;
+ settings.isAssociated = false;
+ settings.isAuthenticated = false;
+ settings.isDisconnected = false;
+ break;
+ case ASSOCIATED:
+ settings.isAssociated = true;
+ break;
+ case COMPLETED:
+ settings.isAuthenticated = true;
+ break;
+ case DISCONNECTED:
+ settings.isAssociated = false;
+ settings.isAssociating = false;
+ settings.isDisconnected = true;
+ break;
+ default:
+ break;
+ }
+ updateWifiState();
+ }
+
+ NetworkInfo networkInfo = (NetworkInfo) intent.getParcelableExtra(ConnectivityManager.EXTRA_NETWORK_INFO);
+ if (networkInfo != null && networkInfo.getType() == ConnectivityManager.TYPE_WIFI) {
updateWifiState();
}
}
}
};
- private void loadDhbwWifiDefinitions() {
- int numOfNetworks = 3;
- int i = 0;
- wifiPresets = new WifiNetworkSettingsSet[numOfNetworks];
-
- wifiPresets[i++] = (new WifiNetworkSettingsSet("dhbw-secure", "dhbw-secure", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE)).
- setWpaEnterprise(
- new int[] {WifiConfiguration.KeyMgmt.WPA_EAP, WifiConfiguration.KeyMgmt.IEEE8021X},
- WifiEnterpriseConfig.Eap.PEAP,
- WifiEnterpriseConfig.Phase2.MSCHAPV2,
- null
- ).setCACertificate("Deutsche Telekom Root CA 2", "-----BEGIN CERTIFICATE-----\n" +
- "MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc\n" +
- "MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj\n" +
- "IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB\n" +
- "IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE\n" +
- "RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl\n" +
- "U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290\n" +
- "IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU\n" +
- "ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC\n" +
- "QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr\n" +
- "rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S\n" +
- "NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc\n" +
- "QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH\n" +
- "txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP\n" +
- "BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC\n" +
- "AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp\n" +
- "tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa\n" +
- "IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl\n" +
- "6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+\n" +
- "xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n" +
- "Cm26OWMohpLzGITY+9HPBVZkVw==\n" +
- "-----END CERTIFICATE-----");
-
- wifiPresets[i++] = (new WifiNetworkSettingsSet("dhbw-wlan", "dhbw-wlan", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_NONE));
-
- wifiPresets[i++] = (new WifiNetworkSettingsSet("eduroam", "eduroam", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE)).
- setWpaEnterprise(
- new int[] {WifiConfiguration.KeyMgmt.WPA_EAP, WifiConfiguration.KeyMgmt.IEEE8021X},
- WifiEnterpriseConfig.Eap.PEAP,
- WifiEnterpriseConfig.Phase2.MSCHAPV2,
- null
- ).setCACertificate("Deutsche Telekom Root CA 2", "-----BEGIN CERTIFICATE-----\n" +
- "MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc\n" +
- "MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj\n" +
- "IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB\n" +
- "IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE\n" +
- "RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl\n" +
- "U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290\n" +
- "IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU\n" +
- "ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC\n" +
- "QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr\n" +
- "rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S\n" +
- "NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc\n" +
- "QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH\n" +
- "txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP\n" +
- "BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC\n" +
- "AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp\n" +
- "tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa\n" +
- "IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl\n" +
- "6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+\n" +
- "xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n" +
- "Cm26OWMohpLzGITY+9HPBVZkVw==\n" +
- "-----END CERTIFICATE-----").
- setUserSuffix("@dhbw-loerrach.de");
- }
-
-
- @TargetApi(18)
- private void connectToWiFi(WifiNetworkSettingsSet settings) {
- WifiConfiguration wifiConfig = new WifiConfiguration();
- wifiConfig.SSID = settings.ssid;
- for(int i = 0; i < settings.authAlgorithms.length; i++)
- wifiConfig.allowedKeyManagement.set(settings.authAlgorithms[i]);
-
- switch(settings.authType) {
- case WIFI_AUTHTYPE_NONE:
- break;
- case WIFI_AUTHTYPE_WEP:
- // not supported by our app
- break;
- case WIFI_AUTHTYPE_WPA:
-
- break;
- case WIFI_AUTHTYPE_WPA_ENTERPRISE:
- WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
- String username = settings.username;
- if(settings.usernameSuffix != null)
- username += settings.usernameSuffix;
- enterpriseConfig.setIdentity(username);
- enterpriseConfig.setPassword(settings.password);
- enterpriseConfig.setEapMethod(settings.eapMethod);
- enterpriseConfig.setPhase2Method(settings.phase2Method);
- try {
- enterpriseConfig.setCaCertificate(settings.generateCertificate());
- } catch (CertificateException e) {
- } catch (IOException e) {
- }
- wifiConfig.enterpriseConfig = enterpriseConfig;
- break;
- }
- int networkId = wifiManager.addNetwork(wifiConfig);
- wifiManager.enableNetwork(networkId, true);
- }
-
-
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- loadDhbwWifiDefinitions();
+
+ wifiPresets = WifiNetworkSettings.LoadNetworkSettingPresets(AppContext);
+
wifiManager = (WifiManager)AppContext.getMainActivity().getSystemService(AppContext.getMainActivity().WIFI_SERVICE);
connectivityManager = (ConnectivityManager) AppContext.getMainActivity().getSystemService(Activity.CONNECTIVITY_SERVICE);
+
+ wifiConfigManager = new WifiConfigurationManager(wifiManager);
}
private void updateSelectedNetworkInformation() {
if(selectedNetworkIndex >= wifiPresets.length)
return;
- WifiNetworkSettingsSet settings = wifiPresets[selectedNetworkIndex];
+ WifiNetworkSettings settings = wifiPresets[selectedNetworkIndex];
TextView ssidInfoView = (TextView) view.findViewById(R.id.ssidInfo);
TextView securityInfoView = (TextView) view.findViewById(R.id.securityInfo);
TextView eapInfoView = (TextView) view.findViewById(R.id.eapInfo);
RelativeLayout insecureNetWarning = (RelativeLayout) view.findViewById(R.id.insecureNetWarning);
- ssidInfoView.setText(settings.ssid);
+ ssidInfoView.setText(settings.getSSID());
eapInfoRow.setVisibility(View.GONE);
phase2InfoRow.setVisibility(View.GONE);
pskInfoRow.setVisibility(View.GONE);
insecureNetWarning.setVisibility(View.GONE);
- switch(settings.authType) {
+ switch(settings.getAuthType()) {
case WIFI_AUTHTYPE_NONE:
securityInfoView.setText(R.string.wifiopts_security_open);
break;
}
- if(settings.authType == WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE) {
+ if(settings.getAuthType() == WifiNetworkSettings.WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE) {
int eapStringId = 0;
- switch(settings.eapMethod) {
+ switch(settings.getEapMethod()) {
case WifiEnterpriseConfig.Eap.PEAP:
eapStringId = R.string.wifiopts_eap_peap;
break;
eapInfoView.setText("");
int phase2StringId = 0;
- switch(settings.phase2Method) {
+ switch(settings.getPhase2Method()) {
case WifiEnterpriseConfig.Phase2.MSCHAPV2:
phase2StringId = R.string.wifiopts_phase2_mschapv2;
break;
else
phase2InfoView.setText("");
- cacertInfoView.setText(settings.caName);
+ cacertInfoView.setText(settings.getCAName());
} else {
}
private void updateWifiState() {
NetworkInfo myNetworkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
WifiInfo myWifiInfo = wifiManager.getConnectionInfo();
+ String ssid = (myWifiInfo != null ? myWifiInfo.getSSID() : null);
+ if(ssid == null)
+ return;
+
+ WifiNetworkSettings settings = null;
+ for(int i = 0; i < wifiPresets.length; i++) {
+ if(wifiPresets[i].getSSID().equalsIgnoreCase(ssid)) {
+ settings = wifiPresets[i];
+ break;
+ }
+ }
+ if(settings == null)
+ return;
+
+ if(settings.isTryConnecting) {
+ boolean success = false;
+ if(settings.isDisconnected) {
+ settings.failedAuthentication = true;
+ settings.isTryConnecting = false;
+ } else if(settings.isAssociated) {
+ settings.isTryConnecting = false;
+ success = true;
+ }
+ if(!settings.isTryConnecting) {
+ // success
+ // TODO: continue
+ }
+ }
+
Resources resources = AppContext.getMainActivity().getResources();
String status;
if(myNetworkInfo.isConnectedOrConnecting()) {
int statusId = (myNetworkInfo.isConnected() ? R.string.wifisettings_status_connected : R.string.wifisettings_status_connecting);
- String ssid = myWifiInfo.getSSID();
+ ssid = ssid.replace("\"", "");
status = String.format(resources.getString(statusId), ssid);
+
+
+
+
+ //if(networkConnecting && wifiPresets[connectingNetworkIndex].getSSID().equalsIgnoreCase(ssid)) {
+
+ /*
+
+ wifiConfigManager.finalizeConnection(wifiPresets[connectingNetworkIndex], myNetworkInfo, myWifiInfo, new WifiConfigurationManager.WifiConfigurationComplete() {
+ @Override
+ public void onWifiConfigurationComplete(WifiNetworkSettings settings, String response) {
+ networkConnecting = false;
+ connectingNetworkIndex = 0;
+ updateWifiConnectButton();
+ }
+ });
+ */
+ //}
} else {
status = resources.getString(R.string.wifisettings_status_disconnected);
}
for(int i = 0; i < wifiPresets.length; i++) {
boolean networkFound = false;
for(ScanResult result : scanResultList) {
- if(result.SSID != null && result.SSID.equalsIgnoreCase(wifiPresets[i].ssid)) {
+ if(result.SSID != null && result.SSID.equalsIgnoreCase(wifiPresets[i].getSSID())) {
networkFound = true;
break;
}
private void updateWifiConnectButton() {
if(selectedNetworkIndex >= wifiPresets.length)
return;
- WifiNetworkSettingsSet preset = wifiPresets[selectedNetworkIndex];
+ WifiNetworkSettings preset = wifiPresets[selectedNetworkIndex];
boolean buttonEnabled = false;
int buttonTextId = 0;
if(!wifiManager.isWifiEnabled()) {
buttonTextId = R.string.wifisettings_connect_button_disabled;
- } else if(networkInfo.isConnectedOrConnecting() && wifiInfo.getSSID() != null && wifiInfo.getSSID().equalsIgnoreCase(preset.ssid)) {
+ } else if(networkInfo.isConnectedOrConnecting() && wifiInfo.getSSID() != null && wifiInfo.getSSID().equalsIgnoreCase(preset.getSSID())) {
buttonTextId = R.string.wifisettings_connect_button_ready;
+ } else if(preset.isTryConnecting) {
+ buttonTextId = R.string.wifisettings_connect_button_connecting;
} else if(!networkScanned) {
buttonTextId = R.string.wifisettings_connect_button_scan;
} else if(!preset.isInScanResult) {
tablayout.removeAllTabs();
for(int i = 0; i < wifiPresets.length; i++) {
TabLayout.Tab tab = tablayout.newTab();
- tab.setText(wifiPresets[i].name);
+ tab.setText(wifiPresets[i].getName());
tablayout.addTab(tab);
}
tablayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
connectBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
- Button connectBtn = (Button) v;
- connectBtn.setEnabled(false);
- WifiNetworkSettingsSet settings = wifiPresets[selectedNetworkIndex];
+ WifiNetworkSettings settings = wifiPresets[selectedNetworkIndex];
if(!settings.isInScanResult) {
networkScanned = false;
wifiManager.startScan();
return;
}
+
+
EditText usernameEdt = (EditText) view.findViewById(R.id.wifiUsername);
EditText passwordEdt = (EditText) view.findViewById(R.id.wifiPassword);
String username = usernameEdt.getText().toString();
String password = passwordEdt.getText().toString();
- if (Build.VERSION.SDK_INT < 18) {
- // connectToDHWiFi not supported!
- // do something else?
- } else if (username.length() > 0 && password.length() > 0) {
-
+ if (username.length() > 0 && password.length() > 0) {
if(settings != null) {
+ settings.isTryConnecting = true;
settings.setAuthData(username, password);
- connectToWiFi(settings);
+
+ wifiConfigManager.connect(settings);
}
- }
- connectBtn.setEnabled(true);
+ updateWifiConnectButton();
+ }
}
});
if(AppContext == null)
AppContext = CampusAppContext.getInstance();
- AppContext.getMainActivity().registerReceiver(this.wifiStateReceiver, new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION));
+ IntentFilter filter = new IntentFilter();
+ filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
+ filter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
+ AppContext.getMainActivity().registerReceiver(this.wifiStateReceiver, new IntentFilter(filter));
AppContext.getMainActivity().registerReceiver(this.wifiScanReceiver, new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION));
networkScanned = false;
timeFrom = now - (86400 * 5);
timeTo = now + (86400 * 7 * 4);
} else {
- timeFrom = now - (86400 * 365 * 3);
+ timeFrom = now - (86400 * 365 * 4);
timeTo = now + (86400 * 365 * 4);
}
CourseEvent[] events = AppContext.getDatabaseManager().getCourseCalendarEvents(sCourseName, timeFrom, timeTo);
}
}
- dbEvent.update(AppContext.getDatabaseManager());
+ dbEvent.update(AppContext.getDatabaseManager(), event);
Log.i("CMSync", "Update Event: "+dbEvent.getUniqueId());
}
package de.dhbwloe.campusapp.vorlesungen;
+import net.fortuna.ical4j.model.Component;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
import de.dhbwloe.campusapp.database.DatabaseManager;
/**
* Created by pk910 on 20.01.2016.
*/
-public class CourseEvent {
+public class CourseEvent implements Comparable<CourseEvent> {
+ public enum CourseType {
+ COURSETYPE_NORMAL,
+ COURSETYPE_SPECIAL,
+ COURSETYPE_KLAUSUR,
+ }
+
private int iEventId;
private String sCourseName;
private String sUniqueId;
private int iSequenceId;
private long iEventFrom, iEventTo;
- private String sEventTitle, sEventLocation, sEventStatus;
+ private String sEventTitle, sEventTitleShort, sEventTitleAuthor, sEventLocation, sEventStatus;
private String sRecurRule, sExcludeDates;
private CourseGroup oCourseGroup;
+ private CourseType oCourseType = null;
private boolean bMustUpdate = false;
private boolean bIsNew = false;
- public CourseEvent(int id, String coursename, String uniqueid, int sequenceid, long eventfrom, long eventto, String title, String location, String status, String rrule, String exdates, CourseGroup group) {
+ private boolean bIsKlausurPraesi = false;
+
+ public CourseEvent(int id, String coursename, String uniqueid, int sequenceid, long eventfrom, long eventto, String title, String location, String status, String rrule, String exdates, CourseGroup group, int eventtype) {
iEventId = id;
sCourseName = coursename;
sUniqueId = uniqueid;
sExcludeDates = exdates;
oCourseGroup = group;
- if(group != null)
+ if(group != null) {
group.addCourseEvent(this);
+ try {
+ oCourseType = CourseType.values()[eventtype];
+ } catch(Exception e) {}
+ }
+
+ ParseEventTitle();
}
public CourseEvent(String coursename, String uniqueid, int sequenceid, boolean isNew) {
bMustUpdate = isNew;
}
+ public void ParseEventTitle() {
+ Pattern pattern = Pattern.compile("^((Klausur|Tutorium|Pr(ä|ae)sentation)[ :]+)?(.*?)( - ([a-zA-Z., -]+))?$");
+ Matcher m = pattern.matcher(sEventTitle);
+ CourseType oldtype = oCourseType;
+ boolean typeisset = (oCourseType != null);
+ if (m.matches()) {
+ String eventType = m.group(2);
+ if (!typeisset && eventType != null && !eventType.isEmpty()) {
+ if(eventType.equalsIgnoreCase("Klausur"))
+ oCourseType = CourseType.COURSETYPE_KLAUSUR;
+ else if(eventType.equalsIgnoreCase("Präsentation") || eventType.equalsIgnoreCase("Praesentation")) {
+ oCourseType = CourseType.COURSETYPE_KLAUSUR;
+ bIsKlausurPraesi = true;
+ } else if(eventType.equalsIgnoreCase("Tutorium"))
+ oCourseType = CourseType.COURSETYPE_SPECIAL;
+
+ typeisset = true;
+ }
+ sEventTitleShort = m.group(4);
+ sEventTitleAuthor = m.group(6);
+ } else {
+ sEventTitleShort = sEventTitle;
+ sEventTitleAuthor = "";
+ }
+ if(!typeisset)
+ oCourseType = CourseType.COURSETYPE_NORMAL;
+
+ if(oldtype != oCourseType)
+ bMustUpdate = true;
+ }
+
public void setEventId(int id) {
iEventId = id;
}
bMustUpdate = false;
}
- public void update(DatabaseManager dbm) {
+ public void update(DatabaseManager dbm, Component event) {
if(!bMustUpdate)
return;
- dbm.updateCourseCalendar(this);
+ dbm.updateCourseCalendar(this, event);
resetUpdateFlag();
}
return oCourseGroup;
}
+ public void setCourseType(CourseType type) {
+ oCourseType = type;
+ }
+
+ public CourseType getCourseType() {
+ return oCourseType;
+ }
+
+ public int getCourseTypeId() {
+ for(int i = 0; i < CourseType.values().length; i++) {
+ if(oCourseType == CourseType.values()[i])
+ return i;
+ }
+ return 0;
+ }
+
public void setCourseGroup(CourseGroup group) {
group.addCourseEvent(this);
oCourseGroup = group;
return sEventTitle;
}
public String getGroupTitle() {
- return sEventTitle; // maybe cut prof name?
+ return sEventTitleShort + (sEventTitleAuthor == null ? "" : " - " + sEventTitleAuthor);
+ }
+ public String getEventShortTitle() {
+ return sEventTitleShort;
+ }
+ public String getEventDozent() {
+ return sEventTitleAuthor;
}
public void setEventTitle(String sEventTitle) {
this.sEventTitle = sEventTitle;
+ ParseEventTitle();
bMustUpdate = true;
}
this.sExcludeDates = exrules;
bMustUpdate = true;
}
+
+ public boolean getIsKlausurPraesi() {
+ return bIsKlausurPraesi;
+ }
+
+ @Override
+ public int compareTo(CourseEvent another) {
+ return (int)(another.getEventFrom() - iEventFrom);
+ }
}
package de.dhbwloe.campusapp.vorlesungen;
+import android.os.Bundle;
import android.provider.ContactsContract;
+import java.lang.reflect.Array;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import de.dhbwloe.campusapp.database.DatabaseManager;
private boolean bIsNew = false;
private ArrayList<CourseEvent> events = new ArrayList<CourseEvent>();
+ private Bundle extraData = new Bundle();
+
public static CourseGroup GetCourseGroupById(DatabaseManager dbm, int id) {
for(CourseGroup group : CourseGroups) {
if(group.iCourseGroupId == id)
return (CourseEvent[])this.events.toArray();
}
+ public CourseEvent[] getOrderedCourseEvents() {
+ CourseEvent[] events = getCourseEvents();
+
+ Arrays.sort(events);
+
+ return events;
+ }
+
public int getGroupId() {
return iCourseGroupId;
}
return ret;
}
+ public Bundle getExtraData() {
+ return extraData;
+ }
+
+ public String getGroupName() {
+ return sCourseGroupName;
+ }
+
}
--- /dev/null
+package de.dhbwloe.campusapp.wifi;
+
+import android.app.DownloadManager;
+import android.net.NetworkInfo;
+import android.net.SSLCertificateSocketFactory;
+import android.net.SSLSessionCache;
+import android.net.wifi.WifiInfo;
+import android.os.AsyncTask;
+import android.util.Log;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+
+import cz.msebera.android.httpclient.HttpVersion;
+import cz.msebera.android.httpclient.NameValuePair;
+import cz.msebera.android.httpclient.client.HttpClient;
+import cz.msebera.android.httpclient.client.methods.HttpPost;
+import cz.msebera.android.httpclient.conn.ClientConnectionManager;
+import cz.msebera.android.httpclient.conn.scheme.PlainSocketFactory;
+import cz.msebera.android.httpclient.conn.scheme.Scheme;
+import cz.msebera.android.httpclient.conn.scheme.SchemeRegistry;
+import cz.msebera.android.httpclient.impl.client.DefaultHttpClient;
+import cz.msebera.android.httpclient.impl.conn.tsccm.ThreadSafeClientConnManager;
+import cz.msebera.android.httpclient.message.BasicNameValuePair;
+import cz.msebera.android.httpclient.params.BasicHttpParams;
+import cz.msebera.android.httpclient.params.HttpParams;
+import cz.msebera.android.httpclient.params.HttpProtocolParams;
+import cz.msebera.android.httpclient.protocol.HTTP;
+import de.dhbwloe.campusapp.CampusAppContext;
+
+/**
+ * Created by pk910 on 08.02.2016.
+ */
+public class SecureLoginManager extends AsyncTask<SecureLoginTask, Void, SecureLoginTask> {
+ private static final String SECURELOGIN_URL = "https://securelogin1.dhbw-loerrach.de/cgi-bin/login";
+ private static final int SECURELOGIN_TIMEOUT = 20000;
+ private static final int SECURELOGIN_HANDSHAKE_TIMEOUT = 10000;
+ private static String SECURELOGIN_FAILED_REGEX = "Authentication failed";
+ private static String SECURELOGIN_SUCCESS_REGEX = "User Authenticated";
+
+ public interface SecureLoginResult {
+ void onSecureLoginFailed(String errMsg);
+ void onSecureLoginSuccess();
+ }
+
+ private CampusAppContext AppContext;
+ private SecureLoginTask task;
+ private String responseString;
+
+ @Override
+ protected SecureLoginTask doInBackground(SecureLoginTask... params) {
+ task = params[0];
+ if (AppContext == null)
+ AppContext = CampusAppContext.getInstance();
+
+ task.responseReceived = false;
+ task.responseString = null;
+
+ //build login post request:
+ //https://securelogin1.dhbw-loerrach.de/cgi-bin/login
+ // user=***censored***
+ // password=***censored***
+ // cmd=authenticate
+ // Login=Log+In
+
+ /* Dear DHBW Tech Guys
+ * Go and replace these fucking outdated and insecure SSL implementation for your "secure"login page!
+ * 3DES_EDE_CBC
+ *
+ * Ok, after ~3 days android ssl library analysis, i've finnaly made it communicating with an 3DES Endpoint.
+ * Dear DHBW Tech Guys, gu fuck yourself! If you don't know why, continue (^.^)
+ */
+
+ //SSLSocket socket = null;
+ StringBuilder responseString = new StringBuilder();
+ try {
+ SSLContext sslContext = SSLContext.getInstance("TLS");
+ SecureLoginTrustManager loginTrustManager = new SecureLoginTrustManager();
+ sslContext.init(null, new TrustManager[]{loginTrustManager}, null);
+ SSLSocketFactory innerSslSocketPactory = SSLCertificateSocketFactory.getInsecure(SECURELOGIN_HANDSHAKE_TIMEOUT, new SSLSessionCache(AppContext.getMainActivity()));
+ SSLSocketFactory sslSocketFactory = new SecureLoginSocketFactory(sslContext, innerSslSocketPactory);
+
+ //SSLSocket socket = (SSLSocket) sslSocketFactory.createSocket("securelogin1.dhbw-loerrach.de", 443);
+ //socket.startHandshake();
+
+ Log.i("SecureLogin", "HTTPS INITIALIZED");
+
+ URL url = new URL(SECURELOGIN_URL);
+ URLConnection conn = url.openConnection();
+ if (conn instanceof HttpsURLConnection) {
+ ((HttpsURLConnection)conn).setSSLSocketFactory(sslSocketFactory);
+ ((HttpsURLConnection )conn).setRequestMethod("POST");
+ ((HttpsURLConnection)conn).setHostnameVerifier(org.apache.http.conn.ssl.SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
+ } else {
+ ((HttpURLConnection) conn).setRequestMethod("POST");
+ }
+ conn.setConnectTimeout(SECURELOGIN_TIMEOUT);
+ conn.setReadTimeout(SECURELOGIN_TIMEOUT);
+
+ conn.setDoInput(true);
+ conn.setDoOutput(true);
+
+ List<NameValuePair> postData = new ArrayList<NameValuePair>();
+ postData.add(new BasicNameValuePair("cmd", "authenticate"));
+ postData.add(new BasicNameValuePair("Login", "Log+In"));
+ postData.add(new BasicNameValuePair("user", task.settings.username));
+ postData.add(new BasicNameValuePair("password", task.settings.password));
+
+ OutputStream os = conn.getOutputStream();
+ BufferedWriter writer = new BufferedWriter(
+ new OutputStreamWriter(os, "UTF-8"));
+ String postString = encodePostData(postData);
+ writer.write(postString);
+ writer.flush();
+ writer.close();
+ os.close();
+
+ conn.connect();
+
+ int responseCode;
+ if (conn instanceof HttpsURLConnection)
+ responseCode = ((HttpsURLConnection)conn).getResponseCode();
+ else
+ responseCode = ((HttpURLConnection)conn).getResponseCode();
+
+ if (responseCode == HttpsURLConnection.HTTP_OK) {
+ task.responseReceived = true;
+ String line;
+ BufferedReader br=new BufferedReader(new InputStreamReader(conn.getInputStream()));
+ while ((line=br.readLine()) != null) {
+ responseString.append(line);
+ }
+ } else {
+ task.responseError = "HTTP " + Integer.toString(responseCode);
+ }
+
+ } catch (Exception e) {
+ task.responseError = e.getMessage();
+ }
+
+ task.responseString = responseString.toString();
+
+ return task;
+ }
+
+ @Override
+ protected void onPreExecute() {
+ super.onPreExecute();
+
+ }
+
+ @Override
+ protected void onPostExecute(SecureLoginTask task) {
+ super.onPostExecute(task);
+
+ boolean success = false;
+ String error = null;
+
+ if(task.responseReceived) {
+ Pattern p1 = Pattern.compile(SECURELOGIN_SUCCESS_REGEX);
+ Pattern p2 = Pattern.compile(SECURELOGIN_FAILED_REGEX);
+
+ Matcher m1 = p1.matcher(task.responseString);
+ Matcher m2 = p2.matcher(task.responseString);
+
+ if(m1.find())
+ success = true;
+ else if(m2.find())
+ error = "Incorrect username or password code entered. Please try again.";
+ else
+ error = "An unknown error occured!";
+ } else if(task.responseError != null) {
+ error = task.responseError;
+ }
+ if(success)
+ task.loginCallback.onSecureLoginSuccess();
+ else
+ task.loginCallback.onSecureLoginFailed(error);
+ }
+
+ private String encodePostData(List<NameValuePair> params) throws UnsupportedEncodingException {
+ StringBuilder result = new StringBuilder();
+ boolean first = true;
+
+ for (NameValuePair pair : params) {
+ if (first)
+ first = false;
+ else
+ result.append("&");
+
+ result.append(URLEncoder.encode(pair.getName(), "UTF-8"));
+ result.append("=");
+ result.append(URLEncoder.encode(pair.getValue(), "UTF-8"));
+ }
+
+ return result.toString();
+ }
+}
--- /dev/null
+package de.dhbwloe.campusapp.wifi;
+
+import android.util.Log;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.Socket;
+import java.net.UnknownHostException;
+import java.security.KeyManagementException;
+import java.security.NoSuchAlgorithmException;
+import java.security.SecureRandom;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSocket;
+import javax.net.ssl.SSLSocketFactory;
+import javax.net.ssl.TrustManager;
+
+public class SecureLoginSocketFactory extends SSLSocketFactory {
+ private static final String ENABLED_PROTOCOLS[] = {
+ "TLSv1", "TLSv1.1", "TLSv1.2"
+ };
+ private static final String ENABLED_CIPHERS[] = {
+ "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA",
+ "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA",
+ "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA",
+ "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA",
+ "TLS_DHE_RSA_WITH_AES_128_CBC_SHA",
+ "TLS_DHE_RSA_WITH_AES_256_CBC_SHA",
+ "TLS_DHE_DSS_WITH_AES_128_CBC_SHA",
+ "TLS_ECDHE_RSA_WITH_RC4_128_SHA",
+ "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA",
+ "TLS_RSA_WITH_AES_128_CBC_SHA",
+ "TLS_RSA_WITH_AES_256_CBC_SHA",
+ "SSL_RSA_WITH_3DES_EDE_CBC_SHA",
+ "SSL_RSA_WITH_RC4_128_SHA",
+ "SSL_RSA_WITH_RC4_128_MD5",
+ };
+
+ private SSLSocketFactory socketFactory;
+ public SSLContext context;
+
+ public SecureLoginSocketFactory(SSLContext context, SSLSocketFactory innerSslSocketFactory) {
+ super();
+ this.context = context;
+ this.socketFactory = innerSslSocketFactory;
+ }
+
+ @Override
+ public String[] getDefaultCipherSuites() {
+ return socketFactory.getDefaultCipherSuites();
+ }
+
+ @Override
+ public String[] getSupportedCipherSuites() {
+ return socketFactory.getSupportedCipherSuites();
+ }
+
+ @Override
+ public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
+ return enableTLSOnSocket(socketFactory.createSocket(s, host, port, autoClose));
+ }
+
+ @Override
+ public Socket createSocket(String host, int port) throws IOException, UnknownHostException {
+ return enableTLSOnSocket(socketFactory.createSocket(host, port));
+ }
+
+ @Override
+ public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException {
+ return enableTLSOnSocket(socketFactory.createSocket(host, port, localHost, localPort));
+ }
+
+ @Override
+ public Socket createSocket(InetAddress host, int port) throws IOException {
+ return enableTLSOnSocket(socketFactory.createSocket(host, port));
+ }
+
+ @Override
+ public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
+ return enableTLSOnSocket(socketFactory.createSocket(address, port, localAddress, localPort));
+ }
+
+ private Socket enableTLSOnSocket(Socket socket) {
+ if(socket != null && (socket instanceof SSLSocket)) {
+ SSLSocket sslSocket = ((SSLSocket) socket);
+
+ sslSocket.setEnabledCipherSuites(ENABLED_CIPHERS);
+ sslSocket.setEnabledProtocols(ENABLED_PROTOCOLS);
+ }
+ return socket;
+ }
+
+}
\ No newline at end of file
--- /dev/null
+package de.dhbwloe.campusapp.wifi;
+
+import android.net.NetworkInfo;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+
+/**
+ * Created by pk910 on 08.02.2016.
+ */
+public class SecureLoginTask {
+ public WifiNetworkSettings settings;
+ public NetworkInfo networkInfo;
+ public WifiInfo wifiInfo;
+
+ public boolean responseReceived;
+ public String responseString;
+ public String responseError;
+
+ public SecureLoginManager.SecureLoginResult loginCallback;
+}
--- /dev/null
+package de.dhbwloe.campusapp.wifi;
+
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+
+/**
+ * Created by pk910 on 12.02.2016.
+ */
+public class SecureLoginTrustManager implements javax.net.ssl.X509TrustManager {
+ private static final X509Certificate[] _AcceptedIssuers = new X509Certificate[] {};
+
+ public void checkClientTrusted(X509Certificate[] arg0, String arg1)
+ throws CertificateException {
+ }
+
+ public void checkServerTrusted(X509Certificate[] arg0, String arg1)
+ throws CertificateException {
+ }
+
+ public boolean isClientTrusted(X509Certificate[] chain) {
+ return (true);
+ }
+
+ public boolean isServerTrusted(X509Certificate[] chain) {
+ return (true);
+ }
+
+ public X509Certificate[] getAcceptedIssuers() {
+ return (_AcceptedIssuers);
+ }
+}
--- /dev/null
+package de.dhbwloe.campusapp.wifi;
+
+import android.annotation.TargetApi;
+import android.net.NetworkInfo;
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiEnterpriseConfig;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Build;
+
+import java.io.IOException;
+import java.security.cert.CertificateException;
+
+/**
+ * Created by pk910 on 08.02.2016.
+ */
+public class WifiConfigurationManager {
+ public interface WifiConfigurationComplete {
+ public void onWifiConfigurationComplete(WifiNetworkSettings settings, String response);
+ }
+
+ private WifiManager wifiManager;
+
+ public WifiConfigurationManager(WifiManager wifiManager) {
+ this.wifiManager = wifiManager;
+ }
+
+ public void connect(WifiNetworkSettings settings) {
+ if (Build.VERSION.SDK_INT >= 18) {
+ connectToWiFi(settings);
+ }
+ }
+
+
+ @TargetApi(18)
+ private void connectToWiFi(WifiNetworkSettings settings) {
+ WifiConfiguration wifiConfig = new WifiConfiguration();
+ wifiConfig.SSID = settings.ssid;
+ for(int i = 0; i < settings.authAlgorithms.length; i++)
+ wifiConfig.allowedKeyManagement.set(settings.authAlgorithms[i]);
+
+ switch(settings.authType) {
+ case WIFI_AUTHTYPE_NONE:
+ break;
+ case WIFI_AUTHTYPE_WEP:
+ // not supported by our app
+ break;
+ case WIFI_AUTHTYPE_WPA:
+
+ break;
+ case WIFI_AUTHTYPE_WPA_ENTERPRISE:
+ WifiEnterpriseConfig enterpriseConfig = new WifiEnterpriseConfig();
+ String username = settings.username;
+ if(settings.usernameSuffix != null)
+ username += settings.usernameSuffix;
+ enterpriseConfig.setIdentity(username);
+ enterpriseConfig.setPassword(settings.password);
+ enterpriseConfig.setEapMethod(settings.eapMethod);
+ enterpriseConfig.setPhase2Method(settings.phase2Method);
+ try {
+ enterpriseConfig.setCaCertificate(settings.generateCertificate());
+ } catch (CertificateException e) {
+ } catch (IOException e) {
+ }
+ wifiConfig.enterpriseConfig = enterpriseConfig;
+ break;
+ }
+ int networkId = wifiManager.addNetwork(wifiConfig);
+ wifiManager.enableNetwork(networkId, true);
+ }
+
+}
--- /dev/null
+package de.dhbwloe.campusapp.wifi;
+
+import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiEnterpriseConfig;
+import android.support.design.widget.TabLayout;
+import android.util.Base64;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.security.cert.CertificateException;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+
+import de.dhbwloe.campusapp.CampusAppContext;
+
+/**
+ * Created by pk910 on 08.02.2016.
+ */
+public class WifiNetworkSettings {
+ public static WifiNetworkSettings[] LoadNetworkSettingPresets(CampusAppContext context) {
+ ArrayList<WifiNetworkSettings> presets = new ArrayList<WifiNetworkSettings>();
+
+ presets.add((new WifiNetworkSettings("dhbw-secure", "dhbw-secure", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE)).
+ setWpaEnterprise(
+ new int[]{WifiConfiguration.KeyMgmt.WPA_EAP, WifiConfiguration.KeyMgmt.IEEE8021X},
+ WifiEnterpriseConfig.Eap.PEAP,
+ WifiEnterpriseConfig.Phase2.MSCHAPV2,
+ null
+ ).setCACertificate("Deutsche Telekom Root CA 2", "-----BEGIN CERTIFICATE-----\n" +
+ "MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc\n" +
+ "MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj\n" +
+ "IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB\n" +
+ "IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE\n" +
+ "RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl\n" +
+ "U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290\n" +
+ "IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU\n" +
+ "ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC\n" +
+ "QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr\n" +
+ "rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S\n" +
+ "NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc\n" +
+ "QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH\n" +
+ "txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP\n" +
+ "BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC\n" +
+ "AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp\n" +
+ "tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa\n" +
+ "IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl\n" +
+ "6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+\n" +
+ "xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n" +
+ "Cm26OWMohpLzGITY+9HPBVZkVw==\n" +
+ "-----END CERTIFICATE-----"));
+
+ presets.add((new WifiNetworkSettings("dhbw-wlan", "dhbw-wlan", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_NONE)).
+ setDHSecureLogin(new SecureLoginManager()).setCACertificate("DHBW CA - G01", "-----BEGIN CERTIFICATE-----\n" +
+ "MIIFSjCCBDKgAwIBAgIHF6/20DYr2jANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQG\n" +
+ "EwJERTETMBEGA1UEChMKREZOLVZlcmVpbjEQMA4GA1UECxMHREZOLVBLSTEkMCIG\n" +
+ "A1UEAxMbREZOLVZlcmVpbiBQQ0EgR2xvYmFsIC0gRzAxMB4XDTE0MDYwNTE0MDU1\n" +
+ "MloXDTE5MDcwOTIzNTkwMFowcjELMAkGA1UEBhMCREUxLDAqBgNVBAoTI0R1YWxl\n" +
+ "IEhvY2hzY2h1bGUgQmFkZW4tV3VlcnR0ZW1iZXJnMRYwFAYDVQQDEw1ESEJXIENB\n" +
+ "IC0gRzAxMR0wGwYJKoZIhvcNAQkBFg5wa2lAZGhidy12cy5kZTCCASIwDQYJKoZI\n" +
+ "hvcNAQEBBQADggEPADCCAQoCggEBALtoqHrbNRjuRdIh20VPATXIitkVgIva+HcA\n" +
+ "Q7qA87lsm6v28DSasCPgx+TnGoUduGucA7fA7UhtWGqmU5cbJ5Ucsra0XBwqbOEN\n" +
+ "u7GIBVcK7vUac67Ny+9TEqB/mtKz4nU/G8TlpX5hotMDg4H46SvtIvtSz1RJ2BVs\n" +
+ "ssssubz3zI/W5Y6qqfRhZGLzrqmZYYlfCc/sn0jOkElgomAzzt4rmKRq8CsX3bYJ\n" +
+ "ImeUaEHXU5QgTEZLgA9olse54r6N2O+cM4y/eDK9q9RaWdjNKTDsRq/sILlgUIaO\n" +
+ "XcxzBa3pOhQ7zRb5amGiTIxWb2Szzy+Ka1XO9BseTFCcot8BAO8CAwEAAaOCAfsw\n" +
+ "ggH3MBIGA1UdEwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMBEGA1UdIAQK\n" +
+ "MAgwBgYEVR0gADAdBgNVHQ4EFgQUjOlwcWC4U59ExpdeQh/tKHK9Dn4wHwYDVR0j\n" +
+ "BBgwFoAUSbfGz+g9H3/qRHsTKffxCnA+3mQwGQYDVR0RBBIwEIEOcGtpQGRoYnct\n" +
+ "dnMuZGUwgYgGA1UdHwSBgDB+MD2gO6A5hjdodHRwOi8vY2RwMS5wY2EuZGZuLmRl\n" +
+ "L2dsb2JhbC1yb290LWNhL3B1Yi9jcmwvY2FjcmwuY3JsMD2gO6A5hjdodHRwOi8v\n" +
+ "Y2RwMi5wY2EuZGZuLmRlL2dsb2JhbC1yb290LWNhL3B1Yi9jcmwvY2FjcmwuY3Js\n" +
+ "MIHXBggrBgEFBQcBAQSByjCBxzAzBggrBgEFBQcwAYYnaHR0cDovL29jc3AucGNh\n" +
+ "LmRmbi5kZS9PQ1NQLVNlcnZlci9PQ1NQMEcGCCsGAQUFBzAChjtodHRwOi8vY2Rw\n" +
+ "MS5wY2EuZGZuLmRlL2dsb2JhbC1yb290LWNhL3B1Yi9jYWNlcnQvY2FjZXJ0LmNy\n" +
+ "dDBHBggrBgEFBQcwAoY7aHR0cDovL2NkcDIucGNhLmRmbi5kZS9nbG9iYWwtcm9v\n" +
+ "dC1jYS9wdWIvY2FjZXJ0L2NhY2VydC5jcnQwDQYJKoZIhvcNAQELBQADggEBAMS9\n" +
+ "5ypdDi/q3AeBOfzj3A3PZaQaLumKxvVeA2xy8j8XtwWpPeG99QwtqeKlJ3+OCuwT\n" +
+ "eRtkWxnsm0eonLYI2rSL8y94LUoM0kj4GiHbRqL4eqPJKCwoQeTWxkeW/2fmZPtn\n" +
+ "u9zBDAWFDgMtK9iiIOzp9FlNljHKJH1EdaWJD/Gv/5+ElNZpFDZ/oz/kosyvLeWZ\n" +
+ "EiA3U8/LDPFPlxe+gVqmr7+tzo88/C6i3NZSaUJ3qkaWSxx+xx/sNXoHX22msHwN\n" +
+ "SqnBQinCotrRO3WgZVDvhN3/eHZ8Zj7z6re7x/qlIGsKDVGxidWjGQDF2jp8O5Rp\n" +
+ "uD3s1d70097Es++KwAg=\n" +
+ "-----END CERTIFICATE-----\n"));
+
+ presets.add((new WifiNetworkSettings("dhbw-802.1x", "dhbw-802.1x", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE)).
+ setWpaEnterprise(
+ new int[]{WifiConfiguration.KeyMgmt.WPA_EAP, WifiConfiguration.KeyMgmt.IEEE8021X},
+ WifiEnterpriseConfig.Eap.PEAP,
+ WifiEnterpriseConfig.Phase2.GTC,
+ null
+ ).setCACertificate("Deutsche Telekom Root CA 2", "-----BEGIN CERTIFICATE-----\n" +
+ "MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc\n" +
+ "MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj\n" +
+ "IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB\n" +
+ "IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE\n" +
+ "RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl\n" +
+ "U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290\n" +
+ "IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU\n" +
+ "ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC\n" +
+ "QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr\n" +
+ "rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S\n" +
+ "NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc\n" +
+ "QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH\n" +
+ "txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP\n" +
+ "BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC\n" +
+ "AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp\n" +
+ "tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa\n" +
+ "IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl\n" +
+ "6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+\n" +
+ "xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n" +
+ "Cm26OWMohpLzGITY+9HPBVZkVw==\n" +
+ "-----END CERTIFICATE-----"));
+
+ presets.add((new WifiNetworkSettings("eduroam", "eduroam", WifiNetworkAuthenticationTypes.WIFI_AUTHTYPE_WPA_ENTERPRISE)).
+ setWpaEnterprise(
+ new int[] {WifiConfiguration.KeyMgmt.WPA_EAP, WifiConfiguration.KeyMgmt.IEEE8021X},
+ WifiEnterpriseConfig.Eap.PEAP,
+ WifiEnterpriseConfig.Phase2.MSCHAPV2,
+ null
+ ).setCACertificate("Deutsche Telekom Root CA 2", "-----BEGIN CERTIFICATE-----\n" +
+ "MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc\n" +
+ "MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj\n" +
+ "IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB\n" +
+ "IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE\n" +
+ "RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl\n" +
+ "U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290\n" +
+ "IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU\n" +
+ "ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC\n" +
+ "QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr\n" +
+ "rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S\n" +
+ "NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc\n" +
+ "QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH\n" +
+ "txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP\n" +
+ "BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC\n" +
+ "AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp\n" +
+ "tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa\n" +
+ "IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl\n" +
+ "6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+\n" +
+ "xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU\n" +
+ "Cm26OWMohpLzGITY+9HPBVZkVw==\n" +
+ "-----END CERTIFICATE-----").
+ setUserSuffix("@dhbw-loerrach.de"));
+
+ WifiNetworkSettings[] presetsArr = new WifiNetworkSettings[presets.size()];
+ presetsArr = presets.toArray(presetsArr);
+ return presetsArr;
+ }
+
+ public enum WifiNetworkAuthenticationTypes {
+ WIFI_AUTHTYPE_NONE,
+ WIFI_AUTHTYPE_WEP,
+ WIFI_AUTHTYPE_WPA,
+ WIFI_AUTHTYPE_WPA_ENTERPRISE,
+ };
+
+ String name;
+ String ssid;
+ WifiNetworkAuthenticationTypes authType;
+ int[] authAlgorithms = new int[0];
+ int eapMethod;
+ int phase2Method;
+
+ String caCertStr;
+ String caName;
+
+ SecureLoginManager performDHSecureLogin;
+ String usernameSuffix;
+ String username;
+ String password;
+
+ public TabLayout.Tab tab;
+ public boolean isInScanResult = false;
+ public boolean isTryConnecting = false;
+ public boolean isAssociating = false;
+ public boolean isAssociated = false;
+ public boolean isAuthenticated = false;
+ public boolean isDisconnected = false;
+ public boolean failedAuthentication = false;
+
+ public WifiNetworkSettings(String name, String ssid, WifiNetworkAuthenticationTypes authType) {
+ this.name = name;
+ this.ssid = ssid;
+ this.authType = authType;
+ switch(authType) {
+ case WIFI_AUTHTYPE_NONE:
+ case WIFI_AUTHTYPE_WEP:
+ this.authAlgorithms = new int[] { WifiConfiguration.KeyMgmt.NONE };
+ break;
+ case WIFI_AUTHTYPE_WPA:
+ this.authAlgorithms = new int[] { WifiConfiguration.KeyMgmt.WPA_PSK };
+ break;
+ }
+ }
+
+ public WifiNetworkSettings setWpaEnterprise(int[] authAlgorithms, int eapMethod, int phase2Method, String username) {
+ this.authAlgorithms = authAlgorithms;
+ this.eapMethod = eapMethod;
+ this.phase2Method = phase2Method;
+ this.username = username;
+ return this;
+ }
+
+ public WifiNetworkSettings setPassword(String password) {
+ this.password = password;
+ return this;
+ }
+
+ public WifiNetworkSettings setCACertificate(String caname, String certificate) {
+ this.caName = caname;
+ this.caCertStr = certificate;
+ return this;
+ }
+
+ public WifiNetworkSettings setUserSuffix(String suffix) {
+ this.usernameSuffix = suffix;
+ return this;
+ }
+
+ public WifiNetworkSettings setDHSecureLogin(SecureLoginManager secureLogin) {
+ this.performDHSecureLogin = secureLogin;
+ return this;
+ }
+
+ public void setAuthData(String username, String password) {
+ this.username = username;
+ this.password = password;
+ }
+
+ public void setAuthData(String password) {
+ this.password = password;
+ }
+
+ public X509Certificate generateCertificate() throws CertificateException, IOException {
+ byte[] decoded = Base64.decode(caCertStr.replaceAll("-----BEGIN CERTIFICATE-----", "").replaceAll("-----END CERTIFICATE-----", ""), Base64.DEFAULT);
+ return (X509Certificate) CertificateFactory.getInstance("X.509").generateCertificate(new ByteArrayInputStream(decoded));
+ }
+
+
+
+ public String getName() {
+ return name;
+ }
+
+ public String getSSID() {
+ return ssid;
+ }
+
+ public WifiNetworkSettings.WifiNetworkAuthenticationTypes getAuthType() {
+ return authType;
+ }
+
+ public int getEapMethod() {
+ return eapMethod;
+ }
+ public int getPhase2Method() {
+ return phase2Method;
+ }
+
+ public String getCAName() {
+ return caName;
+ }
+
+}
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".fragments.Dashboard"
+ android:orientation="horizontal">
+
+ <!-- TODO: Update blank fragment layout -->
+
+ <ScrollView
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:id="@+id/scrollView"
+ android:layout_weight="2" >
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_weight="2">
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_timetable"
+ android:layout_width="match_parent"
+ android:layout_height="160dp"
+ android:layout_margin="8dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="fill_parent"
+ android:layout_height="70dp"
+ android:id="@+id/imageView4"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/header_kalender"
+ android:scaleType="fitXY" />
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="3"
+ android:padding="8dp"
+ android:text="@string/dashboard_calendar_title"
+ android:textColor="#222"
+ android:textStyle="bold"
+ android:textSize="22dp" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardVorlesungsplan"
+ android:layout_below="@+id/imageView4"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:id="@+id/fragment_timetable" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_mensa"
+ android:layout_width="match_parent"
+ android:layout_height="160dp"
+ android:layout_margin="8dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="fill_parent"
+ android:layout_height="70dp"
+ android:id="@+id/imageView5"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/platzhalter"
+ android:scaleType="fitXY" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="3"
+ android:padding="8dp"
+ android:text="@string/dashboard_mensa_title"
+ android:textColor="#222"
+ android:textStyle="bold"
+ android:textSize="22dp"
+ android:id="@+id/textView15" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardMensa"
+ android:id="@+id/fragment_mensa"
+ android:layout_below="@+id/imageView5"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+ </LinearLayout>
+ </ScrollView>
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="300dp"
+ android:layout_height="fill_parent"
+ android:layout_weight="1">
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_view2"
+ android:layout_width="match_parent"
+ android:layout_height="140dp"
+ android:layout_margin="8dp"
+ android:layout_weight="1">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="60dp"
+ android:id="@+id/imageView6"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/header_dhbw"
+ android:scaleType="fitCenter" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardNewsDhbw"
+ android:id="@+id/fragment_dhbw"
+ android:layout_below="@+id/imageView6"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_view3"
+ android:layout_width="wrap_content"
+ android:layout_height="140dp"
+ android:layout_margin="8dp"
+ android:layout_weight="1">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="60dp"
+ android:id="@+id/imageView7"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/header_stuv"
+ android:scaleType="fitCenter" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardNewsStuv"
+ android:id="@+id/fragment_stuv"
+ android:layout_below="@+id/imageView7"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+ </LinearLayout>
+</LinearLayout>
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context=".fragments.Dashboard">
+ tools:context=".fragments.Dashboard"
+ android:orientation="vertical">
<!-- TODO: Update blank fragment layout -->
-</FrameLayout>
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_timetable"
+ android:layout_width="match_parent"
+ android:layout_height="180dp"
+ android:layout_margin="8dp"
+ card_view:cardCornerRadius="5dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="fill_parent"
+ android:layout_height="70dp"
+ android:id="@+id/imageView4"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/header_kalender"
+ android:scaleType="fitXY" />
+
+ <TextView
+ android:id="@+id/title"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="3"
+ android:padding="8dp"
+ android:text="@string/dashboard_calendar_title"
+ android:textColor="#222"
+ android:textStyle="bold"
+ android:textSize="22dp" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardVorlesungsplan"
+ android:layout_below="@+id/imageView4"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:id="@+id/fragment_timetable"
+ tools:layout="@layout/fragment_dashboard_timetable" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_mensa"
+ android:layout_width="match_parent"
+ android:layout_height="180dp"
+ android:layout_margin="8dp"
+ card_view:cardCornerRadius="5dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="fill_parent"
+ android:layout_height="70dp"
+ android:id="@+id/imageView5"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/platzhalter"
+ android:scaleType="fitXY" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:maxLines="3"
+ android:padding="8dp"
+ android:text="@string/dashboard_mensa_title"
+ android:textColor="#222"
+ android:textStyle="bold"
+ android:textSize="22dp"
+ android:id="@+id/textView15" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardMensa"
+ android:id="@+id/fragment_mensa"
+ android:layout_below="@+id/imageView5"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ tools:layout="@layout/fragment_dashboard_mensa_menu" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+ <LinearLayout
+ android:orientation="horizontal"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_view2"
+ android:layout_width="wrap_content"
+ android:layout_height="140dp"
+ android:layout_margin="8dp"
+ android:layout_weight="1"
+ card_view:cardCornerRadius="5dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="60dp"
+ android:id="@+id/imageView6"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/header_dhbw"
+ android:scaleType="fitCenter" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardNewsDhbw"
+ android:id="@+id/fragment_dhbw"
+ android:layout_below="@+id/imageView6"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ tools:layout="@layout/fragment_dashboard_news_dhbw" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_view3"
+ android:layout_width="wrap_content"
+ android:layout_height="140dp"
+ android:layout_margin="8dp"
+ android:layout_weight="1"
+ card_view:cardCornerRadius="5dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <ImageView
+ android:layout_width="wrap_content"
+ android:layout_height="60dp"
+ android:id="@+id/imageView7"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:src="@drawable/header_stuv"
+ android:scaleType="fitCenter" />
+
+ <fragment
+ android:layout_width="match_parent"
+ android:layout_height="fill_parent"
+ android:name="de.dhbwloe.campusapp.fragments.DashboardNewsStuv"
+ android:id="@+id/fragment_stuv"
+ android:layout_below="@+id/imageView7"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ tools:layout="@layout/fragment_dashboard_news_stuv" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+ </LinearLayout>
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingTop="4dp"
+ android:paddingRight="8dp"
+ android:paddingLeft="8dp">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{date}"
+ android:id="@+id/menuDate"
+ android:textColor="@color/color_dhbw_darkred" />
+
+ <ScrollView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/scrollView4" >
+
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/menuList"></LinearLayout>
+ </ScrollView>
+
+</LinearLayout>
\ No newline at end of file
--- /dev/null
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="de.dhbwloe.campusapp.fragments.DashboardMensa"
+ android:paddingLeft="8dp"
+ android:paddingTop="4dp"
+ android:paddingBottom="4dp"
+ android:paddingRight="8dp">
+
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="•"
+ android:id="@+id/textView18"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true"
+ android:textColor="@color/color_dhbw_darkred" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{menu}"
+ android:id="@+id/menuName"
+ android:layout_alignParentTop="true"
+ android:layout_toRightOf="@+id/textView18"
+ android:layout_toEndOf="@+id/textView18"
+ android:layout_marginLeft="8dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{price}"
+ android:id="@+id/menuPrice"
+ android:layout_alignTop="@+id/menuName"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:textColor="@color/color_dhbw_darkred" />
+</RelativeLayout>
--- /dev/null
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="de.dhbwloe.campusapp.fragments.DashboardNewsDhbw">
+
+ <!-- TODO: Update blank fragment layout -->
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>
--- /dev/null
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="de.dhbwloe.campusapp.fragments.DashboardNewsStuv">
+
+ <!-- TODO: Update blank fragment layout -->
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".fragments.DashboardVorlesungsplan"
+ android:orientation="horizontal">
+
+ <!-- TODO: Update blank fragment layout -->
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_weight="1">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{date1}"
+ android:id="@+id/dateView1"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:textColor="@color/color_dhbw_darkred"
+ android:layout_marginTop="4dp" />
+
+ <ScrollView
+ android:layout_width="fill_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/scrollView2"
+ android:layout_below="@+id/dateView1"
+ android:layout_centerHorizontal="true" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/date1Overview">
+
+
+ </RelativeLayout>
+ </ScrollView>
+
+ </RelativeLayout>
+
+ <RelativeLayout
+ android:layout_width="2px"
+ android:layout_height="match_parent"
+ android:background="@color/color_dhbw_darkred"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="4dp"></RelativeLayout>
+
+ <RelativeLayout
+ android:layout_width="wrap_content"
+ android:layout_height="match_parent"
+ android:layout_weight="1" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{date2}"
+ android:id="@+id/dateView2"
+ android:layout_alignParentTop="true"
+ android:layout_centerHorizontal="true"
+ android:textColor="@color/color_dhbw_darkred"
+ android:layout_marginTop="4dp" />
+
+ <ScrollView
+ android:layout_width="fill_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/scrollView3"
+ android:layout_below="@+id/dateView2"
+ android:layout_centerHorizontal="true" >
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:id="@+id/date2Overview" />
+ </ScrollView>
+
+ </RelativeLayout>
+</LinearLayout>
-<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:orientation="vertical">
+
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="100dp"
+ android:id="@+id/imageView8"
+ android:src="@drawable/dhbw_mensa"
+ android:scaleType="center"
+ android:background="#000000" />
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
-</android.support.design.widget.CoordinatorLayout>
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:textAppearance="?android:attr/textAppearanceLarge"
+ android:text="@string/mensa_weekend"
+ android:id="@+id/textView13"
+ android:layout_gravity="center_horizontal"
+ android:layout_marginTop="20dp" />
+</LinearLayout>
\ No newline at end of file
+++ /dev/null
-<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- tools:context="de.dhbwloe.campusapp.fragments.MensaWochenplan">
-
- <!-- TODO: Update blank fragment layout -->
- <TextView
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:text="{MensaWochenplan}" />
-
-</FrameLayout>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
+ android:orientation="vertical"
tools:context="de.dhbwloe.campusapp.fragments.Vorlesungsplan">
- <!-- TODO: Update blank fragment layout -->
- <TextView
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="100dp"
+ android:id="@+id/imageView8"
+ android:src="@drawable/header_kalender"
+ android:scaleType="fitXY"
+ android:background="#000000" />
+
+ <android.support.design.widget.AppBarLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
+
+ <android.support.design.widget.TabLayout
+ android:id="@+id/tabs"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:tabMode="scrollable"
+ />
+ </android.support.design.widget.AppBarLayout>
+
+ <android.support.v4.view.ViewPager
+ android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
- android:text="{Vorlesungsplan}" />
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
-</RelativeLayout>
+</LinearLayout>
--- /dev/null
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="de.dhbwloe.campusapp.fragments.VorlesungsplanExams">
+
+ <!-- TODO: Update blank fragment layout -->
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:text="@string/hello_blank_fragment" />
+
+</FrameLayout>
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="de.dhbwloe.campusapp.fragments.VorlesungsplanGroups"
+ android:orientation="vertical">
+
+ <!-- TODO: Update blank fragment layout -->
+
+ <CheckBox
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/vorlesungsplan_show_old_courses"
+ android:id="@+id/showOldCourses" />
+
+ <ListView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/listView"
+ android:layout_gravity="center_horizontal" />
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_upcomingday"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="8dp"
+ card_view:cardCornerRadius="5dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:padding="8dp">
+
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{title}"
+ android:id="@+id/courseTitle"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentLeft="true"
+ android:layout_alignParentStart="true" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/vorlesungsplan_groups_nextevent"
+ android:id="@+id/textView16"
+ android:layout_below="@+id/courseTitle"
+ android:layout_marginLeft="12dp"
+ android:layout_marginTop="8dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/vorlesungsplan_groups_lastevent"
+ android:id="@+id/textView17"
+ android:layout_below="@+id/textView16"
+ android:layout_marginLeft="12dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/vorlesungsplan_groups_klausur"
+ android:id="@+id/klausurName"
+ android:layout_below="@+id/textView17"
+ android:layout_marginLeft="12dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{date}"
+ android:id="@+id/nextEvent"
+ android:layout_alignBottom="@+id/textView16"
+ android:layout_toRightOf="@+id/textView16"
+ android:layout_toEndOf="@+id/textView16"
+ android:layout_marginLeft="16dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{date}"
+ android:id="@+id/lastEvent"
+ android:layout_alignBottom="@+id/textView17"
+ android:layout_alignLeft="@+id/nextEvent"
+ android:layout_alignStart="@+id/nextEvent" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{date}"
+ android:id="@+id/klausurEvent"
+ android:layout_alignBottom="@+id/klausurName"
+ android:layout_alignLeft="@+id/nextEvent"
+ android:layout_alignStart="@+id/nextEvent" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context="de.dhbwloe.campusapp.fragments.VorlesungsplanUpcoming"
+ android:orientation="vertical">
+
+ <!-- TODO: Update blank fragment layout -->
+
+ <ListView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/listView"
+ android:layout_gravity="center_horizontal" />
+</LinearLayout>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_upcomingday"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="8dp"
+ card_view:cardCornerRadius="5dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{from}"
+ android:id="@+id/timeFrom"
+ android:layout_marginLeft="8dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="-"
+ android:id="@+id/textView1"
+ android:layout_alignParentTop="true"
+ android:layout_toRightOf="@+id/timeFrom"
+ android:layout_toEndOf="@+id/timeFrom"
+ android:layout_marginLeft="4dp"
+ android:layout_marginRight="4dp" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{to}"
+ android:id="@+id/timeTo"
+ android:layout_alignParentTop="true"
+ android:layout_toRightOf="@+id/textView1"
+ android:layout_toEndOf="@+id/textView1" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{room}"
+ android:id="@+id/location"
+ android:layout_alignParentTop="true"
+ android:layout_alignParentRight="true"
+ android:layout_alignParentEnd="true"
+ android:layout_marginRight="8dp"
+ android:password="false" />
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{title}"
+ android:id="@+id/courseTitle"
+ android:layout_below="@+id/timeFrom"
+ android:layout_alignLeft="@+id/timeFrom"
+ android:layout_alignStart="@+id/timeFrom"
+ android:layout_marginLeft="12dp"
+ android:layout_marginRight="12dp"
+ android:layout_marginTop="4dp"
+ android:layout_marginBottom="8dp" />
+
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+</RelativeLayout>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:card_view="http://schemas.android.com/apk/res-auto"
+ android:orientation="vertical" android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/card_upcomingday"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="8dp"
+ card_view:cardCornerRadius="5dp">
+
+ <RelativeLayout
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="{date}"
+ android:id="@+id/cardDate" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/cardCourses"
+ android:layout_below="@+id/cardDate"
+ android:orientation="vertical" />
+ </RelativeLayout>
+ </android.support.v7.widget.CardView>
+
+
+</LinearLayout>
\ No newline at end of file
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
+
+ <color name="color_dhbw_darkred">#8D0011</color>
+ <color name="color_dhbw_lightred">#E3001B</color>
+ <color name="color_dhbw_lightgray">#7E878E</color>
+ <color name="color_dhbw_darkgray">#5F6D78</color>
</resources>
<string name="action_settings">Settings</string>
+ <string name="week_monday">Montag</string>
+ <string name="week_tuesday">Dienstag</string>
+ <string name="week_wednesday">Mittwoch</string>
+ <string name="week_thursday">Donnerstag</string>
+ <string name="week_friday">Freitag</string>
+ <string name="week_saturday">Samstag</string>
+ <string name="week_sunday">Sonntag</string>
+
+ <string name="week_monday_short">Mo</string>
+ <string name="week_tuesday_short">Di</string>
+ <string name="week_wednesday_short">Mi</string>
+ <string name="week_thursday_short">Do</string>
+ <string name="week_friday_short">Fr</string>
+ <string name="week_saturday_short">Sa</string>
+ <string name="week_sunday_short">So</string>
+
+
+ <string name="dashboard_calendar_title">Vorlesungsplan</string>
+ <string name="dashboard_calendar_today">Heute</string>
+ <string name="dashboard_calendar_tomorrow">Morgen</string>
+
+ <string name="dashboard_calendar_klausur">Klausur: </string>
+
+ <string name="mensa_weekend">Hoch die Hände, Wochenende!</string>
+
+ <string name="vorlesungsplan_upcoming">Nächste Kurse</string>
+ <string name="vorlesungsplan_groups">Kursübersicht</string>
+ <string name="vorlesungsplan_exams">Klausurübersicht</string>
+
<string name="wifisettings_about_wifi">Die DHBW Lörrach bietet den Studenten verschiedene Möglichkeiten Geräte mit dem W-LAN zu verbinden. Mithilfe dieser App kannst du dein Gerät dazu konfigurieren sich unter berücksichtigung sicherheitsrelevanter Überprüfungen mit dem dhbw-secure Netzwerk zu verbinden.</string>
<string name="wifisettings_ssid_caption">SSID:</string>
<string name="wifisettings_security_caption">Security:</string>
<string name="wifisettings_connect_button_scan">Scanning...</string>
<string name="wifisettings_connect_button_disabled">WLAN Adapter deaktiviert</string>
<string name="wifisettings_connect_button_ready">Verbunden!</string>
+ <string name="wifisettings_connect_button_connecting">Verbinde...</string>
<string name="title_activity_settings">Settings</string>
<string name="mensacard_guthaben">Dein Guthaben:</string>
<string name="wifisettings_psk_caption">PSK:</string>
<string name="wifisettings_insecure_network">Achtung: Dieses Netzwerk ist potentiell unsicher!</string>
+ <string name="dashboard_mensa_title">Mensaplan</string>
+ <string name="vorlesungsplan_show_old_courses">Vergangene Vorlesungen anzeigen</string>
+ <string name="vorlesungsplan_groups_nextevent">Nächste Vorlesung:</string>
+ <string name="vorlesungsplan_groups_lastevent">Letzte Vorlesung:</string>
+ <string name="vorlesungsplan_groups_nonext">- keine -</string>
+ <string name="vorlesungsplan_groups_noklausur">- keine -</string>
+ <string name="vorlesungsplan_groups_klausur">Klausur:</string>
+ <string name="vorlesungsplan_groups_praesi">Präsentation:</string>
</resources>