Giter Site home page Giter Site logo

Comments (7)

SundeepK avatar SundeepK commented on July 29, 2024

If the user clicks on a day i use compactCalendarView.setCurrentSelectedDayBackgroundColor(R.color.accent);
Thats a light orange.
But after that the color turns to black.

Could you explain this one a little better? I couldn't reproduce it.

Moreover I found a bug: If you scroll on month just a little bit so that the month falls back the first day is loading but the currentselectedday-cycle is still on the old position and not on the first.

This sounds like a bug, will raise an issue and investigate. Just to confirm, is the bug related to when when you scroll, the next/previous calendar is showing the old currrently selected day on touch? Once you lift your finger, it shows correctly?

And something I really dont like: If you placed an event on the current day, there is no little cycle shown because its hidden by the bigger currentday-cycle.

There is already an issue open I think, I just don't have time to look at this yet properly. This is by design, since google calendars does the same thing.

And: The currentday-cycle repeats on every year. For example today is 1st dec. 2015. Than every 1st dec. is marked with a big currentday-cycle.

This is also by design, since google calendars does the same thing.

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

Reopening just in case there are extra comments that need to be made since I have not had a reply.

from compactcalendarview.

XxGoliathusxX avatar XxGoliathusxX commented on July 29, 2024

Sry for taking so long but I had stuff to do.
My Calendar all in all works fine.
But there are some small inconveniences.

The first one:
compactCalendarView.setCurrentSelectedDayBackgroundColor(R.color.accent);
This method doesnt work for me. Only in the layout file I can set the color for the current selected day.
If I try to implement this method^^ in code for example the user clicks on a day --> changeColor(RED) it doesnt change to red but to black. Maybe you set black as default somewhere in your lib and thats why it changes to it.

The second one:
When you click on a day in my calendar on the bottom it shows a list of events that you placed on that day. This works fine.
Lets say for example the 8th of december is currently selected. Then it show in the underneath all events on that day.
When you swipe the calendar just a little bit, it stays on the same month what is absolutely correct.
But the currentselectedday changes to the first of the month. So the underneath list shows all events on the first of december in this example. But the cycle which shows which day is selected is still on the old selected day (in the example the 8th).
For me thats what I call a bug. It occurs no crash but its confusing for the user.

General:
I really like the idea of your calendar but for me the google calendar has ugly properties like I said in the comment above point 3) and 4). Why not enhance it? It would make it much better.

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

The first one:
compactCalendarView.setCurrentSelectedDayBackgroundColor(R.color.accent);
This method doesnt work for me. Only in the layout file I can set the color for the current selected day.
If I try to implement this method^^ in code for example the user clicks on a day --> changeColor(RED) it doesnt change to red but to black. Maybe you set black as default somewhere in your lib and thats why it changes to it.

Ok lets take problem at a time. Lets use the sample which comes with the library as an example. From what I understand, you want to set the setCurrentSelectedDayBackgroundColor when the user click on a day? So change the sample like below for the listener:

        //set title on calendar scroll
        compactCalendarView.setListener(new CompactCalendarView.CompactCalendarViewListener() {
            @Override
            public void onDayClick(Date dateClicked) {
                compactCalendarView.setCurrentSelectedDayBackgroundColor(Color.BLUE);
            }

            @Override
            public void onMonthScroll(Date firstDayOfNewMonth) {
                actionBar.setTitle(dateFormatForMonth.format(firstDayOfNewMonth));
            }
        });

When I run the sample app, it behaves as expected. When I click on a day, that day gets a blue indicator appear. Try to make the change and let me know.

from compactcalendarview.

XxGoliathusxX avatar XxGoliathusxX commented on July 29, 2024

ok that works now .)

from compactcalendarview.

XxGoliathusxX avatar XxGoliathusxX commented on July 29, 2024

I fixed 2):

private String monthFormat = "MM"; //01, 02, ..., 12
private SimpleDateFormat sdf = new SimpleDateFormat(monthFormat, Locale.getDefault());

@OverRide
public void onMonthScroll(Date firstDayOfNewMonth) {

            if(!(sdf.format(currentCalender.getTime()).equals(sdf.format(firstDayOfNewMonth)))){
                  //Do something like refresh list or whatever
            }

}

OnMonthScroll checks if the month has changed. If not like the user swiped only a little bit the list or whatever doesnt get updated. If the months are different it updates.

from compactcalendarview.

SundeepK avatar SundeepK commented on July 29, 2024

Closing this issue as the problems here have been fixed I believe.

from compactcalendarview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.