Open bittergourdbd opened 5 years ago
line 2570:
if (mNumberOfVisibleDays == 7) {
if (mCurrentFlingDirection != Direction.NONE) {
// snap to nearest day
leftDays = 7 * Math.round(leftDays / 7);
} else if (mCurrentScrollDirection == Direction.LEFT) {
// snap to last day
leftDays = 7 * Math.floor(leftDays / 7);
} else if (mCurrentScrollDirection == Direction.RIGHT) {
// snap to next day
leftDays = 7 * Math.ceil(leftDays / 7);
} else {
// snap to nearest day
leftDays = 7 * Math.round(leftDays / 7);
}
} else {
if (mCurrentFlingDirection != Direction.NONE) {
// snap to nearest day
leftDays = Math.round(leftDays);
} else if (mCurrentScrollDirection == Direction.LEFT) {
// snap to last day
leftDays = Math.floor(leftDays);
} else if (mCurrentScrollDirection == Direction.RIGHT) {
// snap to next day
leftDays = Math.ceil(leftDays);
} else {
// snap to nearest day
leftDays = Math.round(leftDays);
}
}
Code speaks for itself
@bittergourdbd I suggest trying out my fork for this repository. I've updated there a lot of things, fixed issues, and I've made it clearer for modification. It might have what you need. Sadly it can never be so customizable due to the amount of drawing within a single View, though. Please check it out here: https://github.com/AndroidDeveloperLB/Android-Week-View