Android-Week-View
Android-Week-View copied to clipboard
How to draw line each half an hour
Hello How can I set the line per 30 minutes? I had tried to change "lineCount" and "hourLines" , but it didn't work. Thanks for response~
// Here is how I added line for every 15 minutes int lineCount = (int) ((getHeight() - mHeaderHeight - mHeaderRowPadding * 2 - mHeaderMarginBottom) / mHourHeight) + 1; lineCount = (lineCount) * (mNumberOfVisibleDays + 1) * 4 * (mHourHeight < mMaxHourHeight / 2 ? 1 : 3); float[] hourLines = new float[lineCount];
int i = 0; for (int hourNumber = 0; hourNumber < mHourLimit && hourLines.length > i * 4; hourNumber++) { float top = mHeaderHeight + mHeaderRowPadding * 2 + mCurrentOrigin.y + mHourHeight * hourNumber + mTimeTextHeight / 2 + mHeaderMarginBottom; for (int j = 0; j < (mHourHeight < mMaxHourHeight / 2 ? 1 : 4); ++j, ++i) { hourLines[i * 4] = start; hourLines[i * 4 + 1] = top + mHourHeight * j / 4; hourLines[i * 4 + 2] = startPixel + mWidthPerDay; hourLines[i * 4 + 3] = top + mHourHeight * j / 4; } }
What is mhourLimit ?