Skip to content

Commit

Permalink
Set min duration 1 sec.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyvasilyev committed Jul 2, 2020
1 parent 7272b67 commit c982c8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class TimelineFragment : Fragment() {
if (DEBUG) Log.v(TAG, "loadFirstValues()")
val time = System.currentTimeMillis()
recordsMajor1Events.clear()
recordsMajor1Events.add(TimeRecord(time - 1000, 0, EventRecord())) // duration can be 0 if unknown
recordsMajor1Events.add(TimeRecord(time - 2000, 0, EventRecord()))
recordsMajor1Events.add(TimeRecord(time - 5000, 1000, EventRecord()))
recordsMajor1Events.add(TimeRecord(time - 30000, 20000, EventRecord()))
recordsMajor1Events.add(TimeRecord(time - 300000, 20000, EventRecord()))
Expand All @@ -117,6 +119,7 @@ class TimelineFragment : Fragment() {
recordsMajor2Events.add(TimeRecord(time - 6000, 1000, EventRecord(), Color.YELLOW))

recordsBackgroundEvents.clear()
recordsBackgroundEvents.add(TimeRecord(time - 50000, 20000, EventRecord()))
recordsBackgroundEvents.add(TimeRecord(time - 500000, 500000, EventRecord()))
recordsBackgroundEvents.add(TimeRecord(time - 1000000, 250000, EventRecord()))
recordsBackgroundEvents.add(TimeRecord(time - 2500000, 1000000, EventRecord()))
Expand Down
4 changes: 2 additions & 2 deletions constants.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ project.ext {
buildToolsVersion = '30.0.0'
minSdkVersion = 21 // 5.0
targetSdkVersion = 30 // 11.0
releaseVersion = "1.4.1"
releaseVersionCode = 141
releaseVersion = "1.4.2"
releaseVersionCode = 142

androidXAnnotationVersion = '1.1.0'
androidXAppcompatVersion = '1.1.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ public interface OnTimelineListener {

public static class TimeRecord {
public final long timestampMsec; // absolute
public final long durationMsec; // relative
public final long durationMsec; // relative. Can be 0 if unknown.
public final Object object;
@ColorInt public final int color;
public TimeRecord(long startMs, long durationMs, @NonNull Object obj) {
this(startMs, durationMs, obj, -1);
}
public TimeRecord(long startMs, long durationMs, @NonNull Object obj, int color) {
timestampMsec = startMs;
durationMsec = durationMs;
durationMsec = Math.max(1000, durationMs); // min 1 sec
object = obj;
this.color = color;
}
Expand Down

0 comments on commit c982c8e

Please sign in to comment.