Tachyon icon indicating copy to clipboard operation
Tachyon copied to clipboard

When duration is below 15, the event is pushed to bottom of timeline regardless of start time

Open duonglong opened this issue 5 years ago • 4 comments

Step to produce:

  1. add following line to inital events: new Event("Lunch", "Cafeteria", 13, 30, 3, android.R.color.holo_green_dark),
  2. build and run

duonglong avatar Aug 13 '20 08:08 duonglong

Haha, I just submitted this same bug without realizing it's a duplicate: https://github.com/linkedin/Tachyon/issues/12

I believe I traced down the code that causes the issue, so hopefully, that's still valuable, even if it is a duplicated report

ahorovit avatar Oct 05 '20 01:10 ahorovit

seems like the author did it intentionally (not sure why though), i ended up subclass the calendar view and default MIN_DURATION_MINUTES=1 and it worked

duonglong avatar Oct 05 '20 06:10 duonglong

@duonglong,

I'd be interested to get your opinion on my proposed bug fix. I think the intention of this part of the code is to prevent tiny Events that appear as unreadable slivers in the DayView.

Overriding the MIN_DURATION_MINUTES would fix the bug of drawing the Event in the wrong part of the DayView. But it also guarantees that Event duration can never be less than MIN_DURATION_MINUTES, which short-circuits the logic entirely. IMHO, if you're concerned about the original author's intent, that's probably not the right approach.

ahorovit avatar Oct 05 '20 16:10 ahorovit

I'm not sure if/when my bug fix will be merged, but if you agree with my fix (or just want to test it), you can include my change by importing my forked repo via jitpack.

ahorovit avatar Oct 05 '20 16:10 ahorovit