Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the horizontal current-time line to be only on today #14

Open
AndroidDeveloperLB opened this issue May 3, 2018 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@AndroidDeveloperLB
Copy link

This is on the library:

image

And this is on Google Calendar:

image

@tobiasschuerg tobiasschuerg added the enhancement New feature or request label Sep 3, 2018
@tobiasschuerg tobiasschuerg changed the title How to set the horizontal current-time line to be only on today? Set the horizontal current-time line to be only on today Sep 3, 2018
@tobiasschuerg
Copy link
Owner

This needs adjustements of drawNowIndicator:

private fun drawNowIndicator(canvas: Canvas) {
if (startTime.isBefore(LocalTime.now()) && endTime.isAfter(LocalTime.now())) {
Log.v(TAG, "Drawing now indicator")
val nowOffset = Duration.between(startTime, LocalTime.now())
val minutes = nowOffset.toMinutes()
val y = topOffsetPx + context.dipToPixelF(minutes * scalingFactor)
accentPaint.alpha = 200
canvas.drawLine(0f, y.toFloat(), canvas.width.toFloat(), y.toFloat(), accentPaint)
}
}

@AndroidDeveloperLB
Copy link
Author

Can you also allow to put the dot?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants