Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions agendacalendarview/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
apply plugin: 'com.android.library'
apply plugin: 'me.tatarka.retrolambda'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 28
buildToolsVersion '27.0.3'

android {
lintOptions {
Expand All @@ -13,7 +12,7 @@ android {

defaultConfig {
minSdkVersion 14
targetSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
}
Expand All @@ -34,14 +33,16 @@ android {
}
}

apply from: 'https://raw.github.com/chrisbanes/gradle-mvn-push/master/gradle-mvn-push.gradle'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Google libraries
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:design:23.2.0'
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:27.1.0'
//noinspection GradleCompatible
compile 'com.android.support:recyclerview-v7:27.1.0'
//noinspection GradleCompatible
compile 'com.android.support:design:27.1.0'
implementation 'com.android.support:support-annotations:27.1.1'

// other libraries
compile 'se.emilsjolander:stickylistheaders:2.7.0'
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions agendacalendarview/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Fri Sep 21 15:27:51 IST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
172 changes: 172 additions & 0 deletions agendacalendarview/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions agendacalendarview/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.github.tibolte.agendacalendarview.agenda.AgendaAdapter;
import com.github.tibolte.agendacalendarview.agenda.AgendaView;
import com.github.tibolte.agendacalendarview.calendar.CalendarView;
import com.github.tibolte.agendacalendarview.calendar.ViewAdapter;
import com.github.tibolte.agendacalendarview.models.BaseCalendarEvent;
import com.github.tibolte.agendacalendarview.models.CalendarEvent;
import com.github.tibolte.agendacalendarview.models.DayItem;
Expand Down Expand Up @@ -198,8 +199,8 @@ public void init(List<CalendarEvent> eventList, Calendar minDate, Calendar maxDa
CalendarManager.getInstance(getContext()).buildCal(minDate, maxDate, locale, new DayItem(), new WeekItem());

// Feed our views with weeks list and events
mCalendarView.init(CalendarManager.getInstance(getContext()), mCalendarDayTextColor, mCalendarCurrentDayColor, mCalendarPastDayTextColor);

mCalendarView.init(CalendarManager.getInstance(getContext()), mCalendarDayTextColor, mCalendarCurrentDayColor, mCalendarPastDayTextColor);
// Load agenda events and scroll to current day
AgendaAdapter agendaAdapter = new AgendaAdapter(mAgendaCurrentDayTextColor);
mAgendaView.getAgendaListView().setAdapter(agendaAdapter);
Expand Down Expand Up @@ -234,6 +235,27 @@ public void init(Locale locale, List<IWeekItem> lWeeks, List<IDayItem> lDays, Li
addEventRenderer(new DefaultEventRenderer());
}

public void initWithCustomAdapter(Locale locale, List<IWeekItem> lWeeks, List<IDayItem> lDays, List<CalendarEvent> lEvents, CalendarPickerController calendarPickerController, ViewAdapter adapter) {
mCalendarPickerController = calendarPickerController;

CalendarManager.getInstance(getContext()).loadCal(locale, lWeeks, lDays, lEvents);

// Feed our views with weeks list and events
mCalendarView.initWithCustomAdapter(CalendarManager.getInstance(getContext()), adapter);

// Load agenda events and scroll to current day
AgendaAdapter agendaAdapter = new AgendaAdapter(mAgendaCurrentDayTextColor);
mAgendaView.getAgendaListView().setAdapter(agendaAdapter);
mAgendaView.getAgendaListView().setOnStickyHeaderChangedListener(this);

// notify that actually everything is loaded
BusProvider.getInstance().send(new Events.EventsFetched());
Log.d(LOG_TAG, "CalendarEventTask finished");

// add default event renderer
addEventRenderer(new DefaultEventRenderer());
}

public void addEventRenderer(@NonNull final EventRenderer<?> renderer) {
AgendaAdapter adapter = (AgendaAdapter) mAgendaView.getAgendaListView().getAdapter();
adapter.addEventRenderer(renderer);
Expand Down
Loading