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

Add other month days until week row is filled #351

Closed
Maragues opened this issue Jun 16, 2016 · 9 comments
Closed

Add other month days until week row is filled #351

Maragues opened this issue Jun 16, 2016 · 9 comments

Comments

@Maragues
Copy link

I'd like to show other month dates, but I don't want to add an entire row with other month days. Something like this

image

Currently, mcv_showOtherDates fills the 6 week rows with CalendarDay, but it would be nice if we could specify a new showOtherDates mode, for example fill_week

I guess this could be done by creating a Decorator in onDateSelected and dynamically calculating which dates fit, but it would be nice if the library provided an easier way

@emitchel
Copy link

Even in the most popular calendar apps (Google Calendar, native android calendars) you'll sometimes see an entire week of the following month. Likely for design reasons since you either A) don't show those days and leave that area blank(white space no-no) or B) remove the access space in which case would make the surrounding views constantly jump since that extra week is there quite often (assuming the calendar is swipe-able).

@Maragues
Copy link
Author

The area is already left blank if you choose to not show other months. The space is there so that there's no jumping.

@quentin41500
Copy link
Member

As @emitchel said, there is some design issues where the calendar would contain 5 rows instead of 6. PRs are welcome if you manage to make it work, but it's not on the roadmap.

@Maragues
Copy link
Author

@quentin41500 I understand that, I probable expressed my self wrong, since you both understood the same.

I meant always keeping space for 6 weeks but offer a new showOtherDates option where the first and last week of the month was filled with othermonthDates, as in the screenshot in the first post

@quentin41500
Copy link
Member

@Maragues So what is the difference with the current showOtherDates feature?

@Maragues
Copy link
Author

Maragues commented Jun 23, 2016

Taking current June as example with weeks starting on sunday, my suggested scenario would be as follows

1st week would display

[29] [30] [31] [1] ....

5th week would display

[26] [27] [28] [29] [30] [1] [2]

6th week would be empty, but its vertical space untouched

With current showOtherDates, 6th week is

[3] [4] [5] ...

Sorry for using text instead of screenshots, I hope I made my idea clear

@quentin41500
Copy link
Member

Ok I see what you are trying to accomplish. It's not on the roadmap, but I will leave this issue open in case anybody wants to pick it up and make a PR for it.

@Maragues
Copy link
Author

Thanks for the input. I investigated a little but it wasn't easy.

Anyway, since I'd also need #344 implemented, for now I've told the designer that we'd better not display other month dates :-)

@quentin41500
Copy link
Member

This is actually now part of the library using this:

    /**
     * By default, the calendar will take up all the space needed to show any month (6 rows).
     * By enabling dynamic height, the view will change height dependant on the visible month.
     * <p>
     * This means months that only need 5 or 4 rows to show the entire month will only take up
     * that many rows, and will grow and shrink as necessary.
     *
     * @param useDynamicHeight true to have the view different heights based on the visible month
     */
    public void setDynamicHeightEnabled(boolean useDynamicHeight) {
        this.mDynamicHeightEnabled = useDynamicHeight;
    }

Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants