Quivr / Android-Week-View

Android Week View is an android library to display calendars (week view or day view) within the app. It supports custom styling.
Apache License 2.0
258 stars 64 forks source link

Question: how to focus on a specific time of day? #99

Closed AndroidDeveloperLB closed 6 years ago

AndroidDeveloperLB commented 6 years ago

I know it's possible to go to a specific date, but what about time?

I need that initially, we focus on current time of the day, so that we could see some above, and some below . Say 10% above vs 90% below.

Similar to what we have on Google Calendar:

image

Is it possible? If so, how?

AndroidDeveloperLB commented 6 years ago

Never mind. It's called: goToHour . Seems to work fine too.

SkyleKayma commented 6 years ago

I have an answer to "how to focus on a specific time range of day?" (like 08:00 to 20:00, without cutting the rest), I have work on something, that need to be improved :

public float getWeekViewHeightWithoutDateNorHour() { return (float)this.getHeight() - (this.mHeaderHeight + (float)(this.mHeaderRowPadding * 2) + this.mHeaderMarginBottom); }

That returns the Height of the weekView, then do something like :

private var NUMBER_OF_HOURS_TO_SHOW: Double = 12.0

weekView.hourHeight != (weekView.weekViewHeightWithoutDateNorHour / NUMBER_OF_HOURS_TO_SHOW).toInt()

AndroidDeveloperLB commented 6 years ago

@SkyleKayma Well this could also be nice.

Mluna97 commented 6 years ago

@SkyleKayma where would you set the hourHeight in your example?