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

Even with tileWidth and tileHeight set to match_parent, day views are square #479

Closed
lordcodes opened this issue Nov 29, 2016 · 2 comments
Closed

Comments

@lordcodes
Copy link

Almost all of the same calendars in the sample app don't display properly in landscape.
I have found that in our app, this can be fixed by using the newly added match_parent for the tileWidth and tileHeight.

However, on our calendar we have added decorators to change the background colours of specific days on the calendar.

The problem is that the DayView onLayout code means that the day views are actually still squares, even if they appear wider than they are tall. This means the decorator background is a little square around the text.

I found by changing DayView onLayout code to be the following fixed the issue:

    private void calculateBounds(int width, int height) {
        tempRect.set(0, 0, width, height);
    }

However, I wasn't sure why the previous (much more complicated code) in calculateBounds was required. I am happy to submit a PR, as currently this is causing real problems with our design. Either we remove the decorators and achieve the affect another way, or we will have to do something else for landscape, as the calendar looks quite bad in landscape when it is completely square.

@nicbell
Copy link
Contributor

nicbell commented Nov 6, 2018

I have found this same problem, did you ever submit a PR?

@lordcodes
Copy link
Author

@nicbell Sorry, I reported this nearly 2 years ago and was waiting to hear back before spending time working on it. Therefore, no I never looked into it. Our project moved on and so didn't have as pressing a need to fix it anymore.

Nice to see your PR 👍

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

No branches or pull requests

2 participants