Search in sources :

Example 11 with CalendarItem

use of de.tum.in.tumcampusapp.component.tumui.calendar.model.CalendarItem in project TumCampusApp by TCA-Team.

the class TimetableWidgetConfigureActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_timetable_widget_configure);
    // Setup toolbar and save button
    setSupportActionBar(findViewById(R.id.main_toolbar));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_check);
    // Get appWidgetId from intent
    Intent intent = getIntent();
    Bundle extras = intent.getExtras();
    if (extras != null) {
        appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, AppWidgetManager.INVALID_APPWIDGET_ID);
    }
    ListView listViewLectures = findViewById(R.id.activity_timetable_lectures);
    // Initialize stations adapter
    CalendarController calendarController = new CalendarController(this);
    List<CalendarItem> lectures = calendarController.getLecturesForWidget(this.appWidgetId);
    listViewLectures.setAdapter(new LectureListSelectionAdapter(this, lectures, this.appWidgetId));
    listViewLectures.requestFocus();
}
Also used : CalendarItem(de.tum.in.tumcampusapp.component.tumui.calendar.model.CalendarItem) CalendarController(de.tum.in.tumcampusapp.component.tumui.calendar.CalendarController) ListView(android.widget.ListView) Bundle(android.os.Bundle) Intent(android.content.Intent) LectureListSelectionAdapter(de.tum.in.tumcampusapp.component.tumui.lectures.adapter.LectureListSelectionAdapter)

Aggregations

CalendarItem (de.tum.in.tumcampusapp.component.tumui.calendar.model.CalendarItem)11 Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 CalendarController (de.tum.in.tumcampusapp.component.tumui.calendar.CalendarController)2 ArrayList (java.util.ArrayList)2 Calendar (java.util.Calendar)2 AlarmManager (android.app.AlarmManager)1 PendingIntent (android.app.PendingIntent)1 ContentResolver (android.content.ContentResolver)1 ContentValues (android.content.ContentValues)1 Cursor (android.database.Cursor)1 AudioManager (android.media.AudioManager)1 ListView (android.widget.ListView)1 WeekViewEvent (com.alamkanak.weekview.WeekViewEvent)1 LectureListSelectionAdapter (de.tum.in.tumcampusapp.component.tumui.lectures.adapter.LectureListSelectionAdapter)1 Date (java.util.Date)1 DateTime (org.joda.time.DateTime)1 Test (org.junit.Test)1