Giter Club home page Giter Club logo

Comments (11)

imrezwan avatar imrezwan commented on July 24, 2024 3

@www0488 the layout resources are being set while you are initializing the "SingleRowCalendar" object. So, after every time you are changing month, you could simply call init() function. that worked for me. Thank you.

from singlerowcalendar.

Bhumil73 avatar Bhumil73 commented on July 24, 2024 2

You need to assign init() property where you are clicking on the button for next and previous months. Just add the init(); statement inside the button's onClickListener function for both previous and next month buttons.

from singlerowcalendar.

misosvec avatar misosvec commented on July 24, 2024 1

@www0488 Thanks for creating issue. Currently I don't have time to maintain this library....

from singlerowcalendar.

DeepikaDhammi avatar DeepikaDhammi commented on July 24, 2024 1

I have an UI Issue here which I don't know how to solve it.

The Calendar will display current selected date correct, the selected date will change it background. But when click the next/previous month and go back to the current month of year and try to select a date, the background wont change it color anymore.

I tested to debug & compare with the sample code from repo and I figured out object CalendarViewManager in my project does not triggered during the date selection after month has been changed. But when I tried the sample code from repo, the CalendarViewManager actually triggered and worked fine.

Same issue i have found
Please help to triggered out, what we can do for it.

from singlerowcalendar.

amulaggarwal avatar amulaggarwal commented on July 24, 2024 1

@miso01 can you help with this issue. The background of the selected date doesn't update after the month has been changed by any of the button. Tried to call init every time when month is changed....but its very slow and long press is called i don't know why. Please help

from singlerowcalendar.

dmnhat avatar dmnhat commented on July 24, 2024 1

As @Bhumil73 mentioned earlier , we need add Init() for both next and previous months action, and combining with the last chosen date likes this:

val myCalendarViewManager = object : CalendarViewManager { override fun setCalendarViewResourceId( position: Int, date: java.util.Date, isSelected: Boolean ): Int { return if (isSelected || chosenDate == date) R.layout.item_time_day_selected else R.layout.item_time_day }

from singlerowcalendar.

www0488 avatar www0488 commented on July 24, 2024

Problem found, The issue was caused by the version of constraintlayout in app Gradle build. If you have version which is higher than version 2.0.0-alpha3, your calendar selection will not working correctly when you change month. To walk around the issue, you have to decrease your constraintlayout version down to 2.0.0-alpha3 but the problem is still remains.

@miso01 Is there any chance you can fix it?

from singlerowcalendar.

Jaydeepwebapprise avatar Jaydeepwebapprise commented on July 24, 2024

Hello @RkPranto

I have tried your way but it's not working.
When we have to change the month using custom button than we had call init() funcation like this
singleRowCalendar.setDates(getDatesOfNextMonth())
singleRowCalendar.init()

        But not working 
        
        Can you please help me

from singlerowcalendar.

kishansolanki124 avatar kishansolanki124 commented on July 24, 2024

@miso01 you need to check this issue. Your sample code works for the selection of date even after the next/previous month change. But when we add your Gradle dependency, it is not working. When we change the month, then the date selection not working. Not only me, but many other developers are having this issue.

from singlerowcalendar.

forceporquillo avatar forceporquillo commented on July 24, 2024

There's also a workaround to do this without the need to call the init() block every time a new list of dates is set.

It works on my implementation by adapting to ListAdapter<T, VH> instead of plain RecyclerView.Adapter<VH>. However, we need to fork this implementation in order to adapt the changes and refactor some areas in it, like if we want to maintain the current position of the list after invoking next/previous month, particularly the current date position.

from singlerowcalendar.

ShoaibKakal avatar ShoaibKakal commented on July 24, 2024

@forceporquillo can you please share your implementation.

from singlerowcalendar.

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.