Open maheeraeron opened 4 years ago
I had the same problem. The error is in the file "TimetableView.java"
Affected lines:
int count = specIdx < 0 ? ++stickerCount : specIdx; int finalCount = count; count = count + 1;
So was my code that solves it:
private void add(final ArrayList
schedules, int specIdx) { int count = specIdx < 0 ? ++stickerCount : specIdx; Sticker sticker = new Sticker(); for (Schedule schedule : schedules) { TextView tv = new TextView(context); RelativeLayout.LayoutParams param = createStickerParam(schedule); tv.setLayoutParams(param); tv.setPadding(10, 0, 10, 0); tv.setText(schedule.getClassTitle() + "\n" + schedule.getClassPlace()); tv.setTextColor(Color.parseColor("#FFFFFF")); tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, DEFAULT_STICKER_FONT_SIZE_DP); tv.setTypeface(null, Typeface.BOLD); int finalCount = count; tv.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if(stickerSelectedListener != null){ stickerSelectedListener.OnStickerSelected(finalCount, schedules); } } }); sticker.addTextView(tv); sticker.addSchedule(schedule); stickers.put(count, sticker); stickerBox.addView(tv); count = count + 1; } setStickerColor();
}
@BrianMedina0903 how did you override the method?
Thanks @devbrianmedina
Hello, I am trying to use your library for an app I am making in Android with Kotlin (even though this was made in Java, I am able to invoke any function used here in Kotlin as well)
I have my timeTable set up with two dummy schedules. I added the schedules to the time table, so their stickers DO show up on the timeTableView UI.
After that, I made a binding by doing timeTable.setOnStickerSelectListener. I am able to access IDX and an array list of stickers.
My issue is that when I click on a sticker, IDX is still 0. Is that supposed to happen? Is IDX supposed to represent a unique ID for each sticker? How can I capture the sticker that was just selected properly, and convert that to a Schedule object?