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
257 stars 64 forks source link

Set click listeners on Header #48

Open ShivamDev31 opened 7 years ago

ShivamDev31 commented 7 years ago

Hi,

I want to set click listener on the header where Day and date is displayed. I've created the interface with listener and stuff and have set it in "onSingleTapConfirmed" but now the issue is I'm not getting the condition of getX, getY to set so that I get the click of the header.

TIA

jhoobergs commented 7 years ago

For the y component I guess it will have to be between mHeaderRowPadding and mHeaderTextHeight + mHeaderRowPadding and you can use the x component to calculate the date by dividing by mHeaderColumnWidth and adding that number of days to the first visible day. I haven't tested it, so I might be wrong.

ShivamDev31 commented 7 years ago

Cool, seems it worked. I only wanted to get the Y axes and no X axis as I wanted the click on whole row.

jhoobergs commented 7 years ago

@ShivamDev31 nice, can you create a PR with that functionality ?

ShivamDev31 commented 7 years ago

Sorry for late reply. Sure, I'll do that soon.

jhoobergs commented 6 years ago

@ShivamDev31 Haven't found any time yet ? 😄