TimetableView
TimetableView copied to clipboard
how can i change the schedule color?
Hi, thank you for this useful service. can i get how to change the each schdule bar color? if possible, could you give me an example? app:sticker_colors="@array/~" <- is this attribute of chainging color?
I ran into same issue. I looked into code, and it seems number of courses in arrayList pushed in to timetable are colored same. For example, if you pushed arraylist that contains monday and wednesday course at 8:00 to 9:00 am into first index of timeTable, timeTable[0], those courses will then be colored with color at first index of array, color[0]. As a result, both monday and wednesday course at 8:00 ~ 9:00 am will be colored same.
So to achieve your goal, you might want to push arrayList that each arrayList contains only one course. Then, Timetable that contains each arrayList will color every course differently across arrayList, resulting in all different color for all sticker.
For ex: In each loop,
Course(day:M, startTime:(8,0), endTime:(9,0)); // Create course
ArrayList<course> courseList.add(Course); // put course into course list
TimeTable.add(courseList); // put courseList that contains one course to Timetable. courses at timetable index will match with
// color array at same index.
courseList.clear(); // clear list, and therefore previous course will not be added into timetable again.
Btw, you are right for attribute. app:sticker_colors="@array/~", sets color for each sticker.