Search in sources :

Example 1 with LectureListSelectionAdapter

use of de.tum.in.tumcampusapp.component.tumui.lectures.adapter.LectureListSelectionAdapter 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

Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 ListView (android.widget.ListView)1 CalendarController (de.tum.in.tumcampusapp.component.tumui.calendar.CalendarController)1 CalendarItem (de.tum.in.tumcampusapp.component.tumui.calendar.model.CalendarItem)1 LectureListSelectionAdapter (de.tum.in.tumcampusapp.component.tumui.lectures.adapter.LectureListSelectionAdapter)1